:root {
  --bg: #f6f4ef; --panel: #ffffff; --ink: #1d2327; --muted: #67707a; --line: #e4e0d8;
  --accent: #2f6f5e; --accent-soft: #e3efea; --warn: #b4531f; --warn-soft: #fbeadf;
  --blue: #2c5d8f; --blue-soft: #e5eef7; --done: #3d7a3a;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15191b; --panel: #1e2427; --ink: #e9ecee; --muted: #9aa4ad; --line: #2e363a;
    --accent: #6fc2a8; --accent-soft: #1f3530; --warn: #f0a070; --warn-soft: #3a2a20;
    --blue: #8db8e6; --blue-soft: #1f2c3a; --done: #8fd18a; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #15191b; --panel: #1e2427; --ink: #e9ecee; --muted: #9aa4ad; --line: #2e363a;
  --accent: #6fc2a8; --accent-soft: #1f3530; --warn: #f0a070; --warn-soft: #3a2a20;
  --blue: #8db8e6; --blue-soft: #1f2c3a; --done: #8fd18a; --shadow: none;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, sans-serif; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; }
button { font: inherit; color: inherit; cursor: pointer; }
.shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }

/* Nav: sidebar on desk, bottom bar on phone */
.nav { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 18px; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.logo { color: var(--accent); font-size: 22px; }
.nav > button { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 10px 12px; border-radius: 10px; text-align: left; font-weight: 500; }
.nav > button:hover { background: var(--bg); }
.nav > button.active { background: var(--accent-soft); color: var(--accent); }
.nav > button em { margin-left: auto; font-style: normal; background: var(--accent); color: #fff; border-radius: 20px; font-size: 12px; padding: 1px 8px; }
.nav > button em:empty { display: none; }
.navfoot { margin-top: auto; padding: 8px; }
.demo-tag { font-size: 12px; color: var(--muted); }
.link { background: none; border: 0; padding: 0; color: var(--blue); font-size: 13px; text-decoration: underline; }

main { padding: 28px 32px 100px; max-width: 980px; width: 100%; }
h1 { font-size: 24px; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0 0 22px; }

/* Cards */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 14px; }
.card.done { opacity: .55; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.who { font-weight: 600; }
.meta { color: var(--muted); font-size: 13px; }
.pill { font-size: 12px; padding: 2px 9px; border-radius: 20px; background: var(--bg); border: 1px solid var(--line); white-space: nowrap; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; font-weight: 600; }
.pill.sop { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.pill.ok { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tldr { font-size: 16px; font-weight: 500; margin: 10px 0 8px; }
details.orig { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
details.orig p { white-space: pre-wrap; background: var(--bg); padding: 10px 12px; border-radius: 10px; margin: 6px 0 0; }
.draft { width: 100%; min-height: 120px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--bg); color: var(--ink); font: inherit; resize: vertical; }
.steps { list-style: none; padding: 0; margin: 12px 0; }
.steps li { display: flex; gap: 10px; padding: 7px 0; border-top: 1px dashed var(--line); font-size: 14px; }
.steps li:first-child { border-top: 0; }
.steps .num { width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.steps .done-mark { background: var(--done); color: #fff; }
.steps small { display: block; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 9px 14px; font-weight: 600; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.05); }
.learn { font-size: 12px; color: var(--muted); margin-top: 10px; }
.bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; margin-top: 4px; max-width: 220px; }
.bar i { display: block; height: 100%; background: var(--accent); }

/* Status page */
.public { background: var(--panel); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.public header { background: var(--accent); color: #fff; padding: 22px; }
.public header h2 { margin: 0; font-size: 20px; }
.public header p { margin: 4px 0 0; opacity: .85; font-size: 14px; }
.issue { padding: 16px 22px; border-top: 1px solid var(--line); }
.issue:first-of-type { border-top: 0; }
.timeline { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }
.pill.st-fixed { color: var(--done); } .pill.st-sched, .pill.st-vendor { color: var(--blue); }
.nocomments { padding: 14px 22px; font-size: 13px; color: var(--muted); background: var(--bg); }

/* Quick note */
.mic { width: 84px; height: 84px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 34px; box-shadow: var(--shadow); }
.mic.on { background: var(--warn); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px dashed var(--line); }
.check:first-of-type { border-top: 0; }
.check input { margin-top: 4px; accent-color: var(--accent); width: 18px; height: 18px; }

/* Today */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat b { font-size: 26px; display: block; }
.stat span { color: var(--muted); font-size: 13px; }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; opacity: 0; transition: .25s; pointer-events: none; max-width: calc(100% - 32px); font-size: 14px; z-index: 20; }
.toast.show { opacity: 1; transform: translateX(-50%); }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .nav { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; flex-direction: row; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); z-index: 10; }
  .brand, .navfoot { display: none; }
  .nav > button { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 4px; position: relative; flex: 1; align-items: center; }
  .nav > button span { font-size: 20px; }
  .nav > button em { position: absolute; top: 0; right: 12%; margin: 0; font-size: 10px; padding: 0 6px; }
  main { padding: 18px 16px 110px; }
  .grid2, .stats { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr; }
}
