/* Anchored: chart-paper look. Harbour navy ink, sea glass, deep water, brass. */

:root {
  --ink: #10243a;
  --ink-soft: #4a5f72;
  --paper: #f5f8f6;
  --glass: #e2eae6;
  --rule: #c3d0ca;
  --water: #1d5c70;
  --water-ink: #ffffff;
  --water-soft: #cfe3e7;
  --brass: #8a5f14;
  --brass-bright: #c18a2f;
  --good: #2c7753;
  --danger: #a33a2a;
  --stage: #0e2a3d;
  --stage-ink: #eaf2f1;
  --grid: rgba(16, 36, 58, 0.045);
  --ui: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Literata', Georgia, 'Times New Roman', serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ink: #e6eef0;
    --ink-soft: #9db1be;
    --paper: #0d1c2d;
    --glass: #09131f;
    --rule: #25405a;
    --water: #7cc0d0;
    --water-ink: #08202c;
    --water-soft: #17394a;
    --brass: #e0ae55;
    --brass-bright: #e0ae55;
    --good: #6fcf9f;
    --danger: #f08a77;
    --grid: rgba(230, 238, 240, 0.04);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --ink: #e6eef0;
  --ink-soft: #9db1be;
  --paper: #0d1c2d;
  --glass: #09131f;
  --rule: #25405a;
  --water: #7cc0d0;
  --water-ink: #08202c;
  --water-soft: #17394a;
  --brass: #e0ae55;
  --brass-bright: #e0ae55;
  --good: #6fcf9f;
  --danger: #f08a77;
  --grid: rgba(230, 238, 240, 0.04);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--ink);
  font-family: var(--ui);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
h1,
h2,
h3,
p {
  margin: 0;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid var(--brass-bright);
  outline-offset: 2px;
  border-radius: 4px;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- shell ---------- */

#app {
  max-width: 660px;
  margin: 0 auto;
  padding: 0 16px calc(104px + env(safe-area-inset-bottom));
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) 0 6px;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.wordmark svg {
  width: 22px;
  height: 22px;
  color: var(--brass);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sync {
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.sync[data-state='offline'] {
  color: var(--danger);
  font-weight: 500;
}

.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: space-around;
  background: var(--paper);
  border-top: 1px solid var(--rule);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.nav button {
  flex: 1;
  max-width: 120px;
  min-height: 52px;
  background: none;
  border: 0;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.75rem;
  color: var(--ink-soft);
}
.nav svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav button[aria-current='page'] {
  color: var(--water);
  font-weight: 700;
}
.nav button[aria-current='page'] svg {
  stroke-width: 2.2;
}

@media (min-width: 900px) {
  #app {
    max-width: 700px;
    margin-left: max(230px, calc(50vw - 350px + 90px));
    margin-right: auto;
    padding-bottom: 60px;
  }
  .nav {
    top: 0;
    right: auto;
    width: 200px;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
    border-top: 0;
    border-right: 1px solid var(--rule);
    padding: 80px 12px 12px;
  }
  .nav button {
    flex: none;
    max-width: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 0 14px;
    min-height: 46px;
    font-size: 0.9375rem;
  }
  .nav button[aria-current='page'] {
    background: var(--water-soft);
  }
}

/* ---------- type and blocks ---------- */

.date {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.75rem, 6.2vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin-top: 10px;
}
.page-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.6rem, 5.6vw, 2.1rem);
  line-height: 1.15;
  margin: 10px 0 4px;
}
.lede {
  color: var(--ink-soft);
  max-width: 52ch;
}
.purpose {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin-top: 8px;
  max-width: 54ch;
}
.purpose button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--water);
  text-decoration: underline;
  text-underline-offset: 3px;
}

