/* Daylog. Flat colour, hairlines, one accent. No gradients, no glass, no glow.
   Layout follows a video site: feed of covers, a "watch" page per day, pills for actions.
   Breakpoints: phone < 720 (bottom tabs) · 720+ icon rail · 1200+ full sidebar. */
:root {
  --bg: #fbfaf7; --surface: #ffffff; --raised: #f1efe9; --hover: #e7e4dc; --line: #e2dfd6; --ink: #171715; --muted: #66645d;
  --accent: #c8371b; --on-accent: #ffffff; --accent-soft: #f7e4dd;
  --hi: #1f7a54; --mid: #a8700a; --lo: #bf3b22; --danger: #b3351f; --water: #2a6fb0;
  --c-placement: #5b43b5; --c-study: #1f66a8; --c-college: #9a5212; --c-health: #1f7a54; --c-personal: #98306f;
  --e-deadline: #bf3b22; --e-eval: #5b43b5; --e-holiday: #1f7a54; --e-home: #a8700a; --e-other: #66645d; --e-trainer: #171715;
  --serif: Newsreader, Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 12px; --top: 56px; --side: 0px; --pad: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg: #0f0f0e; --surface: #181817; --raised: #252523; --hover: #32322f; --line: #2d2d2a; --ink: #f1efe9; --muted: #a5a39b;
    --accent: #f0603f; --on-accent: #1c0b05; --accent-soft: #32180f;
    --hi: #58c794; --mid: #dfae4a; --lo: #f5826a; --danger: #f5826a; --water: #62a8ea;
    --c-placement: #a999ee; --c-study: #78b6ec; --c-college: #e3a264; --c-health: #58c794; --c-personal: #e58cbd;
    --e-deadline: #f5826a; --e-eval: #a999ee; --e-holiday: #58c794; --e-home: #dfae4a; --e-other: #a5a39b; --e-trainer: #f1efe9;
    color-scheme: dark;
  }
  :root:not([data-theme=light]) .i-moon { display: none; }
  :root:not([data-theme=light]) .i-sun { display: block; }
}
:root[data-theme=dark] {
  --bg: #0f0f0e; --surface: #181817; --raised: #252523; --hover: #32322f; --line: #2d2d2a; --ink: #f1efe9; --muted: #a5a39b;
  --accent: #f0603f; --on-accent: #1c0b05; --accent-soft: #32180f;
  --hi: #58c794; --mid: #dfae4a; --lo: #f5826a; --danger: #f5826a; --water: #62a8ea;
  --c-placement: #a999ee; --c-study: #78b6ec; --c-college: #e3a264; --c-health: #58c794; --c-personal: #e58cbd;
  --e-deadline: #f5826a; --e-eval: #a999ee; --e-holiday: #58c794; --e-home: #dfae4a; --e-other: #a5a39b; --e-trainer: #f1efe9;
  color-scheme: dark;
}
.i-sun { display: none; }
:root[data-theme=dark] .i-moon { display: none; }
:root[data-theme=dark] .i-sun { display: block; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.25; font-weight: 600; }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; }
h2 { font-size: 16px; }
h3 { font-size: 15px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 10px;
  padding: 0 max(var(--pad), env(safe-area-inset-right)) 0 max(var(--pad), env(safe-area-inset-left)); background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; flex: none; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font: 700 23px/1 var(--serif); padding-bottom: 3px; }
.word { font: 600 21px/1 var(--serif); letter-spacing: -0.02em; }
.search { flex: 1; min-width: 0; max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.search:focus-within { border-color: var(--ink); color: var(--ink); }
.search svg { flex: none; }
.search input { flex: 1; border: 0; border-radius: 0; background: none; padding: 0; outline: 0; min-width: 0; color: var(--ink); }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.top-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.tool { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.tool:hover { background: var(--raised); }
.create { gap: 6px; height: 40px; padding: 0 16px 0 12px; }
.create > span:first-child { font-size: 20px; line-height: 1; font-weight: 400; }
.avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; font: 600 17px/1 var(--serif); background: var(--ink); color: var(--bg); }
.avatar.lg { width: 60px; height: 60px; font-size: 28px; }
.avatar.me { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--line); margin: 0 3px; }
.avatar.me.s-ok { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--hi); }
.avatar.me.s-syncing { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--mid); }
.avatar.me.s-error { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--lo); }

/* ---------- shell + nav ---------- */
#nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: var(--bg); border-top: 1px solid var(--line);
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
#nav a { flex: 1; min-width: 0; display: grid; justify-items: center; gap: 3px; padding: 8px 2px 7px; font-size: 11px; font-weight: 500; color: var(--muted); }
#nav a svg { box-sizing: content-box; padding: 3px 14px; border-radius: 999px; }
#nav a.on { color: var(--ink); font-weight: 600; }
#nav a.on svg { background: var(--raised); }
#nav a[data-v=review] { display: none; }
main { padding: var(--pad) max(var(--pad), env(safe-area-inset-right)) calc(88px + env(safe-area-inset-bottom)) max(var(--pad), env(safe-area-inset-left));
  margin: 0 auto; display: grid; gap: 14px; align-content: start; min-width: 0; width: 100%; }
main.v-home { max-width: 1480px; gap: 16px; }
main.v-day { max-width: 1280px; }
main.v-today, main.v-review, main.v-calendar, main.v-stats, main.v-settings { max-width: 760px; }

@media (max-width: 599px) {
  .create .lbl, .word { display: none; }
  .create { padding: 0; width: 40px; }
  .top { gap: 8px; }
  .top-actions { gap: 4px; }
}
@media (max-width: 899px) { input, select, textarea { font-size: 16px; } }   /* stops iOS zooming into fields */

