/* Laurl — notebook direction.
   Hand-made accents (wreath, marker, circled dates, stickers, sticky notes)
   on top of a clean, readable interface. */
:root {
  /* Laurl brand palette: #344D3C forest, #A5B49A sage, #F8F7F2 ivory, #C3A66A gold, #252D28 charcoal, #E8EEE5 mist */
  --paper: #F8F7F2;
  --grid: #E8EEE5;
  --margin: #A5B49A;
  --surface: #FFFFFF;
  --sunk: #EFF2EC;
  --ink: #252D28;
  --muted: #56645A;
  --faint: #86918A;
  --line: #DCE2D7;
  --pen: #344D3C;          /* forest — primary */
  --pen-ink: #F8F7F2;
  --red: #A6532F;          /* clay — urgency, pen circles */
  --leaf: #344D3C;         /* logo */
  --marker: #E9D9AE;       /* gold highlighter */
  --hl: #E9D9AE;           /* highlight behind running text */
  --on-marker: #252D28;
  --st-green: #E8EEE5; --st-green-ink: #2C4434;
  --st-pink: #F3E4D9;  --st-pink-ink: #7E3E22;
  --st-blue: #DFE6D8;  --st-blue-ink: #344D3C;
  --st-yellow: #F4ECD6;
  --gold: #9C7F3E;
  --tier-bg: #F4ECD6; --tier-ink: #7A6230; --tier-line: #DCC898;
  --shadow: 0 1px 0 rgb(37 45 40 / .05), 0 6px 18px rgb(37 45 40 / .07);
  --lift: 0 1px 0 rgb(37 45 40 / .07), 0 12px 26px rgb(37 45 40 / .11);
  --scrim: rgb(37 45 40 / .42);
  --hand: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;   /* display + UI: real type */
  --note: "Nanum Pen Script", "Segoe Print", "Bradley Hand", cursive;   /* pen notes only, used small */
  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1E2521; --grid: #262E29; --margin: #4E5E51; --surface: #252D28; --sunk: #2C3530;
    --ink: #EEF1EA; --muted: #AEB8AC; --faint: #7F8A81; --line: #36413A;
    --pen: #A5B49A; --pen-ink: #1E2521; --red: #E0A07E; --leaf: #A5B49A;
    --marker: #C3A66A; --on-marker: #252D28; --hl: rgb(195 166 106 / .36);
    --st-green: #2E3D33; --st-green-ink: #C9D6C0; --st-pink: #3E2D25; --st-pink-ink: #EBC2AA;
    --st-blue: #2F3A32; --st-blue-ink: #C9D6C0; --st-yellow: #3A3527; --gold: #D9BF84; --tier-bg: #3A3527; --tier-ink: #E6CF97; --tier-line: #5C5237;
    --shadow: 0 1px 0 rgb(0 0 0 / .3), 0 6px 18px rgb(0 0 0 / .3); --lift: 0 12px 26px rgb(0 0 0 / .45);
    --scrim: rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1E2521; --grid: #262E29; --margin: #4E5E51; --surface: #252D28; --sunk: #2C3530;
  --ink: #EEF1EA; --muted: #AEB8AC; --faint: #7F8A81; --line: #36413A;
  --pen: #A5B49A; --pen-ink: #1E2521; --red: #E0A07E; --leaf: #A5B49A;
  --marker: #C3A66A; --on-marker: #252D28; --hl: rgb(195 166 106 / .36);
  --st-green: #2E3D33; --st-green-ink: #C9D6C0; --st-pink: #3E2D25; --st-pink-ink: #EBC2AA;
  --st-blue: #2F3A32; --st-blue-ink: #C9D6C0; --st-yellow: #3A3527; --gold: #D9BF84; --tier-bg: #3A3527; --tier-ink: #E6CF97; --tier-line: #5C5237;
  --shadow: 0 1px 0 rgb(0 0 0 / .3), 0 6px 18px rgb(0 0 0 / .3); --lift: 0 12px 26px rgb(0 0 0 / .45);
  --scrim: rgb(0 0 0 / .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
}
body { margin: 0; color: var(--ink); font: 15.5px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--hand); font-weight: 800; line-height: 1.04; text-wrap: balance; margin: 0; letter-spacing: -.035em; }
a { color: var(--pen); }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: normal; }
.eyebrow { font: 400 31px/1.1 var(--note); color: var(--red); }
.muted { color: var(--muted); }