details.block,
section.block {
  border-top: 1px solid var(--rule);
  margin-top: 22px;
  padding-top: 14px;
}
details.block > summary {
  list-style: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  min-height: 44px;
  padding: 2px 0;
}
details.block > summary::-webkit-details-marker {
  display: none;
}
.block h2,
.block-title {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
}
.block-status {
  font-size: 0.875rem;
  color: var(--ink-soft);
  text-align: right;
}
.block-status.done {
  color: var(--good);
  font-weight: 500;
}
details.block > summary::after {
  content: '';
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--ink-soft);
  border-bottom: 2px solid var(--ink-soft);
  transform: rotate(45deg);
  margin-left: 4px;
  align-self: center;
  flex: none;
  transition: transform 0.15s;
}
details.block[open] > summary::after {
  transform: rotate(-135deg);
}
.block-body {
  padding-top: 8px;
  display: grid;
  gap: 20px;
}
.field-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 500;
  margin-bottom: 8px;
}
.hint {
  font-size: 0.875rem;
  color: var(--ink-soft);
}

/* ---------- controls ---------- */

.btn {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1.5px solid var(--ink-soft);
  background: transparent;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
.btn:hover {
  border-color: var(--ink);
}
.btn.primary {
  background: var(--water);
  border-color: var(--water);
  color: var(--water-ink);
  font-weight: 700;
}
.btn.brass {
  background: var(--brass-bright);
  border-color: var(--brass-bright);
  color: #1b1405;
  font-weight: 700;
}
.btn.quiet {
  border-color: transparent;
  color: var(--water);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0 10px;
}
.btn.danger {
  color: var(--danger);
  border-color: var(--danger);
}
.btn.wide {
  width: 100%;
}
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.line-input,
.line-area,
select.line-input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--rule);
  border-radius: 0;
  padding: 10px 2px;
  min-height: 46px;
  color: var(--ink);
}
.line-area {
  resize: vertical;
  min-height: 74px;
  line-height: 1.45;
}
.line-input:focus,
.line-area:focus {
  outline: none;
  border-bottom-color: var(--water);
  box-shadow: 0 1.5px 0 var(--water);
}
::placeholder {
  color: var(--ink-soft);
  opacity: 0.75;
}

/* tide scale: five rising bars, like water level */
.tide {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.tide button {
  background: transparent;
  border: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--ink-soft);
  text-align: center;
}
.tide .gauge {
  height: 56px;
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--paper);
}
.tide .gauge i {
  display: block;
  width: 100%;
  background: var(--water-soft);
  transition: background 0.15s;
}
.tide button:hover .gauge {
  border-color: var(--ink-soft);
}
.tide button[aria-checked='true'] {
  color: var(--ink);
  font-weight: 700;
}
.tide button[aria-checked='true'] .gauge {
  border-color: var(--water);
}
.tide button[aria-checked='true'] .gauge i {
  background: var(--water);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1.5px solid var(--rule);
  background: transparent;
  font-size: 0.9375rem;
}
.chip[aria-pressed='true'] {
  background: var(--water);
  border-color: var(--water);
  color: var(--water-ink);
  font-weight: 700;
}

