/* Sunup Pages (morning pages). Loaded after app.css; uses its colour variables. */
.pg { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 460px; margin: 0 auto; padding: 4px 0 12px; }
.pg-hero { position: relative; align-self: center; }
.pg-hero.small { margin: -4px 0; }
.pg-pencil { position: absolute; right: -8px; bottom: 4px; }
.pg-prompt-card { background: #fff; border-radius: 20px; padding: 14px 16px; box-shadow: 0 3px 0 var(--line), var(--shadow); text-align: left; }
.pg-prompt-card .kicker { margin-bottom: 4px; }
.pg-prompt-card q { display: block; font-size: var(--fs-lg); font-weight: 800; line-height: 1.3; quotes: none; }
.pg-prompt-card.free q { color: var(--muted); font-weight: 700; }
.pg-cat { display: inline-block; font-size: var(--fs-2xs); font-weight: 800; padding: 1px 8px; border-radius: 99px; background: #EDE6FA; color: #5B4C8A; letter-spacing: 0; text-transform: none; }
.pg-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pg-row.end { margin-top: auto; justify-content: flex-end; }
.pg-row.end .btn { flex: 1; }
.pg-lbl { font-weight: 800; font-size: var(--fs-xs); color: var(--muted); margin: 2px 2px -4px; }
.pg-seg { display: flex; background: #F1E6D6; border-radius: 999px; padding: 4px; gap: 4px; }
.pg-seg button { flex: 1; border: 0; background: transparent; border-radius: 999px; padding: 9px 4px; font: inherit; font-weight: 800; font-size: var(--fs-sm); color: var(--ink); cursor: pointer; }
.pg-seg button.on { background: #fff; box-shadow: var(--shadow); }
.pg-sw { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff; border-radius: 16px; padding: 10px 14px; box-shadow: var(--shadow); cursor: pointer; }
.pg-sw small { display: block; font-weight: 600; color: var(--muted); font-size: var(--fs-xs); }
.pg-sw input { width: 22px; height: 22px; accent-color: #8DB36B; flex: none; }
.pg-lock { text-align: center; font-size: var(--fs-xs); color: var(--muted); font-weight: 700; margin: 0; }
.pg .btn.big { width: 100%; }

.pg-write { height: 100%; min-height: min(620px, calc(100dvh - 90px)); }
.pg-top { display: flex; align-items: center; gap: 10px; }
.pg-prompt { flex: 1; font-size: var(--fs-sm); font-weight: 700; color: #5B4C8A; background: #EDE6FA; border-radius: 12px; padding: 7px 10px; margin: 0; }
.pg-ring { position: relative; flex: none; }
.pg-ring svg { transform: rotate(-90deg); display: block; }
.pg-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.pg-bigring { align-self: center; }
.pg-bigring .pg-ring b { font-size: var(--fs-2xl); }
.pg-paper { flex: 1; min-height: 260px; width: 100%; resize: none; border: 0; outline: none; border-radius: 18px; box-shadow: 0 3px 0 var(--line), var(--shadow); padding: 6px 14px 10px 34px;
  font: inherit; font-size: var(--fs-md); line-height: 28px; color: var(--ink);
  background-color: #fff; background-image: linear-gradient(90deg, transparent 24px, #F4B7B0 24px, #F4B7B0 25.5px, transparent 25.5px), repeating-linear-gradient(#fff 0 27px, #E9DECF 27px 28px);
  background-attachment: local; background-position: 0 0, 0 6px; }
.pg-paper:focus { box-shadow: 0 3px 0 var(--line), 0 0 0 3px rgba(242, 163, 58, .35); }
.pg-paper.short { flex: none; min-height: 150px; }
.pg-paper.read { flex: none; min-height: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.pg-paper mark, .pg-paper.read mark { background: linear-gradient(transparent 55%, #FFE6A3 55%); color: inherit; }
.pg-meter { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); font-weight: 800; color: var(--muted); }
.pg-meter i { flex: 1; height: 8px; border-radius: 99px; background: #EFE4D4; overflow: hidden; }
.pg-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #F7C948, #F6B38E); border-radius: 99px; transition: width .4s ease; }
.pg-note { min-height: 1.2em; margin: -4px 2px; font-size: var(--fs-xs); font-weight: 700; color: #8A5A12; opacity: 0; }
.pg-note.show { animation: pgnote 3.2s ease forwards; }
.pg-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pg-tools .btn { margin-left: auto; padding: 11px 18px; }
.pg-paperonly { align-items: stretch; text-align: center; }
.pg-intent { display: flex; flex-direction: column; gap: 6px; background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.pg-intent span { color: var(--muted); font-weight: 700; font-size: var(--fs-sm); }
.pg-intent input { border: 0; outline: none; font: inherit; font-size: var(--fs-lg); font-weight: 700; color: var(--ink); background: transparent; }
.pg-sheet { background: #fff; border-radius: 16px; box-shadow: 0 3px 0 var(--line), var(--shadow); padding: 12px 14px; transform-origin: 50% 100%;
  background-image: repeating-linear-gradient(#fff 0 23px, #EFE6D8 23px 24px); }
.pg-sheet p { margin: 0; font-size: var(--fs-xs); line-height: 24px; color: #6A6180; max-height: 96px; overflow: hidden; }
.pg-sheet.float { animation: pgfloat 1.1s ease-in forwards; }
.pg-choice { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.pg-choice .btn { width: 100%; flex-direction: column; gap: 0; }
.pg-choice small { display: block; font-weight: 600; font-size: var(--fs-xs); opacity: .8; }

/* Today tile + intention */
.pages-tile { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; background: #fff; border-radius: 20px; padding: 12px 14px; margin: 4px 0 10px; box-shadow: 0 3px 0 var(--line), var(--shadow); font: inherit; color: var(--ink); cursor: pointer; position: relative; }
.pages-tile .ic { font-size: 22px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: #EDE6FA; flex: none; }
.pages-tile b { display: block; }
.pages-tile small { display: block; color: var(--muted); font-weight: 600; font-size: var(--fs-xs); line-height: 1.3; }
.pages-tile .secs { margin-left: auto; font-size: var(--fs-xs); color: var(--muted); font-weight: 800; flex: none; }
.pages-tile.done { background: #F6FAF1; }
.intent-chip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; background: #fff; border-radius: 16px; padding: 9px 12px; margin: 8px 0; font-weight: 800; font-size: var(--fs-sm); box-shadow: var(--shadow); }
.intent-chip .t { flex: 1 1 60%; }
.intent-chip .chip { font-size: var(--fs-xs); padding: 5px 10px; }
.intent-chip.done { background: #F6FAF1; }
.pages-link { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.pages-link span:first-child { font-size: 26px; }
.pages-link small { display: block; color: var(--muted); font-weight: 600; }

/* My pages */
.pg-arch { display: flex; flex-direction: column; gap: 10px; }
.pg-arch h1 { margin: 0; flex: 1; }
.pg-arch-head, .pg-read-head { display: flex; align-items: center; gap: 10px; }
.pg-read-head b { flex: 1; font-size: var(--fs-lg); }
.pg-read-head small { display: block; font-weight: 600; color: var(--muted); font-size: var(--fs-xs); }
.pg-icon { width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; box-shadow: var(--shadow); font: inherit; font-size: 18px; cursor: pointer; color: var(--ink); flex: none; }
.pg-search { width: 100%; font: inherit; padding: 11px 14px; border-radius: 14px; border: 2px solid var(--line); background: #fff; color: var(--ink); }
.chips-row .chip.on { background: var(--tab-on); }
.pg-otd { display: flex; flex-direction: column; gap: 3px; text-align: left; border: 0; background: linear-gradient(135deg, #FFF1C9, #FDE3D3); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow); font: inherit; color: var(--ink); font-weight: 700; cursor: pointer; }
.pg-otd .kicker { color: #9A6420; }
.pg-list { display: flex; flex-direction: column; gap: 8px; }
.pg-month { font-size: var(--fs-2xs); font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 8px 2px 0; }
.pg-entry { display: grid; grid-template-columns: 42px 1fr; gap: 10px; align-items: start; text-align: left; border: 0; background: #fff; border-radius: 16px; padding: 10px 12px; box-shadow: 0 2px 0 var(--line), var(--shadow); font: inherit; color: var(--ink); cursor: pointer; }
.pg-d { text-align: center; line-height: 1.05; font-weight: 900; font-size: var(--fs-lg); }
.pg-d small { display: block; font-size: var(--fs-2xs); color: var(--muted); font-weight: 800; text-transform: uppercase; }
.pg-body { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--fs-sm); font-weight: 600; color: #4F4763; }
.pg-tags { display: flex; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
.pg-tag { font-size: var(--fs-2xs); font-weight: 800; padding: 2px 7px; border-radius: 99px; background: var(--cream); }
.pg-tag.idea { background: #FFF1C9; } .pg-tag.goal { background: #E7F3DD; } .pg-tag.prompt { background: #EDE6FA; color: #5B4C8A; }
.pg-empty { text-align: center; padding: 20px 0; }
.pg-read .pg-prompt { flex: none; }
.pg-ideas-list { background: #FFF8E1; border-radius: 16px; padding: 10px 14px; }
.pg-ideas-list ul { margin: 6px 0 0; padding-left: 18px; }
.pg-goal { margin: 0; background: #F3F9EE; border-radius: 14px; padding: 10px 12px; font-size: var(--fs-sm); }

@keyframes pgnote { 0% { opacity: 0; transform: translateY(4px); } 10%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes pgfloat { 0% { transform: none; opacity: 1; } 30% { transform: translateY(-10px) rotate(-3deg) scale(.95); } 100% { transform: translate(60px, -320px) rotate(14deg) scale(.4); opacity: 0; } }

/* Postcard album (Progress) */
.album .al-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0; }
.al-pc { display: grid; gap: 4px; padding: 5px 5px 6px; border: 0; border-radius: 8px; background: #FFFDF8; box-shadow: 0 2px 0 var(--line), var(--shadow); cursor: pointer; font: inherit; color: var(--ink); }
.al-pc:nth-child(odd) { transform: rotate(-1.5deg); }
.al-pc:nth-child(even) { transform: rotate(1.2deg); }
.al-pc svg { display: block; width: 100%; aspect-ratio: 240 / 150; border-radius: 4px; }
.al-pc small { font-size: var(--fs-2xs); font-weight: 800; color: var(--muted); }
.al-pc .ico { color: #E8A23A; }