/* marker highlight + hand-drawn circle (mask, so it takes the theme's red) */
.mark { background: linear-gradient(100deg, transparent 0.5%, var(--hl) 2%, var(--hl) 97%, transparent 99.5%) no-repeat 0 88% / 100% 52%; color: inherit; padding: 0 .12em; margin: 0 -.04em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.circled { position: relative; display: inline-block; padding: 0 .3em; margin: 0 .35em; }
.circled::after {
  content: ""; position: absolute; inset: -4px -8px -4px -8px; pointer-events: none; background: var(--red);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40' preserveAspectRatio='none'%3E%3Cpath d='M54 4C20 2 3 12 5 22c3 12 46 15 74 11 19-4 19-20 1-25C68 4 52 3 34 7' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 40' preserveAspectRatio='none'%3E%3Cpath d='M54 4C20 2 3 12 5 22c3 12 46 15 74 11 19-4 19-20 1-25C68 4 52 3 34 7' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.squiggle { position: relative; }
.squiggle::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -8px; height: 8px; background: var(--red);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 8' preserveAspectRatio='none'%3E%3Cpath d='M1 5c10-4 18 3 30 0s20-4 30 0 20 3 30-1 18-2 28 1' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 8' preserveAspectRatio='none'%3E%3Cpath d='M1 5c10-4 18 3 30 0s20-4 30 0 20 3 30-1 18-2 28 1' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

/* ---------- header / nav ---------- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--paper); border-bottom: 2px solid var(--margin); }
.top-inner { max-width: 1160px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.brand { gap: 6px; }
.brand svg { width: 54px; height: 51px; color: var(--leaf); margin: -6px 0; }
.brand b { font: 900 29px/1 var(--hand); letter-spacing: -.06em; color: var(--pen); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  display: flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 6px 14px 8px 12px;
  text-decoration: none; color: var(--muted); font: 700 15px var(--sans); border: 2px solid transparent;
}
.nav a svg { width: 19px; height: 19px; }
.nav a:hover { color: var(--ink); border-color: var(--line); }
.nav a[aria-current="page"] { color: var(--on-marker); background: var(--marker); border-color: transparent; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; font: 800 11px/20px var(--sans); text-align: center; background: var(--red); color: var(--paper); }

main { max-width: 1160px; margin: 0 auto; padding: 26px 16px 96px; }

@media (max-width: 680px) {
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; margin: 0; gap: 0; justify-content: space-around;
    background: var(--surface); border-top: 2px solid var(--margin);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .nav a { flex-direction: column; gap: 1px; font-size: 12px; padding: 5px 10px; position: relative; }
  .nav a .badge { position: absolute; top: -2px; right: 2px; }
  .brand b { font-size: 26px; }
  main { padding-bottom: 110px; }
}

/* ---------- buttons, inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border: 1.5px solid var(--ink); background: var(--surface); padding: 9px 18px; border-radius: 10px;
  font: 700 15px var(--sans); text-decoration: none; color: var(--ink); transition: transform .12s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 3px 0 var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--pen); color: var(--pen-ink); border-color: var(--pen); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); transform: none; }
.btn.sm { padding: 6px 13px; font-size: 13px; }
.btn svg { width: 17px; height: 17px; }
:focus-visible { outline: 3px solid var(--pen); outline-offset: 2px; }

.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 14px; font-weight: 700; color: var(--muted); }
.input, select.input { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); }
.input:focus { outline: none; border-color: var(--pen); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pen) 20%, transparent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; position: relative;
  padding: 7px 14px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: 14px; font-weight: 700; color: var(--muted);
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked), .chip.on { background: var(--st-blue); color: var(--st-blue-ink); border-color: currentColor; transform: rotate(-1.5deg); }
.chip:has(input:checked)::before { content: "✓"; }
.chip:has(input:focus-visible) { outline: 3px solid var(--pen); outline-offset: 2px; }

/* ---------- hero / welcome ---------- */
.hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; align-items: center; padding: 24px 0 40px; }
.hero h1 { font-size: clamp(40px, 5.8vw, 68px); line-height: 1.0; letter-spacing: -.045em; }
.hero .sub { font: 600 clamp(21px, 2.4vw, 28px)/1.3 var(--hand); letter-spacing: -.02em; color: var(--muted); margin-top: 14px; }
.hero p.lede { font-size: 18px; color: var(--muted); max-width: 48ch; margin: 18px 0 24px; }
.hero .actions { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.hero .actions .btn { padding: 13px 24px; font-size: 18px; }
.hero .aside-note { font: 400 31px/1 var(--note); color: var(--red); transform: rotate(-3deg); display: inline-block; }
.hero-card {
  position: relative; background: var(--surface); padding: 24px 24px 20px; transform: rotate(1.2deg); box-shadow: var(--lift);
  background-image: linear-gradient(var(--surface) 33px, var(--grid) 34px); background-size: 100% 34px; background-position: 0 58px;
}
.hero-card::before { content: ""; position: absolute; top: -13px; left: 40%; width: 104px; height: 28px; background: color-mix(in srgb, var(--marker) 70%, transparent); transform: rotate(-3deg); }
.hero-card .card-title { font: 400 42px/1 var(--note); border-bottom: 2px solid var(--margin); padding-bottom: 8px; margin-bottom: 8px; }
.hero-card .tl-item { background: transparent; border: 0; box-shadow: none; padding: 6px 0; }
.notes { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 34px; }
.sticky { width: 168px; padding: 12px 14px 16px; box-shadow: var(--shadow); color: var(--ink); }
.sticky:nth-child(1) { background: var(--st-yellow); transform: rotate(-2.5deg); }
.sticky:nth-child(2) { background: var(--st-pink); transform: rotate(1.5deg); }
.sticky:nth-child(3) { background: var(--st-green); transform: rotate(-1deg); }
.sticky b { display: block; font: 800 34px/1 var(--hand); letter-spacing: -.04em; }
.sticky span { font: 400 27px/1.05 var(--note); }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; gap: 34px; padding-top: 4px; } .hero-card { transform: none; } }

