/* Atoms · Grind — the study side, redesigned (v2.10).
   Editorial "study desk" look: paper, ink navy, ERB gold. Serif display (Fraunces) with one italic gold word,
   DM Sans for the interface, DM Mono for small labels. Every view is built from the same few parts:
   eyebrow, display title, pill chips, 22px cards, rings, steppers. Motion is short and meaningful. */

:root {
  --g-paper: #FBF8F2;
  --g-paper2: #F5EFE3;
  --g-card: #FFFFFF;
  --g-tint: #FBF3E6;
  --g-ink: #16213A;
  --g-ink2: #3A4660;
  --g-mute: #6B7385;
  --g-faint: #9AA1AE;
  --g-gold: #C08A2D;
  --g-gold2: #E8B95B;
  --g-gold-ink: #7A5414;
  --g-teal: #2E8C8C;
  --g-line: rgba(22, 33, 58, .12);
  --g-line2: rgba(22, 33, 58, .2);
  --g-shadow: 0 2px 14px rgba(22, 33, 58, .06);
  --g-shadow-h: 0 14px 30px rgba(22, 33, 58, .12);
  --g-r: 22px;
  --g-r-sm: 14px;
  --g-serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --g-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --g-mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --g-ease: cubic-bezier(.22, .88, .3, 1);
  /* subject tints: soft background, strong ink */
  --t-sun: #FBEFD3; --k-sun: #8A5A0B;
  --t-sky: #E1EDFB; --k-sky: #23558F;
  --t-mint: #DDF3E8; --k-mint: #1F6B4A;
  --t-teal: #D8EFEE; --k-teal: #1D6767;
  --t-lav: #ECE6FA; --k-lav: #5B45A6;
  --t-coral: #FCE3DE; --k-coral: #A23B2A;
  --t-peach: #FDE8D7; --k-peach: #9A4B12;
}
:root[data-theme="dark"] {
  --g-paper: #0E1424; --g-paper2: #141B2E; --g-card: #151D31; --g-tint: #1B2238;
  --g-ink: #EEF1F7; --g-ink2: #C9CFDC; --g-mute: #9AA3B6; --g-faint: #6F7890;
  --g-gold: #E2AE52; --g-gold2: #F0C877; --g-gold-ink: #F3D08E;
  --g-line: rgba(238, 241, 247, .12); --g-line2: rgba(238, 241, 247, .22);
  --g-shadow: 0 2px 14px rgba(0, 0, 0, .3); --g-shadow-h: 0 14px 30px rgba(0, 0, 0, .45);
  --t-sun: #3A3020; --k-sun: #F2CC7E; --t-sky: #1E2B42; --k-sky: #9CC3F2; --t-mint: #1C3329; --k-mint: #9BDDBB;
  --t-teal: #183333; --k-teal: #8ED6D3; --t-lav: #29233F; --k-lav: #C3B3F2; --t-coral: #3A2420; --k-coral: #F2A797; --t-peach: #3A2A1C; --k-peach: #F2B98C;
}

/* ---------- shell in Grind mode ---------- */
html[data-mode="grind"] body { background: var(--g-paper); }
html[data-mode="grind"] header.top { background: color-mix(in srgb, var(--g-paper) 94%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--g-line); }
html[data-mode="grind"] .nxi svg { width: 20px; height: 20px; display: block; }
html[data-mode="grind"] .navx.on .nxi svg { stroke: var(--g-gold); }

