/* =========================================================
   Lull — Sleep Sounds & Alarms
   Visual layer stylesheet
   Dark Mode + Organic Biophilic (solid surfaces, no blur)
   ========================================================= */

/* ---------- Reset & tokens ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Color palette */
  --bg-base: #0a0a16;
  --bg-surface: #12122a;
  --bg-elevated: #1a1a35;

  --primary: #6366f1;
  --primary-deep: #4338ca;
  --accent: #a78bfa;
  --teal: #5eead4;

  --text: #ece9f7;
  --text-dim: #9b97bc;
  --text-faint: #8b87b3;

  /* Derived helper tokens */
  --primary-glow: rgba(99, 102, 241, 0.3);
  --accent-glow: rgba(167, 139, 250, 0.3);
  --teal-glow: rgba(94, 234, 212, 0.3);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-soft: rgba(255, 255, 255, 0.12);
  --danger: #fda4af;

  /* Typography */
  --font-heading: 'Lora', Georgia, 'Times New Roman', serif;
  --font-body: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Shadow scale */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 24px rgba(99, 102, 241, 0.3);

  /* Border radius scale */
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Easing */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

html {
  color-scheme: dark;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg-base);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* ---------- Animated background ---------- */
/* Subtle drifting gradient — slower, lower opacity */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 20% 18%, rgba(99, 102, 241, 0.18), transparent 50%),
    radial-gradient(circle at 82% 28%, rgba(94, 234, 212, 0.08), transparent 50%),
    radial-gradient(circle at 50% 92%, rgba(167, 139, 250, 0.12), transparent 55%),
    linear-gradient(160deg, var(--bg-base) 0%, #08081a 100%);
  background-size: 185% 185%, 185% 185%, 185% 185%, 100% 100%;
  background-position: 0% 0%, 100% 0%, 50% 100%, 0 0;
  animation: drift 35s var(--ease) infinite alternate;
}

/* Single subtle radial glow replacing the starfield */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 30%, rgba(99, 102, 241, 0.08), transparent 60%);
}

@keyframes drift {
  0%   { background-position: 0% 0%,   100% 0%, 50% 100%, 0 0; }
  100% { background-position: 22% 18%, 74% 24%, 50% 82%,  0 0; }
}

/* ---------- App shell ---------- */
.app {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 30px 20px 52px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 100vh;
}

/* ---------- Header ---------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  color: var(--accent);
  filter: drop-shadow(0 0 14px var(--accent-glow));
}

.brand-logo svg {
  width: 32px;
  height: 32px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand-tagline {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 300;
  letter-spacing: 0.05em;
}

/* ---------- Tabs (segmented pill) ---------- */
.tabs {
  display: flex;
  gap: 4px;
  padding: 5px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}

.tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  padding: 12px 8px;
  min-height: 44px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.25s var(--ease), background 0.25s var(--ease),
              box-shadow 0.25s var(--ease);
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.tab-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ---------- Views ---------- */
.views {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.view {
  display: none;
  flex-direction: column;
  gap: 18px;
}

.view.active {
  display: flex;
  animation: fadeUp 0.4s var(--ease);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Cards (solid elevated surfaces) ---------- */
.glass,
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

.card {
  padding: 22px;
}

.section-title {
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--text-faint);
  margin-bottom: 16px;
}

/* ---------- Clock ---------- */
.clock-card {
  padding: 36px 24px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.clock-card::before {
  content: '';
  position: absolute;
  top: -45%;
  left: 50%;
  transform: translateX(-50%);
  width: 130%;
  aspect-ratio: 1;
  background: radial-gradient(circle, var(--primary-glow), transparent 62%);
  opacity: 0.5;
  pointer-events: none;
}

.current-time {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 10vw, 3.5rem);
  font-weight: 200;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--text);
  position: relative;
}

.current-date {
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--text-dim);
  letter-spacing: 0.07em;
  text-transform: capitalize;
  position: relative;
}

/* ---------- Forms ---------- */
.form-row {
  display: flex;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
  flex: 1;
  min-width: 0;
}

.field-label {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 400;
  letter-spacing: 0.03em;
}

input[type="text"],
input[type="time"],
input[type="number"],
select {
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  width: 100%;
  transition: border 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}

input::placeholder {
  color: var(--text-faint);
}

input:hover,
select:hover {
  border-color: var(--border-soft);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--bg-elevated);
}

/* Custom select chevron */
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239b97bc' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

option {
  background-color: var(--bg-surface);
  color: var(--text);
}

/* ---------- Buttons ---------- */
.btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease),
              background 0.25s var(--ease), opacity 0.2s var(--ease);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  background: var(--primary-deep);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: #22224a;
  border-color: var(--border-soft);
}

.btn-block {
  width: 100%;
}

