:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111827;
  background: #f3f4f6;
  --surface: #ffffff;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #111827;
  --danger: #b91c1c;
  --success: #047857;
  --warning: #b45309;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; padding-bottom: 84px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px; background: rgba(255,255,255,.94);
  backdrop-filter: blur(16px); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 800; letter-spacing: -.02em; }
.subtle { color: var(--muted); font-size: .86rem; }
.container { width: min(900px, 100%); margin: 0 auto; padding: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px; margin-bottom: 14px; box-shadow: 0 2px 10px rgba(17,24,39,.03); }
.card h2, .card h3 { margin: 0 0 10px; }
.hero-balance { font-size: clamp(2rem, 8vw, 3.8rem); font-weight: 800; letter-spacing: -.05em; }
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.drinks { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.drink-btn { min-height: 112px; border: 0; border-radius: 18px; background: #111827; color: #fff; padding: 14px; text-align: left; box-shadow: 0 6px 20px rgba(17,24,39,.15); }
.drink-btn .emoji { font-size: 2rem; display: block; margin-bottom: 8px; }
.drink-btn .name { font-weight: 800; font-size: 1.15rem; }
.drink-btn .price { opacity: .75; margin-top: 3px; }
.btn, .ghost, .danger { border-radius: 12px; padding: 10px 14px; border: 1px solid var(--border); background: #fff; color: #111827; font-weight: 650; }
.btn.primary { background: #111827; color: #fff; border-color: #111827; }
.btn.success { background: #047857; color: #fff; border-color: #047857; }
.danger { color: var(--danger); border-color: #fecaca; background: #fff7f7; }
.small { padding: 7px 10px; font-size: .88rem; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 10px; }
label { font-size: .86rem; color: var(--muted); font-weight: 650; }
input, select, textarea { width: 100%; border: 1px solid #d1d5db; border-radius: 12px; padding: 11px 12px; background: #fff; color: #111827; }
.form-row { display: grid; gap: 6px; }
.list { display: grid; gap: 8px; }
.list-item { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 8px; font-size: .78rem; font-weight: 700; background: #f3f4f6; }
.badge.ok { background: #ecfdf5; color: #065f46; }
.badge.warn { background: #fffbeb; color: #92400e; }
.badge.danger { background: #fef2f2; color: #991b1b; }
.kpi { background: #f9fafb; border-radius: 14px; padding: 12px; }
.kpi .value { font-weight: 800; font-size: 1.35rem; }
.kpi .label { color: var(--muted); font-size: .82rem; margin-top: 3px; }
.bottom-nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 2px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); backdrop-filter: blur(18px); border-top: 1px solid var(--border); }
.bottom-nav button { width: min(22vw, 150px); border: 0; background: transparent; border-radius: 12px; padding: 7px 4px; color: var(--muted); font-size: 1.15rem; }
.bottom-nav button span { display: block; font-size: .72rem; margin-top: 2px; }
.bottom-nav button.active { background: #f3f4f6; color: #111827; }
.toast { position: fixed; z-index: 100; left: 50%; transform: translateX(-50%); bottom: 92px; background: #111827; color: #fff; padding: 11px 14px; border-radius: 12px; max-width: min(90vw, 520px); box-shadow: 0 12px 28px rgba(0,0,0,.25); }
.offline { color: var(--warning); }
.synced { color: var(--success); }
.strike { text-decoration: line-through; opacity: .55; }
hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
code.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88rem; word-break: break-all; }
.auth-wrap { max-width: 520px; margin: 8vh auto 0; }
.tabline { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.tabline button { white-space: nowrap; }
@media (max-width: 600px) {
  .container { padding: 12px; }
  .grid.two, .grid.three { grid-template-columns: 1fr 1fr; }
  .drinks { grid-template-columns: 1fr 1fr; }
  .drink-btn { min-height: 102px; }
}
.target-picker { border: 1px solid #d1d5db; border-radius: 12px; background: #fff; }
.target-picker summary { list-style: none; cursor: pointer; padding: 11px 12px; font-weight: 700; }
.target-picker summary::-webkit-details-marker { display: none; }
.target-picker summary::after { content: '▾'; float: right; color: var(--muted); }
.target-picker[open] summary::after { content: '▴'; }
.target-options { border-top: 1px solid var(--border); padding: 8px; display: grid; gap: 4px; max-height: 280px; overflow-y: auto; }
.target-option { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 9px; color: #111827; cursor: pointer; }
.target-option:hover { background: #f9fafb; }
.target-option input { width: auto; margin: 0; }
.notice { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: #f9fafb; }
.attendance-list { margin-top: 8px; font-size: .88rem; line-height: 1.55; }
button:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 600px) {
  .training-item { flex-direction: column; }
  .training-item > .stack { width: 100%; grid-template-columns: repeat(3, 1fr); }
}
