:root {
  --ink: #111318;
  --ink-2: #24262d;
  --paper: #f4f0e9;
  --surface: #fffdf9;
  --muted: #706e69;
  --line: #ddd7ce;
  --accent: #ff6b2c;
  --accent-2: #ff8a55;
  --success: #197a4a;
  --danger: #b42318;
  --shadow: 0 10px 28px rgba(17, 19, 24, .08);
  --radius: 18px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 2px; }
.app-shell { width: min(100%, 760px); min-height: 100vh; margin: 0 auto; background: var(--paper); padding-bottom: calc(82px + var(--safe-bottom)); }
.topbar { position: sticky; top: 0; z-index: 20; height: 68px; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.brand { border: 0; background: none; display: flex; align-items: center; gap: 10px; color: var(--ink); padding: 0; text-align: left; min-height: 44px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px 12px 5px 12px; display: grid; place-items: center; color: white; background: var(--accent); font-weight: 900; letter-spacing: -.08em; }
.brand strong, .brand small { display: block; line-height: 1.05; }
.brand strong { font-size: 18px; letter-spacing: -.04em; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .13em; }
.stage-pill { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; min-height: 38px; padding: 0 12px; font-size: 12px; font-weight: 700; }
main { padding: 18px 16px 32px; }
.view-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 4px 0 18px; }
.view-head small, .eyebrow { text-transform: uppercase; letter-spacing: .13em; color: var(--accent); font-size: 11px; font-weight: 800; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 5px; font-size: clamp(28px, 8vw, 42px); line-height: .98; letter-spacing: -.055em; }
h2 { letter-spacing: -.035em; }
.view-head p { color: var(--muted); margin: 0; font-size: 14px; }
.primary, .secondary, .quiet-button { border-radius: 14px; min-height: 46px; padding: 0 16px; font-weight: 800; border: 0; }
.primary { background: var(--accent); color: #fff; box-shadow: 0 8px 18px rgba(255, 107, 44, .22); }
.secondary { background: var(--ink); color: white; }
.quiet-button { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.full { width: 100%; }
.dashboard-hero { background: var(--ink); color: white; padding: 22px; border-radius: 24px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.dashboard-hero::after { content: ""; position: absolute; width: 180px; height: 180px; right: -70px; top: -100px; border-radius: 50%; border: 34px solid rgba(255, 107, 44, .62); }
.dashboard-hero small { color: #f7b497; text-transform: uppercase; font-weight: 800; letter-spacing: .12em; }
.dashboard-hero h1 { max-width: 520px; margin: 10px 0 14px; font-size: clamp(29px, 8vw, 46px); }
.dashboard-hero p { max-width: 530px; color: #c9c9cc; margin-bottom: 18px; }
.hero-actions { display: flex; gap: 9px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-actions button { min-height: 44px; }
.hero-actions .quiet-button { background: transparent; color: white; border-color: #464850; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 14px 0 24px; overflow: hidden; box-shadow: var(--shadow); }
.metric { padding: 15px 12px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric strong { display: block; font-size: 22px; letter-spacing: -.04em; }
.metric span { color: var(--muted); font-size: 11px; line-height: 1.2; display: block; }
.section-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 23px 0 11px; }
.section-row h2 { font-size: 20px; margin: 0; }
.section-row button { background: none; border: 0; color: var(--accent); font-weight: 800; min-height: 40px; }
.focus-card { background: #ffe7d8; border: 1px solid #ffc4a3; border-radius: var(--radius); padding: 17px; }
.focus-card textarea { width: 100%; min-height: 78px; resize: vertical; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 17px; font-weight: 700; outline: none; }
.focus-card footer { display: flex; justify-content: space-between; align-items: center; color: #915033; font-size: 12px; }
.task-list { display: grid; gap: 8px; }
.task-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 13px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; }
.task-item.done { opacity: .62; }
.task-item.done .task-title { text-decoration: line-through; }
.check { width: 30px; height: 30px; border-radius: 10px; border: 2px solid var(--line); background: white; display: grid; place-items: center; color: white; padding: 0; }
.done .check { background: var(--success); border-color: var(--success); }
.task-title { font-weight: 750; line-height: 1.25; }
.task-meta { margin-top: 4px; display: flex; gap: 7px; flex-wrap: wrap; color: var(--muted); font-size: 11px; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; margin-right: 3px; }
.task-menu { border: 0; background: none; color: var(--muted); min-width: 42px; min-height: 42px; font-size: 19px; }
.area-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.area-card { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 17px; text-align: left; color: var(--ink); min-height: 154px; box-shadow: 0 5px 16px rgba(17,19,24,.04); }
.area-card .area-index { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; }
.area-card h2 { font-size: 18px; margin: 20px 0 8px; line-height: 1.05; }
.area-card p { font-size: 12px; color: var(--muted); line-height: 1.35; margin-bottom: 14px; }
.progress { height: 6px; border-radius: 99px; background: #ebe7e0; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--area, var(--accent)); border-radius: inherit; }
.area-detail-head { padding: 20px; border-radius: 22px; color: white; background: var(--ink); margin-bottom: 16px; }
.area-detail-head button { border: 0; background: none; color: #ddd; padding: 0; min-height: 40px; }
.area-detail-head h1 { margin: 14px 0 8px; }
.area-detail-head p { color: #c7c7ca; margin: 0; }
.filters { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 11px; scrollbar-width: none; }
.filters button { white-space: nowrap; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; min-height: 38px; padding: 0 13px; font-size: 12px; font-weight: 800; }
.filters button.active { background: var(--ink); border-color: var(--ink); color: white; }
.objective-list { display: grid; gap: 10px; }
.objective { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.objective header { display: flex; justify-content: space-between; gap: 10px; }
.objective h3 { font-size: 16px; margin-bottom: 7px; }
.objective p { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.objective select { border: 1px solid var(--line); border-radius: 10px; background: var(--paper); min-height: 36px; }
.status-line { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 11px; }
.plan-grid { display: grid; gap: 12px; }
.plan-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.plan-card h2 { margin-bottom: 7px; font-size: 18px; }
.plan-card p { color: var(--muted); font-size: 13px; line-height: 1.45; }
.plan-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.warning { border: 1px solid #e4c165; background: #fff5cf; padding: 14px; border-radius: 14px; font-size: 12px; line-height: 1.45; color: #6c551a; }
.empty { text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); padding: 30px 18px; color: var(--muted); }
.bottom-nav { position: fixed; z-index: 30; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 760px); display: grid; grid-template-columns: repeat(4, 1fr); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding: 6px 8px calc(7px + var(--safe-bottom)); }
.bottom-nav button { border: 0; background: none; color: var(--muted); min-height: 56px; font-size: 10px; font-weight: 800; }
.bottom-nav button span { display: block; font-size: 21px; margin-bottom: 2px; }
.bottom-nav button.active { color: var(--accent); }
.sheet { width: min(calc(100% - 24px), 560px); border: 0; border-radius: 24px; padding: 0; background: var(--surface); color: var(--ink); box-shadow: 0 24px 80px rgba(0,0,0,.22); }
.sheet::backdrop { background: rgba(17,19,24,.58); backdrop-filter: blur(3px); }
.sheet form { padding: 20px; }
.sheet-head { display: flex; justify-content: space-between; align-items: start; margin-bottom: 18px; }
.sheet-head small { color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.sheet-head h2 { margin: 3px 0 0; }
.icon-button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--paper); font-size: 26px; }
.sheet label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 750; margin-bottom: 13px; }
.sheet input, .sheet select { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; color: var(--ink); background: white; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gate { padding: 15px; border: 1px solid var(--line); border-radius: 14px; display: grid; gap: 5px; margin: 15px 0; }
.gate span, .legal-note { color: var(--muted); font-size: 13px; line-height: 1.5; }
.toast { position: fixed; z-index: 99; bottom: calc(86px + var(--safe-bottom)); left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: white; border-radius: 999px; padding: 11px 16px; font-size: 12px; font-weight: 750; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 500px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .area-grid { grid-template-columns: 1fr; }
  .area-card { min-height: 134px; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