@media (min-width: 720px) {
  :root { --side: 78px; --pad: 24px; }
  .shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); }
  #nav { position: sticky; top: var(--top); height: calc(100vh - var(--top)); height: calc(100dvh - var(--top)); flex-direction: column; gap: 2px; padding: 8px 6px; border-top: 0; overflow-y: auto; }
  #nav a { flex: none; padding: 12px 2px 10px; border-radius: 10px; font-size: 10.5px; }
  #nav a svg { padding: 0; }
  #nav a[data-v=review] { display: grid; }
  #nav a:hover { background: var(--raised); color: var(--ink); }
  #nav a.on { background: var(--raised); }
  #nav a.on svg { background: none; }
  main { padding-top: 24px; padding-bottom: 64px; }
  #toast { bottom: 28px; }
}
@media (min-width: 1200px) {
  :root { --side: 224px; }
  .brand { width: calc(var(--side) - 24px - 10px); }
  #nav { padding: 12px; }
  #nav a, #nav a[data-v=review] { display: flex; align-items: center; gap: 18px; padding: 10px 12px; font-size: 14.5px; }
  main { padding-left: 28px; padding-right: 32px; }
}

/* ---------- home feed ---------- */
.channel { display: flex; align-items: center; gap: 14px 16px; flex-wrap: wrap; }
.channel-info { flex: 1; min-width: 0; display: grid; gap: 3px; }
.channel-info h1 { font-size: clamp(22px, 3vw, 32px); overflow-wrap: anywhere; }
.next { display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 3px; }
.next .dot { transform: translateY(-1px); }
.next b { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.channel-actions { display: flex; gap: 8px; }
@media (max-width: 599px) { .channel-actions { flex-basis: 100%; } .channel-actions .follow { flex: 1; } }
@media (min-width: 720px) { .avatar.lg { width: 96px; height: 96px; font-size: 46px; } .channel { gap: 20px; padding: 4px 0 6px; } .channel-info { gap: 5px; } .channel-info .muted, .next { font-size: 14px; } }

.follow { display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 18px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px; white-space: nowrap; flex: none; border: 1px solid var(--ink); }
.follow:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.follow.unset { background: none; color: var(--muted); border: 1px dashed var(--muted); font-weight: 500; }
.follow.unset:hover { background: none; color: var(--ink); border-color: var(--ink); }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--pad)); padding: 2px var(--pad); }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; height: 34px; padding: 0 13px; border-radius: 8px; background: var(--raised); font-weight: 500; font-size: 14px; white-space: nowrap; }
.chips button:hover { background: var(--hover); }
.chips button.on { background: var(--ink); color: var(--bg); }