/* ---------- page + type ---------- */
.g-page { max-width: 76rem; margin: 0 auto; padding: 1.6rem 1.25rem 7rem; color: var(--g-ink); font-family: var(--g-sans); }
.g-page :is(h1, h2, h3) { font-family: var(--g-serif); color: var(--g-ink); letter-spacing: -.012em; font-weight: 600; font-variation-settings: "opsz" 72; }
.g-page em.g-it, .g-page h1 em, .g-page h2 em { font-style: italic; color: var(--g-gold); font-weight: 500; }
.g-eyebrow { font-family: var(--g-mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--g-mute); margin: 0 0 .5rem; }
.g-kick { font-family: var(--g-sans); font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--g-gold-ink); }
:root[data-theme="dark"] .g-kick { color: var(--g-gold2); }
.g-muted { color: var(--g-mute); }
.g-hello { font-size: clamp(2rem, 5.4vw, 3.3rem); line-height: 1.04; margin: 0; }
.g-name { position: relative; display: inline-block; font-style: italic; color: var(--g-gold); font-weight: 500; }
.g-name svg { position: absolute; left: -4%; right: -4%; bottom: -.18em; width: 108%; height: .42em; overflow: visible; pointer-events: none; }
.g-name path { fill: none; stroke: var(--g-gold2); stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: 260; stroke-dashoffset: 260; animation: g-draw 1.1s var(--g-ease) .35s forwards; }
.g-sub { color: var(--g-ink2); margin: .7rem 0 0; font-size: 1.02rem; max-width: 40rem; }

/* ---------- chips & buttons ---------- */
.g-chips { display: flex; gap: .55rem; flex-wrap: wrap; margin: 1.4rem 0 1.6rem; }
.g-chip { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .5rem 1rem; border-radius: 999px; border: 1.5px solid var(--g-line2); background: var(--g-card); color: var(--g-ink); font-weight: 600; font-size: .92rem; text-decoration: none; transition: transform .18s var(--g-ease), box-shadow .18s, border-color .18s; }
.g-chip svg { width: 18px; height: 18px; flex: none; }
.g-chip:hover { transform: translateY(-2px); box-shadow: var(--g-shadow-h); border-color: var(--g-gold); }
.g-chip b { font-family: var(--g-mono); font-weight: 500; font-size: .78rem; background: var(--g-tint); color: var(--g-gold-ink); padding: .1rem .45rem; border-radius: 999px; }
:root[data-theme="dark"] .g-chip b { color: var(--g-gold2); }
.g-chip.c1 svg { color: var(--g-gold); } .g-chip.c2 svg { color: #C2553F; } .g-chip.c3 svg { color: var(--g-teal); } .g-chip.c4 svg { color: #6A55C2; }
.g-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 46px; padding: .7rem 1.35rem; border-radius: 999px; font: 700 .97rem/1 var(--g-sans); text-decoration: none; cursor: pointer; border: 1.5px solid transparent; transition: transform .18s var(--g-ease), box-shadow .18s, background .18s; }
.g-btn svg { width: 18px; height: 18px; }
.g-btn-gold { background: var(--g-gold); color: #fff; box-shadow: 0 10px 26px rgba(192, 138, 45, .32); }
.g-btn-gold:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(192, 138, 45, .4); }
.g-btn-ghost { background: var(--g-card); color: var(--g-ink); border-color: var(--g-line2); }
.g-btn-ghost:hover { border-color: var(--g-ink); transform: translateY(-1px); }
.g-btn-ink { background: var(--g-ink); color: var(--g-paper); }
.g-btn-ink:hover { transform: translateY(-1px); box-shadow: var(--g-shadow-h); }
.g-btn-sm { min-height: 38px; padding: .45rem .9rem; font-size: .86rem; }
.g-btn:active, .g-chip:active { transform: scale(.97); }
.g-page :focus-visible { outline: 3px solid var(--g-gold2); outline-offset: 2px; border-radius: 10px; }

