/* Nightlight Stories web app: phone first, calm night colors. */
:root {
  --bg: #0f1630;
  --card: #1a2347;
  --text: #f3f1ea;
  --muted: #a9b0cc;
  --accent: #f5c96a;
  --ok: #7fd1a8;
  --danger: #f08a8a;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}

main { max-width: 640px; margin: 0 auto; padding: 12px 16px 40px; }

.bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; position: sticky; top: 0; background: var(--bg); z-index: 1;
  border-bottom: 1px solid #26305a;
}
.bar h1 { font-size: 1.15rem; margin: 0; color: var(--accent); }

h2 { font-size: 1.2rem; margin: 0 0 8px; }

.card {
  background: var(--card); border-radius: var(--radius); padding: 16px; margin: 12px 0;
  border: 1px solid #26305a; color: inherit; text-align: left; width: 100%;
}

label { display: block; margin: 10px 0; color: var(--muted); }
input, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 12px; font: inherit;
  border-radius: 10px; border: 1px solid #3a4475; background: #0f1630; color: var(--text);
}

button { font: inherit; cursor: pointer; border-radius: 12px; border: 0; padding: 14px 18px; min-height: 48px; }
button:disabled { opacity: 0.6; cursor: wait; }
.primary { background: var(--ok); color: #0b1d14; font-weight: 600; }
.danger { background: var(--danger); color: #2a0b0b; font-weight: 600; }
.secondary { background: #2b3566; color: var(--text); }
.link { background: none; color: var(--accent); padding: 8px 0; min-height: 0; }

.actions { display: flex; gap: 12px; }
.actions button { flex: 1; }

.queue { list-style: none; margin: 0; padding: 0; }
.queue-item { display: flex; flex-direction: column; gap: 4px; }

.countdown { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 600; }
.countdown.urgent { color: var(--danger); }

.muted { color: var(--muted); font-size: 0.95rem; }
.badge { align-self: flex-start; background: #2b3566; border-radius: 999px; padding: 2px 10px; font-size: 0.85rem; }

.story-text p { margin: 0 0 1em; font-size: 1.05rem; }

.notice { padding: 12px 14px; border-radius: 10px; background: #26305a; }
.notice.ok { background: #1e4a37; }
.notice.error { background: #5a2323; }
.notice.warning, .warning { background: #5a4a23; padding: 12px 14px; border-radius: 10px; }

.summary p { margin: 0 0 6px; }

/* Parent pages */
a { color: var(--accent); }
.brand { color: var(--accent); text-decoration: none; }
.bar a.link { text-decoration: none; font-weight: 600; }

.nav {
  display: flex; gap: 4px; overflow-x: auto; padding: 6px 12px; position: sticky; top: 57px; z-index: 1;
  background: var(--bg); border-bottom: 1px solid #26305a;
}
.nav a {
  flex: 1 0 auto; text-align: center; color: var(--muted); text-decoration: none;
  padding: 10px 12px; border-radius: 10px; min-height: 44px;
}
.nav a.active { background: var(--card); color: var(--text); font-weight: 600; }

.button {
  display: inline-block; text-align: center; text-decoration: none; border-radius: 12px;
  padding: 14px 18px; min-height: 48px;
}
.wide { display: block; width: 100%; margin-top: 12px; }
.actions .button { flex: 1; }

select {
  display: block; width: 100%; margin-top: 6px; padding: 12px; font: inherit;
  border-radius: 10px; border: 1px solid #3a4475; background: #0f1630; color: var(--text);
}
label.check { display: flex; align-items: center; gap: 10px; color: var(--text); }
label.check input { width: 24px; height: 24px; margin: 0; flex: none; }

.consent-text { background: #141c3b; border-radius: 10px; padding: 4px 14px; margin: 8px 0; }
.consent-text p { margin: 10px 0; font-size: 0.95rem; }

.recorder { text-align: center; font-size: 2rem; margin: 8px 0; }
audio { width: 100%; margin: 10px 0; }
.tonight h2 { color: var(--accent); }
details.story-text summary { cursor: pointer; color: var(--accent); padding: 8px 0; }
.demo-note { text-align: center; margin: 4px 0 0; font-size: 0.85rem; }
a.queue-item { text-decoration: none; }

/* Show/Hide button inside each password field (show-password.js). */
.pw-field { position: relative; display: block; }
.pw-field input { padding-right: 76px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); margin-top: 3px;
  min-height: 36px; padding: 6px 12px; border-radius: 8px;
  background: #2b3566; color: var(--text); font-size: 0.9rem;
}
