:root {
  --bg: #0f1419;
  --surface: #1a1f2e;
  --surface-2: #232a3d;
  --border: #2d3548;
  --text: #e6e9f0;
  --text-dim: #9aa3b8;
  --accent: #4ade80;
  --accent-2: #60a5fa;
  --warning: #fbbf24;
  --danger: #f87171;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  font-size: 16px;
  height: 100%;
  overscroll-behavior: contain;
}
[hidden] { display: none !important; }
.view { display: none; padding: 16px; }
.view.active { display: block; }
header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
header h1 { font-size: 20px; margin: 0; flex: 1; }
header button.icon, header button.back {
  background: none; border: 0; color: var(--text); font-size: 22px; cursor: pointer; padding: 6px;
}
header .today { color: var(--text-dim); font-size: 14px; }

.group { margin-bottom: 18px; }
.group h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin: 0 0 8px; font-weight: 600; }
.row-card {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 8px; min-height: 56px;
}
.row-card .big { font-weight: 600; font-size: 16px; }
.row-card .small { color: var(--text-dim); font-size: 13px; margin-top: 2px; }
.row-card.tappable { cursor: pointer; }
.row-card .chev { color: var(--text-dim); font-size: 22px; }
.pill { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-dim); white-space: nowrap; font-weight: 600; }
.pill-ok { background: var(--accent); color: #0a1a0e; }
.pill-soon { background: rgba(251,191,36,0.18); color: var(--warning); }
.pill-now { background: rgba(251,191,36,0.28); color: var(--warning); }
.pill-bad { background: rgba(248,113,113,0.15); color: var(--danger); }
.row-card.tone-ok { border-left: 4px solid var(--accent); }
.row-card.tone-bad { border-left: 4px solid var(--danger); }
.row-card.tone-soon, .row-card.tone-now { border-left: 4px solid var(--warning); }
.more { width: 100%; background: none; border: 1px dashed var(--border); color: var(--accent-2); padding: 12px; border-radius: 12px; font-size: 14px; cursor: pointer; margin: 2px 0 10px; }
.banner { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; margin-bottom: 18px; display: grid; gap: 4px; }
.banner-main { font-weight: 600; }
.banner-sub { color: var(--text-dim); font-size: 13px; }
.banner-actions button { background: none; border: 1px solid var(--border); color: var(--text); padding: 8px 12px; border-radius: 10px; font-size: 14px; margin-top: 6px; cursor: pointer; }
.empty { color: var(--text-dim); }
.tabs {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; background: var(--surface); border-top: 1px solid var(--border);
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
}
.tabs button { flex: 1; background: none; border: 0; color: var(--text-dim); font-size: 14px; padding: 12px 0; min-height: 56px; cursor: pointer; }
.tabs button.active { color: var(--accent); font-weight: 600; }
body { padding-bottom: 84px; }
button.danger { width: 100%; margin-top: 18px; background: none; border: 1px solid var(--danger); color: var(--danger); padding: 12px; border-radius: 8px; font-size: 16px; cursor: pointer; }
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: flex-end; z-index: 10; }
.sheet-card { background: var(--surface); width: 100%; border-radius: 16px 16px 0 0; padding: 18px 16px max(18px, env(safe-area-inset-bottom)); }
.sheet-title { font-weight: 600; font-size: 18px; }
.sheet-detail { color: var(--text-dim); margin: 4px 0 14px; }
.danger-fill { background: var(--danger); color: #1a0a0a; }
.toggle { font-size: 13px; color: var(--text-dim); display: flex; gap: 6px; align-items: center; }
.week { margin: 18px 0 8px; display: flex; justify-content: space-between; color: var(--text-dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; }

form label { display: block; margin-bottom: 14px; font-size: 14px; color: var(--text-dim); }
form input[type=date], form input[type=time], form input[type=text] {
  display: block; width: 100%; margin-top: 4px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 10px; border-radius: 6px; font-size: 16px;
}
.row { display: flex; align-items: center; gap: 8px; }

.seg { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.seg button {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 8px 12px; border-radius: 16px; font-size: 13px; cursor: pointer;
}
.seg button.selected { background: var(--accent); color: #0a1a0e; border-color: var(--accent); }

#partner-chips { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0; }
#partner-chips button { background: var(--surface-2); color: var(--text); border: 0; padding: 6px 10px; border-radius: 14px; font-size: 13px; cursor: pointer; }
#partner-selected { margin-top: 6px; font-size: 13px; color: var(--accent); }

.actions { display: flex; gap: 12px; margin-top: 20px; }
.actions button {
  flex: 1; padding: 12px; border-radius: 8px; border: 0; font-size: 16px; font-weight: 600; cursor: pointer;
}
.actions .cancel { background: var(--surface-2); color: var(--text); }
.actions .save { background: var(--accent); color: #0a1a0e; }

#outcome-summary { margin-bottom: 16px; }
.score { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.score-main { font-weight: 600; font-size: 16px; }
.score-sub { color: var(--text-dim); font-size: 13px; margin-top: 2px; }
