:root {
  --ink: #121212;
  --ink-2: #2A2A28;
  --ink-3: #3D3D3A;
  --muted: #6B6B66;
  --faint: #8A8A85;
  --line: rgba(18, 18, 18, 0.08);
  --line-2: rgba(18, 18, 18, 0.14);
  --glass: rgba(255, 255, 255, 0.62);
  --glass-line: rgba(255, 255, 255, 0.75);
  --accent: #C8DB3C;
  --olive: #5E6B0C;
  --p0: #F4A593; --p1: #F2D57E; --p2: #A9CBF5; --p3: #D7CFEA;
  --watch: #E7C65A; --below: #E8836F;
  --sans: 'Zen Kaku Gothic Antique', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --head: 'Poppins', 'Helvetica Neue', Arial, sans-serif;
  --radius: 22px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans); color: var(--ink); background: #F2F1F4;
  -webkit-font-smoothing: antialiased;
}
body::before { content: ''; position: fixed; inset: 0; z-index: -1; background: var(--wall, none) center / cover no-repeat; }
button, input, select, textarea { font-family: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--ink); }
.num { font-variant-numeric: tabular-nums; }
.label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { font-family: var(--head); font-weight: 700; text-transform: uppercase; letter-spacing: 0.01em; margin: 0; line-height: 1.25; }
h1 { font-size: 30px; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }

