:root{
  --bg:#fff6ee; --card:#ffffff; --line:#f2e2d3; --line2:#f7ece2; --field:#e8d6c6; --fieldbg:#fffbf7;
  --ink:#18181b; --muted:#6b5a4e; --accent:#c2185b; --accent-d:#18181b; --accent-l:#ffe3ec;
  --primary:#ffd23f; --run-ink:#a3134a; --run-dot:#ff4f81; --total:#3b1f5c; --total-muted:#d9cdea;
  --warn:#8a4b0f; --warn-l:#fdf0e1; --danger:#a12a2a;
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;-webkit-text-size-adjust:100%}
body{min-height:100vh}
a{color:var(--accent)}a:hover{color:var(--accent-d)}
button,input,select{font:inherit;color:inherit}
button{cursor:pointer}
button:disabled{opacity:.45;cursor:default}
:focus-visible{outline:3px solid #ff9fbd;outline-offset:2px}

#app{max-width:440px;margin:0 auto;padding:max(24px,env(safe-area-inset-top)) 20px calc(32px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:20px}

.top{display:flex;justify-content:space-between;align-items:center;gap:8px}
.top .eyebrow{font-size:13px;color:var(--muted);letter-spacing:.04em;display:flex;align-items:center;gap:6px;min-height:16px}
.top-l{display:flex;flex-direction:column;gap:2px;min-width:0}
h1{margin:0;font-size:22px;font-weight:700}
h2{margin:0;font-size:15px;font-weight:600}
.back-row{display:flex;align-items:center;gap:8px}
.back-row h1{flex-grow:1}
.icon-btn{display:flex;align-items:center;justify-content:center;width:44px;height:44px;flex-shrink:0;border-radius:12px;background:var(--card);border:1px solid var(--line);color:var(--ink);text-decoration:none}
.pill-link{display:flex;align-items:center;gap:6px;font-size:14px;font-weight:600;text-decoration:none;padding:10px 12px;border-radius:10px;background:var(--card);border:1px solid var(--line)}

.card{background:var(--card);border:1px solid var(--line);border-radius:16px}
.timer-card{border-radius:20px;padding:28px 20px;display:flex;flex-direction:column;align-items:center;gap:14px}
.status{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600;padding:6px 12px;border-radius:999px;color:var(--muted);background:var(--line2)}
.status .dot{width:8px;height:8px;border-radius:50%;background:#a8a59d}
.status.on{color:var(--run-ink);background:var(--accent-l)}
.status.on .dot{background:var(--run-dot);animation:pulse 2s infinite}
@keyframes pulse{50%{opacity:.35}}
.clock{font-size:56px;font-weight:700;letter-spacing:-.02em;font-variant-numeric:tabular-nums;line-height:1.1}

.field{width:100%;display:flex;flex-direction:column;gap:6px;font-size:13px;color:var(--muted)}
.field input,.field select{font-size:16px;color:var(--ink);padding:12px 14px;border:1px solid var(--field);border-radius:12px;background:var(--card);width:100%;min-height:48px}
.timer-card .field input,.form-card .field input,.form-card .field select{background:var(--fieldbg)}
.chips{display:flex;gap:8px;overflow-x:auto;padding-bottom:2px;scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chip{flex-shrink:0;height:40px;padding:0 12px 0 10px;border-radius:999px;border:1px solid var(--field);background:var(--card);font-size:14px;font-weight:500;white-space:nowrap;display:flex;align-items:center;gap:6px}
.chip .pdot{width:10px;height:10px}
.chip.on{border:2px solid var(--pc);background:var(--pc);color:var(--ink);font-weight:700;padding:0 14px}
.chip.on .pdot{display:none}
.pdot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--pc);flex-shrink:0}
.chip-add{flex-shrink:0;width:40px;height:40px;border-radius:999px;border:1px dashed #a8a59d;display:flex;align-items:center;justify-content:center;text-decoration:none;font-size:18px;color:var(--muted)}

.btn{width:100%;height:56px;border:0;border-radius:14px;font-size:17px;font-weight:600;display:flex;align-items:center;justify-content:center;gap:10px;background:var(--ink);color:#fff}
.btn.green{background:var(--primary);color:var(--ink);font-weight:700}
a.btn,a.btn:hover{color:#fff;text-decoration:none}
a.btn.green,a.btn.green:hover{color:var(--ink)}
.btn.sm{height:52px;font-size:16px}
.btn.ghost{background:var(--card);color:var(--ink);border:1px solid var(--field)}
.btn.danger-ghost{background:transparent;color:var(--danger);border:1px solid #e3c4c4}
.link-btn{background:none;border:0;padding:10px;font-size:15px;font-weight:600;color:var(--accent);text-decoration:none}

.stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.stat{padding:14px 16px;display:flex;flex-direction:column;gap:4px}
.stat span:first-child{font-size:13px;color:var(--muted)}
.stat span:last-child{font-size:22px;font-weight:700;font-variant-numeric:tabular-nums}

.list{display:flex;flex-direction:column}
.row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 16px;border-bottom:1px solid var(--line2);background:none;border-left:0;border-right:0;border-top:0;text-align:left;width:100%}
.row:last-child{border-bottom:0}
.row-main{display:flex;gap:12px;align-items:stretch;min-width:0}
.stripe{width:4px;border-radius:2px;background:var(--pc);flex-shrink:0}
.row-l{display:flex;flex-direction:column;gap:2px;min-width:0}
.row-l .t{font-size:15px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.row-l .s{font-size:13px;color:var(--muted)}
.row .v{font-size:15px;font-weight:600;white-space:nowrap;font-variant-numeric:tabular-nums}
.empty{padding:18px 16px;font-size:14px;color:var(--muted)}
.section{display:flex;flex-direction:column;gap:10px}
.hint{font-size:13px;color:var(--muted);line-height:1.4;margin:0}
.lead{margin:0;font-size:15px;color:var(--muted);line-height:1.5}

.banner{background:var(--warn-l);border:1px solid #f0d3ae;color:var(--warn);border-radius:16px;padding:14px 16px;display:flex;flex-direction:column;gap:10px}
.banner strong{font-size:15px}
.banner .acts{display:flex;gap:8px;flex-wrap:wrap}
.banner button{height:44px;padding:0 14px;border-radius:12px;font-size:14px;font-weight:600;border:1px solid #e6c497;background:#fff;color:var(--warn)}
.banner button.main{background:var(--warn);color:#fff;border-color:var(--warn)}

.quick{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.quick button{height:48px;border-radius:12px;border:1px solid var(--field);background:var(--card);font-size:15px;font-weight:600}
.quick button.on{border:2px solid var(--ink);background:var(--ink);color:#fff}
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.grow{flex-grow:1}

.total-card{background:var(--total);color:#fff;border-radius:20px;padding:20px;display:flex;flex-direction:column;gap:10px}
.total-card .lbl{font-size:13px;color:var(--total-muted)}
.total-card .big{font-size:40px;font-weight:700;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.bar-row{display:flex;flex-direction:column;gap:8px;padding:14px 16px;border-bottom:1px solid var(--line2)}
.bar-row:last-child{border-bottom:0}
.bar-row .h{display:flex;justify-content:space-between;font-size:15px;font-weight:600}
.bar-row .h span:first-child{display:flex;align-items:center;gap:8px}
.bar-row .pdot{width:10px;height:10px}
.bar{height:10px;border-radius:5px;background:var(--line2)}
.bar div{height:10px;border-radius:5px;background:var(--pc)}
.seg{display:flex;height:10px;border-radius:5px;overflow:hidden;gap:2px}
.seg div{background:var(--pc)}
.form-card{padding:16px;display:flex;flex-direction:column;gap:12px}

.proj-row{display:flex;justify-content:space-between;align-items:center;padding:6px 8px 6px 16px;border-bottom:1px solid var(--line2);gap:8px}
.proj-row:last-child{border-bottom:0}
.proj-row .n{font-size:15px;font-weight:500;display:flex;align-items:center;gap:10px}
.proj-row .pdot{width:10px;height:10px}
.proj-row .mut{color:var(--muted)}
.icon-plain{width:44px;height:44px;border:0;background:transparent;display:flex;align-items:center;justify-content:center;color:var(--muted);border-radius:10px}
.proj-edit{padding:12px 16px;border-bottom:1px solid var(--line2);display:flex;flex-direction:column;gap:10px;background:var(--fieldbg)}
.proj-edit:last-child{border-bottom:0}
.proj-edit .acts{display:flex;gap:8px}
.proj-edit .acts button{flex:1;height:44px;border-radius:12px;font-size:14px;font-weight:600;border:1px solid var(--field);background:#fff}
.proj-edit .acts button.save{background:var(--primary);color:var(--ink);border-color:var(--primary);font-weight:700}
.small-btn{height:40px;padding:0 12px;border-radius:10px;border:1px solid var(--field);background:#fff;font-size:14px;font-weight:600}

/* modal */
.scrim{position:fixed;inset:0;background:rgba(24,24,27,.45);display:flex;align-items:flex-end;justify-content:center;z-index:20}
.sheet{background:var(--bg);width:100%;max-width:440px;border-radius:20px 20px 0 0;padding:20px 20px calc(20px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:14px;max-height:92vh;overflow:auto}
@media (min-width:520px){.scrim{align-items:center}.sheet{border-radius:20px}}
.sheet-acts{display:flex;flex-direction:column;gap:8px;margin-top:4px}

/* PIN */
.pin-wrap{min-height:70vh;display:flex;flex-direction:column;justify-content:center;gap:16px}
.pin-wrap input{text-align:center;font-size:24px;letter-spacing:.3em}
.err{color:var(--danger);font-size:14px;margin:0;min-height:20px}

#toast{position:fixed;left:50%;bottom:calc(24px + env(safe-area-inset-bottom));transform:translateX(-50%) translateY(20px);background:var(--ink);color:#fff;padding:12px 16px;border-radius:12px;font-size:14px;opacity:0;pointer-events:none;transition:.2s;z-index:30;max-width:90vw}
#toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

/* report preview */
.rep{background:#fff;border:1px solid var(--line);border-radius:16px;padding:18px;display:flex;flex-direction:column;gap:14px}
.rep h1{font-size:20px}
.rep .meta{font-size:13px;color:var(--muted)}
.rep table{width:100%;border-collapse:collapse;font-size:13px}
.rep th{text-align:left;font-weight:600;color:var(--muted);border-bottom:1px solid var(--line);padding:6px 4px}
.rep td{padding:6px 4px;border-bottom:1px solid var(--line2);vertical-align:top}
.rep td.num,.rep th.num{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.rep tr.day td{background:#fff6ee;font-weight:600}
.rep tr.tot td{font-weight:700;border-top:2px solid var(--ink);border-bottom:0}
.rep-acts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}

@media print{
  body,html{background:#fff}
  #app{max-width:none;padding:0}
  .no-print,#toast{display:none!important}
  .rep{border:0;padding:0}
  .rep tr{break-inside:avoid}
}
