:root {
  color-scheme: dark;
  --background: #0e1016;
  --panel: #1a1d26;
  --raised: #222631;
  --line: #343843;
  --ink: #f4f5f8;
  --muted: #abb1bf;
  --accent: #baf58c;
  --violet: #bfaeff;
  --danger: #ffa699;
  font: 16px/1.36 -apple-system, BlinkMacSystemFont, "Helvetica Neue", system-ui, sans-serif;
  background: var(--background);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; margin: 0; }
body { overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; padding: 0; background: none; }
button:disabled { cursor: default; opacity: .42; }
button:focus-visible, a:focus-visible, .week-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input, textarea, select { min-width: 0; font-size: 1rem; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.31rem; line-height: 1.2; letter-spacing: -.022em; font-weight: 740; }
h2 { font-size: 1.18rem; line-height: 1.25; letter-spacing: -.016em; }
a { color: var(--accent); }
.app {
  width: min(100%, 700px);
  height: 100vh;
  height: 100dvh;
  margin-inline: auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.app-header {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 7px 20px;
  background: var(--background);
}
.brand, .header-actions { display: flex; align-items: center; gap: 10px; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--accent); color: var(--background); }
.brand-mark .icon { width: 23px; height: 23px; }
.brand > span:last-child { font-size: 1.49rem; font-weight: 820; letter-spacing: -.03em; }
.header-actions { gap: 8px; }
.running-chip { display: flex; align-items: center; gap: 5px; padding: 8px 10px; border-radius: 999px; background: #293332; color: var(--accent); font-size: .84rem; font-weight: 680; }
.running-chip .icon { width: 16px; height: 16px; }
.screen { overflow-y: auto; overscroll-behavior-y: contain; outline: none; scrollbar-width: thin; }
.page { padding: 8px 20px 24px; display: grid; gap: 19px; }
.date-header, .spread, .section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.date-header { min-height: 51px; }
.date-header > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.date-actions, .section-title > div { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.today, .text-button { color: var(--accent); font-weight: 640; font-size: .875rem; }
.today { display: block; margin-top: 4px; text-align: left; }
.icon { width: 22px; height: 22px; flex: none; vertical-align: middle; }
.icon-button {
  width: 44px; min-width: 44px; height: 44px; display: inline-grid; place-items: center;
  border-radius: 14px; color: var(--accent); background: var(--raised);
}
.icon-button .icon { width: 21px; height: 21px; }
.icon-button.quiet { background: transparent; color: var(--muted); }
.icon-button.filled { background: var(--accent); color: var(--background); }
.icon-button.play { color: var(--background); background: var(--item-color); }
.icon-button.mini-play .icon { width: 17px; height: 17px; color: var(--item-color); }
.icon-button.mini-play { width: 40px; min-width: 40px; height: 40px; }
.panel {
  min-width: 0;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 16px;
}
.empty { display: flex; align-items: center; gap: 12px; color: var(--muted); min-height: 50px; font-size: .94rem; }
.empty .icon { width: 18px; height: 18px; }
.stack { display: grid; gap: 10px; }
.section-title { min-height: 35px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.accent-text { color: var(--accent); }
.violet { color: var(--violet); }
.item-color { color: var(--item-color); }
.align-right { text-align: right; }
.ribbon { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) 34px; align-items: center; gap: 5px; }
.ribbon-day { display: grid; place-items: center; gap: 4px; min-width: 0; height: 69px; padding: 7px 0; background: var(--panel); border-radius: 13px; }
.ribbon-day span { font-size: .81rem; font-weight: 680; }
.ribbon-day strong { font-size: 1.06rem; font-variant-numeric: tabular-nums; }
.ribbon-day i { width: 4px; height: 4px; border-radius: 100%; }
.ribbon-day .today-dot { background: var(--accent); }
.ribbon-day.selected { background: var(--accent); color: var(--background); }
.ribbon-day.selected .today-dot { background: var(--background); }
.ribbon-calendar { background: transparent; width: 34px; min-width: 34px; }
.progress-card { display: grid; gap: 14px; }
.progress-card .spread:first-child { align-items: flex-start; }
.progress-card h2 { font-size: 1rem; }
.progress-card p { margin-top: 5px; font-size: .87rem; color: var(--muted); }
.percent { color: var(--accent); font-size: 2.16rem; font-weight: 820; line-height: 1.04; letter-spacing: -.055em; }
.meter { display: block; position: relative; height: 8px; border-radius: 10px; background: var(--raised); }
.meter span { display: block; width: var(--progress, 0%); height: 100%; background: var(--item-color, var(--accent)); border-radius: inherit; }
.meter.target::after { position: absolute; content: ""; top: -3px; bottom: -3px; left: clamp(0px, var(--goal), calc(100% - 2px)); width: 2px; background: var(--ink); border-radius: 1px; }
.focus-card { display: grid; justify-items: start; gap: 10px; }
.label { display: flex; align-items: center; gap: 8px; font-weight: 680; font-size: .88rem; }
.label .icon { width: 18px; height: 18px; }
.timer-title { font-size: 1.62rem; line-height: 1.16; font-weight: 760; }
.clock {
  display: block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 790; font-size: clamp(2.17rem, 12.1vw, 3.45rem); font-variant-numeric: tabular-nums slashed-zero;
  line-height: 1.13; letter-spacing: -.02em; margin-block: 4px 2px;
}
.timer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 45px; padding: 9px 17px; border-radius: 24px; font-weight: 650; }
.button .icon { width: 17px; height: 17px; }
.button.primary { color: var(--background); background: var(--accent); }
.button.secondary { background: #3e5038; color: var(--ink); }
.button.full { width: 100%; }
.text-button { min-height: 33px; text-align: left; }
.signal-text { margin-top: -2px; }
.subject-row, .habit-row, .calendar-row {
  min-height: 62px; display: flex; align-items: center; gap: 12px; padding: 9px 10px; text-align: left;
}
.subject-row .row-text, .habit-row .row-text, .calendar-row .row-text { flex: 1; }
.row-text { display: grid; gap: 3px; min-width: 0; text-align: left; padding-block: 4px; overflow-wrap: anywhere; }
.row-text strong { font-size: 1rem; font-weight: 680; }
.row-text small { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.row-text small.item-color { color: var(--item-color); }
.row-text.completed strong { color: var(--muted); text-decoration: line-through; }
.rows { padding-block: 5px; }
.data-row { display: flex; align-items: center; gap: 8px; min-height: 49px; }
.data-row:not(:last-child) { border-bottom: 1px solid var(--line); }
.data-row .row-text { flex: 1; }
.round-check { display: inline-grid; place-items: center; width: 39px; min-width: 39px; height: 42px; color: var(--muted); }
.round-check.checked { color: var(--accent); }
.round-check.checked .icon { border-radius: 50%; background: color-mix(in srgb, var(--accent) 16%, transparent); }
.weekly-totals { display: grid; gap: 12px; }
.weekly-totals p, .weekly-totals .meter { margin-top: 5px; }
.segments { display: flex; gap: 3px; border-radius: 24px; padding: 3px; background: var(--raised); }
.segments button { flex: 1; min-height: 32px; font-size: .94rem; border-radius: 22px; }
.segments button[aria-pressed=true] { background: #555866; font-weight: 690; }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.summary-grid .panel { display: grid; gap: 4px; }
.summary-grid span { font-size: .85rem; font-weight: 620; color: var(--muted); }
.summary-grid strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.subject-summary { gap: 8px; }
.calendar-row { width: 100%; gap: 9px; }
.calendar-row > .icon { width: 13px; height: 13px; color: var(--muted); }
.calendar-row > .item-color .icon { width: 19px; height: 19px; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.month-weekday { font-size: .81rem; color: var(--muted); text-align: center; }
.month-day { min-height: 58px; display: grid; justify-items: center; align-content: center; gap: 4px; min-width: 0; background: var(--panel); border: 1px solid transparent; border-radius: 10px; }
.month-day.selected { background: var(--raised); border-color: var(--accent); }
.month-day small { font-size: .70rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; width: 100%; }
.month-day.outside { opacity: .58; }
.week-legend { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.week-legend > span { display: inline-flex; align-items: center; gap: 3px; }
.week-legend .icon { height: 15px; width: 15px; }
.week-scroll { --column: max(78px, calc((100vw - 72px) / 7)); border: 1px solid var(--line); border-radius: 12px; overflow: auto; height: clamp(240px, calc(100dvh - 303px), 630px); min-width: 0; scrollbar-width: thin; }
.week-grid { width: max-content; }
.week-head, .week-body { display: grid; grid-template-columns: 32px repeat(7, var(--column)); }
.week-head { position: sticky; top: 0; z-index: 3; background: var(--panel); border-bottom: 1px solid var(--line); }
.week-head button { height: 45px; display: grid; justify-items: center; align-content: center; border-left: 1px solid var(--line); }
.week-head button strong { font-size: .82rem; }
.week-head small { color: var(--muted); font-size: .74rem; }
.time-axis, .week-day { position: relative; height: var(--height); background: repeating-linear-gradient(to bottom, transparent 0 5px, var(--line) 5px 6px, transparent 6px 58px); }
.time-axis { position: sticky; left: 0; z-index: 2; background-color: var(--background); text-align: center; }
.time-axis span { position: absolute; width: 100%; left: 0; color: var(--muted); font: .72rem ui-monospace, monospace; }
.week-day { border-left: 1px solid var(--line); }
.time-block { position: absolute; display: grid; align-content: start; text-align: left; isolation: isolate; overflow: hidden; color: var(--item-color); border-radius: 4px; padding: 3px; font-size: .70rem; line-height: 1.2; }
.time-block::before { content: ""; position: absolute; z-index: -1; inset: 0 0 auto; height: var(--draw-height); border: 1px solid var(--item-color); border-radius: 4px; background: color-mix(in srgb, var(--item-color) 27%, var(--background)); }
.time-block.planned::before { border-style: dashed; background: color-mix(in srgb, var(--item-color) 12%, var(--background)); }
.time-block strong { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.time-block small { font-size: .65rem; white-space: nowrap; }
.challenge-card { display: grid; width: 100%; text-align: left; gap: 8px; }
.challenge-card .spread .icon { color: var(--muted); width: 16px; height: 16px; }
.dock { padding: 4px 16px 5px; background: var(--background); }
.dock nav { display: flex; gap: 4px; min-height: 61px; padding: 6px; border: 1px solid var(--line); border-radius: 23px; background: var(--panel); }
.tab { display: grid; place-content: center; flex: 1; gap: 4px; min-width: 0; padding: 2px; color: var(--muted); border-radius: 16px; font-size: .76rem; font-weight: 700; text-align: center; }
.tab .icon { margin-inline: auto; width: 21px; height: 21px; }
.tab.selected { color: var(--accent); background: #293332; }
.note-prompt { display: flex; gap: 4px; align-items: center; justify-content: space-between; padding: 2px 6px 2px 10px; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); margin-bottom: 8px; color: var(--accent); }
.note-action { min-height: 42px; flex: 1; display: flex; align-items: center; gap: 8px; font-weight: 680; font-size: .91rem; text-align: left; }
.note-prompt .icon-button { background: transparent; width: 36px; min-width: 36px; height: 36px; }
.toast { position: fixed; z-index: 10; bottom: calc(env(safe-area-inset-bottom) + 82px); left: 50%; transform: translateX(-50%); width: min(calc(100% - 36px), 525px); border: 1px solid var(--line); border-radius: 14px; background: var(--raised); color: var(--ink); padding: 11px 14px; font-size: .9rem; }
dialog {
  position: fixed; margin: auto auto 0; border: 1px solid var(--line);
  width: min(100%, 585px); max-width: min(100%, 585px); max-height: min(89dvh, 730px);
  color: var(--ink); background: #191b21; border-radius: 24px 24px 0 0; padding: 0; overflow: hidden;
}
dialog::backdrop { background: rgb(0 0 0 / .57); }
.editor-form { display: contents; }
.sheet-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 15px 15px 12px; text-align: center; }
.sheet-header h2 { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-header > span { min-width: 65px; }
.sheet-side { background: var(--raised); border-radius: 23px; color: var(--accent); padding: 8px 10px; min-height: 39px; font-size: .86rem; font-weight: 680; }
.sheet-content { overflow: auto; max-height: calc(min(89dvh, 730px) - 64px); padding: 6px 16px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 12px; overscroll-behavior: contain; }
.form-group { border-radius: 16px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; padding: 3px 12px; }
.form-group h3 { font-size: .81rem; color: var(--muted); margin: 10px 0 4px; }
.field, .check-field { display: grid; gap: 5px; padding: 9px 0; }
.field + .field, .field + .check-field, .wide-button + .wide-button, .field + .wide-button { border-top: 1px solid var(--line); }
.field > span { font-size: .84rem; color: var(--muted); }
.field input, .field textarea, .field select { width: 100%; padding: 8px 9px; border-radius: 9px; background: var(--background); border: 1px solid var(--line); color: var(--ink); }
.field textarea { min-height: 80px; resize: vertical; }
.field select { appearance: none; padding-right: 26px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.check-field { grid-template-columns: 1fr auto; align-items: center; min-height: 43px; font-size: .94rem; }
.check-field input { width: 19px; height: 19px; accent-color: var(--accent); }
.mode-switch { display: flex; gap: 3px; border: 0; margin: 8px 0; padding: 3px; background: var(--raised); border-radius: 22px; }
.mode-switch label { flex: 1; position: relative; }
.mode-switch input { opacity: 0; position: absolute; inset: 0; width: 100%; margin: 0; cursor: pointer; }
.mode-switch span { display: block; text-align: center; padding: 6px 2px; border-radius: 20px; font-size: .88rem; }
.mode-switch input:checked + span { background: #555866; font-weight: 680; }
.mode-switch input:focus-visible + span { outline: 2px solid var(--accent); }
.wide-button { width: 100%; min-height: 42px; color: var(--accent); text-align: left; padding-block: 8px; font-size: .94rem; }
.wide-button.danger { color: var(--danger); }
.challenge-mark { color: var(--ink); }
.challenge-mark.accent-text { color: var(--accent); }
.wide-button > .icon { width: 17px; height: 17px; margin-inline-end: 3px; }
.detail, .read-note { padding-block: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.help ol { margin: 10px 0; padding-left: 22px; }
.help li { margin: 8px 0; }
.form-error { color: var(--danger); }
.noscript { padding: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip: rect(0, 0, 0, 0); overflow: hidden; white-space: nowrap; border: 0; }
@media (min-width: 700px) {
  .week-scroll { --column: calc((658px - 32px) / 7); }
  dialog { margin: auto; border-radius: 24px; }
  .app { border-inline: 1px solid var(--panel); }
}
@media (max-width: 365px) {
  .page { padding-inline: 14px; }
  .app-header { padding-inline: 14px; }
  .date-actions, .section-title > div { gap: 6px; }
  .date-actions .icon-button { min-width: 38px; width: 38px; height: 42px; }
  .dock { padding-inline: 11px; }
  h1 { font-size: 1.19rem; }
}
@media (display-mode: standalone) {
  .app { height: 100dvh; }
}