/* ---------- page headers & toolbars ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; margin-bottom: 20px; }
.page-head h1 { font-size: clamp(32px, 4.4vw, 48px); }
.page-head p { margin: 8px 0 0; color: var(--muted); max-width: 60ch; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .search { flex: 1 1 280px; position: relative; min-width: 0; }
.toolbar .search svg { position: absolute; left: 12px; top: 50%; translate: 0 -50%; width: 18px; height: 18px; color: var(--faint); }
.toolbar .search input { padding-left: 40px; font-size: 16px; }
.toolbar select.input { width: auto; flex: 0 1 auto; max-width: 100%; font-weight: 700; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.filters select.input { width: auto; max-width: 100%; padding: 6px 10px; font-size: 14px; font-weight: 700; border-radius: 999px; }
.count { font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 0 12px; }

/* ---------- reminder banner (sticky note with tape) ---------- */
.banner {
  position: relative; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 16px 18px; margin: 10px 0 24px;
  background: var(--st-yellow); box-shadow: var(--shadow); transform: rotate(-.4deg);
}
.banner::before { content: ""; position: absolute; top: -11px; left: 28px; width: 80px; height: 22px; background: color-mix(in srgb, var(--surface) 65%, transparent); transform: rotate(-4deg); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.banner svg { width: 22px; height: 22px; color: var(--red); flex: none; }
.banner p { margin: 0; flex: 1 1 240px; }

/* ---------- groups & cards ---------- */
.group { margin-bottom: 36px; }
.group-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.group-head h2 { font-size: 26px; }
.group-head .n { font: 400 31px var(--note); color: var(--red); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
@media (max-width: 420px) { .grid { grid-template-columns: 1fr; } }

.card {
  position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0;
  background: var(--surface); border-radius: 6px; padding: 16px; box-shadow: var(--shadow);
  border-top: 3px solid var(--margin); transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-2px) rotate(-.3deg); box-shadow: var(--lift); }
.card-top { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); padding-right: 40px; flex-wrap: wrap; }
.tag { text-transform: capitalize; font-weight: 800; color: var(--ink); }
.tag::after { content: " ·"; color: var(--faint); font-weight: 600; }
.tier { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 6px; border-radius: 999px; background: var(--tier-bg); color: var(--tier-ink); border: 1px solid var(--tier-line); font-size: 12px; font-weight: 800; white-space: nowrap; }
.tier svg { width: 13px; height: 16px; flex: none; }
.card h3 { font-size: 19px; }
.card h3 button { all: unset; cursor: pointer; }
.card h3 button:hover { text-decoration: underline; text-decoration-color: var(--marker); text-decoration-thickness: 6px; text-underline-offset: -1px; text-decoration-skip-ink: none; }
.card h3 button::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card .org { font-size: 13px; color: var(--muted); margin-top: -6px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 2px 0 0; font-size: 14px; }
.facts div { min-width: 0; }
.facts dt { font-size: 12px; color: var(--faint); font-weight: 700; }
.facts dd { margin: 0; font-weight: 800; overflow-wrap: anywhere; }
.facts dd small { font: 400 22px var(--note); color: var(--red); }
.card-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; position: relative; z-index: 1; pointer-events: none; }
.card-foot > * { pointer-events: auto; }
.save {
  position: absolute; top: 8px; right: 8px; z-index: 2; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; border: 0; background: transparent; cursor: pointer; color: var(--faint);
}
.save:hover { color: var(--red); background: var(--sunk); }
.save[aria-pressed="true"] { color: var(--red); }
.save svg { width: 22px; height: 22px; }
.save[aria-pressed="true"] svg path { fill: currentColor; }