/* ---------- layout ---------- */
.g-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }
@media (min-width: 980px) { .g-grid { grid-template-columns: minmax(0, 2.05fr) minmax(300px, 1fr); gap: 1.75rem; } }
.g-col { display: flex; flex-direction: column; gap: 1.4rem; min-width: 0; }
.g-card { background: var(--g-card); border: 1px solid var(--g-line); border-radius: var(--g-r); box-shadow: var(--g-shadow); padding: 1.35rem 1.4rem; }
.g-card > h2, .g-card .g-h { font-size: 1.32rem; margin: 0; }
.g-cardhead { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: 1rem; }
.g-two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ---------- hero: next up ---------- */
.g-hero { position: relative; overflow: hidden; background: var(--g-tint); border: 1px solid color-mix(in srgb, var(--g-gold) 26%, transparent); border-radius: 26px; padding: 1.7rem 1.6rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.2rem; align-items: center; }
@media (min-width: 640px) { .g-hero { grid-template-columns: minmax(0, 1fr) 150px; padding: 2rem 2rem; } }
.g-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--g-gold2) 30%, transparent), transparent 70%); pointer-events: none; }
.g-pill { display: inline-flex; align-items: center; gap: .4rem; font: 700 .7rem/1 var(--g-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--g-gold-ink); background: color-mix(in srgb, var(--g-gold2) 28%, var(--g-card)); border: 1px solid color-mix(in srgb, var(--g-gold) 30%, transparent); padding: .45rem .7rem; border-radius: 999px; }
:root[data-theme="dark"] .g-pill { color: var(--g-gold2); }
.g-hero h2 { font-size: clamp(1.55rem, 3.6vw, 2.15rem); line-height: 1.12; margin: .8rem 0 .45rem; }
.g-hero p { color: var(--g-ink2); margin: 0 0 1.2rem; }
.g-actions { display: flex; gap: .65rem; flex-wrap: wrap; }

/* ---------- rings ---------- */
.g-ring { position: relative; width: 140px; height: 140px; margin: 0 auto; }
.g-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.g-ring .bg { fill: none; stroke: color-mix(in srgb, var(--g-gold2) 30%, transparent); stroke-width: 10; }
.g-ring .fg { fill: none; stroke: var(--g-gold); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--g-ease); }
.g-ring .lab { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.g-ring .lab b { font: 600 2rem/1 var(--g-serif); color: var(--g-ink); }
.g-ring .lab b small { font-size: .9rem; }
.g-ring .lab > span { font: 600 .62rem/1.2 var(--g-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--g-mute); margin-top: .3rem; }
.g-ring .edit { position: absolute; right: 2px; bottom: 6px; min-height: 30px; padding: .25rem .6rem; border-radius: 999px; border: 1px solid var(--g-line2); background: var(--g-card); font: 700 .66rem/1 var(--g-sans); letter-spacing: .08em; color: var(--g-ink); cursor: pointer; }
.g-ring.sm { width: 64px; height: 64px; } .g-ring.sm .bg, .g-ring.sm .fg { stroke-width: 9; } .g-ring.sm .lab b { font-size: .95rem; font-family: var(--g-sans); font-weight: 700; }
.g-ring.md { width: 96px; height: 96px; } .g-ring.md .lab b { font-size: 1.45rem; }

/* ---------- side tiles ---------- */
.g-count { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: .8rem; align-items: center; background: var(--g-tint); }
.g-count h3 { font-size: 1.2rem; margin: .45rem 0 .2rem; }
.g-count .g-muted { font-size: .9rem; margin: 0 0 .7rem; }
.g-tile { display: flex; flex-direction: column; gap: .35rem; }
.g-tile svg { width: 24px; height: 24px; color: var(--g-gold); }
.g-tile .g-big { font: 600 2rem/1 var(--g-serif); color: var(--g-ink); }
.g-tile .g-big small { font: 600 .9rem var(--g-sans); color: var(--g-ink2); margin-left: .2rem; }
.g-form { display: grid; gap: .55rem; margin-top: .6rem; }
.g-form input { width: 100%; min-height: 44px; border-radius: 12px; border: 1.5px solid var(--g-line2); background: var(--g-card); color: var(--g-ink); padding: .5rem .75rem; font: 500 .95rem var(--g-sans); }

/* ---------- subjects list on Today ---------- */
.g-srow { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: .9rem; align-items: center; padding: .8rem .2rem; border-top: 1px solid var(--g-line); text-decoration: none; color: inherit; border-radius: 12px; transition: background .18s; }
.g-srow:first-of-type { border-top: 0; }
.g-srow:hover { background: var(--g-paper2); }
.g-srow b { display: block; font: 600 1.05rem/1.2 var(--g-serif); }
.g-srow span.g-muted { font-size: .84rem; }
.g-ico { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font: 700 1.15rem/1 var(--g-serif); flex: none; }
.g-ico.sm { width: 40px; height: 40px; border-radius: 12px; font-size: 1rem; }
.tc-sun { background: var(--t-sun); color: var(--k-sun); } .tc-sky { background: var(--t-sky); color: var(--k-sky); } .tc-mint { background: var(--t-mint); color: var(--k-mint); }
.tc-teal { background: var(--t-teal); color: var(--k-teal); } .tc-lav { background: var(--t-lav); color: var(--k-lav); } .tc-coral { background: var(--t-coral); color: var(--k-coral); } .tc-peach { background: var(--t-peach); color: var(--k-peach); }

/* ---------- week bars ---------- */
.g-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: .5rem; align-items: end; height: 120px; }
.g-bar { display: flex; flex-direction: column; align-items: center; gap: .35rem; height: 100%; justify-content: flex-end; }
.g-bar i { width: 100%; max-width: 26px; border-radius: 8px; background: color-mix(in srgb, var(--g-gold2) 45%, var(--g-paper2)); height: max(6px, var(--h)); transform-origin: bottom; animation: g-grow .7s var(--g-ease) both; animation-delay: calc(var(--i) * 60ms + .2s); }
.g-bar.today i { background: var(--g-gold); }
.g-bar span { font: 500 .7rem var(--g-mono); color: var(--g-mute); }

