/* Jaz Do It — tech theme. Light: indigo + electric cyan on cool gray. Dark: deep navy with glowing indigo/cyan.
   Theme = Auto (follows the device) unless <html data-theme="light|dark"> is set by the Theme button.
   Color is meaning: each category, stage, fit bucket, track and region has its own hue (tone-* helpers, last in file). */
:root {
  --bg: #F6F3FC; --surface: #FFFFFF; --surface-2: #FAF8FE; --ink: #1A1033; --muted: #6B6280; --line: #E9E3F5;
  --accent: #7C3AED; --accent-2: #C026D3; --on-accent: #FFFFFF; --on-tone: #FFFFFF;
  --brand-grad: linear-gradient(120deg, #2E1065 0%, #5B21B6 42%, #7C3AED 68%, #C026D3 100%);
  --glow: 0 1px 2px rgb(26 16 51 / .06), 0 6px 20px -10px rgb(124 58 237 / .4);
  --blue: #2563EB; --violet: #7C3AED; --amber: #B45309; --cyan: #0891B2; --green: #15803D; --gold: #A16207;
  --red: #DC2626; --slate: #64748B; --teal: #0D9488; --orange: #EA580C; --rose: #E11D48; --copper: #C2410C;
  --sky: #0284C7; --navy: #1E3A8A; --indigo: #4F46E5;
  --tint: 11%;
  --font-ui: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "SF Pro Display", "Segoe UI Variable Display", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
  --r: 14px; --gap: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D0818; --surface: #160F26; --surface-2: #1C1430; --ink: #EEE8FA; --muted: #9A90B3; --line: #2A2042;
    --accent: #A78BFA; --accent-2: #E879F9; --on-accent: #12081F; --on-tone: #12081F;
    --brand-grad: linear-gradient(120deg, #1A0B2E 0%, #2E1065 48%, #6B21A8 100%);
    --glow: 0 0 0 1px rgb(167 139 250 / .2), 0 8px 28px -10px rgb(232 121 249 / .38);
    --blue: #60A5FA; --violet: #C084FC; --amber: #FBBF24; --cyan: #22D3EE; --green: #4ADE80; --gold: #FACC15;
    --red: #F87171; --slate: #94A3B8; --teal: #2DD4BF; --orange: #FB923C; --rose: #FB7185; --copper: #FB923C;
    --sky: #38BDF8; --navy: #8EA2FF; --indigo: #818CF8;
    --tint: 16%; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D0818; --surface: #160F26; --surface-2: #1C1430; --ink: #EEE8FA; --muted: #9A90B3; --line: #2A2042;
  --accent: #A78BFA; --accent-2: #E879F9; --on-accent: #12081F; --on-tone: #12081F;
  --brand-grad: linear-gradient(120deg, #1A0B2E 0%, #2E1065 48%, #6B21A8 100%);
  --glow: 0 0 0 1px rgb(167 139 250 / .2), 0 8px 28px -10px rgb(232 121 249 / .38);
  --blue: #60A5FA; --violet: #C084FC; --amber: #FBBF24; --cyan: #22D3EE; --green: #4ADE80; --gold: #FACC15;
  --red: #F87171; --slate: #94A3B8; --teal: #2DD4BF; --orange: #FB923C; --rose: #FB7185; --copper: #FB923C;
  --sky: #38BDF8; --navy: #8EA2FF; --indigo: #818CF8;
  --tint: 16%; color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--ink); font: 15px/1.5 var(--font-ui); -webkit-text-size-adjust: 100%; min-height: 100dvh;
  background:
    radial-gradient(900px 480px at 0% -8%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%),
    radial-gradient(700px 420px at 105% 4%, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 70%),
    radial-gradient(color-mix(in srgb, var(--ink) 7%, transparent) 1px, transparent 1.2px) 0 0 / 22px 22px,
    var(--bg); }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: 2px; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { font-size: max(16px, 1rem); }      /* iOS Safari zooms into fields smaller than 16px */
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }

/* ---------------------------------------------------------------- lock */
.lock { min-height: 100dvh; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  background: var(--brand-grad); }
.lock-card { width: min(100%, 24rem); background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 28px 22px; display: grid; gap: 12px; text-align: center; box-shadow: 0 20px 50px rgb(0 0 0 / .3); }
.lock-icon { justify-self: center; border-radius: 14px; }
.lock h1 { font: 800 1.6rem/1.2 var(--font-display); letter-spacing: -.02em; margin: 0; }
.lock p { margin: 0; }
.lock input[type=password] { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); font-family: var(--font-mono); letter-spacing: .04em; text-align: center; }
.remember { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: .9rem; color: var(--muted); }
.btn { border: 0; border-radius: 12px; padding: 12px 16px; cursor: pointer; font-weight: 700; }
.btn.primary { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #fff; }
.btn:disabled { opacity: .6; cursor: progress; }
.error { color: var(--red); font-size: .9rem; }
.fine { font-size: .8rem; }

/* ---------------------------------------------------------------- app chrome */
.app { max-width: 46rem; margin: 0 auto; padding: 0 16px calc(86px + env(safe-area-inset-bottom)); }
.bar { position: sticky; top: 0; z-index: 5; margin: 0 -16px; padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
  background: var(--brand-grad); color: #fff; box-shadow: inset 0 -1px 0 rgb(232 121 249 / .45);
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; }
@media (min-width: 48rem) { .bar { border-radius: 0 0 18px 18px; } }
.bar-title { min-width: 0; }
.bar h1 { font: 800 1.45rem/1.15 var(--font-display); letter-spacing: -.02em; margin: 0; }
.bar h1::after { content: "_"; color: #F0ABFC; margin-left: 1px; }
@media (prefers-reduced-motion: no-preference) { .bar h1::after { animation: blink 1.1s steps(1) infinite; } @keyframes blink { 50% { opacity: 0; } } }
.bar p { margin: 2px 0 0; font-size: .76rem; color: rgb(255 255 255 / .75); }
.bar-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.icon-btn { border: 1px solid rgb(255 255 255 / .3); background: rgb(255 255 255 / .1); color: #fff;
  border-radius: 999px; padding: 5px 12px; font-size: .8rem; cursor: pointer; backdrop-filter: blur(6px); }
.icon-btn:hover { background: rgb(255 255 255 / .18); }
.icon-btn:focus-visible { outline-color: #F0ABFC; }
.banner { margin: 10px 0 0; padding: 8px 12px; border-radius: 12px; font-size: .85rem; background: var(--surface); border: 1px solid var(--line); }
#ios-hint { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.hint-x { border: 0; background: transparent; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 2px 6px; }
.banner.warn { color: var(--amber); background: color-mix(in srgb, var(--amber) var(--tint), var(--surface)); border-color: color-mix(in srgb, var(--amber) 35%, transparent); }

main h2 { font: 700 .76rem/1 var(--font-ui); text-transform: uppercase; letter-spacing: .1em; color: var(--ink);
  margin: 26px 0 10px; display: flex; gap: 8px; align-items: center; }
main h2::before { content: ""; width: .6rem; height: .6rem; border-radius: 3px; background: var(--c, var(--slate));
  box-shadow: 0 0 10px color-mix(in srgb, var(--c, var(--slate)) 60%, transparent); }
.count { font-family: var(--font-mono); color: #fff; background: linear-gradient(120deg, var(--accent), var(--accent-2)); border-radius: 999px;
  padding: 2px 8px; letter-spacing: 0; font-size: .72rem; }
.count:empty { display: none; }
.hint { font-size: .82rem; margin: -4px 0 10px; }
.tools + .hint { margin-top: 12px; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); margin-top: 16px; }
.kpi { --c: var(--slate); background: color-mix(in srgb, var(--c) var(--tint), var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
  border-radius: var(--r); padding: 12px; display: grid; gap: 2px; min-width: 0; }
.kpi-label { font-size: .74rem; color: var(--ink); line-height: 1.25; font-weight: 600; opacity: .8; }
.kpi-num { font: 800 2rem/1.1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--c); }

/* Lists: colored edge = stage / fit / kind */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.item { --c: var(--line); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c);
  border-radius: var(--r); padding: 12px 14px; display: grid; gap: 5px; min-width: 0; box-shadow: var(--glow); }
.item:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.item .top { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
.item .title { font-weight: 700; overflow-wrap: anywhere; }
.item .sub { color: var(--muted); font-size: .86rem; overflow-wrap: anywhere; }
.item .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .8rem; color: var(--muted); }
.item.empty { color: var(--muted); font-size: .9rem; box-shadow: none; }
.pill { --c: var(--slate); display: inline-block; font-size: .74rem; font-weight: 600; line-height: 1.7; padding: 0 9px; border-radius: 999px; white-space: nowrap;
  color: var(--c); background: color-mix(in srgb, var(--c) var(--tint), transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.pill.solid { color: var(--on-tone); background: var(--c); border-color: var(--c); }
details { font-size: .84rem; }
summary { cursor: pointer; color: var(--accent); font-weight: 600; width: fit-content; }
.why { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.why li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 8px; }
.why .lvl { font-weight: 700; color: var(--c, var(--ink)); }
.apply { justify-self: start; margin-top: 4px; font-weight: 700; color: var(--accent); }

/* Filters */
.tools { display: grid; gap: 8px; margin-top: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { --c: var(--accent); border: 1px solid color-mix(in srgb, var(--c) 45%, var(--line)); background: var(--surface); color: var(--c);
  border-radius: 999px; padding: 4px 12px; font-size: .82rem; font-weight: 600; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--c); color: var(--on-tone); border-color: var(--c); }
#q { width: 100%; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }

/* Bottom tabs */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  padding: 6px max(16px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)); }
.tabbtn { border: 0; background: transparent; padding: 10px 4px; font-size: .86rem; font-weight: 700; color: var(--muted); cursor: pointer;
  border-radius: 12px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tabbtn[aria-current="page"] { color: #fff; background: linear-gradient(120deg, var(--accent), var(--accent-2)); box-shadow: var(--glow); }
@media (min-width: 48rem) { .tabs { max-width: 46rem; margin: 0 auto; border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0; } }
@media (prefers-reduced-motion: no-preference) { .tab { animation: fade .18s ease-out; } @keyframes fade { from { opacity: .4; } } }

/* Internship sub-tabs */
.subnav { display: flex; margin-top: 16px; width: 100%; }
.subnav button { flex: 1; }

/* Buttons */
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.btn-link { display: inline-block; text-decoration: none; font-weight: 700; font-size: .84rem; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.btn-link:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.btn-link.primary { background: linear-gradient(120deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; }
.btn-link.small { padding: 4px 10px; font-size: .76rem; }
.warn-text { color: var(--amber) !important; }
.linkish { all: unset; cursor: pointer; text-decoration: underline; font-weight: 700; }

/* Segmented control */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); }
.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .84rem; font-weight: 700;
  padding: 5px 14px; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #fff; }

/* ---------------------------------------------------------------- quote of the day */
.quote { margin: 14px 0 0; padding: 12px 16px 12px 14px; border-radius: 16px; position: relative; overflow: hidden;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 12%, var(--surface)), color-mix(in srgb, var(--accent-2) 10%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line)); box-shadow: var(--glow); }
.quote-label { margin: 0 0 4px; font: 700 .66rem/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-2); }
.quote blockquote { margin: 0; font: 650 1rem/1.4 var(--font-display); letter-spacing: -.01em; text-wrap: pretty; }
.quote figcaption { margin-top: 4px; font-size: .78rem; color: var(--muted); }