/* stickers */
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; border: 1.5px solid currentColor; }
.pill.yes { background: var(--st-green); color: var(--st-green-ink); transform: rotate(-2deg); }
.pill.check { background: var(--st-yellow); color: var(--ink); border-color: var(--ink); transform: rotate(1.5deg); }
.pill.no { background: var(--st-pink); color: var(--st-pink-ink); }
.pill.est { background: var(--surface); color: var(--muted); border-color: var(--line); }
.card-foot .pill.est:nth-of-type(2) { transform: rotate(1deg); }
.soon { color: var(--red); }
.late { color: var(--red); }

.more { display: flex; justify-content: center; margin-top: 22px; }
details.nofit > summary { cursor: pointer; font-weight: 700; color: var(--muted); padding: 8px 0; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); border: 2px dashed var(--line); border-radius: 12px; background: var(--surface); }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; }
.drawer {
  position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; width: min(560px, 100%); overflow-y: auto;
  background: var(--surface); box-shadow: var(--lift); border-left: 3px solid var(--margin);
  padding: calc(18px + env(safe-area-inset-top, 0px)) 22px calc(28px + env(safe-area-inset-bottom, 0px));
  animation: slide .2s ease-out;
}
@keyframes slide { from { transform: translateX(30px); opacity: .5; } }
.drawer-close { position: sticky; top: 0; float: right; margin: -4px -8px 0 0; }
.drawer h2 { font-size: 30px; margin: 8px 0 4px; }
.drawer .org { color: var(--muted); }
.drawer .actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.elig { padding: 12px 14px; margin: 16px 0; border-radius: 4px; }
.elig.yes { background: var(--st-green); color: var(--st-green-ink); }
.elig.check { background: var(--st-yellow); }
.elig.no { background: var(--st-pink); color: var(--st-pink-ink); }
.elig ul { margin: 6px 0 0; padding-left: 18px; }
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); font-weight: 700; }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .dl { grid-template-columns: 1fr; gap: 2px; } .dl dd { margin-bottom: 10px; } }
.materials { margin: 6px 0 0; padding-left: 18px; }
.section-title { font: 800 19px/1.2 var(--hand); margin: 26px 0 10px; }