/* ---------- calendar ---------- */
.g-calnav { display: flex; gap: .4rem; align-items: center; }
.g-iconbtn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--g-line2); background: var(--g-card); color: var(--g-ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.g-iconbtn svg { width: 18px; height: 18px; }
.g-month { font: 600 1.2rem var(--g-serif); }
.g-month em { color: var(--g-gold); font-weight: 500; }
.g-cal { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--g-line); border-radius: 16px; overflow: hidden; }
.g-cal .dow { font: 600 .66rem/1 var(--g-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--g-mute); text-align: center; padding: .7rem 0; background: var(--g-paper2); border-bottom: 1px solid var(--g-line); }
.g-cal .d { min-height: 64px; border-right: 1px solid var(--g-line); border-bottom: 1px solid var(--g-line); padding: .4rem .45rem; position: relative; font: 600 .78rem var(--g-sans); color: var(--g-ink2); }
.g-cal .d:nth-child(7n) { border-right: 0; }
.g-cal .d.out { color: var(--g-faint); background: color-mix(in srgb, var(--g-paper2) 60%, transparent); }
.g-cal .d.today span { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border-radius: 50%; background: var(--g-ink); color: var(--g-paper); animation: g-pulse 1.6s var(--g-ease) .6s 1; }
.g-cal .d .dot { position: absolute; left: .45rem; bottom: .45rem; width: 7px; height: 7px; border-radius: 50%; background: var(--g-teal); }
.g-cal .d .ex { position: absolute; left: .35rem; right: .35rem; bottom: .3rem; font: 700 .6rem/1.2 var(--g-sans); color: #fff; background: var(--g-gold); border-radius: 6px; padding: .15rem .3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-legend { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: .8rem; font-size: .8rem; color: var(--g-mute); }
.g-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .35rem; vertical-align: middle; }
@media (max-width: 560px) { .g-cal .d { min-height: 46px; padding: .3rem; } .g-cal .d .ex { font-size: 0; height: 6px; padding: 0; } }