/* ---------------------------------------------------------------- planner: header + calendar */
.cal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
main h2.cal-title { flex: 1; margin: 0; display: block; font: 800 1.55rem/1.15 var(--font-display); letter-spacing: -.02em;
  text-transform: none; color: var(--ink); }
main h2.cal-title::before { display: none; }
.cal-nav { width: 2.4rem; height: 2.4rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 1.35rem; line-height: 1; cursor: pointer; }
.cal-nav:hover { border-color: var(--accent); color: var(--accent); }
.cal-tools { display: flex; align-items: center; gap: 8px; flex-basis: 100%; justify-content: space-between; }
@media (min-width: 40rem) { .cal-tools { flex-basis: auto; margin-left: auto; } }
.cal { margin-top: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 8px; touch-action: pan-y; box-shadow: var(--glow); }
.cal-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; font: 700 .66rem/1 var(--font-mono);
  color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 4px 0 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-row { display: contents; }
/* Each day is a fixed-height box: keyword chips inside; scroll when they don't fit. */
.cal-cell { box-sizing: border-box; min-width: 0; height: 5.4rem; border-radius: 10px; padding: 3px; display: flex; flex-direction: column; gap: 2px;
  cursor: pointer; background: color-mix(in srgb, var(--ink) 3%, transparent); border: 1px solid transparent; overflow: hidden; }