/* Icon-only button — 44x44 min touch target */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 10px;
  border-radius: var(--radius-sm);
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease),
              border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.icon-btn:hover {
  color: var(--text);
  background: #22224a;
  border-color: var(--border-soft);
}

.icon-btn:active {
  transform: scale(0.97);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* ---------- Sound select + preview row ---------- */
.sound-select-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.sound-select-row select {
  flex: 1;
  min-width: 0;
}

.preview-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  white-space: nowrap;
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease),
              box-shadow 0.2s var(--ease), transform 0.2s var(--ease), color 0.2s var(--ease);
}

.preview-btn:active {
  transform: scale(0.97);
}

.preview-btn .preview-icon {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.preview-btn .preview-icon svg {
  width: 14px;
  height: 14px;
}

.preview-btn.playing {
  background: rgba(94, 234, 212, 0.12);
  border-color: var(--teal);
  color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-glow);
  animation: preview-pulse 1.6s ease-in-out infinite;
}

.preview-btn.playing:hover {
  background: rgba(94, 234, 212, 0.2);
}

@keyframes preview-pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--teal-glow); }
  50%      { box-shadow: 0 0 0 6px rgba(94, 234, 212, 0.12); }
}

/* ---------- Day toggles ---------- */
.day-toggles {
  display: flex;
  gap: 6px;
}

.day-toggle {
  flex: 1;
  aspect-ratio: 1;
  min-width: 44px;
  min-height: 44px;
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.2s var(--ease), background 0.2s var(--ease),
              border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.day-toggle:hover {
  color: var(--text);
  border-color: var(--border-soft);
}

.day-toggle.selected {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}

/* ---------- Alarm list ---------- */
.time-picker-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

.time-field input {
  font-family: var(--font-heading) !important;
  font-size: 2.2rem !important;
  font-weight: 300 !important;
  text-align: center;
  letter-spacing: 0.08em;
  padding: 16px 14px !important;
  font-variant-numeric: tabular-nums;
  color: var(--text) !important;
}

.label-field input {
  padding: 14px 16px !important;
}

/* ---------- Alarm list ---------- */
.alarm-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alarm-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.alarm-item:hover {
  background: #22224a;
  border-color: var(--border-soft);
}

.alarm-time-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 88px;
}

.alarm-time {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: var(--text);
}

.alarm-sound-badge {
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  line-height: 1.4;
}

.alarm-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.alarm-label {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alarm-repeat {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.alarm-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.alarm-delete {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.alarm-delete svg {
  width: 18px;
  height: 18px;
}

.alarm-delete:hover {
  color: var(--danger);
  background: rgba(244, 63, 94, 0.14);
}

/* ---------- Toggle switch ---------- */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.slider {
  position: absolute;
  inset: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}

.slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s var(--ease);
  box-shadow: var(--shadow-sm);
}

.switch input:checked + .slider {
  background: var(--primary);
  border-color: transparent;
}

.switch input:checked + .slider::before {
  transform: translate(20px, -50%);
}

.switch input:focus-visible + .slider {
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ---------- Sounds ---------- */
.now-playing-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.now-playing-label {
  font-size: 0.72rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.now-playing {
  font-size: 0.95rem;
  color: var(--teal);
  font-weight: 500;
}

.sound-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.sound-card {
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 16px 10px;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: transform 0.22s var(--ease), box-shadow 0.25s var(--ease),
              background 0.25s var(--ease), border-color 0.25s var(--ease);
}

.sound-card:hover {
  transform: translateY(-3px);
  background: var(--bg-elevated);
  border-color: rgba(99, 102, 241, 0.4);
  box-shadow: var(--shadow-md);
}

.sound-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  color: var(--accent);
}

.sound-card-icon svg {
  width: 28px;
  height: 28px;
}

.sound-card-label {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--text-dim);
}

.sound-card.playing {
  background: var(--bg-elevated);
  border-color: var(--teal);
  box-shadow: 0 0 0 2px var(--teal-glow), var(--shadow-glow);
}

.sound-card.playing .sound-card-icon {
  color: var(--teal);
}

.sound-card.playing .sound-card-label {
  color: var(--text);
  font-weight: 500;
}

.sound-card.playing .sound-card-icon {
  animation: floaty 2.6s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

/* Sound controls */
.sound-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}

.volume-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.volume-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.volume-label svg {
  width: 18px;
  height: 18px;
}

/* Range slider */
#volume-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
  padding: 0;
  border: none;
  cursor: pointer;
}

#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

#volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.18);
}

#volume-slider:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 5px var(--primary-glow);
}

#volume-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

#volume-slider::-moz-range-track {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated);
}

#volume-slider:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 5px var(--primary-glow);
}

/* ---------- Timer ---------- */
.timer-card {
  text-align: center;
  padding: 38px 22px 30px;
}

