:root {
  --bg: #070707;
  --card: #151515;
  --card-2: #1d1d1f;
  --text: #f5f5f7;
  --muted: #a1a1aa;
  --accent: #ff453a;
  --accent-2: #0a84ff;
  --border: rgba(255,255,255,0.09);
  --success: #30d158;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: radial-gradient(circle at top, #15151a, #070707 55%); color: var(--text); }
body { min-height: 100vh; }
button, input, select { font: inherit; }
button { cursor: pointer; border: 0; border-radius: 16px; padding: 14px 16px; background: #2c2c2e; color: var(--text); }
button.primary { background: var(--accent); color: white; font-weight: 700; }
button.ghost { background: transparent; border: 1px solid var(--border); }
button.small { padding: 8px 12px; border-radius: 12px; }
input, select {
  width: 100%; border: 1px solid var(--border); background: #101012; color: var(--text);
  border-radius: 14px; padding: 14px 12px;
}

.app-shell {
  max-width: 820px;
  margin: 0 auto;
  padding: calc(20px + env(safe-area-inset-top)) 16px calc(30px + env(safe-area-inset-bottom));
}
.card {
  background: rgba(21,21,21,0.9);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.25);
}
.hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.eyebrow { margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
h1, h2 { margin: 0; }
.subtext { color: var(--muted); line-height: 1.45; }
.pill { padding: 10px 14px; border-radius: 999px; background: #2c2c2e; white-space: nowrap; font-weight: 700; }
.pill.active { background: rgba(48,209,88,.15); color: var(--success); }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.field span { color: var(--muted); font-size: 14px; }
.grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checkbox-row { flex-direction: row; align-items: center; gap: 10px; }
.checkbox-row input { width: auto; transform: scale(1.25); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions.compact { margin-top: 10px; }
.status-row { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.status-row:last-child { border-bottom: none; }
.label { color: var(--muted); }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
#log { display: flex; flex-direction: column; gap: 10px; max-height: 280px; overflow: auto; }
.log-entry { background: var(--card-2); border: 1px solid var(--border); border-radius: 16px; padding: 12px; }
.log-time { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.log-message { line-height: 1.45; }
.alarm-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 9999;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.alarm-overlay.hidden { display: none; }
.alarm-content {
  width: min(100%, 520px);
  background: linear-gradient(180deg, rgba(255,69,58,.16), rgba(255,69,58,.06));
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 30px; padding: 28px; text-align: center;
  animation: pulse 1s infinite alternate;
}
.alarm-time { font-size: clamp(42px, 10vw, 76px); font-weight: 800; letter-spacing: .06em; margin-bottom: 8px; }
.alarm-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.025); } }
@media (max-width: 640px) {
  .hero { flex-direction: column; }
  .grid.two { grid-template-columns: 1fr; }
}
