:root {
  --bg: #15131f;
  --panel: rgba(255,255,255,.92);
  --panel-soft: rgba(255,255,255,.74);
  --text: #16121f;
  --muted: #6f6878;
  --accent: #ff7b54;
  --accent-2: #ffd7aa;
  --danger: #b83232;
  --shadow: 0 24px 70px rgba(0,0,0,.24);
  --radius: 28px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, rgba(255,123,84,.36), transparent 35%),
    radial-gradient(circle at 92% 18%, rgba(255,215,170,.28), transparent 32%),
    linear-gradient(135deg, #15131f 0%, #2e2438 52%, #5d3444 100%);
  min-height: 100vh;
}

button, input { font: inherit; }
button { cursor: pointer; }

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(20px, env(safe-area-inset-top)) 20px 8px;
  color: white;
  max-width: 1040px;
  margin: 0 auto;
}
.app-header h1 { margin: 0; font-size: clamp(2rem, 7vw, 3.6rem); letter-spacing: -0.05em; }
.brand-line { opacity: .74; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.app-shell { max-width: 1040px; margin: 0 auto; padding: 12px 20px 42px; }
.hero-card, .panel, .setup-card {
  background: var(--panel);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.45);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 26px; margin-bottom: 18px; }
.hero-card h2 { margin: 4px 0 6px; font-size: clamp(1.7rem, 5vw, 3rem); line-height: .98; letter-spacing: -.04em; }
.hero-card p { margin: 0; color: var(--muted); font-size: 1.05rem; }
.clock-pill { flex: 0 0 auto; color: white; background: linear-gradient(135deg, #252134, #5d3444); padding: 18px 20px; border-radius: 22px; font-size: clamp(1.6rem, 6vw, 2.8rem); font-weight: 800; letter-spacing: -.05em; }

.panel { padding: 22px; margin: 18px 0; }
.panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.panel-header.compact { align-items: center; }
.panel h2 { margin: 0; letter-spacing: -.03em; font-size: clamp(1.4rem, 4vw, 2rem); }
.eyebrow { margin: 0 0 5px; text-transform: uppercase; letter-spacing: .11em; color: var(--accent); font-size: .78rem; font-weight: 800; }
.muted { color: var(--muted); line-height: 1.45; }
.duration { font-weight: 900; font-size: clamp(2.2rem, 10vw, 4.5rem); letter-spacing: -.06em; color: var(--accent); }

.person-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.person-card { border: 0; background: #fff; color: var(--text); padding: 16px 14px; border-radius: 18px; box-shadow: 0 8px 24px rgba(0,0,0,.08); text-align: left; font-weight: 800; min-height: 66px; transition: transform .12s ease, background .12s ease; }
.person-card small { display: block; color: var(--muted); font-weight: 600; margin-top: 4px; }
.person-card.selected { background: var(--accent); color: white; transform: translateY(-2px); }
.person-card.selected small { color: rgba(255,255,255,.78); }

label { display: block; margin: 12px 0; }
label span { display: block; font-size: .82rem; font-weight: 800; color: var(--muted); margin-bottom: 6px; }
input { width: 100%; border: 1px solid rgba(0,0,0,.12); border-radius: 16px; padding: 14px 15px; background: white; outline: none; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255,123,84,.16); }
.full-width { width: 100%; }
.manual-person { background: var(--panel-soft); border-radius: 18px; padding: 12px 14px; margin: 8px 0 14px; }
.manual-person summary { font-weight: 800; color: var(--muted); cursor: pointer; }

.primary-button, .danger-button, .ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  font-weight: 900;
}
.primary-button { background: linear-gradient(135deg, var(--accent), #ff9c62); color: white; box-shadow: 0 12px 28px rgba(255,123,84,.28); }
.primary-button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.danger-button { background: var(--danger); color: white; width: 100%; margin-top: 8px; font-size: 1.2rem; padding: 18px 20px; }
.ghost-button { background: rgba(255,255,255,.18); color: white; border: 1px solid rgba(255,255,255,.25); }
.panel .ghost-button { color: var(--text); background: white; border: 1px solid rgba(0,0,0,.08); }
.ghost-button.small { padding: 10px 14px; font-size: .88rem; }
.wide { width: 100%; font-size: 1.2rem; padding: 18px 20px; }

.today-list { display: grid; gap: 10px; }
.today-row { display: grid; grid-template-columns: minmax(120px, 1fr) auto auto; gap: 12px; align-items: center; background: white; border-radius: 18px; padding: 13px 14px; }
.today-row strong { display: block; }
.today-row span, .empty { color: var(--muted); }
.badge { background: #f4efe8; color: #6d4a34; border-radius: 999px; padding: 6px 10px; font-weight: 800; }

.toast { position: fixed; left: 16px; right: 16px; bottom: 20px; max-width: 520px; margin: 0 auto; background: #15131f; color: white; border-radius: 18px; padding: 14px 16px; box-shadow: var(--shadow); text-align: center; font-weight: 800; }

.setup-page { display: grid; place-items: center; padding: 24px; }
.setup-shell { width: min(520px, 100%); }
.setup-card { padding: 34px; }
.setup-card h1 { margin: 4px 0 8px; font-size: clamp(2rem, 8vw, 3.2rem); letter-spacing: -.05em; }
.brand-mark { font-weight: 900; color: white; background: #15131f; display: inline-flex; border-radius: 999px; padding: 8px 14px; margin-bottom: 18px; }
.lead { color: var(--muted); line-height: 1.45; }
.notice.error { background: #ffe8e8; color: #8a1f1f; border-radius: 14px; padding: 12px 14px; margin: 16px 0; font-weight: 800; }
.setup-form .primary-button { width: 100%; margin-top: 8px; }

@media (max-width: 680px) {
  .app-header { align-items: flex-start; }
  .hero-card { align-items: flex-start; flex-direction: column; }
  .clock-pill { align-self: flex-start; }
  .today-row { grid-template-columns: 1fr; }
}
.active-list { display: grid; gap: 12px; }
.active-row { background: white; border-radius: 20px; padding: 15px; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; }
.active-row h3 { margin: 0; font-size: 1.2rem; }
.active-meta { color: var(--muted); margin-top: 4px; }
.active-row .duration { font-size: 2rem; }
.active-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.active-actions .danger-button { width: auto; margin-top: 0; font-size: 1rem; padding: 14px 18px; }
@media (max-width: 680px) { .active-row { grid-template-columns: 1fr; } .active-actions { grid-template-columns: 1fr; } .active-actions .danger-button { width: 100%; } }
