:root {
  color-scheme: dark;
  --bg: #0b0f19;
  --bg-elevated: #101726;
  --surface: #161f33;
  --surface-strong: #1c2942;
  --surface-soft: rgba(22, 31, 51, 0.74);
  --border: rgba(148, 163, 184, 0.18);
  --border-strong: rgba(148, 163, 184, 0.32);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --blue: #00a3e0;
  --blue-deep: #00205b;
  --blue-soft: rgba(0, 163, 224, 0.14);
  --gold: #d4af37;
  --gold-soft: rgba(212, 175, 55, 0.14);
  --indigo: #818cf8;
  --indigo-soft: rgba(99, 102, 241, 0.16);
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.15);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.15);
  --red: #fb7185;
  --red-soft: rgba(251, 113, 133, 0.13);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 13px;
  --radius-sm: 9px;
  --content-width: 1240px;
  --focus: 0 0 0 3px rgba(0, 163, 224, 0.35);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% -10%, rgba(0, 163, 224, 0.17), transparent 32rem),
    radial-gradient(circle at 90% 18%, rgba(99, 102, 241, 0.1), transparent 28rem),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
}

body.dialog-open {
  overflow: hidden;
}

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

button,
select,
input[type="month"],
input[type="date"],
input[type="checkbox"],
input[type="radio"] {
  cursor: pointer;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.hidden {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  inset-block-start: 10px;
  inset-inline-start: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  font-weight: 800;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  width: min(100%, calc(var(--content-width) + 40px));
  margin: 0 auto;
  padding: 0 20px 32px;
}

.topbar {
  position: sticky;
  z-index: 20;
  inset-block-start: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  margin-inline: -20px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(11, 15, 25, 0.86);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(0, 163, 224, 0.42);
  border-radius: 14px;
  background: linear-gradient(145deg, #07316c, #00205b);
  box-shadow: 0 10px 26px rgba(0, 32, 91, 0.34);
  color: #7dd3fc;
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-copy {
  display: grid;
  line-height: 1.15;
}

.brand-copy strong {
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}

.brand-copy span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.75rem;
}

.top-actions,
.nav-link,
.language-button {
  display: flex;
  align-items: center;
}

.top-actions {
  gap: 6px;
}

.nav-link,
.language-button {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted-strong);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-link:hover,
.language-button:hover {
  border-color: var(--border);
  background: rgba(148, 163, 184, 0.07);
  color: var(--text);
}

.language-button {
  gap: 7px;
  margin-inline-start: 5px;
  border-color: var(--border);
}

.language-button svg {
  width: 17px;
}

.independent-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 0;
  padding: 11px 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-md);
  background: rgba(16, 23, 38, 0.74);
  color: var(--muted-strong);
  font-size: 0.76rem;
}

.independent-notice svg {
  flex: 0 0 auto;
  width: 16px;
  margin-top: 1px;
  color: var(--blue);
}

.independent-notice p {
  margin: 0;
}