.tick-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 56px;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 8px 0;
  text-align: left;
}
.tick-row:last-child {
  border-bottom: 0;
}
.tick {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 2px solid var(--ink-soft);
  display: grid;
  place-items: center;
  color: transparent;
}
.tick svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tick-row[aria-checked='true'] .tick,
.tick.on {
  background: var(--water);
  border-color: var(--water);
  color: var(--water-ink);
}
.tick-row .t {
  flex: 1;
}
.tick-row .t small {
  display: block;
  color: var(--ink-soft);
  font-size: 0.8125rem;
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.stepper button {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1.5px solid var(--ink-soft);
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
}
.stepper output {
  min-width: 44px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.meter {
  height: 8px;
  border-radius: 99px;
  background: var(--water-soft);
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  background: var(--water);
  border-radius: 99px;
}
.meter.hit i {
  background: var(--good);
}
.num {
  font-variant-numeric: tabular-nums;
}
.big-num {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ---------- today scorecard ---------- */

.kpi-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  border-bottom: 1px solid var(--rule);
  padding: 6px 0;
}
.kpi-row:last-child {
  border-bottom: 0;
}
.kpi-row .name {
  flex: 1;
  min-width: 0;
}
.kpi-row .name small {
  display: block;
  color: var(--ink-soft);
  font-size: 0.8125rem;
}
.kpi-val {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  min-width: 56px;
  text-align: right;
}
.kpi-val.hit {
  color: var(--good);
}

/* ---------- wins ---------- */

.win {
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}
.win:last-child {
  border-bottom: 0;
}
.win .what {
  font-weight: 500;
}
.win .why {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
  margin-top: 2px;
}
.win .meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}
.tag {
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 1px 10px;
}
.remember {
  border-left: 4px solid var(--brass-bright);
  padding: 4px 0 4px 16px;
}
.remember blockquote {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.45;
}
.day-head {
  font-weight: 700;
  margin: 20px 0 2px;
  font-size: 0.9375rem;
}
.bars {
  display: grid;
  gap: 8px;
}
.bar-row {
  display: grid;
  grid-template-columns: 8.5em 1fr 2em;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
}
.bar-row .meter {
  height: 10px;
}

/* ---------- scorecard grid ---------- */

.weeknav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
}
.weeknav .btn {
  min-width: 46px;
  padding: 0 12px;
}
.weeknav .label {
  font-weight: 700;
  text-align: center;
}
.grid-wrap {
  overflow-x: auto;
  margin-top: 12px;
}
table.grid {
  border-collapse: collapse;
  width: 100%;
}
table.grid th,
table.grid td {
  padding: 4px 2px;
  text-align: center;
  font-weight: 400;
}
table.grid thead th {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  padding-bottom: 8px;
}
table.grid thead th.today {
  color: var(--ink);
  font-weight: 700;
}
table.grid tbody tr {
  border-top: 1px solid var(--rule);
}
table.grid th[scope='row'] {
  text-align: left;
  font-size: 0.9375rem;
  font-weight: 500;
  width: 31%;
  padding-right: 6px;
  line-height: 1.25;
}
table.grid th[scope='row'] small {
  display: block;
  font-weight: 400;
  margin-top: 2px;
}
.cell {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--rule);
  background: transparent;
  display: inline-grid;
  place-items: center;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  padding: 0;
}
.cell.hit {
  background: var(--water);
  border-color: var(--water);
  color: var(--water-ink);
}
.cell.part {
  background: var(--water-soft);
  border-color: var(--water);
  color: var(--ink);
}
.cell.auto {
  cursor: default;
}
.cell.future {
  opacity: 0.4;
}
.cell svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.weekres {
  font-size: 0.75rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.weekres.hit {
  color: var(--good);
  font-weight: 700;
}

/* ---------- charts ---------- */

.chart {
  width: 100%;
  height: auto;
  display: block;
}
.chart text {
  font-family: var(--ui);
  font-size: 18px;
  fill: var(--ink-soft);
}
.legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: var(--ink-soft);
  margin-top: 4px;
}
.legend i {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}
.insight {
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.insight:last-child {
  border-bottom: 0;
}
.seg {
  display: inline-flex;
  border: 1.5px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
}
.seg button {
  background: none;
  border: 0;
  min-height: 40px;
  padding: 0 14px;
  color: var(--ink-soft);
}
.seg button[aria-pressed='true'] {
  background: var(--water);
  color: var(--water-ink);
  font-weight: 700;
}

/* ---------- settings ---------- */

.setting-item {
  border-bottom: 1px solid var(--rule);
  padding: 12px 0;
  display: grid;
  gap: 8px;
}
.setting-item:last-child {
  border-bottom: 0;
}
.mini {
  min-height: 38px;
  padding: 0 12px;
  font-size: 0.875rem;
  border-radius: 8px;
}
.code {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  background: var(--glass);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 8px 10px;
  word-break: break-all;
  user-select: all;
}
.notice {
  border-left: 4px solid var(--water);
  padding: 4px 0 4px 14px;
  color: var(--ink-soft);
}
.error {
  color: var(--danger);
  font-weight: 500;
}

/* ---------- auth ---------- */

.auth {
  max-width: 420px;
  margin: 0 auto;
  padding: calc(14vh + env(safe-area-inset-top)) 20px 40px;
  display: grid;
  gap: 18px;
}
.auth .wordmark {
  font-size: 1.5rem;
  font-family: var(--serif);
}
.auth .wordmark svg {
  width: 34px;
  height: 34px;
}

/* ---------- full-screen stage (I Am practice, breathing) ---------- */

.stage {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--stage);
  color: var(--stage-ink);
  display: flex;
  flex-direction: column;
  padding: calc(16px + env(safe-area-inset-top)) 22px calc(22px + env(safe-area-inset-bottom));
  overflow-y: auto;
}
.stage .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
}
.stage .count {
  font-size: 0.875rem;
  opacity: 0.8;
}
.stage .x {
  background: none;
  border: 1.5px solid rgba(234, 242, 241, 0.4);
  border-radius: 10px;
  min-height: 44px;
  padding: 0 14px;
  color: var(--stage-ink);
}
.stage .mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 0;
}
.statement {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.7rem, 6.4vw, 2.5rem);
  line-height: 1.25;
  text-wrap: balance;
}
.stage label {
  display: block;
  font-size: 0.9375rem;
  opacity: 0.85;
  margin-bottom: 6px;
}
.stage .line-area {
  color: var(--stage-ink);
  border-bottom-color: rgba(234, 242, 241, 0.35);
  min-height: 84px;
}
.stage .line-area:focus {
  border-bottom-color: #e0ae55;
  box-shadow: 0 1.5px 0 #e0ae55;
}
.stage ::placeholder {
  color: var(--stage-ink);
  opacity: 0.55;
}
.stage .btn {
  border-color: rgba(234, 242, 241, 0.55);
  color: var(--stage-ink);
}
.stage .btn.brass {
  color: #1b1405;
  border-color: #e0ae55;
}
.stage .btn.quiet {
  color: var(--stage-ink);
  opacity: 0.85;
}
.stage .btns {
  display: grid;
  gap: 10px;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}
