body { min-height: 100vh; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 980px; margin: 0 auto; padding: 30px 28px 0; }
.brand { display: flex; align-items: center; gap: 14px; }
/* The mark beside the greeting is a small ring that fills as your work day passes (--day, set by renderDayLine). */
.logo { width: 38px; height: 38px; flex: none; border-radius: 99px;
  background: conic-gradient(var(--accent) 0 calc(var(--day, .4) * 1turn), color-mix(in srgb, var(--accent) 20%, var(--surface-2)) 0);
  -webkit-mask: radial-gradient(circle, transparent 0 54%, #000 56%); mask: radial-gradient(circle, transparent 0 54%, #000 56%); }
.greeting { font-family: var(--serif); font-size: 20px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.day-line { font-size: 14px; color: var(--ink-3); margin-top: 1px; line-height: 1.35; }
.top-actions { display: flex; gap: 2px; position: relative; }
.cmd-btn { display: inline-flex; flex: none; white-space: nowrap; align-items: center; gap: 10px; height: 34px; padding: 0 6px 0 12px; margin-right: 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-3); font-size: 13px; transition: border-color var(--t-touch) var(--calm), color var(--t-touch) var(--calm); }
.cmd-btn:hover { border-color: var(--line-2); color: var(--ink-2); }
.cmd-btn .kbd { font-size: 11px; white-space: nowrap; line-height: 1.5; }
.cmd-btn .t { white-space: nowrap; }
.brand { flex: 1; min-width: 0; }
.brand > div { min-width: 0; }
.greeting { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The date and the time left are two pieces that each stay whole: a narrow window breaks the line between them, never inside. */
.day-line span { white-space: nowrap; }
.top-actions { flex: none; }
@media (max-width: 860px) { .cmd-btn .t { display: none; } }
@media (max-width: 720px) { .cmd-btn .t { display: none; } }
#noiseBtn.playing { color: var(--accent); background: var(--accent-soft); }

/* A faint warm morning light in the top corner (light mode only). */
:root:not([data-theme="dark"]) body { background: radial-gradient(1000px 480px at 16% -140px, rgba(255, 210, 150, .26), rgba(255, 210, 150, 0) 70%) no-repeat, var(--bg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body { background: var(--bg); } }

/* Focus: the page turns a soft green with low hills along the bottom, and everything else steps back. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity var(--t-scene) var(--calm);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 240' preserveAspectRatio='none'%3E%3Cpath d='M0 140C200 100 380 112 560 132S880 180 1060 152S1300 104 1440 124V240H0Z' fill='%23d3e1d4'/%3E%3Cpath d='M0 192C240 170 460 202 700 192S1080 160 1260 178S1380 196 1440 190V240H0Z' fill='%23c2d6c4'/%3E%3C/svg%3E") center bottom / 100% 150px no-repeat,
    linear-gradient(180deg, #e3ece4 0%, #eef2ec 52%, var(--bg) 100%);
}
:root[data-theme="dark"] body::before {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 240' preserveAspectRatio='none'%3E%3Cpath d='M0 140C200 100 380 112 560 132S880 180 1060 152S1300 104 1440 124V240H0Z' fill='%23222c25'/%3E%3Cpath d='M0 192C240 170 460 202 700 192S1080 160 1260 178S1380 196 1440 190V240H0Z' fill='%23283429'/%3E%3C/svg%3E") center bottom / 100% 150px no-repeat,
    linear-gradient(180deg, #1c231e 0%, #19201b 52%, var(--bg) 100%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body::before {
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 240' preserveAspectRatio='none'%3E%3Cpath d='M0 140C200 100 380 112 560 132S880 180 1060 152S1300 104 1440 124V240H0Z' fill='%23222c25'/%3E%3Cpath d='M0 192C240 170 460 202 700 192S1080 160 1260 178S1380 196 1440 190V240H0Z' fill='%23283429'/%3E%3C/svg%3E") center bottom / 100% 150px no-repeat,
      linear-gradient(180deg, #1c231e 0%, #19201b 52%, var(--bg) 100%);
  }
}
body.focus-mode { background: transparent !important; } /* lets the scene behind show through */
body.focus-mode::before { opacity: 1; }
.top { transition: opacity var(--t-scene) var(--calm); }
.focus-note { display: none; font-size: 14px; color: var(--ink-3); }
body.focus-mode .top-actions { display: none; }
body.focus-mode .focus-note { display: block; animation: fade var(--t-scene) var(--calm); }
body.focus-mode .brand { opacity: .7; }
body.focus-mode .park { width: min(560px, 100%); justify-self: center; margin-top: 0; }
/* On the green focus scene the thought box gets a soft paper fill, so it reads clearly over the hills. */
body.focus-mode .park .add { background: color-mix(in srgb, var(--surface) 82%, transparent); border-color: color-mix(in srgb, var(--accent) 30%, var(--line-2)); box-shadow: 0 8px 24px -18px rgba(40, 70, 55, .45); }

.page { max-width: 980px; margin: 0 auto; padding: 5vh 28px 80px; display: grid; gap: 44px; }
body.focus-mode .page { padding-top: 6vh; }

.park { margin-top: -20px; }
.park .add { background: transparent; border-style: dashed; }
#parkIc, .add-ic { display: grid; }
.show-lists { justify-self: center; margin-top: -26px; }

body.focus-mode #lists { display: none; }
body.focus-mode.show-lists #lists { display: block; }
body.focus-mode .foot-line, body.focus-mode .site-foot { display: none; }

.lists { display: block; }
.list-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
/* Buttons are centred on the row. (By baseline, a button with an icon sits higher than one without.) */
.list-head .btn { align-self: center; }
.list-head .btn svg { flex: none; display: block; }
.list-head h2 { margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.list-info { font-size: 13px; color: var(--ink-3); }
/* No colour change when Today is too full: the calm note under the list already says so, once. */
.lists > .add { margin-bottom: 10px; }
/* the calm "that is a lot for one day" line */
.today-hint { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin: 12px 0 4px; padding: 10px 12px 10px 18px; border-radius: 18px; background: color-mix(in srgb, var(--warm-soft) 75%, transparent); color: var(--ink-2); font-size: 13.5px; animation: rise var(--t-panel) var(--spring); }
.today-hint .th-text { flex: 1 1 260px; min-width: 0; }
.today-hint .th-acts { display: inline-flex; align-items: center; gap: 16px; }
.today-hint .link { font-size: 13px; }

/* On this page the bubble only shows once the big card has scrolled out of view. */
/* It is taken out of the page entirely (display: none), not just made see-through: the bubble
   resets its own styles inside, so a see-through bubble would still catch clicks meant for
   whatever is underneath it. Where the browser supports it, it fades as it comes and goes. */
html > nudge-float { transition: opacity var(--t-panel) var(--calm), display var(--t-panel) allow-discrete !important; }
html.hero-in-view > nudge-float { opacity: 0 !important; display: none !important; }
@starting-style { html:not(.hero-in-view) > nudge-float { opacity: 0 !important; } }
.more { margin: 6px 0 0 94px; }

.fold { margin-top: 26px; }
.fold-btn { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 0; font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--ink-2); }
.fold-btn:hover { color: var(--ink); }
.fold-btn .ic { transition: transform var(--t-panel) var(--spring); color: var(--ink-3); }
.fold-btn[aria-expanded="true"] .ic { transform: rotate(180deg); }
.fold-btn .n { font-family: var(--font); font-size: 13px; color: var(--ink-3); font-weight: 500; }
/* While a task is dragged from Today, the Later heading takes drops (outline only, so nothing moves). */
#laterToggle { border-radius: 12px; transition: outline-color var(--t-touch) var(--calm), background var(--t-touch) var(--calm); outline: 1.5px dashed transparent; outline-offset: 6px; }
body.dragging-today #laterToggle { outline-color: color-mix(in srgb, var(--ink) 28%, transparent); }
body.dragging-today #laterToggle::after { content: "· Drop here"; font-family: var(--font); font-size: 13px; font-weight: 500; color: var(--ink-3); }
body.dragging-today #laterToggle.over { outline-style: solid; outline-color: var(--ink-2); background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--ink); }
.fold-hint { margin: 4px 0 10px; font-size: 13px; color: var(--ink-3); }
#laterWrap .add { margin-bottom: 8px; }
.done-list .row .title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-2); }
.done-list .row { opacity: .8; }

.foot-line { display: flex; align-items: center; gap: 12px 20px; font-size: 14px; color: var(--ink-2); padding: 16px 20px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.foot-line .link { font-size: 13px; }
.foot-mid { flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 22px; }
.foot-stats:empty { display: none; }
.foot-line .foot-close { flex: none; margin-right: -6px; }
/* On a phone-width window the three parts stack. */
@media (max-width: 640px) { .foot-line { flex-wrap: wrap; } .foot-line .foot-close { margin-left: auto; } }
/* Today's dot wears a ring 3.5px outside it, so the letters sit 11px below every dot (and stay in
   one line), and the days are spaced so the ring never crowds its neighbours. */
.week { display: inline-flex; align-items: center; gap: 10px; }
.week .wd { display: grid; justify-items: center; gap: 11px; font-size: 11px; line-height: 1; color: var(--ink-3); }
.week .wd:has(i.today) { color: var(--ink-2); font-weight: 600; }
.week i { width: 12px; height: 12px; border-radius: 99px; background: var(--surface-3); display: block; }
.week i.on { background: var(--accent); }
.week i.today { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--ink-3); }

/* popover */
.popover { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; width: 290px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 18px; display: grid; gap: 12px; animation: rise var(--t-panel) var(--spring); }
.popover h4 { margin: 0; font-family: var(--serif); font-size: 17px; font-weight: 600; }
.popover p { margin: 0; font-size: 13px; color: var(--ink-2); }
.popover .line { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.popover input[type=range] { width: 100%; accent-color: var(--btn); }
.popover.mixer-pop { width: 360px; max-width: calc(100vw - 32px); padding: 18px; display: block; }

/* settings */
.settings { display: grid; }
.settings .group { padding: 18px 0; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.settings .group:first-child { border-top: 0; padding-top: 0; }
.settings .group > h3 { margin: 0; font-family: var(--serif); font-size: 17px; font-weight: 600; }
.settings .srow { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; font-size: 14px; flex-wrap: wrap; }
.settings .srow > span:first-child { flex: 1 1 200px; min-width: 0; }
.settings .srow small { display: block; color: var(--ink-3); font-size: 13px; }
.settings .select, .settings .input.narrow { width: auto; min-width: 130px; height: 34px; }

/* onboarding + help */
.intro-points { display: grid; gap: 12px; margin: 18px 0 22px; padding: 0; list-style: none; }
.intro-points li { display: flex; gap: 14px; align-items: flex-start; color: var(--ink-2); }
.intro-points .oi { flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.help-more { margin-top: 8px; }
.intro-points b { display: block; color: var(--ink); font-weight: 600; }
.ob-trial { margin: 14px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 13.5px; color: var(--ink); }
.steps-dots { display: flex; gap: 6px; margin-right: auto; }
.steps-dots i { width: 7px; height: 7px; border-radius: 99px; background: var(--line-2); transition: width .2s; }
.steps-dots i.on { background: var(--btn); width: 20px; }
.help-list { list-style: none; margin: 0; padding: 0; }
.help-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.help-list li:last-child { border-bottom: 0; }

@media (max-width: 640px) {
  .top, .page { padding-left: 16px; padding-right: 16px; }
  .page { padding-top: 28px; }
  .tl-time { width: 54px; }
  .timeline .row::after, .tl-end::after { left: 80px; }
}

.warn-link { color: var(--warm); font-size: 13px; }

/* meeting settings */
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 14px; margin-top: 4px; }
.app-chk { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink); font-weight: 400; cursor: pointer; }
.app-chk input { accent-color: var(--btn); width: 15px; height: 15px; margin: 0; }

/* settings panel: pinned header with a close button, everyday settings on top, the rest folded */
.settings-sheet { padding-top: 0; }
.s-head { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 12px; margin: 0 -26px; padding: 18px 18px 14px 26px; background: var(--surface); border-bottom: 1px solid var(--line); }
.s-head h2 { margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 600; }
.s-saved { font-size: 13px; color: var(--accent); font-weight: 600; }
.s-lede { margin: 14px 0 0; font-size: 13px; color: var(--ink-3); }
.s-search { width: 100%; margin-top: 14px; }
.s-nomatch { margin: 18px 0 0; font-size: 14px; color: var(--ink-2); }
.settings .s-hide { display: none; }
.s-essentials { display: grid; gap: 14px; margin: 14px 0 20px; padding: 18px; border-radius: 18px; background: var(--surface-2); }
.safety:empty { display: none; }
.safety { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); }
.safety-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13.5px; }
.safety-line small { display: block; margin-top: 1px; font-size: 13px; color: var(--ink-2); font-weight: 400; }
.safety .link { font-size: 13px; justify-self: start; }
.daypick { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.daypick button { min-width: 42px; height: 32px; padding: 0 6px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); font-size: 13px; font-weight: 600; transition: background var(--t-touch) var(--calm), color var(--t-touch) var(--calm), border-color var(--t-touch) var(--calm); }
.daypick button:hover { border-color: var(--ink-3); color: var(--ink); }
.daypick button[aria-pressed="true"] { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.s-essentials .srow:has(.daypick) { flex-wrap: wrap; }
.s-note { margin: -8px 0 0; font-size: 13px; color: var(--ink-3); }
.s-note .link { font-size: 13px; color: var(--accent); font-weight: 600; }
.s-fold { border-top: 1px solid var(--line); }
.s-fold:last-child { border-bottom: 1px solid var(--line); }
.s-fold > summary { display: flex; align-items: center; gap: 12px; padding: 15px 2px; cursor: pointer; list-style: none; }
.s-fold > summary::-webkit-details-marker { display: none; }
/* Small headings that split a long fold into short groups. */
.s-sub { margin: 12px 0 -4px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.s-fold > summary b { flex: none; font-size: 14.5px; font-weight: 600; }
.s-fold > summary .sum { flex: 1; min-width: 0; text-align: right; font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-fold > summary .ic { flex: none; color: var(--ink-3); transition: transform var(--t-panel) var(--spring); }
.s-fold[open] > summary .ic { transform: rotate(180deg); }
.s-fold > summary:hover b { color: var(--ink); }
.s-fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.s-body { display: grid; gap: 14px; padding: 2px 2px 20px; animation: rise var(--t-panel) var(--spring); }
.settings-sheet { width: min(520px, 100vw); }
.s-essentials .srow { flex-wrap: nowrap; }
.s-essentials .srow > span:first-child { flex: 1 1 auto; }
.s-essentials .input.narrow { width: 170px; min-width: 0; }
.s-essentials input[type="time"].input.narrow { width: 122px; padding: 0 8px; }
.s-essentials .select { min-width: 140px; }
@media (max-width: 520px) { .s-essentials .srow { flex-wrap: wrap; } }
.settings .field > span small { display: block; margin-top: 1px; font-weight: 400; color: var(--ink-3); font-size: 13px; }
.settings .field > span { font-size: 14px; color: var(--ink); font-weight: 400; }

/* Smooth jumps, and room kept for the scrollbar so the page does not shift sideways the moment
   a list grows long enough to need one. Full-page screens (meeting, evening, plans) use the whole width. */
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
html:has(body.meeting-mode, body.evening-mode, body.plan-ended) { scrollbar-gutter: auto; }
/* The same inside Settings and the task editor: opening a section must not push the content sideways.
   The 10px the scrollbar would take is reserved, and taken back out of the right padding. */
.sheet { scrollbar-gutter: stable; padding-right: 16px; }
.s-head { margin-right: -16px; }

/* The card that offers to set the command bar shortcut. */
.shortcut-steps { margin: 6px 0 0; padding-left: 22px; display: grid; gap: 10px; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.shortcut-steps .kbd { margin: 0 2px; }
