/* Alpha Fine Homes · Junior Design Studio
   Editorial studio palette: ivory, warm paper, sage, cocoa, ink. AFH burgundy reserved for brand moments. */
:root {
  --ivory: #F6F1E7;
  --paper: #EDE5D6;
  --paper-2: #E4DAC7;
  --card: #FFFDF8;
  --ink: #26221E;
  --ink-2: #4A4239;
  --muted: #776C60;
  --line: #DCD2C1;
  --line-2: #CABFAC;
  --sage: #5E7A63;
  --sage-deep: #3F5A46;
  --sage-soft: #E2E9DD;
  --cocoa: #7A5A44;
  --cocoa-soft: #F1E6DA;
  --brand: #700D2C;
  --amber: #A87420;
  --amber-soft: #F6EAD3;
  --rose: #A2483D;
  --rose-soft: #F5E1DC;
  --focus: #2F6F8F;

  --font-display: 'Zodiak', 'Iowan Old Style', Georgia, serif;
  --font-body: 'General Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --text-xs: 0.75rem; --text-sm: 0.875rem; --text-base: 1rem; --text-lg: 1.125rem;
  --text-xl: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);
  --text-2xl: clamp(1.875rem, 1.4rem + 1.8vw, 2.5rem);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px;
  --r-sm: 8px; --r: 14px; --r-lg: 20px;
  --shadow: 0 1px 0 rgba(38,34,30,.04), 0 8px 24px -12px rgba(38,34,30,.18);
  --ease: cubic-bezier(.2,.7,.2,1);
  --sidebar: 248px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ivory: #1B1916; --paper: #24211D; --paper-2: #2E2A25; --card: #221F1B;
    --ink: #F1EBE0; --ink-2: #D6CDBF; --muted: #A89D8E; --line: #3A352E; --line-2: #4A443B;
    --sage: #8DAE92; --sage-deep: #A9C7AD; --sage-soft: #2A3329; --cocoa: #CFA98C; --cocoa-soft: #33291F;
    --brand: #D9869E; --amber: #E0B062; --amber-soft: #3A2F1C; --rose: #E5998D; --rose-soft: #3B2622; --focus: #7FC0DE;
    --shadow: 0 1px 0 rgba(0,0,0,.2), 0 10px 30px -14px rgba(0,0,0,.6);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ivory); color: var(--ink); font-family: var(--font-body); font-size: var(--text-base); line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--sage-deep); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--ivory); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { margin: 0; font-weight: 500; }