.dots {
  display: flex;
  gap: 6px;
}
.dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(234, 242, 241, 0.25);
}
.dots i.on {
  background: #e0ae55;
}
.dots i.skip {
  background: transparent;
  border: 1.5px solid rgba(234, 242, 241, 0.5);
}
.dots i.now {
  outline: 2px solid rgba(234, 242, 241, 0.7);
  outline-offset: 2px;
}

.orb-wrap {
  display: grid;
  place-items: center;
  height: min(72vw, 320px);
}
.orb {
  width: min(66vw, 290px);
  height: min(66vw, 290px);
  border-radius: 50%;
  border: 2px solid #e0ae55;
  background: radial-gradient(circle at 50% 40%, rgba(124, 192, 208, 0.45), rgba(124, 192, 208, 0.12));
  display: grid;
  place-items: center;
  transform: scale(0.6);
  transition-property: transform;
  transition-timing-function: ease-in-out;
}
.orb span {
  font-family: var(--serif);
  font-size: 1.5rem;
}
.stage .setrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.stage .chip {
  border-color: rgba(234, 242, 241, 0.4);
  color: var(--stage-ink);
}
.stage .chip[aria-pressed='true'] {
  background: #e0ae55;
  border-color: #e0ae55;
  color: #1b1405;
}

