:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #173830;
  background: #f3f6f3;
  accent-color: #166a55;
  font-synthesis: none;
  --ink: #173830;
  --muted: #4c645b;
  --green: #17664f;
  --edge: #d6e1d9;
  --paper: #fff;
  --soft: #eaf2eb;
  --danger: #8e3225;
  --sidebar: #14362e;
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.48; }
a { color: var(--green); text-underline-offset: .2em; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 3px solid #a36920; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.85rem, 4vw, 3.2rem); line-height: 1.08; letter-spacing: -.05em; font-weight: 720; }
h2 { font-size: 1.24rem; letter-spacing: -.023em; }
h3 { font-size: 1rem; }
small, .muted { color: var(--muted); }
.skip { position: fixed; left: .6rem; top: .6rem; z-index: 6; padding: .6rem 1rem; background: white; transform: translateY(-150%); }
.skip:focus { transform: none; }
.shell { min-height: 100dvh; display: grid; grid-template-columns: 255px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; align-self: start; max-height: 100dvh; overflow: auto; scrollbar-color: #5c8273 var(--sidebar); background: var(--sidebar); color: #eef8ef; padding: 1.35rem 1rem .9rem; }
.brand { display: flex; align-items: center; gap: .65rem; font-weight: 750; color: white; text-decoration: none; padding: .45rem .35rem 1.2rem; font-size: 1.14rem; line-height: 1.25; }
.brand small { display: block; color: #b5ccbe; font-size: .82rem; font-weight: 450; margin-top: .18rem; }
.nav-group { margin: .95rem 0 1.15rem; }
.nav-label { color: #b5ccbe; padding: 0 .65rem; font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.nav-link, .signout button { display: block; width: 100%; border: 0; text-align: left; background: none; padding: .48rem .65rem; color: #edf6ef; text-decoration: none; font-size: .9rem; font-weight: 530; border-radius: .44rem; overflow-wrap: anywhere; }
.nav-link:hover, .signout button:hover { background: #224b40; }
.nav-link[aria-current] { background: #317360; color: white; }
.signout { border-top: 1px solid #396154; padding-top: .85rem; }
.workspace { min-width: 0; }
.bar { min-height: 72px; border-bottom: 1px solid var(--edge); background: #fff; display: flex; justify-content: space-between; gap: .6rem; align-items: center; padding: .7rem clamp(.8rem, 3.4vw, 3rem); }
.bar-left, .bar-actions, .controls, .dialog-actions, .row-actions, .header-buttons { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.bar-name { font-size: .96rem; font-weight: 700; }
.bar-actions { justify-content: flex-end; }
.sync { font-size: .84rem; color: var(--muted); }
.sync::before { content: ""; display: inline-block; width: .45rem; height: .45rem; border-radius: 50%; background: #27805f; margin: 0 .38rem .11rem 0; }
.sync[data-state="problem"]::before { background: #a2452e; }
.button.menu { display: none; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .25rem; min-height: 40px; border: 1px solid var(--edge); border-radius: .52rem; padding: .47rem .85rem; background: white; color: var(--ink); font-size: .9rem; font-weight: 670; text-decoration: none; white-space: nowrap; }
.button:hover { background: #edf5ef; border-color: #a4c3b5; }
.button.primary { color: white; background: var(--green); border-color: var(--green); }
.button.primary:hover { background: #105641; border-color: #105641; }
.button.quiet { background: transparent; }
.button.danger { color: var(--danger); }
.button.refresh { min-width: 40px; padding: 0; font-size: 1.3rem; }
main { max-width: 1360px; margin: 0 auto; padding: 2.1rem clamp(.8rem, 3.4vw, 3rem) 2rem; min-height: 72vh; }
.page-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.45rem; }
.page-title p { color: var(--muted); margin-top: .55rem; max-width: 62ch; }
.hero { border-radius: 1.1rem; background: #e2eee5; border: 1px solid #d2e5d9; padding: clamp(1.12rem, 2.9vw, 2.3rem); margin-bottom: 1rem; align-items: center; }
.hero .date-line { color: #3a6859; font-weight: 650; margin: 0 0 .58rem; }
.progress-card { min-width: 185px; width: 29%; align-self: center; }
.progress-card strong { font-size: 1.6rem; display: block; letter-spacing: -.05em; }
progress { appearance: none; width: 100%; height: .55rem; border-radius: 30px; border: 0; overflow: hidden; background: #c9ded0; }
progress::-webkit-progress-bar { background: #c9ded0; }
progress::-webkit-progress-value { background: #21755b; }
progress::-moz-progress-bar { background: #21755b; }
.metric-grid { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.metric { background: var(--paper); border: 1px solid var(--edge); border-radius: .85rem; padding: .9rem 1rem; }
.metric span { display: block; color: var(--muted); font-size: .84rem; }
.metric strong { display: block; font-size: 1.55rem; letter-spacing: -.05em; margin-top: .12rem; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.stack { display: grid; gap: .8rem; align-content: start; }
.panel { background: var(--paper); border: 1px solid var(--edge); border-radius: .9rem; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; gap: .55rem; align-items: center; padding: .85rem 1rem; border-bottom: 1px solid var(--edge); }
.panel-body { padding: .9rem 1rem; }
.panel-head .button { min-height: 36px; }
.controls { margin-bottom: 1rem; }
.controls label { display: flex; align-items: center; gap: .45rem; font-weight: 650; font-size: .9rem; }
.empty { padding: 1.05rem; color: var(--muted); }
.items { list-style: none; padding: 0; margin: 0; }
.item { display: flex; gap: .7rem; align-items: center; min-width: 0; padding: .76rem 1rem; border-bottom: 1px solid var(--edge); }
.item:last-child { border-bottom: 0; }
.item-main { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.item-title { font-weight: 700; }
.item-meta { color: var(--muted); font-size: .88rem; margin-top: .15rem; }
.item.done .item-title { text-decoration: line-through; color: var(--muted); }
.check { flex: 0 0 2.4rem; min-height: 40px; display: grid; place-items: center; border-radius: .55rem; }
.check:hover { background: var(--soft); }
.check input { width: 1.28rem; height: 1.28rem; cursor: pointer; margin: 0; }
.chip { display: inline-block; color: #2d5d4f; background: #e8f1eb; border-radius: .35rem; padding: .18rem .42rem; margin: .16rem .3rem .16rem 0; font-size: .83rem; }
.row-actions { justify-content: flex-end; }
.row-actions .button { min-height: 36px; padding: .32rem .6rem; }
.reminder.overdue { color: #7d4325; }
.quick { display: block; padding: .6rem 0; font-weight: 650; border-bottom: 1px solid var(--edge); }
.quick:last-child { border-bottom: 0; }
.footer { padding: 0 clamp(.8rem, 3.4vw, 3rem) 1.45rem; font-size: .86rem; color: var(--muted); }
input, select, textarea { min-width: 0; max-width: 100%; border: 1px solid #aabdaf; color: var(--ink); border-radius: .48rem; background: white; padding: .48rem .62rem; font-size: 1rem; }
select { appearance: none; padding-right: 1.85rem; background-image: linear-gradient(45deg,transparent 50%,#486b5c 50%),linear-gradient(135deg,#486b5c 50%,transparent 50%); background-position: calc(100% - 14px) 52%,calc(100% - 9px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
dialog { width: min(570px, calc(100vw - 1.4rem)); max-height: min(860px, calc(100dvh - 1.4rem)); overflow: auto; padding: 1.2rem; border: 1px solid var(--edge); border-radius: .95rem; color: var(--ink); box-shadow: 0 16px 55px #163a3245; }
dialog::backdrop { background: #142d27a6; }
dialog h2 { margin-bottom: .75rem; }
.dialog-body, .fields { display: grid; gap: .75rem; margin-bottom: .9rem; }
.fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: grid; align-content: start; gap: .25rem; font-weight: 620; font-size: .91rem; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field small { font-weight: 450; font-size: .84rem; }
fieldset { min-width: 0; border: 1px solid var(--edge); border-radius: .48rem; padding: .45rem .65rem; }
.weekday-options { display: flex; flex-wrap: wrap; gap: .55rem; }
.weekday-options label { display: flex; align-items: center; gap: .25rem; padding: .2rem 0; }
.dialog-actions { justify-content: flex-end; }
.error { color: var(--danger); font-weight: 600; margin: .45rem 0; }
.toast { position: fixed; z-index: 4; bottom: 1rem; right: 1rem; max-width: min(32rem, calc(100vw - 2rem)); background: #153d32; color: white; padding: .8rem 1.05rem; border-radius: .55rem; box-shadow: 0 6px 25px #1d302e35; }
.login { min-height: 100dvh; display: grid; place-items: center; padding: 1rem; background: #e2eee5; }
.login-card { display: grid; justify-items: start; gap: .95rem; width: min(100%, 420px); padding: 2rem; background: white; border: 1px solid var(--edge); border-radius: 1rem; }
.login-card h1 { font-size: clamp(1.7rem, 8vw, 2.3rem); }
.login-card p { color: var(--muted); }
.login-card p.error { color: var(--danger); }
@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (min-width: 781px) { .sidebar { min-height: 100dvh; } }
@media (max-width: 780px) {
  .shell { display: block; }
  .sidebar { display: none; position: static; max-height: none; }
  .shell.menu-open { display: flex; flex-direction: column; }
  .shell.menu-open .workspace { display: contents; }
  .shell.menu-open .bar { order: -1; }
  .shell.menu-open .sidebar { display: block; }
  .shell.menu-open main { width: 100%; }
  .button.menu { display: inline-flex; }
  .bar { min-height: 60px; }
  .bar-name { display: none; }
  main { padding-top: 1.15rem; }
}
@media (max-width: 460px) {
  .page-title { flex-wrap: wrap; }
  .progress-card { width: 100%; }
  .metric { padding: .65rem .75rem; }
  .item, .panel-head { padding-left: .65rem; padding-right: .65rem; }
  .fields { gap: .6rem; }
  .header-buttons { gap: .35rem; }
  .item { gap: .4rem; }
  .row-actions { max-width: 42%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
