:root {
  color-scheme: dark;
  --bg: #050609;
  --panel: #0b0f14;
  --panel-2: #101720;
  --panel-3: #151f2a;
  --line: #233140;
  --line-hot: #3f5d78;
  --text: #e5eef7;
  --muted: #8392a5;
  --quiet: #556579;
  --green: #5ff28a;
  --cyan: #4dd4ff;
  --amber: #ffcc66;
  --red: #ff6b75;
  --blue: #85a7ff;
  --violet: #c397ff;
  --shadow: 0 18px 60px rgb(0 0 0 / 45%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.terminal-shell {
  display: grid;
  gap: 12px;
  min-height: 100vh;
  padding: 14px;
}

.terminal-top,
.status-strip,
.command-bar,
.readout-grid,
.month,
.day-dialog .dialog-shell {
  border: 1px solid var(--line);
  background: rgb(11 15 20 / 94%);
  box-shadow: var(--shadow);
}

.terminal-top {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
}

.brand-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.prompt {
  color: var(--green);
  font-size: 18px;
  font-weight: 800;
}

.prompt::before {
  content: "$ ";
  color: var(--quiet);
}

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

.path-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.path-tab {
  display: grid;
  gap: 2px;
  min-width: 138px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 8px 10px;
}

.path-tab.active {
  border-color: var(--green);
  background: #0d1d14;
}

.path-tab span,
.status-strip span,
.readout-grid span,
.filter-label,
.numeric-filters label span,
.eyebrow {
  color: var(--quiet);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

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

.status-strip,
.readout-grid {
  display: grid;
  grid-template-columns: 1.2fr .7fr 1.4fr .5fr;
}

.status-strip div,
.readout-grid div {
  display: grid;
  gap: 4px;
  min-width: 0;
  border-right: 1px solid var(--line);
  padding: 9px 10px;
}

.status-strip div:last-child,
.readout-grid div:last-child {
  border-right: 0;
}

.status-strip strong,
.readout-grid strong {
  overflow: hidden;
  color: var(--green);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-bar {
  display: grid;
  grid-template-columns: minmax(210px, .7fr) minmax(170px, .55fr) minmax(260px, .8fr) minmax(320px, 1.25fr) minmax(340px, 1fr);
  gap: 12px;
  padding: 10px;
}

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

.toggle-row,
.program-row,
.airport-row,
.numeric-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.program-row {
  max-height: 86px;
  overflow: auto;
  padding-right: 3px;
}

.toggle-pill,
.program-chip,
.airport-chip,
.check-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  min-height: 30px;
  padding: 5px 8px;
}

.toggle-pill:has(input:checked),
.program-chip:has(input:checked),
.airport-chip:has(input:checked),
.check-filter:has(input:checked) {
  border-color: var(--cyan);
  background: #0b1d26;
}

.toggle-pill.quiet:has(input:checked) {
  border-color: var(--amber);
  background: #251c0d;
}

.toggle-pill input,
.program-chip input,
.airport-chip input,
.check-filter input {
  accent-color: var(--green);
}

.airport-chip span {
  color: var(--green);
  font-weight: 900;
}

.toggle-pill span {
  color: var(--green);
  font-weight: 900;
}

.toggle-pill small,
.program-chip small {
  color: var(--muted);
}

.program-chip span {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.numeric-filters {
  align-content: start;
}

.numeric-filters label {
  display: grid;
  gap: 4px;
}

.numeric-filters input[type="number"] {
  width: 94px;
  min-height: 30px;
  border: 1px solid var(--line);
  background: #05080c;
  color: var(--text);
  padding: 5px 7px;
}

.check-filter {
  align-self: end;
}

.plain-button {
  min-height: 30px;
  align-self: end;
  border: 1px solid var(--line-hot);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  padding: 5px 10px;
}

.plain-button:hover {
  border-color: var(--green);
  color: var(--green);
}

.readout-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.calendar-root {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(355px, 1fr));
  gap: 12px;
  align-items: start;
}

.month {
  overflow: hidden;
}

.month h2 {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  padding: 9px 10px;
}

.month h2 span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.weekdays,
.days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekdays {
  border-bottom: 1px solid var(--line);
  background: #070a0f;
  color: var(--quiet);
  font-size: 10px;
  font-weight: 800;
  text-align: center;
}

.weekdays span {
  padding: 6px 2px;
}

.day {
  display: grid;
  min-height: 84px;
  align-content: start;
  gap: 4px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #070a0f;
  color: var(--text);
  padding: 6px;
  text-align: left;
}

.day:nth-child(7n) {
  border-right: 0;
}

.day.blank,
.day.empty,
.day.past {
  background: #06080c;
  color: var(--quiet);
}

.day.available {
  cursor: pointer;
}

.day.available:hover,
.day.available.selected {
  outline: 2px solid var(--cyan);
  outline-offset: -2px;
}

.tier-elite {
  background: linear-gradient(180deg, rgb(95 242 138 / 24%), #071109);
}

.tier-good {
  background: linear-gradient(180deg, rgb(77 212 255 / 20%), #071015);
}

.tier-watch {
  background: linear-gradient(180deg, rgb(255 204 102 / 22%), #151006);
}

.tier-high {
  background: linear-gradient(180deg, rgb(255 107 117 / 17%), #16090b);
}

.day-head,
.day-tags,
.day-dots,
.day-values {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.day-head {
  justify-content: space-between;
}

.day-head b {
  color: var(--text);
}

.day-head i {
  color: var(--quiet);
  font-size: 10px;
  font-style: normal;
}

.day-values {
  justify-content: space-between;
}

.miles {
  color: var(--green);
  font-size: 15px;
  font-weight: 900;
}

.cash {
  color: var(--amber);
  font-size: 11px;
}

.tag {
  border: 1px solid var(--line-hot);
  background: rgb(255 255 255 / 3%);
  color: var(--muted);
  font-size: 10px;
  padding: 1px 4px;
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
}

.dot:nth-child(2n) {
  background: var(--green);
}

.dot:nth-child(3n) {
  background: var(--amber);
}

.dot:nth-child(4n) {
  background: var(--violet);
}

.empty-message {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  padding: 22px;
}

.day-dialog {
  width: min(1120px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
}

.day-dialog::backdrop {
  background: rgb(0 0 0 / 72%);
}

.dialog-shell {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.dialog-head h2,
.dialog-head p {
  margin: 0;
}

.dialog-head p {
  color: var(--muted);
}

.dialog-body {
  overflow: auto;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
}

.result-table th,
.result-table td {
  border-bottom: 1px solid var(--line);
  padding: 7px 8px;
  text-align: left;
  white-space: nowrap;
}

.result-table th {
  color: var(--quiet);
  font-size: 10px;
  text-transform: uppercase;
}

.result-table td:nth-child(4),
.result-table td:nth-child(5),
.result-table td:nth-child(6) {
  text-align: right;
}

.cards {
  display: flex;
  gap: 4px;
}

.card-badge {
  border: 1px solid var(--line-hot);
  color: var(--cyan);
  font-size: 10px;
  padding: 1px 4px;
}

@media (max-width: 1120px) {
  .terminal-top,
  .command-bar {
    grid-template-columns: 1fr;
  }

  .path-tabs {
    justify-content: flex-start;
  }

  .status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .terminal-shell {
    padding: 8px;
  }

  .calendar-root,
  .readout-grid {
    grid-template-columns: 1fr;
  }

  .status-strip {
    grid-template-columns: 1fr;
  }

  .status-strip div,
  .readout-grid div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .status-strip div:last-child,
  .readout-grid div:last-child {
    border-bottom: 0;
  }

  .day {
    min-height: 76px;
    padding: 5px;
  }
}