.timer-display {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 13vw, 4.5rem);
  font-weight: 200;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-bottom: 26px;
}

.timer-presets {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 18px;
}

.preset-btn {
  appearance: none;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  min-width: 52px;
  height: 42px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease),
              background 0.2s var(--ease), transform 0.2s var(--ease);
}

.preset-btn:active {
  transform: scale(0.97);
}

.preset-btn:hover {
  color: var(--text);
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.12);
}

.timer-field {
  align-items: center;
  max-width: 160px;
  margin: 0 auto 20px;
}

.timer-field input {
  text-align: center;
}

.timer-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.timer-actions .btn {
  flex: 1;
}

/* ---------- Alarm overlay ---------- */
.alarm-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 5, 12, 0.85);
  opacity: 0;
  visibility: hidden;
  transform: scale(1.04);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), visibility 0.3s var(--ease);
}

.alarm-overlay.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.alarm-overlay-content {
  text-align: center;
  padding: 42px 30px;
  max-width: 360px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.alarm-overlay-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  color: var(--accent);
  filter: drop-shadow(0 0 18px var(--accent-glow));
  animation: ring 1.1s ease-in-out infinite;
}

.alarm-overlay-icon svg {
  width: 48px;
  height: 48px;
}

@keyframes ring {
  0%, 100% { transform: rotate(0); }
  20%      { transform: rotate(-13deg); }
  40%      { transform: rotate(13deg); }
  60%      { transform: rotate(-8deg); }
  80%      { transform: rotate(8deg); }
}

.alarm-overlay-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text);
}

.alarm-overlay-label {
  color: var(--text-dim);
  font-weight: 300;
}

.alarm-overlay-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  width: 100%;
}

.alarm-overlay-actions .btn {
  flex: 1;
}

/* ---------- Alarm empty state ---------- */
.alarm-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 36px 20px;
  text-align: center;
}

.alarm-empty-state svg {
  width: 36px;
  height: 36px;
  color: var(--text-faint);
  opacity: 0.6;
}

.alarm-empty-state-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-dim);
}

.alarm-empty-state-subtitle {
  font-size: 0.82rem;
  color: var(--text-faint);
}

/* ---------- Disabled alarm state ---------- */
.alarm-item.disabled {
  opacity: 0.5;
}

.alarm-item.disabled .alarm-time {
  text-decoration: line-through;
  text-decoration-color: var(--text-faint);
}

.alarm-item.disabled .alarm-sound-badge {
  opacity: 0.6;
}

/* ---------- Wake lock button ---------- */
.wake-lock-control {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  width: 100%;
}

.wake-lock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.wake-lock-btn svg {
  width: 18px;
  height: 18px;
}

.wake-lock-btn.active {
  background: rgba(94, 234, 212, 0.12);
  border-color: var(--teal);
  color: var(--teal);
}

/* ---------- Focus & accessibility ---------- */
.tab:focus-visible,
.day-toggle:focus-visible,
.preset-btn:focus-visible,
.sound-card:focus-visible,
.btn:focus-visible,
.icon-btn:focus-visible,
.alarm-delete:focus-visible,
.preview-btn:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 360px) {
  .app { padding: 22px 14px 44px; }
  .card { padding: 18px; }
  .sound-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
  .brand-name { font-size: 1.6rem; }
  .brand-logo svg { width: 28px; height: 28px; }
  .tab { font-size: 0.8rem; padding: 9px 4px; }
}

@media (min-width: 600px) {
  .app { padding-top: 44px; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- SEO content pages ---------- */

/* ---------- Minimal nav header ---------- */
.seo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
  font-family: var(--font-body);
}

.seo-logo {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}

.seo-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
}

.seo-nav a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.seo-nav a:hover,
.seo-nav a:focus-visible {
  color: var(--accent);
}

/* ---------- Content page wrapper ---------- */
.seo-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px;
  color: var(--text);
  line-height: 1.7;
}

.seo-page h1 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text);
  line-height: 1.2;
}

.seo-page h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--text);
  line-height: 1.3;
}

.seo-page p {
  margin-bottom: 16px;
  color: var(--text-dim);
}

.seo-page ul,
.seo-page ol {
  margin: 0 0 16px;
  padding-left: 1.4em;
}

.seo-page li {
  margin-bottom: 8px;
  color: var(--text-dim);
}

.seo-page strong {
  color: var(--text);
  font-weight: 600;
}

.seo-page .btn {
  display: inline-block;
  margin-top: 8px;
  text-decoration: none;
}

@media (max-width: 480px) {
  .seo-page h1 { font-size: 1.7rem; }
  .seo-page h2 { font-size: 1.25rem; }
  .seo-nav { gap: 12px; font-size: 0.8rem; }
}