main {
  display: grid;
  gap: 28px;
  margin-top: 46px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.section-heading h1,
.section-heading h2,
.matrix-heading h2 {
  margin: 4px 0 0;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.section-heading h1 {
  max-width: 720px;
  font-size: clamp(2rem, 5vw, 3.65rem);
}

.section-heading h2,
.matrix-heading h2 {
  font-size: clamp(1.55rem, 3vw, 2.2rem);
}

.section-heading p:not(.eyebrow),
.matrix-heading p:not(.eyebrow) {
  max-width: 700px;
  margin: 12px 0 0;
  color: var(--muted);
}

.eyebrow {
  margin: 0;
  color: #67e8f9;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

[dir="rtl"] .eyebrow {
  letter-spacing: 0.07em;
}

.horizon-pill,
.source-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(22, 31, 51, 0.72);
  color: var(--muted-strong);
  font-size: 0.75rem;
  font-weight: 800;
}

.horizon-pill svg {
  width: 16px;
  color: var(--blue);
}

.search-card,
.matrix-section,
.alerts-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: linear-gradient(150deg, rgba(22, 31, 51, 0.95), rgba(14, 21, 35, 0.96));
  box-shadow: var(--shadow);
}

.search-card {
  margin-top: 24px;
  padding: 20px;
}

.route-controls {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 44px minmax(190px, 1fr) minmax(180px, 0.7fr);
  align-items: end;
  gap: 12px;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.field > span:first-child,
.cabin-tabs legend,
.channel-fieldset legend {
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.select-wrap,
.input-wrap {
  position: relative;
  display: block;
}

.select-wrap > svg,
.input-wrap > svg {
  position: absolute;
  z-index: 1;
  inset-block-start: 50%;
  inset-inline-start: 13px;
  width: 17px;
  height: 17px;
  color: var(--blue);
  pointer-events: none;
  transform: translateY(-50%);
}

.field input,
.field select,
.select-wrap select,
.input-wrap input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  outline: none;
  background: rgba(7, 12, 22, 0.72);
  color: var(--text);
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.select-wrap select,
.input-wrap input {
  padding-inline-start: 42px;
}

.field input:hover,
.field select:hover,
.select-wrap select:hover,
.input-wrap input:hover {
  border-color: rgba(0, 163, 224, 0.48);
}

.field input:focus,
.field select:focus,
.select-wrap select:focus,
.input-wrap input:focus {
  border-color: var(--blue);
  box-shadow: var(--focus);
}

select option {
  background: #111827;
}

.swap-button,
.icon-button {
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: rgba(148, 163, 184, 0.06);
  color: var(--muted-strong);
}

.swap-button {
  width: 44px;
  height: 44px;
  margin-bottom: 2px;
  border-radius: 50%;
}

.swap-button:hover,
.icon-button:hover {
  border-color: rgba(0, 163, 224, 0.48);
  background: var(--blue-soft);
  color: #7dd3fc;
}

.swap-button svg,
.icon-button svg {
  width: 18px;
}

.search-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.cabin-tabs,
.channel-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.cabin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cabin-tabs legend {
  width: 100%;
  margin-bottom: 2px;
}

.cabin-tab,
.channel-option {
  position: relative;
}

.cabin-tab input,
.channel-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.cabin-tab > span,
.channel-option > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(7, 12, 22, 0.48);
  color: var(--muted-strong);
  font-size: 0.8rem;
  font-weight: 800;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.cabin-tab svg,
.channel-option svg {
  width: 16px;
}

.cabin-tab input:focus-visible + span,
.channel-option input:focus-visible + span {
  box-shadow: var(--focus);
}

.cabin-business input:checked + span {
  border-color: rgba(212, 175, 55, 0.72);
  background: var(--gold-soft);
  color: #fde68a;
}

.cabin-premium input:checked + span {
  border-color: rgba(129, 140, 248, 0.72);
  background: var(--indigo-soft);
  color: #c7d2fe;
}

.cabin-economy input:checked + span {
  border-color: rgba(16, 185, 129, 0.72);
  background: var(--green-soft);
  color: #a7f3d0;
}

.primary-button,
.secondary-button,
.text-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 850;
  text-decoration: none;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, opacity 140ms ease;
}

.primary-button {
  border: 1px solid #19b5eb;
  background: linear-gradient(135deg, #0ea5e9, #0369a1);
  box-shadow: 0 10px 28px rgba(14, 165, 233, 0.19);
  color: white;
}

.secondary-button {
  border: 1px solid rgba(0, 163, 224, 0.45);
  background: var(--blue-soft);
  color: #7dd3fc;
}

.text-button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-strong);
}

.danger-button {
  border: 1px solid rgba(251, 113, 133, 0.35);
  background: var(--red-soft);
  color: #fda4af;
}

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

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled,
.text-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.primary-button svg,
.secondary-button svg,
.danger-button svg {
  width: 18px;
  height: 18px;
}

.compact-button {
  min-height: 40px;
  padding: 8px 13px;
  font-size: 0.82rem;
}

.field-error {
  margin: 9px 0 0;
  color: #fda4af;
  font-size: 0.78rem;
  font-weight: 700;
}

.matrix-section,
.alerts-section {
  padding: clamp(18px, 3vw, 30px);
}

.matrix-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.source-chip {
  min-height: 25px;
  padding: 4px 8px;
  font-size: 0.64rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.source-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 14%, transparent);
}