/* ---------- profile form ---------- */
.form { display: grid; gap: 24px; max-width: 780px; }
.panel { background: var(--surface); border-radius: 6px; padding: 22px; display: grid; gap: 16px; box-shadow: var(--shadow); border-top: 3px solid var(--margin); }
.panel h2 { font-size: 24px; }
.panel h2 .muted { font: 400 29px var(--note) !important; color: var(--red); }
.panel .hint { margin: -10px 0 0; color: var(--muted); font-size: 14px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 600; }
.check-row input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--pen); }
.privacy { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--muted); }
.privacy svg { width: 18px; height: 18px; flex: none; color: var(--leaf); }
.form-foot { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.form-foot .btn.primary { padding: 12px 24px; font-size: 17px; }

/* ---------- schedule ---------- */
.sched { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 900px) { .sched { grid-template-columns: 1fr; } }
.summary { display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; align-items: stretch; }
.summary > div { background: var(--surface); border-radius: 6px; padding: 12px 14px; min-width: 0; box-shadow: var(--shadow); }
.summary b { display: block; font: 800 26px/1.1 var(--hand); letter-spacing: -.04em; }
.summary span { font-size: 12px; font-weight: 700; color: var(--muted); }
.ring { display: flex; align-items: center; gap: 12px; }
.ring svg { width: 64px; height: 64px; flex: none; }
.ring .track { stroke: var(--sunk); }
.ring .fill { stroke: var(--red); }
.ring text { fill: var(--ink); font: 800 17px var(--hand); }
@media (max-width: 560px) { .summary { grid-template-columns: repeat(3, minmax(0, 1fr)); } .summary .ring { grid-column: 1 / -1; } }
.month-label { font: 400 39px/1 var(--note); margin: 22px 0 8px; padding-bottom: 4px; border-bottom: 2px solid var(--margin); }
.tl { display: grid; gap: 8px; }
.tl-item {
  display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  background: var(--surface); border-radius: 6px; padding: 10px 12px; box-shadow: var(--shadow);
}
.tl-item.done { opacity: .6; }
.tl-item.done .tl-main button { text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.tl-date { text-align: center; line-height: 1.05; }
.tl-date b { display: block; font: 800 24px var(--hand); letter-spacing: -.04em; }
.tl-date span { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tl-date.now b { color: var(--red); }
.tl-main { min-width: 0; }
.tl-main button { all: unset; cursor: pointer; font-weight: 800; }
.tl-main button:hover { text-decoration: underline; text-decoration-color: var(--marker); text-decoration-thickness: 5px; }
.tl-main p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.tl-item select { padding: 6px 8px; font-size: 13px; font-weight: 700; border-radius: 8px; }
@media (max-width: 480px) { .tl-item { grid-template-columns: 46px minmax(0, 1fr); } .tl-item select { grid-column: 2; justify-self: start; } }

.cal { background: var(--surface); border-radius: 6px; padding: 14px; box-shadow: var(--shadow); border-top: 3px solid var(--margin); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head h3 { font: 400 39px/1 var(--note); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-grid .dow { font-size: 11px; text-align: center; color: var(--faint); font-weight: 800; padding: 4px 0; }
.day {
  position: relative; aspect-ratio: 1; max-width: 100%; border: 0; border-radius: 8px; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; padding: 6px 0; font-size: 14px; font-weight: 600;
}
.day:hover { background: var(--sunk); }
.day.out { color: var(--faint); opacity: .5; }
.day.today .num { background: var(--marker); color: var(--on-marker); padding: 0 5px; border-radius: 3px 8px 4px 7px; font-weight: 800; }
.day.sel { background: var(--st-blue); }
.dots { display: flex; gap: 3px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.dot.start { background: var(--red); }
.dot.due { background: var(--pen); }
.legend { display: flex; gap: 14px; font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 10px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.day-list { margin-top: 12px; display: grid; gap: 6px; font-size: 14px; }
.day-list button { all: unset; cursor: pointer; font-weight: 700; color: var(--pen); }
.export { margin-top: 22px; display: grid; gap: 10px; }
.export textarea { width: 100%; min-height: 120px; font: 12px/1.4 ui-monospace, Menlo, monospace; border: 1.5px solid var(--line); border-radius: 8px; background: var(--sunk); padding: 10px; }

.toast {
  position: fixed; left: 50%; translate: -50% 0; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  background: var(--st-yellow); color: var(--ink); padding: 10px 18px; box-shadow: var(--lift); rotate: -1deg;
  font: 700 15px var(--hand); max-width: calc(100% - 32px);
}
@media (max-width: 680px) { .toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }
footer.site { max-width: 1160px; margin: 0 auto; padding: 0 16px 40px; font-size: 13px; color: var(--faint); }

/* ---------- vault ---------- */
.vault-meter { position: relative; min-width: 130px; padding: 10px 14px 14px; background: var(--surface); border-radius: 6px; box-shadow: var(--shadow); }
.vault-meter b { display: block; font: 800 30px/1 var(--hand); letter-spacing: -.04em; }
.vault-meter span { font-size: 12px; font-weight: 700; color: var(--muted); }
.vault-meter i { position: absolute; left: 14px; right: 14px; bottom: 8px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--pen) var(--p), var(--sunk) var(--p)); }
main .panel + .panel { margin-top: 20px; }
.vhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.vhead h2 .muted { font: 600 15px var(--sans); }
.vitem { display: grid; gap: 12px; padding: 14px; border-radius: 8px; background: var(--sunk); }
.vitem.row { align-items: end; }
.vrow-actions { display: flex; gap: 6px; justify-content: flex-end; }
.field small { font-weight: 600; color: var(--faint); margin-left: 6px; }
textarea.input { resize: vertical; line-height: 1.5; }
textarea.essay { min-height: 160px; }
.empty.small { padding: 18px; font-size: 14px; }
#vault-io { font: 12px/1.4 ui-monospace, Menlo, monospace; }
/* kit in the drawer */
.kit { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.kit li { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kit small { color: var(--muted); font-weight: 600; }
.kit-ok { color: var(--pen); font-weight: 900; }
.kit-miss { color: var(--red); font-weight: 900; }
.kit-na { color: var(--faint); }
.kit-essays { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; font-size: 14px; }
.kit-essays b { width: 100%; }
.kit-hint { font-size: 13px; margin: 10px 0 0; }
.kit-foot { font-size: 13px; margin: 12px 0 0; }
@media (max-width: 680px) { .nav a { padding: 5px 6px; } }

/* ---------- account ---------- */
.acct {
  display: inline-flex; align-items: center; gap: 6px; flex: none; cursor: pointer; margin-left: 6px;
  padding: 7px 14px; border-radius: 10px; border: 1.5px solid var(--pen); background: var(--pen); color: var(--pen-ink);
  font: 700 14px var(--sans);
}
.acct svg { width: 18px; height: 18px; }
.acct[data-state="saved"], .acct[data-state="saving"], .acct[data-state="pending"], .acct[data-state="syncing"], .acct[data-state="readonly"], .acct[data-state="error"] {
  background: transparent; color: var(--pen); border-color: var(--line);
}
.acct[data-state="error"] { color: var(--red); }
.acct[data-state="saving"] svg, .acct[data-state="pending"] svg, .acct[data-state="syncing"] svg { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (max-width: 680px) { .acct { margin-left: auto; padding: 6px 12px; font-size: 13px; } }
.modal {
  position: fixed; z-index: 51; left: 50%; top: 50%; translate: -50% -50%; width: min(440px, calc(100% - 32px)); max-height: calc(100% - 48px); overflow-y: auto;
  background: var(--surface); border-radius: 10px; border-top: 3px solid var(--margin); box-shadow: var(--lift); padding: 24px 24px 22px;
}
#modal-root .scrim { z-index: 50; }
.modal h2 { font-size: 26px; margin-bottom: 8px; }
.modal p { margin: 0 0 12px; }
.modal .small, .acct-form .small { font-size: 13px; }
.modal-x { position: absolute; top: 10px; right: 10px; }
.acct-status { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 8px; background: var(--st-green); color: var(--st-green-ink); }
.acct-status svg { width: 20px; height: 20px; flex: none; }
.acct-form { display: grid; gap: 12px; margin-bottom: 12px; }
.acct-form .btn { width: 100%; padding: 11px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.acct-msg { font-weight: 700; color: var(--pen); margin: 0; min-height: 1em; }

/* ---------- plan: progress, checklist, recommenders ---------- */
.prog { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--muted); white-space: nowrap; }
.prog i { width: 46px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--pen) var(--p), var(--sunk) var(--p)); }
.tl-main p .prog { margin-right: 6px; }
.check-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.checklist label { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: start; padding: 7px 0; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14.5px; }
.checklist input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--pen); }
.checklist input:checked + span { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.recs { display: grid; gap: 8px; }
.rec { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 10px 12px; background: var(--sunk); border-radius: 8px; }
.rec-who { min-width: 0; display: grid; }
.rec-who small { color: var(--muted); font-weight: 600; }
.rec select { width: auto; padding: 6px 8px; font-size: 13px; font-weight: 700; }
@media (max-width: 480px) { .rec { grid-template-columns: 1fr 1fr; } .rec-who { grid-column: 1 / -1; } }
.tl-ctl { display: grid; gap: 6px; justify-items: end; }
@media (max-width: 480px) { .tl-ctl { grid-column: 2; justify-items: start; grid-auto-flow: column; } }
.small { font-size: 13px; }
.linkish { all: unset; cursor: pointer; color: var(--pen); font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; display: inline-flex; align-items: center; gap: 4px; }
.linkish svg { width: 14px; height: 14px; }
.linkish:focus-visible { outline: 3px solid var(--pen); outline-offset: 2px; }
.sel { user-select: all; font-weight: 700; background: var(--sunk); padding: 1px 6px; border-radius: 4px; overflow-wrap: anywhere; }

/* ---------- this week digest (a notebook page) ---------- */
.digest { position: relative; margin: 6px 0 24px; padding: 16px 18px 14px 58px; background: var(--surface); box-shadow: var(--shadow); border-radius: 4px;
  background-image: linear-gradient(90deg, transparent 42px, color-mix(in srgb, var(--red) 45%, transparent) 42px, color-mix(in srgb, var(--red) 45%, transparent) 43.5px, transparent 43.5px); }
.digest-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.digest-head h2 { font-size: 24px; }
.digest-head span { font: 400 26px/1 var(--note); color: var(--red); }
.digest ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.digest li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; font-size: 14.5px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.digest li:last-child { border-bottom: 0; }
.digest li > b { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-top: 2px; }
.digest li button { all: unset; cursor: pointer; font-weight: 800; }
.digest li button:hover { text-decoration: underline; text-decoration-color: var(--marker); text-decoration-thickness: 5px; }
.digest small { color: var(--muted); font-weight: 600; }
@media (max-width: 480px) { .digest { padding-left: 18px; background-image: none; } .digest li { grid-template-columns: 1fr; gap: 0; } }
.wins { margin-top: 18px; background: var(--tier-bg); color: var(--ink); padding: 14px 16px; border-radius: 6px; border: 1px solid var(--tier-line); }
.wins ul { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.wins li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; align-items: start; }
.wins li svg { width: 16px; height: 20px; }
.wins li span { display: grid; }
.wins small { color: var(--tier-ink); font-weight: 700; }
.fresh .group-head { flex-wrap: wrap; }

/* ---------- modals & forms ---------- */
.modal.wide { width: min(600px, calc(100% - 32px)); }
.copybox { font: 13.5px/1.5 var(--sans); min-height: 180px; background: var(--sunk); }
.data-box { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.data-box summary { cursor: pointer; font-weight: 700; color: var(--muted); font-size: 14px; }
.data-box p { margin: 10px 0; }
.btn.danger { color: var(--red); border-color: var(--red); }
.btn.danger[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.del-confirm { margin-top: 10px; padding: 12px; border-radius: 8px; background: var(--st-pink); color: var(--st-pink-ink); }
.del-confirm .input { background: var(--surface); color: var(--ink); }
.acct-form .chips .chip { font-size: 13px; padding: 6px 12px; }
.acct-form .chip:has(input[type=radio]:checked)::before { content: "✓"; }

/* ---------- essay feedback (margin notes) ---------- */
.fb-overall { margin-top: 14px; padding: 14px 16px; background: var(--st-yellow); box-shadow: var(--shadow); transform: rotate(-.4deg); }
.fb-notes { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 12px; counter-reset: fb; }
.fb-notes li { position: relative; padding: 10px 12px 10px 42px; border-left: 3px solid var(--margin); background: var(--surface); counter-increment: fb; }
.fb-notes li::before { content: counter(fb); position: absolute; left: 10px; top: 8px; font: 400 26px/1 var(--note); color: var(--red); }
.fb-notes li.fb-works { border-left-color: var(--pen); }
.fb-notes li.fb-question { border-left-color: var(--gold); }
.fb-notes li.fb-consider { border-left-color: var(--red); }
.fb-kind { display: block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.fb-notes q { display: block; margin: 4px 0; font-style: italic; quotes: "“" "”"; }
.fb-notes p { margin: 2px 0 0; font-size: 14.5px; }
.fb-next { padding: 12px 14px; border-radius: 6px; background: var(--st-green); color: var(--st-green-ink); margin-bottom: 12px; }

/* ---------- pages & footer ---------- */
.prose { max-width: 68ch; }
.prose h1 { font-size: clamp(34px, 4.6vw, 50px); margin-bottom: 10px; }
.prose h2 { font-size: 22px; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--ink); }
.prose .lede { font-size: 18px; color: var(--muted); }
.prose ul { padding-left: 20px; display: grid; gap: 6px; }
.draft-note { display: inline-block; font: 400 25px/1.1 var(--note); color: var(--red); transform: rotate(-1.5deg); margin: 4px 0 8px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 8px; }
.foot-links a, .foot-links .linkish { color: var(--muted); font-weight: 700; font-size: 13px; text-decoration: none; }
.foot-links a:hover, .foot-links .linkish:hover { color: var(--ink); text-decoration: underline; }
footer.site p { margin: 0; }
@media (max-width: 680px) { main { padding-bottom: 36px; } footer.site { padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)); } }
