:root {
  --bg: #F4F3EF; --surface: #FFFFFF; --ink: #16161A; --text-2: #3D3D42; --text-3: #5A5A60;
  --border: #E2E0DA; --border-btn: #D4D2CB; --divider: #EEECE6; --track: #DAD8D1; --accent: #C2410C;
  --p1-bg: #FBE7DC; --p1-fg: #9A3412; --p2-bg: #E9E7E1; --p2-fg: #3D3D42; --p3-bg: #F1EFEA; --p3-fg: #5A5A60;
  --display: 'Space Grotesk', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--ink); } a:hover { color: var(--accent); }
button { font-family: inherit; cursor: pointer; color: var(--ink); }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: .5; cursor: default; }

.screen {
  max-width: 430px; margin: 0 auto; min-height: 100dvh; height: 100dvh;
  display: flex; flex-direction: column; gap: 14px;
  padding: calc(16px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
  overflow: hidden;
}
.screen.scroll { height: auto; overflow: visible; gap: 18px; padding-bottom: calc(32px + env(safe-area-inset-bottom)); }

.header { display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: 10px; }
.mark { width: 32px; height: 32px; border-radius: 9px; background: var(--ink); color: var(--bg); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 15px; }
.brand-text { display: flex; flex-direction: column; }
.brand-text b { font-size: 14px; font-weight: 600; }
.meta { font-size: 12px; color: var(--text-3); }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; padding: 0; }

.heading { display: flex; flex-direction: column; gap: 6px; }
h1 { margin: 0; font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.sub { margin: 0; font-size: 13px; color: var(--text-3); }

.progress { display: flex; flex-direction: column; gap: 4px; }
.segs { display: grid; gap: 6px; }
.seg { height: 6px; border-radius: 3px; background: var(--track); transition: background .2s; }
.undo-row { height: 36px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-3); }
.undo-btn { height: 36px; background: none; border: none; padding: 0 0 0 12px; font-size: 12px; font-weight: 600; text-decoration: underline; }

.stage { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.card { flex: 1; min-height: 0; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 1px 2px rgba(22,22,26,.05); }
.card.reject { gap: 12px; }
.chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--bg); }
.pri { font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 999px; }
.pri.P1 { background: var(--p1-bg); color: var(--p1-fg); } .pri.P2 { background: var(--p2-bg); color: var(--p2-fg); } .pri.P3 { background: var(--p3-bg); color: var(--p3-fg); }
.due { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--text-3); }
h2.title { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
.why { margin: 0; font-size: 15px; line-height: 1.45; color: var(--text-2); }
.next { background: var(--bg); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.next .label { color: var(--accent); }
.next-action { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; font-weight: 600; line-height: 1.35; }
.next-action svg { flex-shrink: 0; margin-top: 1px; }
.effect { font-size: 13px; line-height: 1.4; color: var(--text-3); }
.draft { display: flex; flex-direction: column; gap: 6px; }
.draft textarea { font-family: Inter, system-ui, sans-serif; font-size: 14px; line-height: 1.45; color: var(--ink); border: 1px solid var(--border-btn); border-radius: 12px; padding: 12px; resize: none; background: var(--surface); width: 100%; }

.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.btn { height: 48px; border-radius: 14px; border: 1px solid var(--border-btn); background: var(--surface); font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; }
.btn-primary { height: 56px; border-radius: 16px; border: none; background: var(--ink); color: #fff; font-size: 16px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-outline { height: 56px; border-radius: 16px; border: 1px solid var(--border-btn); background: var(--surface); font-size: 16px; font-weight: 600; }
.help { margin: 0; font-size: 14px; line-height: 1.45; color: var(--text-2); }
.reasons { display: flex; flex-direction: column; gap: 8px; }
.reason { min-height: 56px; text-align: left; padding: 10px 16px; border-radius: 14px; border: 1px solid var(--border-btn); background: #F9F8F5; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.reason b { font-size: 15px; font-weight: 600; } .reason span { font-size: 12px; color: var(--text-3); }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.tile b { font-family: var(--display); font-size: 28px; font-weight: 700; line-height: 1.1; }
.tiles.small .tile b { font-size: 26px; }
.tile span { font-size: 12px; font-weight: 500; color: var(--text-3); }
.outcomes { flex: 1; min-height: 0; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 16px 20px 8px; display: flex; flex-direction: column; }
.outcomes .label { padding-bottom: 8px; }
.outcome { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--divider); }
.outcome-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.outcome-text b { font-size: 14px; font-weight: 600; } .outcome-text span { font-size: 12px; line-height: 1.35; color: var(--text-3); }
.tag { flex-shrink: 0; font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 999px; }
.tag.run { background: var(--ink); color: #fff; } .tag.rework { background: var(--p1-bg); color: var(--p1-fg); } .tag.tomorrow { background: var(--p2-bg); color: var(--p2-fg); }
.center-note { margin: 0; font-size: 13px; color: var(--text-3); text-align: center; }

.empty { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 24px 20px; }

/* All tasks */
.back { height: 44px; display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; text-decoration: none; background: none; border: none; padding: 0; }
section { display: flex; flex-direction: column; gap: 8px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; }
.sec-head h2 { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.sec-head h2.hot { color: var(--p1-fg); }
.link { font-size: 12px; font-weight: 600; background: none; border: none; padding: 0; text-decoration: underline; }
.list { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 4px 16px; display: flex; flex-direction: column; }
.item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; }
.item + .item { border-top: 1px solid var(--divider); }
.item-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.item-text b { font-size: 14px; font-weight: 600; } .item-text span { font-size: 13px; color: var(--text-3); }
.item .pri { flex-shrink: 0; font-size: 11px; }
.item .side { flex-shrink: 0; font-size: 12px; font-weight: 500; color: var(--text-3); text-align: right; max-width: 45%; }
.none { padding: 12px 0; font-size: 13px; color: var(--text-3); }
.dashed { min-height: 52px; border-radius: 16px; border: 1px dashed #C9C7C0; background: transparent; font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; width: 100%; }
.dashed svg { transition: transform .2s; } .dashed[aria-expanded="true"] svg { transform: rotate(180deg); }
.cmd { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--bg); border-radius: 10px; padding: 10px; word-break: break-all; }
.key-input { height: 48px; border-radius: 14px; border: 1px solid var(--border-btn); padding: 0 14px; font-size: 15px; width: 100%; background: var(--surface); }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 13px; font-weight: 500; z-index: 10; }