.cal-cell:hover { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.cal-cell:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.cal-cell.other { opacity: .4; }
.cal-cell .num { flex: none; font: 700 .72rem/1 var(--font-mono); width: 1.45rem; height: 1.45rem; display: grid; place-items: center; border-radius: 999px; }
.cal-cell.late .num { color: var(--red); }
.cal-cell.today .num { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #fff; }
.cal-cell.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 16px -4px color-mix(in srgb, var(--accent) 70%, transparent); }
.titles { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 40%, transparent) transparent; }
.titles::-webkit-scrollbar { width: 3px; }
.titles::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 40%, transparent); border-radius: 3px; }
.titles .t { flex: none; font-size: .58rem; line-height: 1.2; padding: 1px 3px; border-radius: 4px; color: var(--c);
  background: color-mix(in srgb, var(--c) var(--tint), transparent); border-left: 2px solid var(--c);
  overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.titles .t.done { text-decoration: line-through; opacity: .6; }
.titles .t.late { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 60%, transparent); }
@media (min-width: 40rem) {
  .cal-cell { height: 6.8rem; padding: 5px; gap: 3px; }
  .cal-cell .num { font-size: .8rem; width: 1.7rem; height: 1.7rem; }
  .titles .t { font-size: .72rem; line-height: 1.3; padding: 1px 5px; -webkit-line-clamp: 1; }
}
@media (min-width: 64rem) { .cal-cell { height: 7.6rem; } }
.kbd-hint { display: none; margin: 8px 2px 0; font-size: .74rem; color: var(--muted); }
.kbd-hint kbd { font: 600 .7rem/1 var(--font-mono); padding: 2px 5px; border-radius: 5px; border: 1px solid var(--line);
  background: var(--surface); box-shadow: inset 0 -1px 0 var(--line); }
@media (hover: hover) and (pointer: fine) { .kbd-hint { display: block; } }

/* Week view: stacked days on phones, seven columns on wide screens */
.week { display: grid; gap: 6px; }
.week-day { all: unset; box-sizing: border-box; display: grid; grid-template-columns: 3.4rem minmax(0, 1fr); gap: 10px; align-items: start;
  padding: 8px 10px; border-radius: 12px; cursor: pointer; background: color-mix(in srgb, var(--ink) 3%, transparent); min-width: 0; border: 1px solid transparent; }