.display { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; line-height: 1.12; }
h1.display { font-size: var(--text-2xl); }
h2.display { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); font-weight: 600; line-height: 1.3; }
p { margin: 0; }
.eyebrow { font-size: var(--text-xs); letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--cocoa); }
.muted { color: var(--muted); }
.small { font-size: var(--text-sm); }
.xs { font-size: var(--text-xs); }
.stack > * + * { margin-top: var(--s4); }
.stack-sm > * + * { margin-top: var(--s2); }
.stack-lg > * + * { margin-top: var(--s8); }
.row { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.tnum { font-variant-numeric: tabular-nums; }

/* Boot */
.boot { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 16px; color: var(--muted); }
.boot img { animation: breathe 1.6s var(--ease) infinite alternate; }
@keyframes breathe { from { opacity: .5 } to { opacity: 1 } }

/* Shell */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0,1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; padding: var(--s6) var(--s5); border-right: 1px solid var(--line); background: var(--paper); display: flex; flex-direction: column; gap: var(--s6); }
.brand { display: grid; gap: 6px; text-decoration: none; color: inherit; }
.brand-logo { width: 150px; height: auto; }
.brand-sub { font-family: var(--font-display); font-size: 1.05rem; color: var(--ink-2); }
.nav { display: grid; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 500; min-height: 44px; }
.nav a:hover { background: var(--paper-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.nav svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav .count { margin-left: auto; font-size: var(--text-xs); background: var(--brand); color: #fff; border-radius: 99px; padding: 1px 8px; font-weight: 600; }
.side-foot { margin-top: auto; font-size: var(--text-sm); color: var(--muted); display: grid; gap: 8px; }
.side-foot button { justify-self: start; }
.main { padding: var(--s10) clamp(var(--s5), 4vw, var(--s12)) var(--s16); max-width: 1180px; width: 100%; }
.topbar { display: none; }
.tabbar { display: none; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); background: var(--ivory); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .topbar .brand-logo { width: 112px; }
  .topbar .who { font-size: var(--text-xs); color: var(--muted); }
  .main { padding: var(--s5) var(--s4) calc(96px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 30; }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 8px 2px 10px; font-size: 11px; color: var(--muted); text-decoration: none; min-height: 56px; position: relative; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--ink); font-weight: 600; }
  .tabbar a[aria-current="page"]::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; background: var(--sage); border-radius: 2px; }
  .tabbar .dot { position: absolute; top: 6px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
}

/* Cards & surfaces */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s6); box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card.paper { background: var(--paper); box-shadow: none; }
.card.sage { background: var(--sage-soft); border-color: transparent; box-shadow: none; }
.card.amber { background: var(--amber-soft); border-color: transparent; box-shadow: none; }
.grid { display: grid; gap: var(--s5); }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1020px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g-main { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .g2, .g3 { grid-template-columns: 1fr; } }
.page-head { margin-bottom: var(--s8); display: grid; gap: var(--s2); }
.page-head p { max-width: 62ch; color: var(--ink-2); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: var(--s4); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1px solid transparent; font-weight: 600; font-size: var(--text-sm); text-decoration: none; transition: transform .15s var(--ease), background .15s, box-shadow .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--ivory); }
.btn-primary:hover { background: #000; }
@media (prefers-color-scheme: dark) { .btn-primary { background: var(--ink); color: #1B1916; } .btn-primary:hover { background: #fff; } }
.btn-sage { background: var(--sage-deep); color: #fff; }
.btn-sage:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { background: var(--paper); }
.btn-quiet { background: transparent; color: var(--ink-2); padding-inline: 10px; }
.btn-quiet:hover { background: var(--paper); }
.btn-lg { min-height: 54px; padding: 14px 28px; font-size: var(--text-base); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }

/* Forms */
.field { display: grid; gap: 6px; }
.field label, .label { font-size: var(--text-sm); font-weight: 600; color: var(--ink-2); }
.hint { font-size: var(--text-xs); color: var(--muted); }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; min-height: 46px; padding: 11px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--card); color: var(--ink); }
textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--sage-deep); flex-shrink: 0; }
.seg { display: inline-flex; background: var(--paper); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: var(--text-sm); color: var(--muted); min-height: 38px; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.error { color: var(--rose); font-size: var(--text-sm); }
.alert { padding: 14px 16px; border-radius: 12px; font-size: var(--text-sm); line-height: 1.5; }
.alert.err { background: var(--rose-soft); color: var(--ink); border-left: 3px solid var(--rose); }
.alert.info { background: var(--sage-soft); border-left: 3px solid var(--sage); }
.alert.warn { background: var(--amber-soft); border-left: 3px solid var(--amber); }

/* Pills & status */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--paper); color: var(--ink-2); white-space: nowrap; }
.pill.sage { background: var(--sage-soft); color: var(--sage-deep); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }
.pill.rose { background: var(--rose-soft); color: var(--rose); }
.pill.ink { background: var(--ink); color: var(--ivory); }
.pill.brand { background: var(--brand); color: #fff; }
.dotc { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--line-2); flex-shrink: 0; }
.dotc.green { background: #3F8A5A; } .dotc.yellow { background: #D3A03E; } .dotc.red { background: #B9483C; } .dotc.blue { background: var(--focus); }

/* Meter */
.meter { height: 8px; background: var(--paper-2); border-radius: 99px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--sage); border-radius: 99px; transition: width .6s var(--ease); }
.ring { --p: 0; width: 120px; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(var(--sage) calc(var(--p) * 1%), var(--paper-2) 0); display: grid; place-items: center; }
.ring > div { width: 92px; aspect-ratio: 1; border-radius: 50%; background: var(--card); display: grid; place-items: center; text-align: center; }
.ring strong { font-family: var(--font-display); font-size: 1.75rem; font-weight: 500; line-height: 1; }