.source-live {
  border-color: rgba(16, 185, 129, 0.4);
  background: var(--green-soft);
  color: #6ee7b7;
}

.source-demo {
  border-color: rgba(245, 158, 11, 0.5);
  background: var(--amber-soft);
  color: #fcd34d;
}

.source-unconfigured {
  border-color: rgba(251, 113, 133, 0.42);
  background: var(--red-soft);
  color: #fda4af;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 14px;
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 750;
}

.legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.high {
  background: var(--green);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.legend-dot.low {
  background: var(--amber);
}

.legend-dot.none {
  border: 1px solid var(--muted);
  background: transparent;
}

.legend-dot.unknown {
  background: #475569;
}

.source-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 20px 0;
  padding: 13px 14px;
  border: 1px solid;
  border-radius: var(--radius-md);
}

.source-banner > svg {
  flex: 0 0 auto;
  width: 19px;
  margin-top: 2px;
}

.source-banner > div {
  display: grid;
  gap: 2px;
}

.source-banner strong {
  font-size: 0.81rem;
}

.source-banner span {
  color: var(--muted-strong);
  font-size: 0.75rem;
}

.source-banner-live {
  border-color: rgba(16, 185, 129, 0.34);
  background: var(--green-soft);
  color: #6ee7b7;
}

.source-banner-demo {
  border-color: rgba(245, 158, 11, 0.45);
  background: var(--amber-soft);
  color: #fcd34d;
}

.source-banner-unconfigured {
  border-color: rgba(251, 113, 133, 0.36);
  background: var(--red-soft);
  color: #fda4af;
}

.result-status:empty {
  display: none;
}

.state-card {
  display: grid;
  min-height: 250px;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 28px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: rgba(7, 12, 22, 0.38);
  text-align: center;
}

.state-card svg {
  width: 36px;
  height: 36px;
  margin-bottom: 5px;
  color: var(--blue);
}

.state-card strong {
  font-size: 1rem;
}

.state-card span {
  max-width: 460px;
  color: var(--muted);
  font-size: 0.82rem;
}

.state-error svg {
  color: var(--red);
}

.state-card .secondary-button {
  margin-top: 10px;
}

.loading-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.loading-cell {
  min-height: 104px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: linear-gradient(100deg, rgba(148, 163, 184, 0.04) 15%, rgba(148, 163, 184, 0.11) 40%, rgba(148, 163, 184, 0.04) 65%);
  background-size: 220% 100%;
  animation: shimmer 1.35s linear infinite;
}

@keyframes shimmer {
  to {
    background-position-x: -220%;
  }
}

.calendar-shell {
  position: relative;
}

.calendar-watermark {
  position: absolute;
  z-index: 4;
  inset-block-start: 52px;
  inset-inline-end: 10px;
  padding: 6px 9px;
  border: 1px solid rgba(245, 158, 11, 0.58);
  border-radius: 8px;
  background: rgba(69, 40, 4, 0.92);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  color: #fde68a;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.weekday {
  padding: 4px 5px 7px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.calendar-blank {
  min-height: 104px;
  border-radius: var(--radius-md);
  background: rgba(7, 12, 22, 0.17);
}

.day-cell {
  position: relative;
  min-width: 0;
}

.day-button {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 104px;
  align-content: space-between;
  gap: 8px;
  padding: 10px;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(7, 12, 22, 0.52);
  color: var(--text);
  text-align: start;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.day-button:hover {
  z-index: 3;
  border-color: var(--border-strong);
  background: var(--surface-strong);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
  transform: translateY(-2px);
}

.day-button.is-selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(0, 163, 224, 0.18);
}

.day-button.status-high {
  border-color: rgba(16, 185, 129, 0.32);
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.13), rgba(7, 12, 22, 0.55));
}