.week-day:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.week-day.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.wd-head { display: grid; justify-items: center; }
.wd-name { font: 700 .66rem/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.wd-num { font: 700 1.05rem/1 var(--font-mono); width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 999px; }
.week-day.today .wd-num { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #fff; }
.week-day.late .wd-num { color: var(--red); }
.week-day.today.late .wd-num { color: #fff; }
.wd-items { display: grid; gap: 4px; min-width: 0; padding-top: 2px; }
.wd-item { display: flex; gap: 6px; align-items: center; min-width: 0; font-size: .86rem; }
.wd-item i { flex: none; width: 7px; height: 7px; border-radius: 999px; background: var(--c); box-shadow: 0 0 6px var(--c); }
.wd-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wd-item.done span { text-decoration: line-through; color: var(--muted); }
.wd-empty { color: var(--muted); font-size: .86rem; }
@media (min-width: 40rem) {
  .week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .week-day { grid-template-columns: 1fr; align-content: start; min-height: 12rem; padding: 8px 6px; }
  .wd-head { justify-items: start; }
  .wd-item { font-size: .74rem; padding: 2px 5px; border-radius: 5px; color: var(--c); background: color-mix(in srgb, var(--c) var(--tint), transparent); }
  .wd-item i { display: none; }
}

/* Category chips: pickers on add forms, and the filter under the calendar */
.cat-pick, .cat-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-pick { flex-basis: 100%; }
.cat-filter { margin-top: 10px; }
.cat-chip { --c: var(--slate); border: 1px solid color-mix(in srgb, var(--c) 45%, var(--line)); background: var(--surface); color: var(--c);
  border-radius: 999px; padding: 3px 11px; font-size: .78rem; font-weight: 700; cursor: pointer; }
.cat-chip[aria-checked="true"], .cat-chip[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: var(--on-tone); }
/* Category on a row: looks like a pill; a transparent native <select> on top does the picking (16px, so iOS doesn't zoom). */
.cat-wrap { position: relative; display: inline-flex; }
.cat-wrap .pill::after { content: " ▾"; font-size: .65rem; }
.cat-wrap select { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; font-size: 16px; }
.cat-wrap:focus-within .pill { outline: 2px solid var(--accent-2); outline-offset: 1px; }

/* ---------------------------------------------------------------- planner: day details (side panel on laptops, bottom sheet on phones) */
.plan-side { display: flex; flex-direction: column; }
.side-group { min-width: 0; }
.day-panel { margin-top: 14px; min-width: 0; }
.day-name { margin: 0; font: 800 1.9rem/1.1 var(--font-display); letter-spacing: -.02em; }
.day-sub { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.day-close { display: none; position: absolute; top: 10px; right: 12px; width: 2.2rem; height: 2.2rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.sheet-backdrop { display: none; }
@media (max-width: 63.99rem) {
  .plan-side .side-up { order: 1; } .plan-side .side-someday { order: 2; } .plan-side .side-proj { order: 3; } .plan-side .sync-row { order: 4; }
  .day-panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0 auto; max-width: 42rem; max-height: min(86dvh, 46rem);
    overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--line); border-bottom: 0;
    border-radius: 22px 22px 0 0; padding: 22px 16px calc(24px + env(safe-area-inset-bottom));
    box-shadow: 0 -16px 48px rgb(0 0 0 / .3); transform: translateY(105%); visibility: hidden;
    transition: transform .24s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .24s; }
  .day-panel::before { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line); }
  .day-panel.open { transform: none; visibility: visible; transition: transform .24s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
  .day-close { display: grid; place-items: center; }
  .day-name { padding-right: 3rem; }
  .sheet-backdrop { display: block; position: fixed; inset: 0; z-index: 29; background: rgb(3 6 18 / .5); backdrop-filter: blur(2px); }
  body.sheet-open { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .day-panel { transition: none !important; } }

/* Add forms */
.quick-add { display: flex; gap: 8px; margin: 14px 0 10px; flex-wrap: wrap; }
.quick-add input:not([type=checkbox]):not([type=time]):not([type=url]), .task-edit input, .task-edit textarea, .more input, .more textarea {
  flex: 1 1 12rem; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.quick-add input:focus, .task-edit input:focus, .task-edit textarea:focus, .more input:focus, .more textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.quick-add .btn-link { padding: 9px 16px; }
.more { flex-basis: 100%; }
.more summary { font-size: .8rem; color: var(--muted); }
.more[open] summary { margin-bottom: 8px; }
.more-row { display: flex; flex-wrap: wrap; gap: 8px; }
.more-field { display: grid; gap: 4px; font-size: .74rem; font-weight: 700; color: var(--muted); min-width: 0; margin-bottom: 8px; }
.more-field.grow { flex: 1 1 12rem; }
.more textarea, .task-edit textarea { width: 100%; resize: vertical; min-height: 4.5rem; font-family: var(--font-ui); line-height: 1.45; }

/* To-do rows */
.tasks { gap: 6px; }
.task { grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 9px 10px 9px 12px; }
.task input[type=checkbox] { width: 1.3rem; height: 1.3rem; accent-color: var(--c); margin: 2px 0 0; cursor: pointer; }
.task-body { display: grid; gap: 5px; min-width: 0; }
.task-line { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.task .time { font: 700 .78rem/1.4 var(--font-mono); color: var(--c); white-space: nowrap; }
.task .ttl { all: unset; cursor: text; overflow-wrap: anywhere; font-weight: 650; }
.task .ttl:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 4px; }
.task.done .ttl, .task.done .ttl-text { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.ttl-text { font-weight: 650; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.task .due { position: relative; cursor: pointer; }
.task .due-input { position: absolute; inset: 0; opacity: 0; width: 100%; pointer-events: none; }
.task .x { border: 0; background: transparent; color: var(--muted); font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.task .x:hover, .task .x:focus-visible { color: var(--red); }
.join { background: #2D8CFF; border-color: #2D8CFF; color: #fff; padding: 3px 11px; font-size: .74rem; }
.join:hover { filter: brightness(1.08); }
.notes summary { font-size: .76rem; color: var(--muted); }
.notes p { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .86rem; line-height: 1.5;
  padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.task-edit { grid-column: 1 / -1; display: grid; gap: 8px; }
.edit-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.edit-row input[type=time] { flex: 0 0 auto; }
#day-canvas:empty { display: none; }

/* Upcoming: next 14 days grouped by date */
.upcoming { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.up-day { display: grid; gap: 4px; }
.up-date { all: unset; cursor: pointer; font: 700 .78rem/1.4 var(--font-mono); color: var(--accent); letter-spacing: .02em; }
.up-date:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 4px; }
.up-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.up-item { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 7px 10px; border-radius: 10px; background: var(--surface);
  border: 1px solid var(--line); font-size: .88rem; }
.up-item i { flex: none; width: 8px; height: 8px; border-radius: 999px; background: var(--c); box-shadow: 0 0 6px var(--c); }
.up-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.up-time { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.sync-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 22px; }
.sync-row p { margin: 0; font-size: .8rem; flex-basis: 100%; }

/* ---------------------------------------------------------------- projects */
.proj-summary { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.ps-item { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; cursor: pointer;
  padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c); }
.ps-item:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.ps-title { font-weight: 650; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-pct { font: 700 .74rem/1 var(--font-mono); color: var(--c); }
.ps-item .proj-bar { grid-column: 1 / -1; height: 4px; }
.projects-wrap > summary { list-style: none; width: auto; }
.projects-wrap > summary::-webkit-details-marker { display: none; }
.projects-wrap > summary h2 { margin-bottom: 10px; }
.projects-wrap > summary h2::after { content: "▾"; color: var(--muted); font-size: .8rem; margin-left: auto; }
.projects-wrap:not([open]) > summary h2::after { content: "▸"; }
.projects-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.project { --c: var(--teal); background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--r);
  padding: 12px 14px; display: grid; gap: 8px; box-shadow: var(--glow); min-width: 0; }
.project:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.project.done { opacity: .72; }
.proj-head { display: flex; gap: 10px; align-items: center; min-width: 0; }
.proj-head input[type=checkbox] { width: 1.25rem; height: 1.25rem; accent-color: var(--c); margin: 0; flex: none; }
.proj-head .ttl { all: unset; flex: 1; min-width: 0; font: 700 1rem/1.3 var(--font-display); overflow-wrap: anywhere; cursor: text; }
.project.done .ttl { text-decoration: line-through; }
.proj-head .ttl-edit { flex: 1; min-width: 0; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 700; }
.proj-head .x { border: 0; background: transparent; color: var(--muted); font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 2px 4px; }
.proj-head .x:hover { color: var(--red); }
.proj-bar { height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--c) 14%, transparent); overflow: hidden; }
.proj-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--c), var(--accent-2)); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 60%, transparent);
  transition: width .3s ease; }
.proj-info { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; font: 600 .76rem/1.4 var(--font-mono); color: var(--muted); }
.proj-steps summary { font-size: .8rem; }
.steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.step { display: flex; gap: 8px; align-items: center; padding: 5px 8px; border-radius: 8px; background: var(--surface-2); font-size: .88rem; }
.step span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.step input { accent-color: var(--c); margin: 0; }
.step.done span { text-decoration: line-through; color: var(--muted); }
.step .x { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.step-add { margin: 8px 0 0; }

/* ---------------------------------------------------------------- achievements */
.ach-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.ach-stat { padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 2px; }
.ach-stat b { font: 800 1.4rem/1.1 var(--font-display); background: linear-gradient(120deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ach-stat span { font-size: .72rem; color: var(--muted); font-weight: 600; }
.ach-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 8px; }
.ach { padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 6px; align-content: start; min-width: 0; }
.ach .badge { width: 2.4rem; height: 2.4rem; border-radius: 12px; display: grid; place-items: center; color: var(--muted);
  background: color-mix(in srgb, var(--slate) 14%, transparent); }
.ach .badge svg { width: 1.3rem; height: 1.3rem; }
.ach-name { font-weight: 750; font-size: .86rem; line-height: 1.25; }
.ach-desc { font-size: .74rem; color: var(--muted); line-height: 1.35; }
.ach-bar { height: 5px; border-radius: 999px; background: color-mix(in srgb, var(--slate) 18%, transparent); overflow: hidden; }
.ach-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: inherit; }
.ach-meta { font: 600 .68rem/1.3 var(--font-mono); color: var(--muted); }
.ach.locked .ach-name { color: color-mix(in srgb, var(--ink) 70%, transparent); }
.ach.done { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--glow);
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface) 60%); }
.ach.done .badge { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 0 18px -2px color-mix(in srgb, var(--accent-2) 70%, transparent); }
.ach.done .ach-meta { color: var(--accent); }

/* Toast (achievement unlocked) */
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 40; transform: translateX(-50%);
  max-width: min(92vw, 26rem); width: max-content; padding: 8px 16px; border-radius: 999px; color: #fff; font-weight: 700; font-size: .82rem; text-align: center;
  background: linear-gradient(120deg, #4C1D95, #7C3AED 55%, #C026D3); box-shadow: 0 12px 32px rgb(0 0 0 / .3), 0 0 0 1px rgb(255 255 255 / .15) inset; }
@media (prefers-reduced-motion: no-preference) { .toast:not([hidden]) { animation: pop .3s cubic-bezier(.2, .9, .3, 1.3); } @keyframes pop { from { opacity: 0; transform: translate(-50%, 12px) scale(.96); } } }

/* ---------------------------------------------------------------- wide screens */
@media (min-width: 64rem) {
  .app, .tabs { max-width: 76rem; }
  #tab-intern, #tab-apps, #tab-matches, .subnav { max-width: 46rem; margin-inline: auto; }
  #tab-plan:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) 23rem; grid-template-areas: "quote quote" "main side";
    column-gap: 28px; align-items: start; }
  #tab-plan > .quote { grid-area: quote; }
  #tab-plan > .plan-main { grid-area: main; }
  #tab-plan > .plan-side { grid-area: side; padding-top: 2px; }
  .plan-side .day-panel { order: 0; } .plan-side .side-proj { order: 1; } .plan-side .side-up { order: 2; } .plan-side .side-someday { order: 3; } .plan-side .sync-row { order: 4; }
  .day-panel { padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--glow); }
  .day-panel.flash { animation: flash .5s ease-out; } @keyframes flash { from { box-shadow: 0 0 0 2px var(--accent), 0 0 24px color-mix(in srgb, var(--accent) 50%, transparent); } }
  #tab-proj:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); column-gap: 28px; align-items: start; }
}

/* ---------------------------------------------------------------- small phones + landscape */
@media (max-width: 380px) {                                   /* iPhone SE / mini */
  .app { padding-inline: 12px; }
  .bar { margin-inline: -12px; padding-inline: 12px; }
  .bar h1 { font-size: 1.2rem; }
  .icon-btn { padding: 4px 8px; font-size: .72rem; }
  .tabs { gap: 2px; padding-inline: max(8px, env(safe-area-inset-left)); }
  .tabbtn { font-size: .78rem; padding: 10px 2px; }
  main h2.cal-title { font-size: 1.25rem; }
  .cal-nav { width: 2.1rem; height: 2.1rem; }
  .cal { padding: 6px 4px; }
  .cal-grid { gap: 2px; }
  .cal-cell { height: 5rem; padding: 2px; }
  .cal-cell .num { width: 1.3rem; height: 1.3rem; font-size: .66rem; }
  .titles .t { font-size: .54rem; padding: 1px 2px; }
  .kpi { padding: 10px 8px; }
  .kpi-num { font-size: 1.55rem; }
  .day-name { font-size: 1.6rem; }
  .task { gap: 8px; padding: 8px; }
  .why li { grid-template-columns: 1fr; }
  .ach-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seg button { padding: 5px 11px; }
}
@media (orientation: landscape) and (max-height: 500px) {    /* phone held sideways: keep the bars slim */
  .bar { padding-top: calc(8px + env(safe-area-inset-top)); padding-bottom: 8px; }
  .bar p { display: none; }
  .tabbtn { padding-block: 7px; }
  .app { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .day-panel { max-height: 92dvh; }
}
@media (max-width: 22rem) { .kpi-num { font-size: 1.6rem; } .why li { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- bottom nav icons */
.tabbtn { display: grid; justify-items: center; gap: 2px; padding: 7px 2px 6px; }
.tabbtn svg { width: 1.3rem; height: 1.3rem; }
.tabbtn span { font-size: .72rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 380px) { .tabbtn span { font-size: .64rem; } }
@media (orientation: landscape) and (max-height: 500px) { .tabbtn { grid-auto-flow: column; align-items: center; gap: 6px; } .tabbtn svg { width: 1.05rem; height: 1.05rem; } }
.tabs { grid-template-columns: repeat(4, 1fr); }

/* ---------------------------------------------------------------- quick notes (chat-style) */
.qnotes h2 { margin-top: 22px; }
.qn-box { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--glow); overflow: hidden; }
.qn-list { list-style: none; margin: 0; padding: 10px 10px 4px; display: flex; flex-direction: column; gap: 6px;
  max-height: 20rem; min-height: 5rem; overflow-y: auto; overscroll-behavior: contain;
  background: radial-gradient(color-mix(in srgb, var(--accent) 6%, transparent) 1px, transparent 1.2px) 0 0 / 16px 16px; }
.qn-empty { color: var(--muted); font-size: .84rem; text-align: center; padding: 14px 10px; }
.qn-day { align-self: center; font: 700 .64rem/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); margin: 4px 0; }
.qn-msg { display: flex; align-items: flex-end; justify-content: flex-end; gap: 6px; max-width: 100%; border-radius: 16px; }
.qn-msg:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.qn-bubble { max-width: min(80%, 32rem); padding: 8px 12px 6px; border-radius: 16px 16px 4px 16px; color: #fff;
  background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent-2) 85%, var(--accent))); box-shadow: 0 4px 14px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
