:root {
  --color-bg: #f3f0e8;
  --color-surface: #fffdf8;
  --color-surface-strong: #12324a;
  --color-text: #10202f;
  --color-text-muted: #4d6070;
  --color-accent: #1f6c8b;
  --color-accent-strong: #0d5470;
  --color-border: #cfd8df;
  --color-shadow: rgba(10, 28, 40, 0.14);
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --radius-sm: 0.75rem;
  --radius-md: 1.25rem;
  --radius-lg: 1.75rem;
  --shadow-card: 0 20px 40px var(--color-shadow);
  --font-body: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --max-width: 32rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  width: 100%;
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  width: 100%;
  min-width: 320px;
  min-height: 100svh;
  max-width: 100%;
  overflow-x: hidden;
  font-family: var(--font-body);
  color: var(--color-text);
  background:
    radial-gradient(circle at top, rgba(31, 108, 139, 0.14), transparent 40%),
    linear-gradient(180deg, #f8f5ee 0%, var(--color-bg) 100%);
}

@supports (min-height: 100dvh) {
  body {
    min-height: 100dvh;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

.app-shell {
  width: 100%;
  max-width: 100%;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding:
    max(var(--space-4), env(safe-area-inset-top))
    max(var(--space-4), env(safe-area-inset-right))
    max(var(--space-4), env(safe-area-inset-bottom))
    max(var(--space-4), env(safe-area-inset-left));
  overflow-x: clip;
}

@supports (min-height: 100dvh) {
  .app-shell {
    min-height: 100dvh;
  }
}

.hero {
  width: 100%;
  max-width: var(--max-width);
  min-width: 0;
  margin-inline: auto;
}

.hero__header {
  margin-bottom: var(--space-5);
  min-width: 0;
}

.hero__eyebrow {
  margin: 0 0 var(--space-2);
  color: var(--color-text-muted);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero__header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 3rem);
  line-height: 1.05;
}

.countdown-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: var(--color-surface);
  border: 1px solid rgba(18, 50, 74, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-5);
  overflow: hidden;
}

.countdown-card__label {
  margin: 0 0 var(--space-3);
  color: var(--color-text-muted);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.countdown-card__value {
  font-family: var(--font-display);
  font-size: clamp(4rem, 18vw, 5.5rem);
  line-height: 0.95;
  color: var(--color-surface-strong);
}

.countdown-card__value--facility {
  font-size: clamp(2.25rem, 11vw, 3.25rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.countdown-card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin: var(--space-5) 0 var(--space-4);
}

.countdown-card__meta dt {
  margin-bottom: var(--space-2);
  color: var(--color-text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.countdown-card__meta dd {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.countdown-card__status {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.actions {
  margin-top: var(--space-5);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.button {
  width: 100%;
  min-height: 3.75rem;
  border: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.button--primary {
  background: linear-gradient(180deg, var(--color-accent), var(--color-accent-strong));
  color: #fff;
  box-shadow: 0 14px 28px rgba(13, 84, 112, 0.28);
  font-size: 1.125rem;
  font-weight: 700;
}

.button--primary:hover {
  transform: translateY(-1px);
}

.button--secondary {
  min-height: 2.75rem;
  border: 1px solid rgba(18, 50, 74, 0.18);
  background: #fff;
  color: var(--color-surface-strong);
  font-size: 0.95rem;
  font-weight: 700;
}

.button:focus-visible {
  outline: 3px solid rgba(31, 108, 139, 0.35);
  outline-offset: 4px;
}

.status-text {
  margin: var(--space-4) 0 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.debug-panel {
  margin-top: var(--space-5);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
}

.debug-panel summary {
  cursor: pointer;
  font-weight: 700;
}

.debug-panel__copy {
  margin-top: var(--space-4);
}

.debug-panel pre {
  margin: var(--space-4) 0 0;
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: auto;
  font-size: 0.875rem;
  line-height: 1.5;
}

.button[disabled] {
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
}

@media (max-width: 480px) {
  :root {
    --max-width: 100%;
    --space-4: 0.875rem;
    --space-5: 1rem;
    --space-6: 1.25rem;
    --radius-md: 1rem;
    --radius-lg: 1.25rem;
    --shadow-card: 0 14px 28px rgba(10, 28, 40, 0.1);
  }

  .app-shell {
    display: block;
    width: 100%;
    max-width: 100%;
    align-items: start;
    padding: 0.75rem 0.75rem 1rem;
    overflow-x: hidden;
  }

  @supports (padding: max(0px)) {
    .app-shell {
      padding:
        max(0.75rem, env(safe-area-inset-top))
        max(0.75rem, env(safe-area-inset-right))
        max(1rem, env(safe-area-inset-bottom))
        max(0.75rem, env(safe-area-inset-left));
    }
  }

  .hero {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .hero__header {
    margin-bottom: var(--space-4);
  }

  .hero__eyebrow {
    font-size: 0.78rem;
    letter-spacing: 0.055em;
  }

  .hero__header h1 {
    font-size: clamp(1.9rem, 9vw, 2.35rem);
  }

  .countdown-card {
    padding: var(--space-4);
  }

  .countdown-card__label {
    margin-bottom: var(--space-2);
    font-size: 0.78rem;
  }

  .countdown-card__value {
    font-size: clamp(3rem, 18vw, 4.15rem);
  }

  .countdown-card__value--facility {
    font-size: clamp(1.7rem, 9vw, 2.35rem);
  }

  .countdown-card__meta {
    gap: var(--space-3);
    margin: var(--space-4) 0 var(--space-3);
  }

  .countdown-card__meta dt {
    margin-bottom: var(--space-1);
    font-size: 0.75rem;
  }

  .countdown-card__meta dd {
    font-size: 1rem;
  }

  .countdown-card__status,
  .status-text {
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .actions {
    margin-top: var(--space-4);
  }

  .button {
    min-height: 3.25rem;
  }

  .button--primary {
    font-size: 1rem;
  }

  .debug-panel {
    margin-top: var(--space-4);
    padding: var(--space-3) var(--space-4);
  }
}