/* ---------- tasks ---------- */
.g-tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.g-task { display: grid; grid-template-columns: 30px minmax(0, 1fr) 34px; align-items: center; gap: .55rem; padding: .55rem .55rem .55rem .35rem; border-radius: 12px; border: 1px solid var(--g-line); background: var(--g-card); transition: transform .35s var(--g-ease), opacity .35s, max-height .35s, margin .35s, padding .35s; max-height: 120px; }
.g-task a { color: var(--g-ink); text-decoration: none; font-weight: 600; font-size: .94rem; }
.g-task .tk { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--g-line2); background: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.g-task .tk svg { width: 14px; height: 14px; opacity: 0; color: #fff; }
.g-task.done .tk { background: var(--g-teal); border-color: var(--g-teal); animation: g-pop .35s var(--g-ease); }
.g-task.done .tk svg { opacity: 1; }
.g-task.done a, .g-task.done span.t { text-decoration: line-through; color: var(--g-faint); }
.g-task.leaving { transform: translateX(28px); opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; margin: 0; border-width: 0; }
.g-task .x { width: 34px; height: 34px; border: 0; background: none; color: var(--g-faint); cursor: pointer; border-radius: 50%; }
.g-task .x:hover { color: var(--g-ink); background: var(--g-paper2); }
.g-addrow { display: flex; gap: .5rem; margin-top: .8rem; }
.g-addrow input { flex: 1; min-height: 44px; border-radius: 999px; border: 1.5px solid var(--g-line2); background: var(--g-card); color: var(--g-ink); padding: .5rem 1rem; font: 500 .95rem var(--g-sans); }
.g-suggest { display: grid; gap: .4rem; margin-top: .9rem; padding-top: .9rem; border-top: 1px dashed var(--g-line2); }
.g-suggest button { text-align: left; display: flex; gap: .6rem; align-items: center; min-height: 44px; border: 1px dashed var(--g-line2); background: var(--g-paper2); border-radius: 12px; padding: .5rem .7rem; color: var(--g-ink); font: 600 .88rem var(--g-sans); cursor: pointer; }
.g-suggest button:hover { border-color: var(--g-gold); }
.g-empty { color: var(--g-mute); font-size: .92rem; text-align: center; padding: .8rem 0; }

/* ---------- notices ---------- */
.g-note { display: flex; gap: .9rem; align-items: flex-start; border-radius: 18px; padding: 1rem 1.1rem; background: var(--t-coral); color: var(--k-coral); text-decoration: none; }
.g-note b { display: block; font-family: var(--g-serif); font-size: 1.05rem; }
.g-note.lav { background: var(--t-lav); color: var(--k-lav); }

/* ---------- Learn: subject picker ---------- */
.g-center { text-align: center; margin: .6rem auto 1.8rem; max-width: 44rem; }
.g-center h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 1rem; }
.g-seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--g-card); border: 1px solid var(--g-line2); box-shadow: var(--g-shadow); flex-wrap: wrap; justify-content: center; }
.g-seg button { min-height: 40px; border: 0; background: none; border-radius: 999px; padding: .45rem 1rem; font: 700 .86rem var(--g-sans); color: var(--g-ink2); cursor: pointer; transition: background .18s, color .18s; }
.g-seg button[aria-pressed="true"] { background: var(--g-ink); color: var(--g-paper); }
.g-searchrow { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 0 0 1rem; }
.g-search { position: relative; flex: 0 1 22rem; }
.g-search svg { position: absolute; left: .9rem; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--g-mute); }
.g-search input { width: 100%; min-height: 46px; border-radius: 999px; border: 1.5px solid var(--g-line2); background: var(--g-card); color: var(--g-ink); padding: .5rem 1rem .5rem 2.6rem; font: 500 .95rem var(--g-sans); }
.g-subgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.g-scard { display: flex; flex-direction: column; border-radius: 18px; background: var(--g-card); border: 1px solid var(--g-line); box-shadow: var(--g-shadow); overflow: hidden; text-decoration: none; color: var(--g-ink); transition: transform .18s var(--g-ease), box-shadow .18s, border-color .18s; }
.g-scard:hover { transform: translateY(-3px); box-shadow: var(--g-shadow-h); border-color: var(--g-line2); }
.g-scard .g-sct { display: flex; align-items: center; gap: .6rem; padding: 1rem 1rem 0; }
.g-scard .code { font: 500 .78rem var(--g-mono); color: var(--g-mute); }
.g-scard .nm { font: 600 1.22rem/1.2 var(--g-serif); padding: .65rem 1rem .25rem; }
.g-scard .meta { font-size: .82rem; color: var(--g-mute); padding: 0 1rem 1rem; min-height: 2.4em; }
.g-scard .foot { margin-top: auto; display: flex; align-items: center; gap: .7rem; padding: .7rem 1rem; }
.g-scard .foot .trk { flex: 1; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .7); overflow: hidden; }
:root[data-theme="dark"] .g-scard .foot .trk { background: rgba(0, 0, 0, .25); }
.g-scard .foot .trk i { display: block; height: 100%; width: var(--p); background: currentColor; border-radius: 6px; transform-origin: left; animation: g-grow-x .9s var(--g-ease) .3s both; }
.g-scard .foot svg { width: 18px; height: 18px; transition: transform .18s var(--g-ease); }
.g-scard:hover .foot svg { transform: translateX(3px); }
.g-scard .tag { margin-left: auto; font: 700 .64rem/1 var(--g-sans); letter-spacing: .08em; text-transform: uppercase; padding: .35rem .5rem; border-radius: 999px; background: var(--g-paper2); color: var(--g-ink2); }
.g-scard .tag.full { background: var(--t-mint); color: var(--k-mint); }
.g-scard.soon { opacity: .62; }
.g-hits { display: grid; gap: .4rem; margin: 0 0 1.4rem; }
.g-hit { display: flex; gap: .7rem; align-items: center; padding: .6rem .8rem; border-radius: 12px; background: var(--g-card); border: 1px solid var(--g-line); text-decoration: none; color: var(--g-ink); }
.g-hit small { display: block; color: var(--g-mute); }
.g-hit:hover { border-color: var(--g-gold); }
.g-sect { margin: 2rem 0 .9rem; }

