:root {
  color-scheme: light dark;
  --bg: #f8f1f4;
  --surface: rgba(255, 255, 255, 0.92);
  --text: #2a1520;
  --muted: #745c68;
  --accent: #8d2755;
  --accent-strong: #5d1738;
  --border: rgba(93, 23, 56, 0.12);
  --good: #1d7a4c;
  --bad: #b13b37;
  --steady: #76666f;
  --shadow: 0 16px 45px rgba(63, 20, 41, 0.10);
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(240, 173, 195, 0.42), transparent 33rem),
    linear-gradient(180deg, #fff9fb 0%, var(--bg) 30rem);
  color: var(--text);
  font-family: ui-rounded, -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hero {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  padding: max(3.5rem, env(safe-area-inset-top)) 1.25rem 1.8rem;
  overflow: hidden;
}

.petals {
  position: absolute;
  right: 1rem;
  top: 1.6rem;
  font-size: 7rem;
  line-height: 1;
  color: rgba(141, 39, 85, 0.12);
  transform: rotate(12deg);
}

.eyebrow, .kicker {
  margin: 0;
  color: var(--accent);
  font-weight: 800;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0.25rem 0 0;
  max-width: 10ch;
  font-size: clamp(2.6rem, 11vw, 5rem);
  line-height: 0.92;
  letter-spacing: -0.06em;
}

.updated {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.shell {
  width: min(100% - 1.5rem, 780px);
  margin: 0 auto;
  padding-bottom: 3rem;
}

.card {
  margin-bottom: 1rem;
  padding: 1.2rem;
  border: 1px solid var(--border);
  border-radius: 1.4rem;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.headline {
  overflow: hidden;
}

.headline.primary {
  border: 2px solid rgba(141, 39, 85, 0.28);
  background:
    linear-gradient(145deg, rgba(255,255,255,.98), rgba(255,240,246,.96));
}

.headline.jal {
  border-color: rgba(151, 23, 35, 0.28);
}

.headline-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.headline h2 {
  margin: 0.25rem 0 0;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.badge {
  flex: 0 0 auto;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-strong);
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.dates {
  margin: 1.1rem 0 0.2rem;
  font-size: 1.08rem;
  font-weight: 750;
}

.flight {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.fare-grid, .compact-grid {
  display: grid;
  grid-template-columns: minmax(5.5rem, 1fr) auto minmax(8.5rem, auto);
  gap: 0.65rem 0.75rem;
  align-items: baseline;
  margin-top: 1.25rem;
  font-variant-numeric: tabular-nums;
}

.fare-grid {
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.who { font-weight: 760; }
.days { color: var(--muted); text-align: right; white-space: nowrap; }
.price { text-align: right; white-space: nowrap; font-weight: 850; }

.change-down { color: var(--good); }
.change-up { color: var(--bad); }
.change-flat, .change-new { color: var(--steady); }

.button {
  display: block;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 0.95rem;
  background: var(--accent-strong);
  color: white;
  text-align: center;
  text-decoration: none;
  font-weight: 800;
}

.button[hidden] { display: none; }

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 2rem 0 0.75rem;
  padding: 0 0.25rem;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.2rem;
}

.section-heading span {
  color: var(--muted);
  font-size: 0.8rem;
}

.options-card { padding: 0; overflow: hidden; }

.option {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
}

.option:last-child { border-bottom: 0; }

.option-title {
  display: flex;
  gap: 0.75rem;
  align-items: start;
}

.option-rank {
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: rgba(141,39,85,.1);
  color: var(--accent);
  font-weight: 900;
}

.option-title strong {
  display: block;
  font-size: 0.95rem;
}

.option-flight {
  color: var(--muted);
  font-size: 0.82rem;
}

.compact-grid {
  margin: 0.85rem 0 0 2.55rem;
  font-size: 0.88rem;
}

.compact-grid span:nth-child(3n+2),
.compact-grid span:nth-child(3n) {
  text-align: right;
  white-space: nowrap;
}

.trend p {
  margin: 0.5rem 0 0;
  line-height: 1.5;
}

.status-card {
  min-height: 9rem;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}

.loader {
  width: 2rem;
  height: 2rem;
  border: 3px solid rgba(141,39,85,.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.stale {
  border-color: rgba(177,59,55,.35);
}

.stale-banner {
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 1rem;
  background: rgba(177,59,55,.1);
  color: var(--bad);
  font-weight: 750;
}

footer {
  padding: 1rem 1rem max(2rem, env(safe-area-inset-bottom));
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #160d12;
    --surface: rgba(37, 20, 29, 0.94);
    --text: #fff4f8;
    --muted: #c6aab7;
    --accent: #f5a6c1;
    --accent-strong: #a83b68;
    --border: rgba(255, 219, 232, 0.12);
    --shadow: 0 20px 50px rgba(0,0,0,.25);
    --good: #77d6a6;
    --bad: #ff9892;
    --steady: #c3adb7;
  }

  body {
    background:
      radial-gradient(circle at top right, rgba(148, 43, 85, 0.35), transparent 32rem),
      linear-gradient(180deg, #211119 0%, var(--bg) 30rem);
  }

  .headline.primary {
    background:
      linear-gradient(145deg, rgba(47,25,36,.98), rgba(54,22,36,.96));
  }
}

@media (max-width: 420px) {
  .fare-grid, .compact-grid {
    grid-template-columns: minmax(4.8rem, 1fr) auto minmax(7.8rem, auto);
    column-gap: 0.45rem;
  }

  .card { padding: 1rem; }
  .price { font-size: 0.94rem; }
}


.notification-card h2 {
  margin: 0.25rem 0 0.45rem;
  font-size: 1.3rem;
}

.notification-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.device-label {
  display: grid;
  gap: 0.4rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.device-label input {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  background: rgba(255,255,255,.65);
  color: var(--text);
  font: inherit;
}

.notification-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.button-native {
  border: 0;
  cursor: pointer;
  margin-top: 0;
}

.button-secondary,
.button-quiet {
  margin-top: 0;
  border: 1px solid var(--border);
  cursor: pointer;
}

.button-secondary {
  background: transparent;
  color: var(--accent-strong);
}

.button-quiet {
  background: transparent;
  color: var(--muted);
}

.notification-status {
  min-height: 1.4rem;
  margin-top: 0.8rem !important;
  font-size: 0.86rem;
}

.notification-card.enabled {
  border-color: rgba(29, 122, 76, 0.3);
}

.notification-card.unsupported {
  opacity: 0.78;
}

@media (prefers-color-scheme: dark) {
  .device-label input {
    background: rgba(0,0,0,.18);
  }

  .button-secondary {
    color: var(--accent);
  }
}


.ai-summary {
  position: relative;
  overflow: hidden;
}

.ai-summary::after {
  content: "✦";
  position: absolute;
  right: 1rem;
  bottom: -0.6rem;
  color: rgba(141, 39, 85, 0.09);
  font-size: 5rem;
  line-height: 1;
}

.ai-summary-top,
.daily-screen-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.ai-summary h2 {
  margin: 0.3rem 0 0;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
}

.ai-summary-copy {
  position: relative;
  z-index: 1;
  margin: 0.9rem 0 0;
  max-width: 60ch;
  line-height: 1.55;
}

.ai-summary-meta {
  position: relative;
  z-index: 1;
  margin: 0.8rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.status-pill {
  flex: 0 0 auto;
  padding: 0.38rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.verdict-watch .status-pill {
  background: rgba(118, 102, 111, 0.13);
  color: var(--steady);
}

.verdict-consider {
  border-color: rgba(141, 39, 85, 0.32);
}

.verdict-consider .status-pill {
  background: rgba(141, 39, 85, 0.13);
  color: var(--accent);
}

.verdict-urgent {
  border-color: rgba(177, 59, 55, 0.42);
}

.verdict-urgent .status-pill {
  background: rgba(177, 59, 55, 0.14);
  color: var(--bad);
}

.daily-screen {
  box-shadow: none;
}

.daily-screen-top span {
  color: var(--muted);
  font-size: 0.78rem;
  text-align: right;
}

.daily-screen > p {
  margin: 0.65rem 0 0;
  line-height: 1.5;
}