.grid-feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 28px 16px; padding-top: 4px; }
@media (min-width: 1700px) { .grid-feed { grid-template-columns: repeat(4, 1fr); } }
.vcard { display: grid; gap: 10px; align-content: start; min-width: 0; }
.vbody { min-width: 0; display: grid; gap: 3px; padding: 0 2px; }
.vbody h3 { font-size: 16px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.vmeta { color: var(--muted); font-size: 13px; }
.flairs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.flair { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; line-height: 1.5; padding: 1px 7px; border-radius: 5px; background: var(--raised); color: var(--muted); white-space: nowrap; }
.flair.star { color: var(--mid); } .flair.ok, .flair.f-done { color: var(--hi); } .flair.f-trainer, .flair.f-skipped { color: var(--lo); }

/* covers: an uploaded photo, or a flat cover whose colour is the weekday */
.thumb { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: var(--raised); container-type: inline-size; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (hover: hover) { .vcard:hover h3 { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; } }
.gen { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 6cqw 7cqw 7.5cqw; color: #fff; background: var(--cover, #4a4a44); }
.wd-1 { --cover: #2f5d50; } .wd-2 { --cover: #a84a24; } .wd-3 { --cover: #34507a; } .wd-4 { --cover: #86681a; }
.wd-5 { --cover: #7a3b52; } .wd-6 { --cover: #2f6672; } .wd-0 { --cover: #57504a; }
.gen-top, .gen-mon { font: 500 max(9px, 3.9cqw)/1 var(--mono); text-transform: uppercase; letter-spacing: .09em; }
.gen-top { display: flex; justify-content: space-between; gap: 8px; }
.gen-bot { display: flex; align-items: baseline; gap: 3.5cqw; }
.gen-day { font: 600 31cqw/.74 var(--serif); letter-spacing: -0.035em; }
.gen-mon { opacity: .85; }
.gen.empty { align-items: center; justify-content: center; gap: 8px; background: none; color: var(--muted); font-weight: 500; border: 1.5px dashed var(--line); border-radius: var(--r); }
.gen.empty .plus { font: 400 34px/1 var(--serif); color: var(--accent); }
.badge { position: absolute; right: 8px; bottom: 10px; font: 500 12px/1 var(--sans); padding: 4px 6px; border-radius: 5px; background: rgb(15 15 14 / .86); color: #fff; }
.prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgb(255 255 255 / .3); }
.prog i { display: block; height: 100%; background: var(--accent); }
.thumb.sm { width: 168px; flex: none; border-radius: 8px; }
.thumb.sm .gen-top { display: none; }
.thumb.sm .gen { justify-content: flex-end; }
.thumb.sm .badge { font-size: 11px; right: 5px; bottom: 7px; padding: 3px 5px; }
.thumb.hero .gen { padding: 4.5cqw 5.5cqw 5.5cqw; }
.thumb.hero .gen-top, .thumb.hero .gen-mon { font-size: max(11px, 2.2cqw); }
.thumb.hero .gen-day { font-size: 24cqw; }
.thumb.hero .badge { font-size: 13px; right: 12px; bottom: 14px; padding: 5px 8px; }
@media (max-width: 420px) { .thumb.sm { width: 140px; } }
/* on a wide, short window the cover must not push the title below the fold */
@media (min-width: 720px) { .thumb.hero { max-height: max(300px, calc(100dvh - 250px)); width: 100%; } }

/* ---------- day page ---------- */
.watch { display: grid; gap: 28px; }
@media (min-width: 1100px) { .watch { grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; } }
.watch-main { display: grid; gap: 12px; min-width: 0; }
.watch-title { font-size: clamp(20px, 2.2vw, 24px); line-height: 1.25; overflow-wrap: anywhere; margin-top: 2px; }
.watch-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.watch-owner { display: flex; align-items: center; gap: 12px; min-width: 0; }
.watch-owner .avatar { width: 40px; height: 40px; font-size: 19px; }
.watch-by { display: grid; min-width: 0; line-height: 1.3; margin-right: 8px; }
.watch-by b { font-weight: 600; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-by .muted { font-size: 12.5px; white-space: nowrap; }
.watch-actions { display: flex; gap: 8px; }
.pill { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 16px; border-radius: 999px; background: var(--raised); font-weight: 500; font-size: 14px; white-space: nowrap; }
.pill:hover { background: var(--hover); }
.pill-pair { display: inline-flex; }
.pill-pair .pill { padding: 0 14px; font-size: 18px; line-height: 1; }
.pill-pair .pill:not(:only-child):first-child { border-radius: 999px 0 0 999px; box-shadow: inset -1px 0 0 var(--line); }
.pill-pair .pill:not(:only-child):last-child { border-radius: 0 999px 999px 0; }
@media (max-width: 599px) {
  main.v-day { padding-top: 0; }
  .thumb.hero { margin: 0 calc(-1 * var(--pad)); border-radius: 0; }
  .watch-owner { flex: 1 1 100%; }
  .watch-owner .follow { margin-left: auto; }
  .watch-by { flex: 1; margin-right: 0; }
  .watch-actions { flex: 1 1 100%; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad); }
  .watch-actions::-webkit-scrollbar { display: none; }
  .watch-actions > * { flex: none; }
}
.descbox { background: var(--raised); border-radius: var(--r); padding: 12px 14px 14px; display: grid; gap: 6px; }
.desc-meta { font-weight: 600; font-size: 14px; }
.descbox .flairs { margin: 0 0 2px; }
.descbox .flair { background: var(--bg); }
.desc { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; max-width: 72ch; }
.desc.none { color: var(--muted); font-size: 14px; }
.block { display: grid; gap: 10px; padding-top: 12px; }
.block h2, .upnext h2 { font-size: 16px; font-weight: 600; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.block h2 .muted { font-weight: 400; }
.rtasks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rtasks li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.rtasks li.ok { color: var(--ink); }
.rmark { width: 22px; flex: none; font: 600 14px/1 var(--mono); text-align: center; }
.rtasks li.ok .rmark { color: var(--hi); }
.rtext { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.statrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; margin-top: 8px; }
.statrow > div { padding: 14px 16px; display: grid; gap: 2px; box-shadow: 1px 1px 0 var(--line); }
.statrow b { font: 600 28px/1.1 var(--serif); letter-spacing: -0.02em; }
.statrow small { font: 500 13px/1 var(--sans); color: var(--muted); letter-spacing: 0; }
.statrow span { color: var(--muted); font-size: 13px; }
.meals-read { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 24px; }
.meals-read dt { font-size: 13px; color: var(--muted); }
.meals-read dd { margin: 2px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; max-width: 72ch; }
.quote { padding: 1px 0 1px 14px; border-left: 3px solid var(--line); overflow-wrap: anywhere; white-space: pre-wrap; line-height: 1.6; max-width: 72ch; }
.quote span { display: block; font-size: 13px; color: var(--muted); }
.upnext { display: grid; gap: 12px; align-content: start; min-width: 0; }
.ncard { display: flex; gap: 10px; min-width: 0; }
.ncard > div:last-child { min-width: 0; display: grid; gap: 4px; align-content: start; padding-top: 1px; }
.ncard h3 { font-size: 14.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ncard:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 640px) and (max-width: 1099px) { .upnext { grid-template-columns: 1fr 1fr; column-gap: 20px; } .upnext h2 { grid-column: 1 / -1; } }

/* ---------- editor ---------- */
.datebar { display: flex; align-items: center; gap: 8px; }
.datebar-mid { flex: 1; text-align: center; min-width: 0; }
.datebar-mid h1 { overflow-wrap: anywhere; }
.datebar-mid .muted { display: block; margin-top: 2px; }
.icon { width: 40px; height: 40px; border-radius: 50%; background: var(--raised); font-size: 20px; line-height: 1; flex: none; display: grid; place-items: center; padding-bottom: 2px; }
.icon:hover { background: var(--hover); }
.icon.solid { background: var(--ink); color: var(--bg); }
.icon.solid:hover { background: var(--accent); color: var(--on-accent); }
.link { color: var(--accent); font-weight: 500; font-size: 14px; padding: 6px 2px; text-decoration: underline; text-underline-offset: 3px; }
.link.center { justify-self: center; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 14px; min-width: 0; }
@media (min-width: 720px) { .card { padding: 20px; } }
.card.pad-s { padding: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head > div:first-child { min-width: 0; }
.card-head .muted { display: block; margin-top: 2px; }
.empty { color: var(--muted); font-size: 14px; }
.empty.wide { grid-column: 1 / -1; text-align: center; padding: 48px 0; }

.post-edit { grid-template-columns: minmax(0, 250px) minmax(0, 1fr); align-items: start; gap: 18px; }
@media (max-width: 640px) { .post-edit { grid-template-columns: 1fr; } }
.pe-thumb { display: grid; gap: 6px; justify-items: start; }
.pe-fields { display: grid; gap: 12px; }
.thumb-pick { position: relative; display: block; width: 100%; cursor: pointer; }
.pick-cta { position: absolute; right: 8px; top: 8px; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: rgb(15 15 14 / .86); color: #fff; }
.thumb-pick:hover .pick-cta, .thumb-pick:focus-within .pick-cta { background: var(--accent); color: var(--on-accent); }
.thumb-pick .gen-top span:last-child { display: none; }

.banner { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); font-weight: 500; font-size: 14px; }
.banner.inset { padding: 8px 12px; }
.banner > span { display: inline-flex; align-items: center; gap: 7px; }
.banner .muted { font-weight: 400; }

.ring { flex: none; }
.ring-bg { fill: none; stroke: var(--raised); stroke-width: 5; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 5; transition: stroke-dashoffset .3s; }
.ring text { font: 600 14px var(--sans); fill: currentColor; }

.tasks { list-style: none; margin: 0; padding: 0; display: grid; }
.task { display: flex; align-items: center; gap: 8px 10px; padding: 9px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.task:first-child { border-top: 0; }
.check { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--muted); flex: none; position: relative; }
.check::before { content: ""; position: absolute; inset: -9px; }                 /* a bigger target for thumbs */
.check:hover { border-color: var(--ink); }
.task.done .check { background: var(--ink); border-color: var(--ink); }
.task.done .check::after { content: ""; position: absolute; left: 7.5px; top: 3.5px; width: 5px; height: 10px; border: solid var(--bg); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.t-text { flex: 1 1 140px; min-width: 0; overflow-wrap: anywhere; }
.task.done .t-text, .task.dropped .t-text { color: var(--muted); text-decoration: line-through; }
.t-act { display: inline-flex; gap: 6px; align-items: center; }
.chip { font-size: 12px; font-weight: 500; line-height: 1.5; padding: 1px 7px; border-radius: 5px; border: 1px solid currentColor; white-space: nowrap; }
.c-placement { color: var(--c-placement); } .c-study { color: var(--c-study); } .c-college { color: var(--c-college); }
.c-health { color: var(--c-health); } .c-personal { color: var(--c-personal); }
.tag { font-size: 12px; line-height: 1.5; color: var(--muted); background: var(--raised); padding: 1px 6px; border-radius: 5px; white-space: nowrap; text-decoration: none; display: inline-block; }
.x { width: 36px; height: 36px; border-radius: 50%; color: var(--muted); font-size: 20px; line-height: 1; flex: none; }
.x:hover { background: var(--raised); color: var(--danger); }
.mini { font-size: 13px; font-weight: 500; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--ink); color: var(--bg); }
.mini.ghost { background: var(--raised); color: var(--ink); }

input, select, textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; width: 100%; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--ink); }
textarea { resize: none; overflow: hidden; display: block; }
select { width: auto; }
.addrow { display: flex; gap: 8px; }
.addrow input { flex: 1; }
.btn { background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px; height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--ink); white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.ghost { background: none; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); background: none; color: var(--ink); }
.btn.danger { background: none; color: var(--danger); border-color: var(--line); }
.btn.danger:hover { border-color: var(--danger); background: none; color: var(--danger); }
.btn.big { height: 48px; padding: 0 22px; font-size: 15.5px; }
button.btn.big { width: 100%; }
button:disabled { opacity: .55; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.end > * { flex: 1 1 200px; }
.field { display: grid; gap: 6px; }
.field > span, .meals label > span { font-size: 13px; font-weight: 500; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.authform { display: grid; gap: 8px; }
@media (max-width: 480px) { .addrow { flex-wrap: wrap; } .addrow input[name=text] { flex: 1 1 100%; } .addrow select { flex: 1; } }

.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--raised); }
.seg button { flex: 1 1 auto; min-height: 36px; padding: 6px 12px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.checkline { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.checkline input { width: auto; margin-top: 4px; accent-color: var(--accent); }

.stepper { display: flex; gap: 8px; }
.drops { display: flex; flex-wrap: wrap; gap: 8px; }
.drop { width: 30px; height: 36px; border: 1.5px solid var(--line); border-radius: 4px 4px 10px 10px; background: var(--bg); }
.drop:hover { border-color: var(--water); }
.drop.full { background: var(--water); border-color: var(--water); }
.mins { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; flex: none; }
.mins input { width: 76px; padding: 7px 8px; text-align: right; }
.meals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.meals label { display: grid; gap: 6px; min-width: 0; }
@media (max-width: 480px) { .meals { grid-template-columns: 1fr; } }
.stars { display: flex; gap: 2px; }
.stars button { font-size: 30px; line-height: 1; color: var(--line); width: 44px; height: 44px; }
.stars button.on { color: var(--mid); }
.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); }
.facts b { color: var(--ink); font-weight: 600; }

/* events + calendar */
.events { list-style: none; margin: 0; padding: 0; display: grid; }
.event { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.event:first-child { border-top: 0; }
.e-main { flex: 1; min-width: 0; display: grid; }
.e-main b { overflow-wrap: anywhere; font-weight: 600; }
.count { font: 500 12px/1 var(--sans); padding: 5px 8px; border-radius: 5px; background: var(--raised); color: var(--muted); flex: none; }
.count.soon { background: var(--lo); color: var(--bg); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; background: var(--e-other); }
.e-deadline { background: var(--e-deadline); } .e-eval { background: var(--e-eval); } .e-holiday { background: var(--e-holiday); }
.e-home { background: var(--e-home); } .e-trainer { background: none; border: 2px solid var(--e-trainer); }
.evform { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.evform input[name=title], .evform select { grid-column: 1 / -1; width: 100%; }
.until { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; grid-column: 1; min-width: 0; }
.evform .btn { grid-column: 2; }
@media (min-width: 620px) {
  .evform { grid-template-columns: minmax(0, 1fr) auto auto auto; }
  .evform input[name=title], .evform select, .until, .evform .btn { grid-column: auto; }
  .evform select { width: auto; }
  .until input { width: 150px; }
}
.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.grid.head span { text-align: center; font-size: 12px; font-weight: 500; line-height: 1; color: var(--muted); padding: 4px 0 6px; }
.cell { aspect-ratio: 1 / 1.02; border-radius: 8px; border: 1px solid transparent; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 7px 4px 6px; min-width: 0; }
@media (min-width: 720px) { .cell { aspect-ratio: 1 / .8; } }
.cell:not(.blank):hover { border-color: var(--line); }
.cell.blank { background: none; }
.cell .num { font-size: 14px; font-weight: 500; line-height: 1.5; font-variant-numeric: tabular-nums; }
.cell.is-off { background: color-mix(in srgb, var(--hi) 15%, var(--bg)); }
.cell.is-today .num { background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 0 7px; }
.cell.is-sel { border-color: var(--ink); }
.dots { display: flex; gap: 3px; min-height: 8px; }
.dots .dot { width: 6px; height: 6px; }
.dots .e-trainer { border-width: 1.5px; }
.bar { width: 78%; height: 3px; background: var(--line); overflow: hidden; display: block; border-radius: 2px; }
.bar i { display: block; height: 100%; }
.hi { background: var(--hi); } .mid { background: var(--mid); } .lo { background: var(--lo); } .none { background: var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); padding: 8px 2px 0; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* stats */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
@media (max-width: 640px) { .tiles { grid-template-columns: 1fr 1fr; } }
.tile { padding: 16px; display: grid; gap: 4px; align-content: start; box-shadow: 1px 1px 0 var(--line); }
.tile b { font: 600 34px/1.05 var(--serif); letter-spacing: -0.02em; }
.tile span { font-size: 13px; color: var(--muted); }
.chart { display: flex; gap: 5px; align-items: flex-end; height: 150px; }
.col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; min-width: 0; }
.col-track { flex: 1; width: 100%; display: flex; align-items: flex-end; border-bottom: 1px solid var(--line); }
.col-track i { display: block; width: 100%; border-radius: 3px 3px 0 0; }
.col:hover .col-track { background: var(--raised); }
.col span { font-size: 11px; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
.col span.now { color: var(--ink); font-weight: 600; }

#toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translate(-50%, 8px); background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 10px; font-weight: 500; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 30; width: max-content; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- task deadlines + inline edit ---------- */
.x { display: inline-grid; place-items: center; }
.t-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rtasks .t-meta { flex: none; justify-content: flex-end; }
.due { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; line-height: 1.5; padding: 1px 7px; border-radius: 5px; background: var(--raised); color: var(--muted); white-space: nowrap; }
.due svg { flex: none; }
.due.soon { color: var(--mid); background: color-mix(in srgb, var(--mid) 13%, transparent); }
.due.late { color: var(--lo); background: color-mix(in srgb, var(--lo) 13%, transparent); font-weight: 600; }
.task.done .due, .task.dropped .due { background: none; padding-left: 0; }

.duepick { position: relative; display: inline-flex; align-items: center; gap: 6px; flex: none; height: 44px; padding: 0 4px 0 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--muted); font-size: 13px; cursor: pointer; }
.duepick:focus-within { border-color: var(--ink); color: var(--ink); }
.duepick-lbl { font-weight: 500; }
.duepick input { border: 0; background: none; padding: 0 6px 0 0; width: 128px; height: 100%; border-radius: 0; color: var(--ink); font-size: 14px; cursor: pointer; }
.duepick input:focus { outline: 0; }
.duepick input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .6; }
:root[data-theme=dark] .duepick input::-webkit-calendar-picker-indicator { filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .duepick input::-webkit-calendar-picker-indicator { filter: invert(1); } }
.addrow { align-items: stretch; }
.addrow .btn { height: auto; }

.task.editing { display: block; padding: 12px 0; }
.editrow { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; margin: 0 -12px; border-radius: 10px; background: var(--raised); }
.editrow input[name=text] { flex: 1 1 100%; background: var(--surface); }
.editrow select, .editrow .duepick { background: var(--surface); }
.editbtns { display: flex; gap: 8px; margin-left: auto; }
.editbtns .btn.ghost { border-color: transparent; }
.editbtns .btn.ghost:hover { border-color: var(--line); }

.e-task { background: var(--ink); border-radius: 1px; transform: rotate(45deg); }
.dots .e-task { width: 5px; height: 5px; margin: 0 1px; }
a.e-main:hover b { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 560px) {
  .addrow { flex-wrap: wrap; }
  .addrow input[name=text] { flex: 1 1 100%; }
  .addrow select { flex: 1 1 0; }
  .addrow .duepick { flex: 1 1 0; min-width: 0; }
  .duepick input { width: 100%; min-width: 0; }
  .addrow .btn { height: 44px; }
  .editrow select, .editrow .duepick { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .editbtns { flex: 1 1 100%; }
  .editbtns .btn { flex: 1; }
}
.duepick input[data-empty]::-webkit-datetime-edit { color: var(--muted); opacity: .7; }
@media (max-width: 560px) {
  .duepick-lbl { display: none; }
  .duepick { padding-left: 10px; gap: 4px; }
  .duepick input { font-size: 15px; }
  /* phone: [ task text ][Add] on top, [ category ][ deadline ] below */
  .addrow input[name=text] { flex: 1 1 calc(100% - 96px); order: 1; }
  .addrow .btn { order: 2; }
  .addrow select { order: 3; flex: 1 1 calc(50% - 4px); }
  .addrow .duepick { order: 4; flex: 1 1 calc(50% - 4px); }
}

/* ---------- task time ---------- */
.when { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; line-height: 1.5; padding: 1px 7px; border-radius: 5px; background: var(--raised); color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.when svg { flex: none; opacity: .7; }
.task.done .when, .task.dropped .when { color: var(--muted); background: none; padding-left: 0; }
.timepick input { width: 108px; }

/* add row, every width: [ task text ][Add] / [ category ][ time ][ deadline ] */
.addrow { flex-wrap: wrap; }
.addrow input[name=text] { flex: 1 1 calc(100% - 96px); order: 1; }
.addrow .btn { order: 2; height: 44px; }
.addrow select { order: 3; flex: none; }
.addrow .timepick { order: 4; }
.addrow .duepick:not(.timepick) { order: 5; }
@media (max-width: 560px) {
  .addrow select, .addrow .timepick, .editrow select, .editrow .timepick { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .addrow .duepick:not(.timepick), .editrow .duepick:not(.timepick) { flex: 1 1 100%; }
  .timepick input { width: 100%; }
}
.t-act { margin-left: auto; }

/* duration picker lives inside the same pill as the deadline picker */
.duepick.timepick { padding-right: 0; }
.duepick.timepick select { order: 0; flex: 1 1 auto; min-width: 0; width: auto; height: 100%; border: 0; border-radius: 0; background: none; padding: 0 10px 0 2px; color: var(--ink); font-size: 14px; cursor: pointer; }
.duepick.timepick select:focus { outline: 0; }
.duepick.timepick select[data-empty] { color: var(--muted); }
.duepick.timepick select option { color: var(--ink); background: var(--surface); }
@media (max-width: 560px) { .duepick.timepick select { font-size: 15px; } }
/* phone: task text on its own line, then [duration · category · deadline ........ edit ×] */
@media (max-width: 560px) {
  .task .t-text { flex: 1 1 calc(100% - 40px); }
  .task .t-meta { flex: 1 1 0; min-width: 0; padding-left: 34px; }
  .task .t-act { flex: none; align-self: center; }
}

/* ---------- cardio by month (Stats) ---------- */
.s-done { --k: var(--hi); } .s-trainer { --k: var(--lo); } .s-rest { --k: var(--water); } .s-skipped { --k: var(--mid); } .s-over { --k: var(--lo); }
.mnav { display: flex; gap: 6px; flex: none; }
.mnav .icon:disabled { opacity: .35; }
.mtitle { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin-top: -4px; }
.ctiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 560px) { .ctiles { grid-template-columns: 1fr 1fr; } }
.ctile { display: grid; gap: 2px; padding: 12px 14px; border-radius: 10px; background: var(--raised); border-top: 3px solid var(--k, var(--line)); }
.ctile.k-trainer { --k: var(--lo); } .ctile.k-rest { --k: var(--water); } .ctile.k-done { --k: var(--hi); } .ctile.k-skipped { --k: var(--mid); }
.ctile b { font: 600 32px/1.05 var(--serif); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ctile small { font: 500 15px/1 var(--sans); color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.ctile span { font-size: 13px; color: var(--muted); }
.ctile.is-over b { color: var(--lo); }

.hmeter { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hboxes { display: flex; gap: 5px; flex-wrap: wrap; }
.hbox { width: 22px; height: 22px; border-radius: 6px; border: 1.5px dashed color-mix(in srgb, var(--muted) 60%, transparent); }
.hbox.used { background: var(--water); border: 0; }
.hbox.over { background: var(--lo); border: 0; }
.bad { color: var(--lo); }

.mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.mgrid.head span { text-align: center; font-size: 12px; font-weight: 500; color: var(--muted); }
.mday { display: grid; place-items: center; height: 38px; border-radius: 8px; background: var(--raised); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--muted); }
@media (min-width: 720px) { .mday { height: 44px; } }
.mday.blank { background: none; }
.mday[class*=" s-"] { background: var(--k); color: #fff; font-weight: 600; }
:root[data-theme=dark] .mday[class*=" s-"] { color: #111110; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .mday[class*=" s-"] { color: #111110; } }
.mday.future { opacity: .45; }
.mday.is-today { box-shadow: inset 0 0 0 2px var(--ink); }
.mday:not(.blank):hover { outline: 2px solid var(--line); outline-offset: 1px; }
.sq { display: inline-block; width: 11px; height: 11px; border-radius: 3px; background: var(--k, var(--raised)); }
.legend .sq:not([class*=" s-"]) { box-shadow: inset 0 0 0 1px var(--line); }

.hist { display: grid; }
.hrow { display: grid; grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 14px; padding: 9px 8px; margin: 0 -8px; border-radius: 8px; text-align: left; }
button.hrow:hover { background: var(--raised); }
.hrow.on { background: var(--raised); }
.hrow.on .hmon { font-weight: 700; color: var(--ink); }
.hhead { padding-top: 0; padding-bottom: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
.hmon { font-size: 14px; color: var(--muted); font-weight: 500; }
.hcell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hcell b { width: 20px; flex: none; font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; }
.hbar { position: relative; flex: 1; height: 10px; border-radius: 5px; background: var(--raised); overflow: visible; }
.hrow.on .hbar, button.hrow:hover .hbar { background: var(--hover); }
.hbar i { display: block; height: 100%; border-radius: 5px; background: var(--k); min-width: 0; }
.hbar em { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); opacity: .55; border-radius: 1px; }
@media (max-width: 420px) { .hrow { grid-template-columns: 40px minmax(0, 1fr) minmax(0, 1fr); gap: 10px; } }

/* ---------- calendar markers: readable at a glance ---------- */
.cell { justify-content: flex-start; gap: 4px; position: relative; }
.cell .bar { position: absolute; left: 11%; bottom: 6px; }
.marks { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px; min-height: 12px; width: 100%; }
.mk { display: inline-flex; align-items: center; }
.mk em { display: none; }
.mk .dot { width: 10px; height: 10px; }
.mk .e-task { width: 9px; height: 9px; border-radius: 2px; transform: rotate(45deg); }
.mk .e-trainer { width: 11px; height: 11px; border-width: 2.5px; }
.mk.more { font-size: 11px; font-weight: 600; line-height: 1; color: var(--muted); }
@media (min-width: 720px) {
  .cell { align-items: stretch; padding: 6px 6px 12px; }
  .cell .num { align-self: center; }
  .marks { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 3px; }
  .mk { gap: 6px; min-width: 0; padding: 2px 6px; border-radius: 5px; background: var(--raised); font-size: 11.5px; font-weight: 500; line-height: 1.35; text-align: left; }
  .cell.is-off .mk { background: var(--surface); }
  .mk em { display: block; font-style: normal; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mk .dot { width: 8px; height: 8px; }
  .mk .e-task { width: 7px; height: 7px; margin: 0 1px; }
  .mk .e-trainer { width: 9px; height: 9px; border-width: 2px; }
  .mk.more { background: none; padding: 0 6px; font-size: 11.5px; }
}
@media (min-width: 720px) and (max-width: 899px) { .mk { padding: 2px 4px; gap: 4px; font-size: 11px; } }

/* legend */
.legend { gap: 8px 18px; font-size: 13.5px; padding-top: 12px; }
.legend span { gap: 8px; }
.legend .dot { width: 11px; height: 11px; }
.legend .e-task { width: 10px; height: 10px; border-radius: 2px; transform: rotate(45deg); }
.legend .e-trainer { width: 12px; height: 12px; border-width: 2.5px; }
@media (min-width: 720px) { .cell { aspect-ratio: auto; min-height: 92px; } }
@media (min-width: 1000px) { main.v-calendar { max-width: 1100px; } .mk { font-size: 12px; padding: 3px 7px; } .cell { min-height: 100px; } }
@media (max-width: 719px) { .marks { flex-wrap: nowrap; gap: 3px; } .mk .dot { width: 9px; height: 9px; } .mk .e-task { width: 8px; height: 8px; } .mk .e-trainer { width: 10px; height: 10px; } .mk.more { font-size: 10px; letter-spacing: -0.02em; } }

/* ---------- repeating tasks ---------- */
.rep { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--muted); background: var(--raised); flex: none; }
.rep.big { width: 28px; height: 28px; border-radius: 8px; color: var(--ink); }
.task.done .rep { background: none; }
.addrow .reppick { order: 5; }
.addrow .duepick:not(.timepick):not(.reppick) { order: 6; }
.duepick.reppick { padding-right: 0; }
.duepick.reppick select { flex: 1 1 auto; min-width: 0; width: auto; height: 100%; border: 0; border-radius: 0; background: none; padding: 0 10px 0 2px; color: var(--ink); font-size: 14px; cursor: pointer; }
.duepick.reppick select:focus { outline: 0; }
.duepick.reppick select[data-empty] { color: var(--muted); }
.duepick.reppick select option { color: var(--ink); background: var(--surface); }
.editrow select, .editrow .duepick { background: var(--surface); }
.editrow .duepick select { background: none; }
@media (max-width: 560px) {
  .addrow .reppick, .editrow .reppick { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .addrow .duepick:not(.timepick):not(.reppick), .editrow .duepick:not(.timepick):not(.reppick) { flex: 1 1 calc(50% - 4px); }
  .duepick.reppick select { font-size: 15px; }
}
#routines .addrow .btn { order: 2; }
#routines .addrow .reppick { order: 5; }

/* ---------- placements ---------- */
main.v-jobs { max-width: 900px; }
.j-todo { --k: var(--muted); } .j-applied { --k: var(--c-study); } .j-oa { --k: var(--mid); }
.j-interview { --k: var(--c-placement); } .j-offer { --k: var(--hi); } .j-rejected { --k: var(--lo); }
.e-job { background: var(--c-college); border-radius: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.pipeline { gap: 12px; }
.pbar { display: flex; gap: 3px; height: 10px; border-radius: 5px; overflow: hidden; }
.pbar i { display: block; background: var(--k); min-width: 6px; }
.ptiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 640px) { .ptiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ptile { display: grid; gap: 1px; padding: 10px 12px; border-radius: 10px; background: var(--raised); border-top: 3px solid var(--k); }
.ptile b { font: 600 26px/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.ptile span { font-size: 12.5px; color: var(--muted); }

.addjob { gap: 0; padding: 0; }
.addjob > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 16px; font-weight: 600; border-radius: var(--r); }
.addjob > summary::-webkit-details-marker { display: none; }
.addjob > summary:hover { background: var(--raised); }
.addjob .plus { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: 18px; font-weight: 400; line-height: 1; transition: transform .15s; }
.addjob[open] .plus { transform: rotate(45deg); }
.addjob[open] > summary { border-radius: var(--r) var(--r) 0 0; }
.addjob .jobform { padding: 4px 16px 16px; }
@media (min-width: 720px) { .addjob > summary { padding: 16px 20px; } .addjob .jobform { padding: 4px 20px 20px; } }
.jobform { display: grid; gap: 12px; }
.jf-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .jf-two { grid-template-columns: 1fr; } }
.jobform select { width: 100%; }
.end-btns { justify-content: flex-end; }

.chips .cnt { font-weight: 500; opacity: .6; margin-left: 2px; font-variant-numeric: tabular-nums; }
.jobs { display: grid; gap: 10px; }
.job { gap: 10px; border-left: 4px solid var(--k); }
.job.editing { border-left-color: var(--line); }
.job-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.job-name { display: grid; gap: 1px; min-width: 0; }
.job-name h3 { font-size: 17px; overflow-wrap: anywhere; }
.jstatus { position: relative; flex: none; }
.jstatus select { width: auto; height: 32px; padding: 0 28px 0 12px; border-radius: 999px; border: 0; font-size: 13px; font-weight: 600; cursor: pointer;
  background: color-mix(in srgb, var(--k) 16%, transparent); color: var(--k); }
.jstatus select option { color: var(--ink); background: var(--surface); }
.job-next { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--muted); }
.job-next svg { flex: none; }
.job-next b { color: var(--ink); font-weight: 600; }
.job-next.soon, .job-next.soon b { color: var(--mid); }
.job-next.late, .job-next.late b { color: var(--lo); }
.job-notes { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.job-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; padding-top: 2px; }
.job-foot .link { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; padding: 4px 0; font-size: 13px; }
.job-foot .link:hover { text-decoration: underline; }
.job-foot .t-act { margin-left: auto; }
@media (max-width: 560px) { .addrow .duepick.reppick, .editrow .duepick.reppick { flex: 1 1 calc(50% - 4px); } #routines .addrow .duepick.reppick { flex: 1 1 100%; } }

/* ---------- focus timer ---------- */
.when.met { color: var(--hi); }
.x.play { color: var(--ink); }
.x.play:hover { background: var(--raised); color: var(--accent); }
.x.play.on { cursor: default; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.6); opacity: .5; } }

#timer { position: fixed; z-index: 25; left: 12px; right: 12px; bottom: calc(70px + env(safe-area-inset-bottom)); display: none; align-items: center; gap: 12px;
  padding: 10px 10px 10px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); overflow: hidden; box-shadow: 0 6px 24px rgb(0 0 0 / .18); }
body.has-timer #timer { display: flex; }
#timer .tprog { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: color-mix(in srgb, var(--bg) 20%, transparent); }
#timer .tprog i { display: block; height: 100%; background: var(--accent); transition: width 1s linear; }
#timer .tmain { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
#timer .tlabel { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; opacity: .65; }
#timer .ttask { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#timer .ttime { font: 600 22px/1 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
#timer .tbtns { display: flex; align-items: center; gap: 4px; }
#timer .x { color: var(--bg); }
#timer .x:hover { background: color-mix(in srgb, var(--bg) 14%, transparent); color: var(--bg); }
#timer .mini { background: var(--bg); color: var(--ink); }
#timer .mini.ghost { background: color-mix(in srgb, var(--bg) 16%, transparent); color: var(--bg); }
#timer.is-paused .ttime { opacity: .6; }
#timer.is-done { background: var(--accent); color: var(--on-accent); }
#timer.is-done .x { color: var(--on-accent); }
#timer.is-done .mini { background: var(--on-accent); color: var(--accent); }
body.has-timer main { padding-bottom: calc(160px + env(safe-area-inset-bottom)); }
body.has-timer #toast { bottom: calc(146px + env(safe-area-inset-bottom)); }
@media (max-width: 420px) { #timer { gap: 8px; padding-left: 12px; } #timer .ttime { font-size: 19px; } #timer .mini { padding: 0 10px; } }
@media (min-width: 720px) {
  #timer { left: auto; right: 24px; bottom: 24px; width: 420px; }
  body.has-timer main { padding-bottom: 120px; }
  body.has-timer #toast { bottom: 104px; }
}
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

/* ---------- bring over yesterday ---------- */
.pullbar { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 14px; border-radius: 10px; border: 1.5px dashed var(--line); color: var(--muted); font-size: 14px; text-align: left; }
.pullbar svg { flex: none; color: var(--ink); }
.pullbar b { color: var(--ink); font-weight: 600; }
.pullbar:hover { border-color: var(--ink); color: var(--ink); }

/* ---------- sleep ---------- */
.sleep-sum { font: 600 26px/1 var(--serif); letter-spacing: -0.02em; flex: none; }
.sleep-chart { position: relative; }
.sleep-chart .guide { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--muted); opacity: .45; pointer-events: none; }

/* ---------- home: needs attention ---------- */
.nudge { display: flex; flex-wrap: wrap; gap: 8px; }
.nb { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 8px; background: var(--raised); font-size: 14px; color: var(--ink); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.nb b { font-weight: 700; font-variant-numeric: tabular-nums; }
.nb:hover { background: var(--hover); }
.nb.soon { background: color-mix(in srgb, var(--mid) 16%, transparent); color: var(--mid); }
.nb.late { background: color-mix(in srgb, var(--lo) 14%, transparent); color: var(--lo); }
@media (max-width: 560px) { .task .t-act { gap: 0; } .task .t-act .x { width: 32px; height: 32px; } }

/* ---------- topic + solved pickers on task forms ---------- */
.duepick.selpick { padding-right: 0; }
.duepick.selpick select { flex: 1 1 auto; min-width: 0; width: auto; height: 100%; border: 0; border-radius: 0; background: none; padding: 0 10px 0 2px; color: var(--ink); font-size: 14px; cursor: pointer; }
.duepick.selpick select:focus { outline: 0; }
.duepick.selpick select[data-empty] { color: var(--muted); }
.duepick.selpick select option { color: var(--ink); background: var(--surface); }
.solvedpick input { width: 76px; padding: 0 8px 0 0; }
.addrow:not([data-topic]) .topicpick, .editrow:not([data-topic]) .topicpick, .editrow:not([data-topic]) .solvedpick { display: none; }
.addrow .topicpick { order: 7; }
@media (max-width: 560px) {
  .addrow .duepick.topicpick, .editrow .duepick.topicpick { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .editrow .duepick.solvedpick { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .solvedpick input { width: 100%; }
  .duepick.selpick select { font-size: 15px; }
}
.topic { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; line-height: 1.5; padding: 1px 7px; border-radius: 5px; background: color-mix(in srgb, var(--c-placement) 12%, transparent); color: var(--c-placement); white-space: nowrap; }
a.topic:hover { text-decoration: underline; }
.task.done .topic { background: none; padding-left: 0; }

/* ---------- placements tabs ---------- */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--raised); justify-self: center; }
.tabs a { padding: 7px 18px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--muted); }
.tabs a:hover { color: var(--ink); }
.tabs a.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }

/* ---------- DSA topics ---------- */
.tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } .tiles.three .tile b { font-size: 26px; } }
.tile small { font: 500 15px/1 var(--sans); color: var(--muted); margin-left: 2px; letter-spacing: 0; }
.weak .nb { border: 0; cursor: pointer; font: inherit; font-size: 14px; }
.topics { list-style: none; margin: 0; padding: 0; display: grid; }
.trow { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.trow:first-child { border-top: 0; }
.tname { display: grid; min-width: 0; line-height: 1.3; }
.tname b { font-weight: 600; overflow-wrap: anywhere; }
.trow.stale .tname .muted { color: var(--lo); }
.tbar { position: relative; display: block; height: 10px; border-radius: 5px; background: var(--raised); overflow: hidden; }
.tbar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c-placement); opacity: .35; border-radius: 5px; }
.tbar em { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c-placement); border-radius: 5px; }
.thrs { font-size: 14px; font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.trow .t-act { margin: 0; gap: 0; }
.trow .x { font-size: 18px; }
@media (max-width: 560px) {
  .trow { grid-template-columns: minmax(0, 1fr) auto auto; row-gap: 6px; }
  .trow .tbar { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- weekly review ---------- */
.weeklink { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.weeklink:hover { border-color: var(--ink); }
.weeklink > span:nth-child(2) { flex: 1; min-width: 0; display: grid; }
.wl-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--raised); flex: none; }
.wl-go { font-size: 24px; color: var(--muted); }
.wgrid { display: grid; gap: 14px; }
@media (min-width: 720px) { .wgrid { grid-template-columns: 1fr 1fr; } }
.wbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.wbars li { display: grid; grid-template-columns: minmax(0, 110px) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 14px; }
.wbars li > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.wbars .tbar i { opacity: 1; background: var(--ink); }
.wbars b { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 48px; text-align: right; }

/* ---------- app + reminders ---------- */
.okline { color: var(--hi); font-weight: 600; font-size: 14px; }
.muted.small { font-size: 12.5px; line-height: 1.5; }
.field > p { margin: 0; }