:root[data-theme="dark"] .qn-bubble { color: #0A0F1F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .qn-bubble { color: #0A0F1F; } }
.qn-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92rem; line-height: 1.4; }
.qn-text a { color: inherit; text-decoration: underline; }
.qn-time { display: block; text-align: right; font: 600 .62rem/1.4 var(--font-mono); opacity: .8; margin-top: 2px; }
.qn-msg.done .qn-bubble { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); box-shadow: none; }
.qn-msg.done .qn-text { text-decoration: line-through; }
.qn-tick { flex: none; width: 1.7rem; height: 1.7rem; border-radius: 999px; border: 1.5px solid color-mix(in srgb, var(--accent) 50%, var(--line));
  background: var(--surface); color: transparent; display: grid; place-items: center; cursor: pointer; padding: 0; margin-bottom: 2px; }
.qn-tick svg { width: 1rem; height: 1rem; }
.qn-tick:hover { color: color-mix(in srgb, var(--green) 60%, transparent); border-color: var(--green); }
.qn-tick[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.qn-del { flex: none; border: 0; background: transparent; color: var(--muted); font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 4px; opacity: 0; margin-bottom: 4px; }
.qn-msg:hover .qn-del, .qn-msg:focus-within .qn-del, .qn-msg.done .qn-del { opacity: 1; }
@media (hover: none) { .qn-del { opacity: .55; } }
.qn-del:hover { color: var(--red); }
.qn-form { display: flex; gap: 8px; align-items: flex-end; padding: 8px; border-top: 1px solid var(--line); background: var(--surface); }
.qn-form textarea { flex: 1; min-width: 0; resize: none; max-height: 10rem; padding: 9px 14px; border-radius: 20px; border: 1px solid var(--line);
  background: var(--surface-2); line-height: 1.35; font-family: var(--font-ui); }
.qn-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.qn-send { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 999px; border: 0; cursor: pointer; color: #fff; display: grid; place-items: center;
  background: linear-gradient(120deg, var(--accent), var(--accent-2)); box-shadow: var(--glow); }
.qn-send svg { width: 1.15rem; height: 1.15rem; }
#qn-clear { margin-top: 8px; }

/* ---------------------------------------------------------------- references */
.ref-card { background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: 18px; padding: 14px 16px;
  display: grid; gap: 10px; box-shadow: var(--glow); }
.ref-head { display: flex; gap: 12px; align-items: center; min-width: 0; }
.ref-icon { flex: none; width: 2.8rem; height: 2.8rem; border-radius: 14px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.ref-icon svg { width: 1.4rem; height: 1.4rem; }
.ref-text { display: grid; gap: 2px; min-width: 0; }
.ref-title { font-weight: 750; overflow-wrap: anywhere; }
.ref-sub { font-size: .74rem; color: var(--muted); overflow-wrap: anywhere; }
.small-note { margin: 0; font-size: .8rem; }
.ref-card .btn-row, .ref-file .btn-row { margin-top: 0; }
.file-add { margin-top: 10px; cursor: pointer; }
.file-add:focus-within { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.ref-link .top .x, .ref-file .top .x { border: 0; background: transparent; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; }
#tab-refs { max-width: 46rem; margin-inline: auto; }
#cloud-line { font-size: .84rem; }

.toast.tappable { cursor: pointer; }
.toast.tappable::after { content: "  ›"; opacity: .8; }

/* Phones: title and header buttons share one row */
@media (max-width: 40rem) {
  .bar { flex-wrap: nowrap; align-items: center; gap: 8px; }
  .bar-title { flex: 1 1 auto; }
  .bar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bar p { font-size: .66rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bar-actions { flex-wrap: nowrap; flex: none; gap: 5px; }
  .icon-btn { padding: 4px 10px; font-size: .74rem; }
}

/* ---------------------------------------------------------------- paste a schedule (bottom sheet on phones, dialog on wide screens) */
.modal { position: fixed; z-index: 35; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 42rem; max-height: min(90dvh, 48rem);
  overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 22px 22px 0 0; padding: 22px 16px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -16px 48px rgb(0 0 0 / .3); }
@media (min-width: 48rem) { .modal { top: 50%; bottom: auto; transform: translateY(-50%); border-radius: 20px; border-bottom: 1px solid var(--line); max-height: 86vh; padding: 24px; } }
.modal .modal-close { display: grid; place-items: center; }
.modal-title { margin: 0 3rem 6px 0; font: 800 1.35rem/1.2 var(--font-display); letter-spacing: -.02em; }
.modal .hint { margin: 0 0 8px; }
.import-input { display: grid; gap: 8px; margin: 6px 0 12px; }
.import-input textarea { width: 100%; min-height: 7rem; resize: vertical; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); line-height: 1.45; font-family: var(--font-ui); }
.import-input textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.import-input .btn-link { justify-self: start; }
.import-list { list-style: none; margin: 12px 0 6px; padding: 0; display: grid; gap: 8px; }
.imp { --c: var(--green); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: start; padding: 10px 12px;
  border-radius: 12px; border: 1px solid var(--line); border-left: 4px solid var(--c); background: var(--surface-2); }
.imp > :not(input) { grid-column: 2; }
.imp > input[type=checkbox] { width: 1.25rem; height: 1.25rem; margin: 8px 0 0; accent-color: var(--c); }
.imp.off { opacity: .55; }
.imp-fields { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 6px; min-width: 0; }
.imp-fields input { min-width: 0; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
.imp-fields .imp-title { font-weight: 650; }
.imp-src { font-size: .74rem; color: var(--muted); overflow-wrap: anywhere; }
.imp-flag { font-size: .72rem; font-weight: 700; color: var(--amber); }
#import-skipped { margin: 4px 0 10px; overflow-wrap: anywhere; }
@media (max-width: 30rem) { .imp-fields { grid-template-columns: 1fr 1fr; } .imp-fields .imp-title { grid-column: 1 / -1; } }

/* "Jaz Do It has moved" banner on an old copy of the app */
.banner.moved { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.banner.moved[hidden] { display: none !important; }

/* Daily habits + shopping list (To Do tab, side column) */
.habit-list .task, .shop-list .task { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
.habit .task-body, .shop .task-body { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.habit-streak { font: 700 .72rem/1.3 var(--font-mono); color: var(--c); }
.habit.done .ttl, .shop.done .ttl { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.habit input[type=checkbox] { width: 1.45rem; height: 1.45rem; }
#shop-clear { margin-top: 8px; }
@media (max-width: 63.99rem) {
  .plan-side .side-habits { order: 0; } .plan-side .side-up { order: 1; } .plan-side .side-someday { order: 2; }
  .plan-side .side-shop { order: 3; } .plan-side .side-proj { order: 4; } .plan-side .sync-row { order: 5; }
}
@media (min-width: 64rem) {
  .plan-side .day-panel { order: 0; } .plan-side .side-habits { order: 1; } .plan-side .side-proj { order: 2; }
  .plan-side .side-up { order: 3; } .plan-side .side-someday { order: 4; } .plan-side .side-shop { order: 5; } .plan-side .sync-row { order: 6; }
}

/* 15-minute time pickers */
.more-field select, .edit-row .time-select, .imp-fields .time-select { padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); min-width: 7.5rem; }
.imp-fields .time-select { border-radius: 8px; padding: 6px 8px; background: var(--surface); }

/* Acts heatmap key: a ramp per category */
.heat-key { flex-wrap: wrap; justify-content: flex-start; gap: 6px 14px; }
.heat-ramp { display: inline-flex; align-items: center; gap: 3px; }
.heat-ramp > .muted { margin-right: 3px; font-weight: 700; color: var(--c); }
.heat-ramp i { width: 10px; }

/* Developer info (Services panel) */
.icon-btn.icon-only { display: inline-grid; place-items: center; padding: 5px 8px; }
.icon-btn.icon-only svg { width: 1rem; height: 1rem; }
.dev-body { display: grid; gap: 10px; margin: 6px 0 10px; }
.svc { --c: var(--slate); padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--c); display: grid; gap: 6px; min-width: 0; }
.svc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.svc h3 { margin: 0; font: 750 .95rem/1.3 var(--font-display); }
.svc-line { margin: 0; font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.svc .btn-row { margin-top: 2px; }
.meter { display: grid; gap: 4px; }
.meter-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; font-size: .76rem; }
.meter-top .mono { color: var(--muted); }
.meter-bar { height: 7px; border-radius: 999px; background: color-mix(in srgb, var(--slate) 18%, transparent); overflow: hidden; }
.meter-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.meter.warm .meter-bar i { background: var(--amber); }
.meter.hot .meter-bar i { background: var(--red); }

/* Theme button: icon + label (Auto / Light / Dark) */
#theme-btn { display: inline-flex; align-items: center; gap: 5px; }
#theme-btn svg { width: 1rem; height: 1rem; flex: none; }

/* ---------------------------------------------------------------- toast with an action (Undo) */
.toast { display: flex; align-items: center; gap: 12px; }
.toast-btn { flex: none; border: 0; border-radius: 999px; padding: 4px 12px; cursor: pointer; font: inherit; font-weight: 800;
  color: #fff; background: rgb(255 255 255 / .2); }
.toast-btn:hover, .toast-btn:focus-visible { background: rgb(255 255 255 / .32); outline-color: #fff; }

/* ---------------------------------------------------------------- Acts (heaven = gold, world = cyan, hell = rose, overall = indigo) */
.tabs { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 380px) { .tabbtn span { font-size: .6rem; letter-spacing: -.01em; } }
.acts-titlebar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; margin-top: 16px; }
main h2.acts-title { margin: 0; font: 800 1.55rem/1.15 var(--font-display); letter-spacing: -.02em; text-transform: none; color: var(--ink); }
main h2.acts-title::before { display: none; }
.acts-sub { font: 700 .7rem/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-left: 4px; }
.acts-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.acts-card { --c: var(--slate); min-width: 0; display: grid; gap: 1px; align-content: start; padding: 12px; border-radius: 16px;
  background: color-mix(in srgb, var(--c) var(--tint), var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 32%, transparent); }
.acts-card-label { font: 800 .7rem/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--c); overflow-wrap: anywhere; }
.acts-card-main { display: flex; align-items: baseline; gap: 4px; }
.acts-card-pts { font: 800 2rem/1.1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--c); }
.acts-card-unit { font: 700 .7rem/1 var(--font-mono); color: var(--muted); }
.acts-card-count { font: 600 .78rem/1.3 var(--font-mono); color: var(--ink); opacity: .85; }
.acts-card-streak { font-size: .72rem; color: var(--muted); }
.acts-cheer { margin: 10px 0 0; padding: 8px 12px; border-radius: 12px; font-size: .88rem;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); }
.acts-add { display: grid; gap: 10px; margin-top: 12px; }
@media (min-width: 48rem) { .acts-add { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; } }
.acts-form { display: grid; gap: 10px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--glow); min-width: 0; }
#acts-action { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
#acts-action[aria-invalid="true"] { border-color: var(--amber); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 20%, transparent); }
#acts-action:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.acts-form-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.acts-form-row .acts-cat { flex: 1 1 auto; flex-basis: auto; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.stepper button { border: 0; background: transparent; color: var(--ink); width: 2.3rem; height: 2.3rem; font-size: 1.15rem; cursor: pointer; }
.stepper button:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.stepper input { width: 3.2rem; border: 0; background: transparent; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.acts-again { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.again-list { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.again-chip { --c: var(--slate); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; font-size: .78rem; font-weight: 650;
  padding: 3px 10px; border-radius: 999px; color: var(--c); background: color-mix(in srgb, var(--c) var(--tint), transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.acts-quick { padding: 12px; border-radius: 16px; background: color-mix(in srgb, var(--rose) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--rose) 25%, var(--line)); min-width: 0; }
.acts-quick-h { margin: 0 0 8px; font: 800 .7rem/1.2 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--rose); }
.acts-quick .fine { margin: 8px 0 0; }
.acts-quicks { display: grid; gap: 10px; min-width: 0; }
.acts-quick.heaven { background: color-mix(in srgb, var(--gold) 8%, var(--surface)); border-color: color-mix(in srgb, var(--gold) 28%, var(--line)); }
.acts-quick.heaven .acts-quick-h { color: var(--gold); }
.heaven-btn { --c: var(--gold); }
.heaven-btn .hell-key { font-family: var(--font-ui); font-size: .92rem; font-weight: 800; }
#acts-heaven-pts .more-field { flex: 1 1 5rem; }
.acts-hell { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.hell-btn { --c: var(--rose); display: grid; justify-items: center; gap: 1px; padding: 12px 4px 10px; border-radius: 14px; cursor: pointer; min-width: 0;
  background: var(--surface); color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 45%, var(--line)); transition: transform .08s ease; }
.hell-btn:hover { background: color-mix(in srgb, var(--c) 10%, var(--surface)); }
.hell-btn:active { transform: scale(.95); }
.hell-key { font: 800 1.05rem/1.1 var(--font-mono); }
.hell-pts { font: 700 .7rem/1 var(--font-mono); color: var(--muted); }
.acts-grid { display: grid; gap: 0 28px; }
@media (min-width: 64rem) { .acts-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.acts-col { min-width: 0; }
.acts-streaks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.streak-tile { --c: var(--slate); min-width: 0; display: grid; gap: 1px; padding: 12px; border-radius: 16px; background: var(--surface);
  border: 1px solid var(--line); border-top: 3px solid var(--c); }
.streak-name { font: 800 .66rem/1.25 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--c); overflow-wrap: anywhere; }
.streak-main { display: flex; align-items: baseline; gap: 4px; }
.streak-num { font: 800 1.8rem/1.1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--c); }
.streak-unit { font: 700 .72rem/1 var(--font-mono); color: var(--muted); }
.streak-best { font: 600 .74rem/1.3 var(--font-mono); color: var(--ink); opacity: .85; }
.streak-status { font-size: .72rem; color: var(--muted); }
.reward.ready { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 40%, transparent), var(--glow); }
.reward.claimed { opacity: .85; }
.reward .proj-bar { --c: var(--gold); }
.reward-info { font-size: .76rem; color: var(--muted); }
.reward-form { display: grid; gap: 8px; margin-top: 8px; }
.reward-form > input, .reward-form select, .acts-filters select, .acts-filters input, .task-edit select {
  padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); min-width: 0; }
.reward-form > input { width: 100%; padding: 10px 12px; }
.reward-row { display: flex; flex-wrap: wrap; gap: 8px; }
.reward-row .more-field input { width: 6rem; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.reward-row .more-field.grow select { width: 100%; }
.reward-form .fine { margin: 2px 0 0; }
.cat-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-check { --c: var(--slate); display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 999px; cursor: pointer; font-size: .8rem; font-weight: 700;
  color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 40%, var(--line)); background: var(--surface); }
.cat-check input { accent-color: var(--c); margin: 0; }
.acts-new-reward, .acts-claims { margin-top: 10px; }
.acts-claims .list { margin-top: 8px; }
.stat-block { padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 10px; min-width: 0; }
.stat-block h3 { margin: 0; font: 750 .92rem/1.3 var(--font-display); }
.stat-block > .fine { margin: 2px 0 8px; }
.acts-chart { display: block; width: 100%; height: auto; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-tick, .ch-x { fill: var(--muted); font: 600 8px var(--font-mono); }
.ch-x.today { fill: var(--accent); font-weight: 800; }
.ch-bar { fill: var(--c); }
.ch-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; font-size: .76rem; color: var(--muted); }
.ch-legend span { display: inline-flex; gap: 6px; align-items: center; }
.ch-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.acts-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.acts-table th { text-align: left; font: 700 .64rem/1.2 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 4px 6px 6px; }
.acts-table td { padding: 6px; border-top: 1px solid var(--line); vertical-align: middle; }
.acts-table .delta { color: var(--muted); white-space: nowrap; }
.acts-table td b { display: block; white-space: nowrap; }
.acts-table .cmp-count { display: block; font-size: .72rem; white-space: nowrap; }
.acts-table .delta.up { color: var(--green); font-weight: 700; }
.table-wrap { overflow-x: auto; }
.bd-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: color-mix(in srgb, var(--slate) 16%, transparent); }
.bd-bar i { background: var(--c); min-width: 0; }
.bd-bar.none i { display: none; }
.bd-rows { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.bd-rows li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: .8rem; }
.top-acts { margin: 0; padding-left: 1.3rem; display: grid; gap: 6px; font-size: .84rem; }
.top-acts li { padding-left: 2px; }
.top-acts li > * { margin-right: 8px; }
.ta-name { font-weight: 650; overflow-wrap: anywhere; }
.heat-wrap { display: grid; gap: 6px; min-width: 0; }
.heat-wrap .cat-filter { margin: 0 0 4px; }
.heat-months { display: grid; grid-template-columns: repeat(17, minmax(0, 1fr)); gap: 3px; font: 600 .6rem/1 var(--font-mono); color: var(--muted); }
.heat-months span { white-space: nowrap; overflow: visible; }
.heat { --c: var(--indigo); display: grid; grid-template-rows: repeat(7, auto); grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; }
.heat i, .heat-key i { display: block; aspect-ratio: 1; border-radius: 3px; background: color-mix(in srgb, var(--ink) 6%, transparent); }
.heat .lv1, .heat-key .lv1 { background: color-mix(in srgb, var(--c) 28%, var(--surface-2)); }
.heat .lv2, .heat-key .lv2 { background: color-mix(in srgb, var(--c) 50%, var(--surface-2)); }
.heat .lv3, .heat-key .lv3 { background: color-mix(in srgb, var(--c) 74%, var(--surface-2)); }
.heat .lv4, .heat-key .lv4 { background: var(--c); }
.heat .lvf { background: transparent; }
.heat-key { --c: var(--indigo); display: flex; align-items: center; gap: 4px; font-size: .68rem; justify-content: flex-end; }
.heat-key i { width: 10px; }
.acts-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.acts-filters .more-field { margin: 0; flex: 1 1 9rem; }
.acts-filters .more-field select, .acts-filters .more-field input { width: 100%; }
.acts-history { list-style: none; margin: 10px 0 8px; padding: 0; display: grid; gap: 4px; }
.h-day { font: 700 .66rem/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 10px 0 2px; }
.h-row { --c: var(--slate); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 8px 10px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c); font-size: .86rem; }
.h-row:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.h-time { color: var(--muted); font-size: .76rem; min-width: 4.4rem; }
.h-act { flex: 1 1 8rem; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.h-pts { color: var(--c); font-weight: 800; }
.h-btns { display: inline-flex; gap: 4px; align-items: center; margin-left: auto; }
.h-btns .x { border: 0; background: transparent; color: var(--muted); font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 2px 4px; }
.h-btns .x:hover { color: var(--red); }
.h-edit { padding: 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--accent); }
.h-edit .edit-row input[type=number] { width: 5rem; flex: 0 0 auto; }
#acts-more { margin-bottom: 8px; }
.acts-settings { margin-top: 22px; }
.acts-settings-form { display: grid; gap: 10px; margin-top: 10px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.acts-settings-form .more-field input { width: 100%; min-width: 4.5rem; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.acts-settings-form .fine { margin: 0; }
#acts-hell-pts .more-field { flex: 1 1 4.5rem; font-family: var(--font-mono); }
@media (max-width: 380px) {
  .acts-card { padding: 10px 8px; }
  .acts-card-pts { font-size: 1.6rem; }
  .streak-tile { padding: 10px 8px; }
  .streak-num { font-size: 1.5rem; }
  .seg button { padding: 5px 9px; }
}
#tab-acts { max-width: 76rem; }

/* Calendar keyword chips: the time is shown from tablet width up */
.titles .t b { display: none; font-weight: 800; }
@media (min-width: 40rem) { .titles .t b { display: inline; } }
.quick-add input:not([type=checkbox]) { flex: 1 1 12rem; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.more-field input { width: 100%; }

/* Tone helpers last, so they override the default --c set by .pill/.item/.chip/.kpi/.project (same specificity). */
.tone-blue { --c: var(--blue); } .tone-violet { --c: var(--violet); } .tone-amber { --c: var(--amber); }
.tone-cyan { --c: var(--cyan); } .tone-green { --c: var(--green); } .tone-gold { --c: var(--gold); }
.tone-red { --c: var(--red); } .tone-slate { --c: var(--slate); } .tone-teal { --c: var(--teal); }
.tone-orange { --c: var(--orange); } .tone-rose { --c: var(--rose); } .tone-copper { --c: var(--copper); }
.tone-sky { --c: var(--sky); } .tone-navy { --c: var(--navy); } .tone-indigo { --c: var(--indigo); }