/* ---------- Subject: stepper ---------- */
.g-shead { display: flex; align-items: center; gap: 1rem; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1.4rem; }
.g-shead .l { display: flex; align-items: center; gap: .9rem; }
.g-shead h1 { font-size: clamp(1.7rem, 4.4vw, 2.4rem); margin: 0; }
.g-steps { display: grid; gap: .65rem; margin-bottom: 1.3rem; }
.g-step { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: .8rem; align-items: center; padding: .75rem 1rem; border-radius: 16px; border: 1px solid var(--g-line2); background: var(--g-card); }
.g-step .n { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 700 .8rem var(--g-sans); border: 1.5px solid var(--g-line2); color: var(--g-ink2); }
.g-step.done .n { border-color: var(--g-teal); color: var(--g-teal); }
.g-step.done .n svg { width: 16px; height: 16px; }
.g-step.on { border: 2px solid var(--g-ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--g-gold2) 22%, transparent); }
.g-step.on .n { background: var(--g-ink); border-color: var(--g-ink); color: var(--g-paper); }
.g-step small { display: block; font: 600 .62rem/1 var(--g-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--g-mute); margin-bottom: .25rem; }
.g-step b { font-weight: 700; }
.g-step a { font-size: .84rem; color: var(--g-mute); }
.g-modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .8rem; margin: .2rem 0 1.4rem; }
.g-mode { display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.05rem; border-radius: 16px; border: 1.5px solid var(--g-line); background: var(--g-card); color: var(--g-ink); text-decoration: none; transition: transform .18s var(--g-ease), border-color .18s, box-shadow .18s; }
.g-mode svg { width: 24px; height: 24px; color: var(--g-gold); }
.g-mode b { font: 600 1.08rem var(--g-serif); }
.g-mode span { font-size: .84rem; color: var(--g-mute); }
.g-mode:hover { transform: translateY(-2px); box-shadow: var(--g-shadow-h); }
.g-mode[aria-current="true"] { border-color: var(--g-ink); background: var(--g-tint); }
.g-toolbar { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.g-prog { display: inline-flex; align-items: center; gap: .6rem; font: 600 .86rem var(--g-sans); color: var(--g-ink2); padding: .35rem .5rem .35rem .9rem; border-radius: 999px; border: 1px solid var(--g-line2); background: var(--g-card); }
.g-prog .g-ring.sm { width: 34px; height: 34px; } .g-prog .g-ring.sm .lab { display: none; } .g-prog .g-ring.sm .bg, .g-prog .g-ring.sm .fg { stroke-width: 14; }
.g-chap { margin: 1.4rem 0 .4rem; display: flex; align-items: center; gap: .7rem; }
.g-chap .num { width: 28px; height: 28px; border-radius: 8px; background: var(--g-paper2); border: 1px solid var(--g-line); display: inline-flex; align-items: center; justify-content: center; font: 600 .78rem var(--g-mono); color: var(--g-ink2); flex: none; }
.g-chap h2 { font-size: 1.12rem; margin: 0; }
.g-chap .g-muted { font-size: .8rem; margin-left: auto; white-space: nowrap; }
.g-topics { display: grid; grid-template-columns: minmax(0, 1fr); gap: .35rem 1.2rem; }
@media (min-width: 760px) { .g-topics { grid-template-columns: 1fr 1fr; } }
.g-topic { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: .65rem; align-items: center; min-height: 48px; padding: .45rem .6rem; border-radius: 12px; text-decoration: none; color: var(--g-ink); transition: background .18s; }
.g-topic:hover { background: var(--g-card); box-shadow: inset 0 0 0 1px var(--g-line); }
.g-topic .ck { width: 22px; height: 22px; border-radius: 7px; border: 1.8px solid var(--g-line2); display: inline-flex; align-items: center; justify-content: center; }
.g-topic .ck svg { width: 14px; height: 14px; opacity: 0; color: #fff; }
.g-topic.done .ck { background: var(--g-teal); border-color: var(--g-teal); } .g-topic.done .ck svg { opacity: 1; }
.g-topic.started .ck { border-color: var(--g-gold); box-shadow: inset 0 0 0 4px var(--g-card), inset 0 0 0 12px var(--g-gold2); }
.g-topic .tt { font-size: .93rem; font-weight: 600; line-height: 1.3; }
.g-topic .tt i { font-style: normal; font-family: var(--g-mono); font-size: .76rem; color: var(--g-gold-ink); margin-right: .35rem; }
:root[data-theme="dark"] .g-topic .tt i { color: var(--g-gold2); }
.g-topic .mn { font: 500 .74rem var(--g-mono); color: var(--g-faint); }
.g-topic.locked { opacity: .55; }
.g-topic.locked .mn::after { content: " · locked"; }
.g-unlock { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; padding: 1rem 1.2rem; border-radius: 16px; background: var(--g-tint); border: 1px dashed color-mix(in srgb, var(--g-gold) 50%, transparent); margin-bottom: 1rem; }
.g-unlock b { font-family: var(--g-serif); font-size: 1.05rem; }
.g-more { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; }
.g-more a { display: flex; gap: .7rem; align-items: center; padding: .9rem 1rem; border-radius: 14px; border: 1px solid var(--g-line); background: var(--g-card); color: var(--g-ink); text-decoration: none; font-weight: 600; }
.g-more a:hover { border-color: var(--g-gold); }
.g-more svg { width: 20px; height: 20px; color: var(--g-gold); flex: none; }

/* ---------- motion ---------- */
.g-rise > * { animation: g-rise .55s var(--g-ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes g-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes g-draw { to { stroke-dashoffset: 0; } }
@keyframes g-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes g-grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes g-pop { 0% { transform: scale(.5); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes g-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--g-gold) 55%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
.g-burst { position: fixed; pointer-events: none; z-index: 90; width: 8px; height: 8px; border-radius: 2px; animation: g-burst .8s var(--g-ease) forwards; }
@keyframes g-burst { to { transform: translate(var(--dx), var(--dy)) rotate(220deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .g-rise > *, .g-name path, .g-bar i, .g-scard .foot .trk i, .g-cal .d.today span { animation: none !important; } .g-name path { stroke-dashoffset: 0; } .g-ring .fg { transition: none; } }
html.rm .g-rise > *, html.rm .g-bar i, html.rm .g-scard .foot .trk i, html.rm .g-cal .d.today span { animation: none !important; }
html.rm .g-name path { animation: none; stroke-dashoffset: 0; }
html.rm .g-ring .fg { transition: none; }

/* ---------- fixes & integration ---------- */
.g-page { font-variant-numeric: lining-nums; }
.g-page h1[tabindex="-1"]:focus, .g-page h1[tabindex="-1"]:focus-visible { outline: none; }
.g-checkslot:empty { display: none; }
.g-checkslot .checkin { background: var(--g-card); border: 1px solid var(--g-line); border-radius: var(--g-r); box-shadow: var(--g-shadow); padding: 1.1rem 1.3rem; margin: 0; }
.g-checkslot .moods { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0 0; }
.g-checkslot .moods button { width: auto; height: auto; min-height: 44px; padding: .5rem 1.05rem; border-radius: 999px; border: 1.5px solid var(--g-line2); background: var(--g-card); color: var(--g-ink); font: 700 .9rem/1 var(--g-sans); cursor: pointer; transition: border-color .18s, transform .18s var(--g-ease); }
.g-checkslot .moods button:hover { border-color: var(--g-gold); transform: translateY(-1px); }
.g-page .elsw-row { margin: 0 0 1rem; }
.g-note.renew { margin-bottom: 1.2rem; }
.g-note span { line-height: 1.45; }
.g-scard .meta { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 0; margin-bottom: 1rem; padding-bottom: 0; }
.g-scard .code { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.g-scard .tag { white-space: nowrap; flex: none; }
.g-subgrid { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }
.g-shead .g-ring, .g-srow .g-ring { margin: 0; }
.g-ring .lab b { font-family: var(--g-sans); font-weight: 700; letter-spacing: -.02em; }
.g-ring .lab b small { font-weight: 600; color: var(--g-mute); }
@media (max-width: 979px) {
  .g-grid > .g-col { display: contents; }
  .g-hero { order: 1; } .g-taskcard { order: 2; } .g-count { order: 3; } .g-two { order: 4; } .g-checkslot { order: 5; }
  .g-subjcard { order: 6; } .g-weekcard { order: 7; } .g-calcard { order: 8; } .g-eolenote { order: 9; }
}
@media (max-width: 639px) {
  .g-hero { padding: 1.4rem 1.2rem; gap: 1rem; }
  .g-hero .g-ring { width: 104px; height: 104px; }
  .g-hero .g-ring .lab b { font-size: 1.45rem; } .g-hero .g-ring .lab > span { font-size: .55rem; }
  .g-hero .g-actions .g-btn { flex: 1 1 auto; }
  .g-page { padding-top: 1.1rem; }
}
:root .g-page a.g-chip, :root .g-page a.g-srow, :root .g-page a.g-scard, :root .g-page a.g-hit, :root .g-page a.g-mode, :root .g-page a.g-topic, :root .g-page .g-more a, :root .g-page a.g-btn-ghost, :root .g-page .g-task a { color: var(--g-ink); }
:root .g-page a.g-btn-gold { color: #fff; } :root[data-theme="dark"] .g-page a.g-btn-gold { color: #16213A; } :root[data-theme="dark"] .g-btn-gold { color: #16213A; }
:root .g-page a.g-note.lav { color: var(--k-lav); } :root .g-page a.g-note.renew { color: var(--k-coral); }
:root .g-page a.g-btn-ink { color: var(--g-paper); }