.day-button.status-low {
  border-color: rgba(245, 158, 11, 0.32);
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.11), rgba(7, 12, 22, 0.55));
}

.day-button.status-none {
  color: var(--muted);
}

.day-button.status-unknown {
  border-style: dashed;
  color: var(--muted-strong);
}

.day-number-row,
.day-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.day-number {
  font-size: 0.84rem;
  font-weight: 850;
}

.flight-count {
  color: var(--muted);
  font-size: 0.62rem;
}

.availability-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 900;
  white-space: nowrap;
}

.availability-pill::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-high .availability-pill {
  background: var(--green-soft);
  color: #6ee7b7;
}

.status-low .availability-pill {
  background: var(--amber-soft);
  color: #fcd34d;
}

.status-none .availability-pill {
  background: rgba(148, 163, 184, 0.07);
  color: var(--muted);
}

.status-unknown .availability-pill {
  background: rgba(71, 85, 105, 0.22);
  color: #cbd5e1;
}

.points-value {
  color: var(--muted-strong);
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.day-tooltip {
  position: absolute;
  z-index: 8;
  inset-block-end: calc(100% + 8px);
  inset-inline-start: 50%;
  display: none;
  width: max-content;
  max-width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: #070c16;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
  color: var(--muted-strong);
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.35;
  pointer-events: none;
  transform: translateX(-50%);
}

.day-button:hover .day-tooltip,
.day-button:focus-visible .day-tooltip {
  display: block;
}

.day-cell:nth-child(7n + 1) .day-tooltip {
  inset-inline-start: 0;
  transform: none;
}

.day-cell:nth-child(7n) .day-tooltip {
  inset-inline-start: auto;
  inset-inline-end: 0;
  transform: none;
}

.matrix-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.matrix-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.alerts-section {
  scroll-margin-top: 92px;
}

.alerts-heading {
  align-items: center;
}

.alerts-status {
  margin-top: 18px;
}

.alerts-status:empty {
  display: none;
}

.inline-status {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(7, 12, 22, 0.42);
  color: var(--muted-strong);
  font-size: 0.78rem;
}

.inline-status.error {
  border-color: rgba(251, 113, 133, 0.35);
  background: var(--red-soft);
  color: #fda4af;
}

.inline-status svg {
  width: 17px;
}

.alerts-empty {
  display: grid;
  min-height: 190px;
  place-items: center;
  align-content: center;
  gap: 7px;
  margin-top: 20px;
  padding: 26px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--muted);
  text-align: center;
}

.alerts-empty svg {
  width: 30px;
  height: 30px;
  color: var(--blue);
}

.alerts-empty strong {
  color: var(--text);
}

.alerts-table-wrap {
  margin-top: 20px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.alerts-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  background: rgba(7, 12, 22, 0.34);
}

.alerts-table th,
.alerts-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  text-align: start;
  vertical-align: middle;
}

.alerts-table tr:last-child td {
  border-bottom: 0;
}

.alerts-table th {
  background: rgba(148, 163, 184, 0.05);
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.alerts-table td {
  color: var(--muted-strong);
  font-size: 0.76rem;
}

.route-lockup {
  display: grid;
  min-width: 105px;
  gap: 2px;
}

.route-lockup strong {
  color: var(--text);
  font-size: 0.85rem;
}

.route-lockup span,
.cell-subtext {
  color: var(--muted);
  font-size: 0.68rem;
}

.alert-state,
.deal-badge,
.cabin-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 850;
  white-space: nowrap;
}

.alert-state.active {
  background: var(--green-soft);
  color: #6ee7b7;
}

.alert-state.paused {
  background: rgba(148, 163, 184, 0.1);
  color: var(--muted-strong);
}

.alert-state.error {
  background: var(--red-soft);
  color: #fda4af;
}