/* Hero mission */
.mission { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: clamp(24px, 4vw, 44px); box-shadow: var(--shadow); }
.mission::after { content: ''; position: absolute; inset: auto -40px -60px auto; width: 300px; height: 300px; background: url('../img/plan-lines.svg') no-repeat center / contain; opacity: .5; pointer-events: none; }
.mission h1 { max-width: 18ch; }
.mission .lede { font-size: var(--text-lg); color: var(--ink-2); max-width: 46ch; }
.next { margin-top: var(--s6); padding: var(--s5); border-radius: var(--r); background: var(--ivory); border: 1px dashed var(--line-2); display: grid; gap: 6px; max-width: 560px; position: relative; z-index: 1; }
.journey { display: grid; grid-template-columns: repeat(16, 1fr); gap: 4px; }
.journey a { height: 30px; border-radius: 6px; background: var(--paper-2); display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; transition: transform .15s var(--ease); }
.journey a:hover { transform: translateY(-2px); }
.journey a.done { background: var(--sage); color: #fff; }
.journey a.review { background: var(--sage-soft); color: var(--sage-deep); box-shadow: inset 0 0 0 1.5px var(--sage); }
.journey a.revise { background: var(--amber-soft); color: var(--amber); box-shadow: inset 0 0 0 1.5px var(--amber); }
.journey a.now { background: var(--ink); color: var(--ivory); }
.journey a.prog { background: var(--paper-2); color: var(--ink); box-shadow: inset 0 -3px 0 var(--sage); }
@media (max-width: 520px) { .journey { grid-template-columns: repeat(8, 1fr); } }

/* Steps */
.steps { display: grid; gap: 10px; counter-reset: step; }
.step { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); transition: background .2s, border-color .2s; }
.step.done { background: var(--sage-soft); border-color: transparent; }
.step.next-up { border-color: var(--sage); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage) 18%, transparent); }
.step .box { width: 30px; height: 30px; border-radius: 9px; border: 1.5px solid var(--line-2); background: var(--card); display: grid; place-items: center; padding: 0; margin-top: 2px; }
.step.done .box { background: var(--sage-deep); border-color: var(--sage-deep); color: #fff; }
.step .box svg { width: 18px; height: 18px; stroke-dasharray: 24; stroke-dashoffset: 24; }
.step.done .box svg { animation: draw .35s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.step .t { font-weight: 600; }
.step .d { color: var(--ink-2); font-size: var(--text-sm); margin-top: 2px; }
.step .k { font-size: var(--text-xs); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }

/* Learning loop */
.loop { display: flex; gap: 0; flex-wrap: wrap; }
.loop span { font-size: var(--text-xs); font-weight: 600; padding: 7px 12px; background: var(--paper); color: var(--muted); position: relative; }
.loop span:first-child { border-radius: 99px 0 0 99px; }
.loop span:last-child { border-radius: 0 99px 99px 0; }
.loop span.on { background: var(--sage-deep); color: #fff; }
.loop span.past { background: var(--sage-soft); color: var(--sage-deep); }

/* Details */
details.fold { border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
details.fold > summary { list-style: none; padding: 16px 18px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 600; min-height: 52px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: '+'; font-size: 1.3rem; color: var(--muted); }
details.fold[open] > summary::after { content: '–'; }
details.fold > div { padding: 0 18px 18px; color: var(--ink-2); font-size: var(--text-sm); }
ul.clean { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
ul.ticks { padding-left: 0; list-style: none; display: grid; gap: 8px; margin: 0; }
ul.ticks li { padding-left: 26px; position: relative; }
ul.ticks li::before { content: ''; position: absolute; left: 2px; top: 8px; width: 12px; height: 7px; border-left: 2px solid var(--sage); border-bottom: 2px solid var(--sage); transform: rotate(-45deg); }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
@media (max-width: 420px) { .gallery { grid-template-columns: 1fr 1fr; gap: 10px; } .tile .meta { padding: 8px 10px 10px; } }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: grid; position: relative; }
.tile.selected { border-color: var(--sage-deep); box-shadow: 0 0 0 2px var(--sage-deep); }
.thumb { aspect-ratio: 4 / 3; background: var(--paper-2) repeating-linear-gradient(45deg, transparent 0 10px, rgba(0,0,0,.025) 10px 20px); display: grid; place-items: center; color: var(--muted); font-size: var(--text-xs); cursor: zoom-in; border: 0; padding: 0; width: 100%; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.tile .meta { padding: 10px 12px 12px; display: grid; gap: 6px; font-size: var(--text-sm); }
.tile .meta .tt { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.upload-zone { border: 1.5px dashed var(--line-2); border-radius: 18px; padding: 22px; text-align: center; background: var(--ivory); display: grid; gap: 8px; justify-items: center; cursor: pointer; }
.upload-zone:hover, .upload-zone.drag { border-color: var(--sage); background: var(--sage-soft); }
.upload-zone svg { width: 28px; height: 28px; color: var(--sage-deep); }
.queue { display: grid; gap: 10px; }
.qitem { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.qitem img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; background: var(--paper-2); }

/* Counts */
.count-card { padding: var(--s5); border-radius: var(--r); background: var(--card); border: 1px solid var(--line); display: grid; gap: 6px; }
.count-card .n { font-family: var(--font-display); font-size: 2.25rem; line-height: 1; }
.count-card.ok { background: var(--sage-soft); border-color: transparent; }
.count-card.over { background: var(--amber-soft); border-color: transparent; }

/* Lists */
.list { display: grid; }
.list > .li { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.list > .li:last-child { border-bottom: 0; }
.list a.li { color: inherit; text-decoration: none; }
.list a.li:hover .ttl { text-decoration: underline; }
.wk-num { width: 38px; height: 38px; border-radius: 12px; background: var(--paper); display: grid; place-items: center; font-weight: 600; font-size: var(--text-sm); flex-shrink: 0; }
.wk-num.now { background: var(--ink); color: var(--ivory); }
.wk-num.done { background: var(--sage-deep); color: #fff; }
.phase { margin-top: var(--s8); }
.phase:first-child { margin-top: 0; }

/* Rubric */
.rubric { display: grid; gap: 12px; }
.rub { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; }
.rub .opts { display: flex; gap: 6px; }
.rub .opts label { position: relative; }
.rub .opts input { position: absolute; opacity: 0; inset: 0; }
.rub .opts span { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-2); display: grid; place-items: center; font-weight: 600; cursor: pointer; }
.rub .opts input:checked + span { background: var(--ink); color: var(--ivory); border-color: var(--ink); }
.rub .opts input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 560px) { .rub { grid-template-columns: 1fr; } }
.decision { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.decision label { border: 1px solid var(--line-2); border-radius: 14px; padding: 12px; cursor: pointer; display: grid; gap: 2px; font-size: var(--text-sm); position: relative; }
.decision input { position: absolute; opacity: 0; }
.decision label:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.decision label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (max-width: 560px) { .decision { grid-template-columns: 1fr; } }

/* Modal / lightbox */
dialog { border: 0; border-radius: 22px; padding: 0; background: var(--card); color: var(--ink); max-width: min(560px, calc(100vw - 24px)); width: 100%; box-shadow: 0 30px 80px -20px rgba(0,0,0,.45); }
dialog::backdrop { background: rgba(28, 24, 20, .55); backdrop-filter: blur(2px); }
dialog .dlg { padding: 24px; display: grid; gap: 16px; }
dialog.lightbox { max-width: min(1100px, calc(100vw - 24px)); background: #111; color: #eee; }
dialog.lightbox img { max-height: 78vh; width: 100%; object-fit: contain; }
dialog.lightbox .cap { padding: 14px 18px; display: flex; justify-content: space-between; gap: 12px; align-items: center; font-size: var(--text-sm); }

/* Toast */
#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--ink); color: var(--ivory); padding: 12px 18px; border-radius: 999px; font-size: var(--text-sm); font-weight: 500; transition: all .3s var(--ease); z-index: 200; pointer-events: none; max-width: calc(100vw - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--rose); color: #fff; }
@media (max-width: 860px) { #toast { bottom: calc(84px + env(safe-area-inset-bottom)); } }

/* Auth */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { background: var(--paper); position: relative; overflow: hidden; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art .plan { position: absolute; inset: 10% -10% -10% 10%; background: url('../img/plan-lines.svg') no-repeat center / contain; opacity: .7; }
.auth-art blockquote { margin: 0; font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.25; max-width: 18ch; position: relative; }
.auth-form { display: grid; place-content: center; padding: 40px 24px; }
.auth-form .card { width: min(420px, 100%); }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-art { padding: 28px 24px 120px; min-height: 260px; } .auth-art blockquote { font-size: 1.4rem; } .auth-form { padding: 0 16px 40px; margin-top: -90px; position: relative; } }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table th { text-align: left; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap { overflow-x: auto; }

.essay-meta { display: flex; justify-content: space-between; align-items: center; font-size: var(--text-sm); color: var(--muted); }
textarea.essay { min-height: 320px; font-size: 1.02rem; line-height: 1.7; font-family: var(--font-body); }
.prompt { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.4; }
.kbd { font-family: ui-monospace, Menlo, monospace; font-size: 1.6rem; letter-spacing: .25em; padding: 12px 18px; background: var(--paper); border-radius: 12px; text-align: center; }
.empty { text-align: center; padding: 32px 16px; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.empty svg { width: 40px; height: 40px; color: var(--line-2); }
.skeleton { background: linear-gradient(90deg, var(--paper) 0%, var(--paper-2) 50%, var(--paper) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 12px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.fade-in { animation: fi .35s var(--ease); }
@keyframes fi { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
.footer-note { margin-top: var(--s12); font-size: var(--text-xs); color: var(--muted); max-width: 72ch; line-height: 1.6; }
hr.rule { border: 0; border-top: 1px solid var(--line); margin: var(--s6) 0; }

/* ---------- Parent checkpoint grid ---------- */
.alert.danger { background: var(--rose-soft); color: var(--ink); border-left: 3px solid var(--rose); }
.card.amber { background: var(--amber-soft); border-color: transparent; }
.rgy { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.rgy-cell { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--paper); text-decoration: none; color: var(--ink-2); border-left: 4px solid var(--line-2); min-height: 64px; align-content: start; }
.rgy-cell .wn { font-weight: 600; color: var(--ink); font-size: var(--text-sm); }
.rgy-cell .xs { line-height: 1.3; }
.rgy-cell.green { border-left-color: #3F8A5A; background: var(--sage-soft); }
.rgy-cell.yellow { border-left-color: #D3A03E; background: var(--amber-soft); }
.rgy-cell.red { border-left-color: #B9483C; background: var(--rose-soft); }
.rgy-cell.blue { border-left-color: var(--focus); }
.rgy-cell.cur { box-shadow: inset 0 0 0 1.5px var(--ink); }
.rgy-cell:hover { filter: brightness(.98); }
@media (max-width: 560px) { .rgy { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
a.card { display: block; }
a.card.stack-sm > :not(.row), a.card.stack > :not(.row) { display: block; }
a.card .meter { display: block; }
.thumb img:not([src]) { visibility: hidden; }
.thumb img { transition: opacity .25s var(--ease); }
@media (min-width: 861px) { .shell { background: linear-gradient(to right, var(--paper) calc(var(--sidebar) - 1px), var(--line) calc(var(--sidebar) - 1px) var(--sidebar), transparent var(--sidebar)); } .sidebar { border-right: 0; } }
picture { display: contents; }
@media (max-width: 860px) {
  body.wf-badge .tabbar { padding-bottom: calc(44px + env(safe-area-inset-bottom)); }
  body.wf-badge .main { padding-bottom: calc(140px + env(safe-area-inset-bottom)); }
  body.wf-badge #toast { bottom: calc(128px + env(safe-area-inset-bottom)); }
}
/* Keep focused/scrolled controls clear of the fixed Webflow badge (free hosting only). */
html:has(body.wf-badge) { scroll-padding-bottom: 72px; }
@media (min-width: 861px) { body.wf-badge .main { padding-bottom: 96px; } }