/* glass */
.panel, .rail, .topbar { backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); }
.panel { background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.panel.tight { padding: 20px; gap: 14px; }
.panel.dark { background: #121212; color: #FAFAF8; border: 0; backdrop-filter: none; }
.panel.dashed { background: rgba(255, 255, 255, 0.45); border: 1px dashed rgba(18, 18, 18, 0.22); }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 6px; }
.grid { display: grid; gap: 16px; }
.cards-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cards-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* layout */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; align-items: stretch; }
.rail { flex: 0 0 92px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 0; background: rgba(255, 255, 255, 0.4); border-right: 1px solid rgba(255, 255, 255, 0.6); }
.mark { width: 36px; height: 36px; border-radius: 10px; background: var(--ink); color: #FAFAF8; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; margin-bottom: 22px; }
.nav-btn { width: 76px; min-height: 52px; border: 0; background: transparent; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 6px 2px; color: var(--muted); font-size: 11px; line-height: 1.2; text-align: center; }
.nav-btn .dot { width: 6px; height: 6px; border-radius: 3px; border: 1px solid #B8B8B2; }
.nav-btn[aria-current="page"] { color: var(--ink); }
.nav-btn[aria-current="page"] .dot { background: var(--ink); border-color: var(--ink); }
.nav-btn:hover { background: rgba(255, 255, 255, 0.5); }
.rail .spacer { flex: 1; }
.avatar { width: 38px; height: 38px; border-radius: 19px; border: 0; background: #E9E9E4; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 500; }
.main { flex: 999 1 560px; min-width: 0; padding: 40px 48px 64px; display: flex; flex-direction: column; gap: 26px; max-width: 1380px; }
.view-head { display: flex; flex-direction: column; gap: 10px; }
.kicker { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sub { font-size: 15px; color: var(--muted); }
.split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.split > .wide { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.split > .side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* controls */
.chip { min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid rgba(18, 18, 18, 0.12); background: rgba(255, 255, 255, 0.7); font-size: 13px; }
.chip.sm { min-height: 32px; padding: 0 12px; font-size: 12px; }
.chip[aria-pressed="true"] { background: var(--ink); color: #FAFAF8; border-color: var(--ink); }
.btn { min-height: 40px; padding: 0 18px; border-radius: 20px; border: 1px solid rgba(18, 18, 18, 0.15); background: rgba(255, 255, 255, 0.85); font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.primary { background: var(--accent); border-color: transparent; font-weight: 500; }
.btn.dark { background: var(--ink); color: #FAFAF8; border-color: var(--ink); }
.btn.ghost { background: transparent; border-style: dashed; color: var(--ink-3); }
.btn.link { border: 0; background: transparent; text-decoration: underline; color: var(--muted); padding: 0 4px; min-height: 32px; }
.btn:disabled { opacity: .5; cursor: default; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.input, .select, .textarea { min-height: 44px; width: 100%; border: 1px solid rgba(18, 18, 18, 0.12); border-radius: 12px; padding: 0 12px; font-size: 14px; background: #FFFFFF; outline: none; }
.textarea { padding: 12px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); }
.search { flex: 1 1 280px; max-width: 460px; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px; border-radius: 22px; background: rgba(255, 255, 255, 0.85); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 14px; outline: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.subcard { border-radius: 18px; background: rgba(255, 255, 255, 0.85); border: 1px solid var(--line); padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #FAFAF8; padding: 12px 18px; border-radius: 14px; font-size: 14px; z-index: 50; max-width: calc(100% - 32px); }
.error { color: #9A3A26; font-size: 13px; }
.empty { font-size: 14px; color: var(--muted); padding: 8px 0; }

/* stats */
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat b { font-size: 32px; line-height: 1; font-weight: 400; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.panel.dark .stat span { color: #B9B9B4; }

/* day card */
.day-card { min-width: 240px; padding: 18px 22px; gap: 12px; border-radius: 18px; }
.segments { display: flex; gap: 4px; }
.segments span { flex: 1 1 0; height: 6px; border-radius: 3px; background: #3A3A38; }
.segments span.on { background: var(--accent); }
.focus-card { min-width: 280px; max-width: 380px; padding: 18px 22px; gap: 10px; border-radius: 18px; }
.focus-text { font-size: 18px; font-weight: 500; line-height: 1.3; }

/* tasks */
.task { display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 4px 0; border-top: 1px solid rgba(18, 18, 18, 0.05); }
.task:first-child { border-top: 0; }
.task .tick { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 14px; border: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; padding: 0; }
.task .tick.done { background: var(--accent); }
.task .t-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; border: 0; background: transparent; padding: 0; }
.task .t-text { font-size: 14px; line-height: 1.35; }
.task.done .t-text { color: var(--faint); text-decoration: line-through; }
.task .t-meta { font-size: 11px; color: var(--faint); }
.task .x { border: 0; background: transparent; color: var(--faint); font-size: 18px; width: 32px; height: 32px; border-radius: 16px; opacity: 0; }
.task:hover .x, .task .x:focus { opacity: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-3); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 6px; margin-right: 6px; vertical-align: -1px; }
.quick-add { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-add .input { flex: 1 1 200px; }
.quick-add .select { flex: 0 0 150px; }

/* daily joke / fact */
.daily-box { border-radius: 16px; padding: 22px 20px; min-height: 140px; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.daily-box p { margin: 0; }
.daily-q { font-family: var(--head); font-weight: 700; font-size: 15px; line-height: 1.5; text-transform: uppercase; }
.daily-a { font-size: 16px; font-weight: 500; line-height: 1.45; }

/* rings and bars */
.ring { width: 64px; height: 64px; border-radius: 32px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.ring > div { width: 52px; height: 52px; border-radius: 26px; background: #FFFFFF; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.ring.big { width: 132px; height: 132px; border-radius: 66px; }
.ring.big > div { width: 108px; height: 108px; border-radius: 54px; flex-direction: column; gap: 2px; }
.ring.big b { font-size: 26px; font-weight: 400; line-height: 1; }
.track { position: relative; height: 8px; border-radius: 4px; background: rgba(18, 18, 18, 0.08); }
.track > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.track > i { position: absolute; left: 80%; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .35; }
.sl-row { display: grid; grid-template-columns: minmax(120px, 1.2fr) minmax(120px, 3fr) 60px minmax(96px, 1fr); gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.pill { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 12px; line-height: 1.3; }

/* claims table */
.table-wrap { overflow-x: auto; }
.claims { min-width: 1060px; display: flex; flex-direction: column; }
.c-grid { display: grid; grid-template-columns: 150px 136px 80px 112px 118px 124px 112px minmax(180px, 1fr) 20px; gap: 12px; align-items: center; }
.c-head { padding-bottom: 10px; }
.c-row { border-top: 1px solid var(--line); }
.c-row > button { width: 100%; padding: 14px 0; border: 0; background: transparent; text-align: left; font-size: 14px; }
.c-row > button:hover { background: rgba(255, 255, 255, 0.35); }
.c-detail { display: flex; flex-wrap: wrap; gap: 24px; padding: 6px 0 22px; }
.c-detail .flags { flex: 1 1 520px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.c-detail .notes { flex: 1 1 340px; display: flex; flex-direction: column; gap: 10px; }
.note { font-size: 14px; line-height: 1.5; white-space: pre-line; }
.note small { display: block; color: var(--faint); font-size: 11px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; min-height: 36px; }
.check input { width: 18px; height: 18px; accent-color: #121212; }

/* review cards */
.review { border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 12px; background: rgba(255, 255, 255, 0.75); }
.stars { display: flex; gap: 3px; }
.stars svg { width: 14px; height: 14px; }

/* audits grid */
.a-grid { display: grid; grid-template-columns: minmax(200px, 2fr) repeat(7, minmax(56px, 1fr)); gap: 10px; align-items: center; min-width: 760px; }
.a-cell { width: 44px; height: 44px; border: 0; background: transparent; padding: 0; display: flex; align-items: center; justify-content: center; margin: 0 auto; }
.a-cell span { width: 28px; height: 28px; border-radius: 14px; border: 1.5px solid #BDBDB7; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.a-cell.clean span { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
.a-cell.flag span { background: var(--accent); border-color: var(--olive); }
.a-cell:disabled { cursor: default; }

/* login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 48px 16px; }
.login .panel { width: 100%; max-width: 780px; padding: 40px; gap: 26px; }
.people { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.person { min-height: 160px; border-radius: 18px; border: 1.5px solid rgba(18, 18, 18, 0.1); background: rgba(255, 255, 255, 0.55); padding: 20px 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.person[aria-pressed="true"] { border-color: var(--ink); background: #FFFFFF; }
.person .face { width: 60px; height: 60px; border-radius: 30px; display: flex; align-items: center; justify-content: center; font-family: var(--head); font-weight: 700; font-size: 20px; }

@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(176, 196, 40, .45); } 70% { box-shadow: 0 0 0 8px rgba(176, 196, 40, 0); } 100% { box-shadow: 0 0 0 0 rgba(176, 196, 40, 0); } }
.pulse { animation: pulse 2.2s infinite; }
.dot8 { width: 8px; height: 8px; border-radius: 4px; display: inline-block; background: #D6D6D0; }
.dot8.hot { background: var(--accent); }

@media (max-width: 760px) {
  .rail { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; justify-content: center; padding: 12px; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.6); }
  .rail .mark { margin: 0 8px 0 0; }
  .rail .spacer { display: none; }
  .main { padding: 24px 16px 48px; }
  h1 { font-size: 24px; }
  .sl-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .sl-row > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .sl-row > :nth-child(4) { grid-column: 1 / -1; }
  .panel { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