.table-actions,
.card-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.table-actions button,
.card-actions button {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 0.68rem;
}

.alert-history summary {
  width: max-content;
  color: #7dd3fc;
  font-size: 0.7rem;
  font-weight: 750;
  cursor: pointer;
}

.history-list {
  display: grid;
  gap: 7px;
  min-width: 210px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.history-list li {
  display: grid;
  gap: 1px;
  padding-inline-start: 9px;
  border-inline-start: 2px solid var(--border-strong);
}

.history-list strong {
  color: var(--muted-strong);
  font-size: 0.69rem;
}

.history-list span {
  color: var(--muted);
  font-size: 0.64rem;
}

.alert-cards {
  display: none;
  gap: 12px;
  margin-top: 18px;
}

.alert-card {
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(7, 12, 22, 0.38);
}

.alert-card-head,
.alert-card-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.alert-card-body {
  display: grid;
  gap: 9px;
  margin: 13px 0;
  padding: 12px 0;
  border-block: 1px solid var(--border);
}

.alert-card-row span:first-child {
  color: var(--muted);
  font-size: 0.7rem;
}

.alert-card-row span:last-child {
  color: var(--muted-strong);
  font-size: 0.73rem;
  font-weight: 750;
  text-align: end;
}

.alert-card .card-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

dialog {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(3, 7, 14, 0.76);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.flight-drawer {
  width: min(560px, 100%);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0 0 0 auto;
  border-block: 0;
  border-inline-end: 0;
  border-radius: 22px 0 0 22px;
}

[dir="rtl"] .flight-drawer {
  margin: 0 auto 0 0;
  border-inline-end: 1px solid var(--border-strong);
  border-inline-start: 0;
  border-radius: 0 22px 22px 0;
}

.flight-drawer[open] {
  animation: drawer-in 220ms ease-out;
}

@keyframes drawer-in {
  from {
    opacity: 0;
    transform: translateX(35px);
  }
}

[dir="rtl"] .flight-drawer[open] {
  animation-name: drawer-in-rtl;
}

@keyframes drawer-in-rtl {
  from {
    opacity: 0;
    transform: translateX(-35px);
  }
}

.drawer-layout {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: 100%;
}

.drawer-header,
.modal-header,
.drawer-footer,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-color: var(--border);
}

.drawer-header,
.modal-header {
  border-bottom-style: solid;
  border-bottom-width: 1px;
}

.drawer-footer,
.modal-footer {
  border-top-style: solid;
  border-top-width: 1px;
  background: rgba(7, 12, 22, 0.45);
}

.drawer-header h2,
.modal-header h2 {
  margin: 4px 0 0;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
}

.drawer-header p:last-child {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.icon-button {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 11px;
}

.drawer-source {
  padding: 12px 20px 0;
}

.drawer-content {
  overflow-y: auto;
  padding: 16px 20px 24px;
}

.drawer-empty {
  display: grid;
  min-height: 240px;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  text-align: center;
}

.drawer-empty svg {
  width: 32px;
  color: var(--muted);
}

.drawer-empty span {
  color: var(--muted);
  font-size: 0.78rem;
}

.flights-list {
  display: grid;
  gap: 13px;
}

.flight-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(7, 12, 22, 0.48);
}

.flight-card-head,
.flight-route,
.cost-row,
.flight-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.flight-number {
  display: grid;
  gap: 2px;
}

.flight-number strong {
  font-size: 1rem;
}

.flight-number span {
  color: var(--muted);
  font-size: 0.68rem;
}

.cabin-badge.business {
  background: var(--gold-soft);
  color: #fde68a;
}

.cabin-badge.premium {
  background: var(--indigo-soft);
  color: #c7d2fe;
}

.cabin-badge.economy {
  background: var(--green-soft);
  color: #a7f3d0;
}

.flight-route {
  margin: 16px 0;
}

.flight-time {
  display: grid;
  gap: 3px;
}

.flight-time:last-child {
  text-align: end;
}

.flight-time strong {
  font-size: 1.25rem;
}

.flight-time span {
  color: var(--muted);
  font-size: 0.68rem;
}

.route-line {
  position: relative;
  flex: 1;
  height: 1px;
  background: var(--border-strong);
}

.route-line::after {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: -2px;
  width: 6px;
  height: 6px;
  border: solid var(--blue);
  border-width: 1px 1px 0 0;
  content: "";
  transform: translateY(-50%) rotate(45deg);
}

[dir="rtl"] .route-line::after {
  transform: translateY(-50%) rotate(-135deg);
}

.route-line span {
  position: absolute;
  inset-block-start: 7px;
  inset-inline-start: 50%;
  width: max-content;
  color: var(--muted);
  font-size: 0.61rem;
  transform: translateX(-50%);
}

.cost-panel {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(22, 31, 51, 0.55);
}

.cost-row span:first-child {
  color: var(--muted);
  font-size: 0.7rem;
}

.cost-row strong {
  color: var(--muted-strong);
  font-size: 0.78rem;
  text-align: end;
}

.flight-card-footer {
  align-items: flex-end;
  margin-top: 13px;
}

.cpp-block {
  display: grid;
  gap: 4px;
}

.cpp-block > span:first-child {
  color: var(--muted);
  font-size: 0.65rem;
}

.deal-badge.exceptional {
  background: var(--green-soft);
  color: #6ee7b7;
}

.deal-badge.good {
  background: var(--blue-soft);
  color: #7dd3fc;
}

.deal-badge.average {
  background: rgba(148, 163, 184, 0.1);
  color: var(--muted-strong);
}

.deal-badge.unknown {
  background: rgba(71, 85, 105, 0.22);
  color: var(--muted);
}

.booking-button {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 0.76rem;
}

.modal-dialog {
  width: min(680px, calc(100% - 28px));
  max-width: 680px;
  max-height: min(860px, calc(100dvh - 28px));
  border-radius: 22px;
}

.modal-dialog[open] {
  animation: modal-in 190ms ease-out;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
}

.modal-card {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  max-height: inherit;
}

.modal-body {
  overflow-y: auto;
  padding: 20px;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.channel-fieldset {
  margin-top: 19px;
}

.channel-options {
  display: flex;
  gap: 9px;
  margin-top: 8px;
}

.channel-option input:checked + span {
  border-color: rgba(0, 163, 224, 0.58);
  background: var(--blue-soft);
  color: #7dd3fc;
}

.contact-grid {
  margin-top: 14px;
}

.modal-source-notice {
  margin: 14px 20px 0;
  padding: 10px 12px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 11px;
  background: var(--amber-soft);
  color: #fde68a;
  font-size: 0.73rem;
  font-weight: 700;
}

.modal-footer {
  justify-content: flex-end;
}

.toast-region {
  position: fixed;
  z-index: 100;
  inset-block-end: max(18px, env(safe-area-inset-bottom));
  inset-inline-end: 18px;
  display: grid;
  width: min(360px, calc(100% - 36px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: #111a2b;
  box-shadow: var(--shadow);
  color: var(--muted-strong);
  font-size: 0.77rem;
  animation: toast-in 180ms ease-out;
}

.toast.success {
  border-color: rgba(16, 185, 129, 0.4);
}

.toast.error {
  border-color: rgba(251, 113, 133, 0.42);
}

.toast svg {
  flex: 0 0 auto;
  width: 17px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 28px;
  padding: 20px 4px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.7rem;
}

.footer p {
  margin: 0;
}

.footer strong {
  color: var(--muted-strong);
}

@media (max-width: 900px) {
  .route-controls {
    grid-template-columns: 1fr 44px 1fr;
  }

  .month-field {
    grid-column: 1 / -1;
  }

  .matrix-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .legend {
    justify-content: flex-start;
  }

  .alerts-table-wrap {
    display: none;
  }

  .alert-cards {
    display: grid;
  }
}

@media (max-width: 680px) {
  .app-shell {
    padding-inline: 12px;
  }

  .topbar {
    min-height: 66px;
    margin-inline: -12px;
    padding-inline: 12px;
  }

  .brand-mark {
    width: 39px;
    height: 39px;
    border-radius: 12px;
  }

  .brand-copy span,
  .nav-link {
    display: none;
  }

  .language-button {
    margin-inline-start: 0;
  }

  .independent-notice {
    margin-top: 12px;
  }

  main {
    gap: 18px;
    margin-top: 30px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .search-heading .horizon-pill {
    align-self: flex-start;
  }

  .search-card {
    padding: 14px;
    border-radius: 19px;
  }

  .route-controls {
    grid-template-columns: minmax(0, 1fr) 38px minmax(0, 1fr);
    gap: 8px;
  }

  .swap-button {
    width: 38px;
    height: 38px;
  }

  .field > span:first-child,
  .cabin-tabs legend,
  .channel-fieldset legend {
    font-size: 0.67rem;
  }

  .select-wrap > svg,
  .input-wrap > svg {
    display: none;
  }

  .select-wrap select,
  .input-wrap input {
    min-height: 45px;
    padding-inline: 9px 28px;
    font-size: 0.78rem;
  }

  .month-field {
    grid-column: 1 / -1;
  }

  .search-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .cabin-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .cabin-tab > span {
    justify-content: center;
    padding-inline: 7px;
    font-size: 0.69rem;
  }

  .cabin-tab svg {
    display: none;
  }

  .matrix-section,
  .alerts-section {
    padding: 15px;
    border-radius: 19px;
  }

  .matrix-heading h2 {
    font-size: 1.55rem;
  }

  .legend {
    gap: 7px 11px;
  }

  .source-banner {
    margin-block: 15px;
  }

  .calendar-grid,
  .loading-grid {
    gap: 4px;
  }

  .weekday {
    padding-inline: 0;
    font-size: 0.55rem;
    letter-spacing: 0.02em;
  }

  .calendar-blank,
  .day-button,
  .loading-cell {
    min-height: 78px;
  }

  .day-button {
    gap: 5px;
    padding: 6px 4px;
    border-radius: 9px;
  }

  .day-number {
    font-size: 0.72rem;
  }

  .flight-count {
    display: none;
  }

  .availability-pill {
    gap: 3px;
    min-height: 20px;
    padding: 3px 4px;
    font-size: 0.57rem;
  }

  .availability-pill::before {
    width: 4px;
    height: 4px;
  }

  .seat-word {
    display: none;
  }

  .points-value {
    overflow: hidden;
    font-size: 0.57rem;
    text-overflow: ellipsis;
  }

  .day-tooltip {
    display: none !important;
  }

  .calendar-watermark {
    inset-block-start: 32px;
    font-size: 0.55rem;
  }

  .matrix-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .alerts-heading {
    align-items: stretch;
  }

  .modal-grid {
    grid-template-columns: 1fr;
  }

  .modal-dialog {
    width: calc(100% - 16px);
    max-height: calc(100dvh - 16px);
  }

  .modal-header,
  .modal-body,
  .modal-footer,
  .drawer-header,
  .drawer-content,
  .drawer-footer {
    padding-inline: 15px;
  }

  .modal-source-notice {
    margin-inline: 15px;
  }

  .flight-drawer {
    width: 100%;
    border: 0;
    border-radius: 0;
  }

  [dir="rtl"] .flight-drawer {
    border: 0;
    border-radius: 0;
  }

  .drawer-footer {
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }

  .flight-card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .booking-button {
    width: 100%;
  }

  .footer {
    flex-direction: column;
    gap: 7px;
  }
}

@media (max-width: 390px) {
  .brand-copy strong {
    font-size: 1rem;
  }

  .language-button {
    padding-inline: 9px;
    font-size: 0.75rem;
  }

  .cabin-tab > span {
    font-size: 0.61rem;
  }

  .day-button {
    padding-inline: 3px;
  }
}

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