dialog {
  border: 1.5px solid var(--rule);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  padding: 20px;
  width: min(92vw, 380px);
}
dialog::backdrop {
  background: rgba(8, 20, 33, 0.55);
}
dialog form {
  display: grid;
  gap: 16px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 10px;
  z-index: 60;
  font-size: 0.9375rem;
  max-width: 90vw;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- chart marks (classes, so they follow the theme) ---------- */

.chart .grid-line {
  stroke: var(--rule);
  stroke-width: 1;
}
.chart .goal-line {
  stroke: var(--brass-bright);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
}
.chart .line.l-mood,
.chart .dot.l-mood {
  stroke: var(--water);
}
.chart .dot.l-mood {
  fill: var(--water);
}
.chart .line.l-happy,
.chart .dot.l-happy {
  stroke: var(--brass-bright);
}
.chart .dot.l-happy {
  fill: var(--brass-bright);
}
.chart .bar {
  fill: var(--water-soft);
  stroke: var(--water);
  stroke-width: 1;
}
.chart .bar-hit {
  fill: var(--water);
}
.chart .c-hit {
  fill: var(--water);
}
.chart .c-miss {
  fill: var(--rule);
  opacity: 0.55;
}
.stage .hint {
  color: inherit;
  opacity: 0.8;
}
a.btn {
  text-decoration: none;
  color: inherit;
}

/* ---------- finish time, family minutes, music button ---------- */

.kpi-row.has-extra {
  flex-wrap: wrap;
}
.kpi-extra {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 4px 0 6px;
}
.kpi-extra .chips {
  width: 100%;
}
.kpi-val.over {
  color: var(--brass);
}
.kpi-val {
  white-space: nowrap;
}
.time-input {
  width: auto;
  min-width: 118px;
  font-variant-numeric: tabular-nums;
  font-size: 1.0625rem;
}
.chip.quiet {
  border-color: transparent;
  color: var(--ink-soft);
  text-decoration: underline;
}
.cell.txt {
  width: 36px;
  border-radius: 11px;
  font-size: 0.6875rem;
  letter-spacing: -0.02em;
  font-weight: 600;
}
.cell.over {
  background: transparent;
  border-color: var(--brass-bright);
  color: var(--brass);
}
.stage .top .x[aria-pressed] {
  opacity: 0.9;
}
.work-times {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 14px;
  align-items: center;
}
.chart .bar-over {
  fill: var(--brass-bright);
}

/* ---------- Today: one part of the day at a time, with room to breathe ---------- */

.tide .gauge {
  height: 46px;
}
.today .purpose {
  margin-bottom: 18px;
}
.glance {
  margin: 4px 0 18px;
}
.glance > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 40px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.glance > summary::-webkit-details-marker {
  display: none;
}
.glance > summary .meter {
  flex: none;
  width: 96px;
  height: 6px;
}
.glance-list {
  padding: 4px 0 10px;
  display: grid;
  gap: 2px;
}
.g-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--ink-soft);
  padding: 7px 0;
  border-bottom: 1px dotted var(--rule);
}
.g-row.hit {
  color: var(--ink);
}
.g-row.hit .num {
  color: var(--good);
  font-weight: 700;
}

.daytabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  padding: 4px;
  background: var(--glass);
  border-radius: 14px;
}
.daytabs button {
  position: relative;
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.9375rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
}
.daytabs button[aria-selected='true'] {
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(16, 36, 58, 0.18);
}
.daytabs .ok {
  position: absolute;
  top: 2px;
  right: 2px;
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--good);
  color: var(--paper);
}
.daytabs .ok svg {
  width: 9px;
  height: 9px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.panel {
  display: grid;
  gap: 40px;
  padding: 30px 0 24px;
}
.group {
  display: grid;
  gap: 16px;
}
.stack {
  display: grid;
  gap: 10px;
}
.stack .field-label {
  margin: 0;
}
.sub {
  display: block;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
}
.card {
  background: var(--glass);
  border-radius: 16px;
  padding: 20px 20px 22px;
  display: grid;
  gap: 10px;
}
.card.done {
  background: transparent;
  border: 1.5px solid var(--rule);
}
.card-title {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.25;
}
.card .btn.wide {
  margin-top: 6px;
}
.card .btn.quiet {
  justify-self: start;
  padding-left: 0;
}
.ticks {
  display: grid;
  gap: 6px;
}
.today .tick-row {
  border-bottom: 0;
  min-height: 62px;
  padding: 6px 0;
}
.items {
  display: grid;
  gap: 30px;
}
.item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.item-head .name {
  min-width: 0;
  font-weight: 500;
}
.item-head .name small {
  display: block;
  color: var(--ink-soft);
  font-size: 0.8125rem;
  font-weight: 400;
  margin-top: 2px;
}
.item-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}
.item-body .chips {
  width: 100%;
}
.add-win > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-self: start;
}
.add-win > summary::-webkit-details-marker {
  display: none;
}
.add-win[open] > summary {
  display: none;
}
.add-win .block-body {
  padding-top: 4px;
  gap: 16px;
}
.today .win {
  padding: 14px 0;
}
