/* Palette: olive for trust and "safe to proceed", warm paper for calm,
   amber only where a person needs to look, clay only when something was blocked. */
:root {
  --paper: #F3F1E7;
  --card: #FBFAF4;
  --ink: #20261A;
  --ink-2: #4A5140;
  --muted: #7A7F6C;
  --line: #DCD8C6;
  --olive: #5A6B2E;
  --olive-deep: #3D4A1E;
  --olive-soft: #DDE4C3;
  --olive-tint: #ECEFDB;
  --amber: #B5631C;
  --amber-mid: #E7B77F;
  --amber-soft: #F5E2CB;
  --clay: #A23B2C;
  --clay-soft: #F4D9D2;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); background: var(--paper); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--olive); outline-offset: 2px; }
kbd { font: 11px/1 var(--mono); padding: 3px 5px; border-radius: 5px; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); }
h1, h2, h3, h4, p { margin: 0; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 20; height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: var(--olive) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M9 16.5l4.5 4.5L23 11.5' fill='none' stroke='%23F3F1E7' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.brand-name { font: 600 18px var(--serif); }
.brand-sub { color: var(--muted); font-size: 12.5px; }
.top-right { display: flex; align-items: center; gap: 10px; }
.ghost { white-space: nowrap; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.ghost:hover { background: var(--card); }
.mode { font-size: 12.5px; color: var(--ink-2); padding: 7px 12px; border-radius: 999px; background: var(--olive-tint); white-space: nowrap; }
.mode::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); margin-right: 7px; vertical-align: 1px; }
.mode.live::before { background: var(--olive); box-shadow: 0 0 0 3px var(--olive-soft); }
.mode:disabled { cursor: default; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 264px 1fr; min-height: calc(100vh - 58px); }
.side { border-right: 1px solid var(--line); padding: 20px 14px 30px; position: sticky; top: 58px; height: calc(100vh - 58px); overflow: auto; }
.side h4 { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 16px 10px 6px; }
.side h4:first-child { margin-top: 0; }
.side button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; text-align: left; font-size: 14px; color: var(--ink-2); transition: background .2s; }
.side button:hover:not(:disabled) { background: var(--olive-tint); }
.side button:disabled { cursor: default; color: #A9AB9A; }
.side .dot { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 600; border: 1.5px solid var(--line); color: var(--muted); transition: all .25s; }
.side button.done .dot { background: var(--olive-soft); border-color: var(--olive-soft); color: var(--olive-deep); }
.side button.on { background: var(--olive-tint); color: var(--ink); font-weight: 600; }
.side button.on .dot { background: var(--olive); border-color: var(--olive); color: var(--paper); }
.side button.skip { color: #A9AB9A; text-decoration: line-through; text-decoration-color: var(--line); }

main { padding: 34px 48px 110px; min-width: 0; }
#screen { max-width: 900px; margin: 0 auto; }
.screen { animation: enter .4s cubic-bezier(.2, .7, .2, 1) both; }
.screen.back { animation-name: enter-back; }
@keyframes enter { from { opacity: 0; transform: translateX(24px); } }
@keyframes enter-back { from { opacity: 0; transform: translateX(-24px); } }
.fade-in { animation: fade .45s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

.crumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; font-size: 12.5px; }
.crumbs .stage { font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--olive); font-size: 11.5px; margin-right: 4px; }
.screen h1 { font: 500 34px/1.15 var(--serif); letter-spacing: -0.015em; }
.plain { font-size: 16.5px; color: var(--ink-2); margin: 10px 0 24px; max-width: 62ch; }

.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; background: #E9E6D8; color: var(--ink-2); }
.tag.good { background: var(--olive-soft); color: var(--olive-deep); }
.tag.warn { background: var(--amber-soft); color: var(--amber); }
.tag.stop { background: var(--clay-soft); color: var(--clay); }
.tag.role { background: transparent; border: 1px solid var(--line); font-weight: 500; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; }
.card + .card { margin-top: 16px; }
.card h2 { font: 600 12px var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.cols > * { min-width: 0; margin-top: 0 !important; }

.banner { margin-top: 16px; padding: 14px 18px; border-radius: 12px; background: var(--olive-tint); color: var(--olive-deep); font-size: 15px; }
.banner.warn { background: var(--amber-soft); color: #6B3A10; }
.banner.stop { background: var(--clay-soft); color: #6E241A; }
.banner b { font-weight: 600; }
.hint { font-size: 13px; color: var(--muted); margin-top: 10px; }

/* ---------- bottom nav ---------- */
.nav { position: fixed; left: 264px; right: 0; bottom: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 48px; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.nav .where { font-size: 13px; color: var(--muted); }
.btn { padding: 11px 22px; border-radius: 999px; font-weight: 600; font-size: 14.5px; transition: transform .15s, background .2s; white-space: nowrap; }
.btn.primary { background: var(--olive); color: var(--paper); box-shadow: 0 1px 0 var(--olive-deep), 0 8px 20px -10px var(--olive-deep); }
.btn.primary:hover:not(:disabled) { background: var(--olive-deep); transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.outline { border: 1.5px solid var(--line); color: var(--ink-2); font-weight: 500; }
.btn.outline:hover:not(:disabled) { border-color: var(--olive); color: var(--olive-deep); }
.btn.small { padding: 7px 14px; font-size: 13px; }
.btn.danger { border: 1.5px solid var(--clay-soft); color: var(--clay); font-weight: 500; }
.btn.danger:hover { background: var(--clay-soft); }

/* ---------- home ---------- */
.hero h1 { font: 500 44px/1.1 var(--serif); letter-spacing: -0.02em; max-width: 18ch; }
.hero h1 em { font-style: italic; color: var(--olive); }
.stories { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.story { text-align: left; padding: 16px 18px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); transition: all .2s; }
.story:hover { border-color: var(--olive); transform: translateY(-2px); box-shadow: 0 10px 24px -18px var(--olive-deep); }
.story b { display: block; font: 500 18px var(--serif); margin-bottom: 3px; }
.story span { color: var(--ink-2); font-size: 14px; }
.story.blank { background: transparent; border-style: dashed; }
.section-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }

/* ---------- forms ---------- */
.field { display: block; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.field > span { display: block; margin-bottom: 5px; }
select, input[type="number"], input[type="text"], textarea { width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; transition: border-color .2s; }
select:hover, input:hover, textarea:hover { border-color: #C4C0AC; }
select:focus, input:focus, textarea:focus { border-color: var(--olive); outline: none; }
textarea { resize: vertical; min-height: 64px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr) 110px; gap: 8px; margin: 18px 0; align-items: end; }
.week label { font-size: 12px; color: var(--muted); text-align: center; font-weight: 600; }
.week input { text-align: center; padding: 12px 4px; font-size: 17px; font-variant-numeric: tabular-nums; margin-top: 5px; }
.week .wkend input { background: var(--paper); }
.week .total { text-align: right; }
.week .total b { display: block; font: 500 34px/1.1 var(--serif); font-variant-numeric: tabular-nums; transition: color .2s; }
.week .total.over b { color: var(--amber); }
.who { font-size: 13px; color: var(--muted); margin-top: 6px; }

.sys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.sys .card { margin: 0; transition: border-color .3s, background .3s; }
.sys .card.diff { border-color: var(--amber-mid); background: #FBF1E2; }
.sys .big { font: 500 38px/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.sys .big small { font: 14px var(--sans); color: var(--muted); }
.sys input[type="number"] { font: 500 24px var(--serif); padding: 6px 10px; width: 110px; }
.sys .row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.sys .status { margin-top: 10px; font-size: 13px; color: var(--olive-deep); min-height: 20px; }
.sys .diff .status { color: var(--amber); font-weight: 600; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); margin-top: 10px; cursor: pointer; }
.check input { accent-color: var(--olive); width: 15px; height: 15px; }

/* ---------- checks ---------- */
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; transition: opacity .3s; }
.checks li + li { border-top: 1px solid var(--line); }
.checks li.wait { opacity: .35; }
.checks .ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; border: 1.5px solid var(--line); color: var(--muted); }
.checks li.run .ic { border-color: var(--olive); animation: pulse 1s infinite; }
.checks li.pass .ic { background: var(--olive); border-color: var(--olive); color: var(--paper); }
.checks li.fail .ic { background: var(--amber); border-color: var(--amber); color: #fff; }
.checks li.fail b { color: var(--amber); }
.checks b { font-weight: 500; font-size: 15px; }
.checks span { font-size: 13px; color: var(--muted); }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px var(--olive-soft); } }

/* ---------- policy ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.tabs button.on { background: var(--olive); border-color: var(--olive); color: var(--paper); font-weight: 600; }
.ask input { font-size: 15px; }
.shelf { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 4px; }
.shelf span { font: 12px var(--mono); padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); color: #A9AB9A; transition: all .3s; }
.shelf span.hit { background: var(--olive); border-color: var(--olive); color: var(--paper); transform: translateY(-2px); }
.hit-card { display: grid; grid-template-columns: 26px 1fr 90px; gap: 4px 12px; padding: 14px 0; align-items: center; }
.hit-card + .hit-card { border-top: 1px solid var(--line); }
.hit-card .rank { font: 500 18px var(--serif); color: var(--muted); }
.hit-card b { font-size: 15px; }
.hit-card b code { font: 600 13px var(--mono); color: var(--olive-deep); background: var(--olive-soft); padding: 2px 6px; border-radius: 5px; margin-right: 6px; }
.hit-card p { grid-column: 2 / -1; font-size: 14px; color: var(--ink-2); }
.bar { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--olive); border-radius: 3px; transition: width .4s ease; }

/* ---------- explain ---------- */
.explain { font: 17px/1.65 var(--serif); min-height: 120px; }
.explain mark { background: none; color: inherit; border-bottom: 2px solid var(--line); font-weight: 600; transition: all .3s; }
.explain mark.ok { border-bottom-color: var(--olive); }
.explain mark.bad { border-bottom-color: var(--clay); color: var(--clay); background: var(--clay-soft); }
.proof { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.proof li { display: grid; grid-template-columns: 22px auto 1fr; gap: 8px; align-items: center; padding: 6px 0; opacity: .3; transition: opacity .3s; }
.proof li.shown { opacity: 1; }
.proof li + li { border-top: 1px solid var(--line); }
.proof .ic { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; background: var(--line); color: var(--card); }
.proof li.shown.ok .ic { background: var(--olive); }
.proof li.shown.bad .ic { background: var(--clay); }
.proof b { font: 600 13px var(--mono); }
.proof span { color: var(--muted); text-align: right; }
.proof li.bad span { color: var(--clay); font-weight: 600; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- money ---------- */
.calc { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; font: 500 30px var(--serif); font-variant-numeric: tabular-nums; }
.calc small { display: block; font: 12px var(--sans); color: var(--muted); }
.calc .op { color: var(--muted); font-size: 22px; }
.calc .res { color: var(--amber); }
.meter { position: relative; height: 10px; border-radius: 5px; background: var(--olive-soft); margin: 40px 0 30px; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--amber); transition: width .8s cubic-bezier(.2, .7, .2, 1); }
.meter .line { position: absolute; left: 50%; top: -8px; bottom: -8px; width: 2px; background: var(--ink); }
.meter .line::after { content: "$500 threshold"; position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 11.5px; white-space: nowrap; color: var(--ink-2); font-weight: 600; }
.meter .ends { position: absolute; top: 16px; left: 0; right: 0; display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.owner { display: flex; align-items: center; gap: 14px; }
.owner .avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--olive); color: var(--paper); display: grid; place-items: center; font: 600 15px var(--sans); flex: none; }
.owner b { font: 500 20px var(--serif); display: block; }
.owner span { font-size: 13.5px; color: var(--ink-2); }
.quote { font: italic 15px/1.5 var(--serif); color: var(--ink-2); padding-left: 12px; border-left: 2px solid var(--line); margin-top: 12px; }

/* ---------- review + report ---------- */
.review-item + .review-item { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.review-item h3 { font: 500 20px var(--serif); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.review-item p { margin-top: 6px; color: var(--ink-2); }
.review-item .do { margin-top: 10px; font-weight: 600; color: var(--ink); }
.decide { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.decide input { flex: 1; }
.log { list-style: none; margin: 0; padding: 0; }
.log li { display: grid; grid-template-columns: 70px 16px 1fr; gap: 10px; padding: 9px 0; font-size: 14px; position: relative; animation: fade .4s ease both; }
.log time { font: 12px var(--mono); color: var(--muted); padding-top: 2px; }
.log li::before { content: ""; grid-column: 2; grid-row: 1; width: 9px; height: 9px; border-radius: 50%; background: var(--olive); margin: 6px auto 0; z-index: 1; }
.log li::after { content: ""; position: absolute; left: 87px; top: 20px; bottom: -10px; width: 1.5px; background: var(--line); }
.log li:last-child::after { display: none; }
.log li.person::before { background: var(--amber); }
.log b { font-weight: 600; }
.log span { grid-column: 3; }

/* ---------- whole week ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, 26px); gap: 7px; }
.tiles i { width: 26px; height: 26px; border-radius: 7px; background: #E6E2D2; transition: background .3s, transform .3s; }
.tiles i.ok { background: var(--olive-soft); }
.tiles i.flag { background: var(--amber-mid); }
.tiles i.cleared { background: var(--olive); }
.tiles i.exception { background: var(--amber); transform: scale(1.08); }
.legend { display: flex; gap: 16px; margin-top: 12px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font: 500 30px/1.15 var(--serif); font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
.stat.warn b { color: var(--amber); }
.versus { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; }
.versus div b { font: 500 22px var(--serif); display: block; }
.versus div span { font-size: 13.5px; color: var(--ink-2); }
.versus .arrow { font-size: 22px; color: var(--muted); }

/* ---------- value + reuse ---------- */
.slider { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; margin-bottom: 10px; font-size: 14px; }
.slider output { font-weight: 600; font-variant-numeric: tabular-nums; }
.slider input { grid-column: 1 / -1; width: 100%; accent-color: var(--olive); }
.value-total strong { font: 500 44px/1 var(--serif); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.value-total span { color: var(--muted); margin-left: 8px; }
.value-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.value-split div { padding: 10px 12px; border-radius: 10px; background: var(--olive-tint); font-size: 13px; color: var(--ink-2); }
.value-split b { display: block; font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
.blocks { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.block { font-size: 12.5px; padding: 6px 10px; border-radius: 7px; background: var(--olive-soft); color: var(--olive-deep); font-weight: 500; transition: all .35s; }
.block.off { background: transparent; color: #B4B5A4; box-shadow: inset 0 0 0 1px var(--line); text-decoration: line-through; }
.block.new { background: var(--amber-soft); color: var(--amber); box-shadow: inset 0 0 0 1.5px var(--amber-mid); animation: fade .4s ease both; }
.block.new::before { content: "+ "; }
.reuse b { font: 500 26px var(--serif); margin-right: 8px; white-space: nowrap; color: var(--ink); }
.reuse { font-size: 14px; color: var(--ink-2); }
details { margin-top: 16px; }
details summary { cursor: pointer; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.todo { list-style: none; margin: 10px 0 0; padding: 0; }
.todo li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 14px; border-top: 1px solid var(--line); }

/* ---------- notes drawer ---------- */
.notes { position: fixed; top: 0; right: 0; bottom: 0; width: 370px; z-index: 40; overflow: auto; background: var(--ink); color: #E8E6D9; padding: 26px 26px 40px; transform: translateX(100%); transition: transform .35s cubic-bezier(.2, .7, .2, 1); box-shadow: -20px 0 50px -30px rgba(0, 0, 0, .5); }
.notes.open { transform: none; }
.notes h2 { font: 500 22px var(--serif); margin: 6px 0 14px; }
.notes .eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #B9C58B; }
.notes h3 { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: #9BA088; margin: 20px 0 8px; }
.notes .idea { font: 16px/1.55 var(--serif); color: #F3F1E7; padding: 12px 14px; border-radius: 10px; background: #2E3526; }
.notes ul { margin: 0; padding-left: 18px; }
.notes li { margin-bottom: 8px; font-size: 14px; line-height: 1.5; }
.notes .qa { font-size: 14px; margin-bottom: 12px; }
.notes .qa b { display: block; color: #F3F1E7; }
.notes .qa span { color: #C9C8B8; }
.notes .close { position: absolute; top: 18px; right: 18px; color: #9BA088; font-size: 13px; }

.toast { position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 50; background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 999px; font-size: 13.5px; transition: all .3s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .nav { left: 0; padding: 12px 20px; }
  main { padding: 24px 20px 100px; }
  .brand-sub { display: none; }
  .cols, .sys, .stories, .stats, .versus { grid-template-columns: 1fr; }
  .week { grid-template-columns: repeat(4, 1fr); }
  .hero h1 { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
