:root {
  --bg: #0b0f17;
  --panel: #121826;
  --panel-2: #182032;
  --line: #243049;
  --text: #e7eaf0;
  --muted: #8f9ab0;
  --gold: #ffc107;
  --gold-soft: rgba(255, 193, 7, 0.14);
  --danger: #ff6b6b;
  --success: #3ddc97;
  --info: #5fb4ff;
  --warn: #ffb547;
  /* Schedule bars. Same hexes as lib/calendar-schedule-type-display.ts. */
  --bar-edw: #8f2929;
  --bar-non-edw: #234e94;
  --bar-international: #147638;
  --bar-reserve: #95440d;
  --bar-lco: #F57C00;
  --bar-text: #e5e5e5;
  --cal-weekend: rgba(255, 107, 107, 0.09);
  --cal-off: rgba(255, 193, 7, 0.55);
  --cal-off-ink: #14110a;
  --cal-off-x: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M22 22 L78 78 M78 22 L22 78' fill='none' stroke='%23ffffff' stroke-opacity='0.72' stroke-width='16' stroke-linecap='round'/%3E%3C/svg%3E");
  --cal-off-x-soft: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M22 22 L78 78 M78 22 L22 78' fill='none' stroke='%23ffffff' stroke-opacity='0.42' stroke-width='14' stroke-linecap='round'/%3E%3C/svg%3E");
  --topbar-h: 64px;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.4;
}

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

a {
  color: var(--gold);
}

code {
  background: var(--panel-2);
  padding: 1px 6px;
  border-radius: 6px;
}

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

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

.small {
  font-size: 13px;
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  min-height: var(--topbar-h);
  padding: 10px 20px;
  background: rgba(11, 15, 23, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar-left,
.topbar-center,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar-center {
  flex: 1 1 360px;
}

.topbar-right {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}

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

.brand {
  font-weight: 700;
  white-space: nowrap;
}

.brand-mark {
  display: inline-block;
  padding: 1px 6px;
  margin-right: 4px;
  border-radius: 6px;
  background: var(--gold);
  color: #111;
}

.sort-controls select,
.full-select {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 0;
  max-width: 100%;
}

.packet-code {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid rgba(255, 193, 7, 0.42);
  border-radius: 8px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1.2;
  white-space: nowrap;
}

.packet-select {
  flex: 1 1 180px;
  max-width: 280px;
  min-width: 0;
}

.search-wrap {
  flex: 1 1 200px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  min-width: 0;
}

.search-wrap input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 8px 0;
  outline: none;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 600;
}

.btn:hover:not(:disabled) {
  border-color: var(--gold);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #111;
}

.btn.ghost {
  background: transparent;
}

.btn.full {
  width: 100%;
}

.pill {
  display: inline-block;
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--gold);
  color: #111;
  font-size: 12px;
  text-align: center;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}

.icon-button:disabled {
  opacity: 0.3;
  cursor: default;
}

.link-button {
  border: 0;
  background: none;
  color: var(--gold);
  cursor: pointer;
  padding: 6px 4px;
  font-weight: 600;
}

/* ---------- banner and gate ---------- */

.banner {
  position: sticky;
  top: var(--topbar-h);
  z-index: 25;
  margin: 0;
  padding: 10px 20px;
  font-weight: 500;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.banner.hidden {
  display: none;
}

.banner.success {
  background: rgba(61, 220, 151, 0.14);
  color: var(--success);
}

.banner.error {
  background: rgba(255, 107, 107, 0.14);
  color: var(--danger);
}

.banner.info {
  background: rgba(95, 180, 255, 0.14);
  color: var(--info);
}

.gate {
  display: flex;
  justify-content: center;
  padding: 12vh 20px;
}

.gate-card {
  max-width: 460px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px 24px;
}

.gate-card iconify-icon {
  color: var(--gold);
}

.gate-card h1 {
  font-size: 22px;
  margin: 12px 0 8px;
}

.gate-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ---------- board layout ---------- */

.board {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr) 230px;
  gap: 0;
  min-height: calc(100vh - var(--topbar-h));
}

/* Eliminated lists every removed line, so the filter column is not part of that view. */
.board.unfiltered {
  grid-template-columns: minmax(0, 1fr) 230px;
}

.board.unfiltered .filters {
  display: none;
}

@media (min-width: 1101px) {
  body:not(.calendar-focus) .board.filters-collapsed {
    grid-template-columns: minmax(0, 1fr) 230px;
  }

  body:not(.calendar-focus) .board.filters-collapsed .filters {
    display: none;
  }
}

.filters,
.buckets {
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  background: var(--panel);
  padding: 16px;
}

.filters {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--line);
}

.filters .panel-head,
#addFilterHost {
  flex: none;
}

.crew-toggles {
  display: flex;
  flex-direction: column;
}

.crew-toggle {
  align-items: center;
  min-height: 44px;
  padding: 0;
}

.crew-toggle input {
  margin-top: 0;
}

.crew-toggle.inactive {
  cursor: not-allowed;
  opacity: 0.55;
}

.crew-note {
  margin: 6px 0 0;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.filters-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

/* The filter list is a fixed-height column. macOS overlay scrollbars stay
   hidden until someone scrolls, so the pane looks finished when it is not. */
.scroll-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  --scroll-cue-bg: var(--panel);
}

.filters-scroll {
  flex: 1 1 auto;
}

.add-filter-frame {
  flex: 1 1 auto;
  margin-top: 8px;
  overflow: hidden;
  --scroll-cue-bg: var(--panel-2);
}

.filters-body,
.add-filter-menu {
  scroll-padding-top: 36px;
  scroll-padding-bottom: 48px;
  scrollbar-width: thin;
  scrollbar-color: #9aa6bd transparent;
}

.filters-body::-webkit-scrollbar,
.add-filter-menu::-webkit-scrollbar {
  width: 10px;
}

.filters-body::-webkit-scrollbar-thumb,
.add-filter-menu::-webkit-scrollbar-thumb {
  background: #9aa6bd;
  border: 2px solid var(--scroll-cue-bg, var(--panel));
  border-radius: 999px;
}

.filters-body::-webkit-scrollbar-track,
.add-filter-menu::-webkit-scrollbar-track {
  background: transparent;
}

.scroll-cue-fade,
.scroll-cue-button {
  position: absolute;
  z-index: 2;
  left: 8px;
  right: 14px;
}

.scroll-cue-fade {
  height: 52px;
  pointer-events: none;
}

.scroll-cue-fade.scroll-cue-up {
  top: 0;
  background: linear-gradient(to bottom, var(--scroll-cue-bg), transparent);
}

.scroll-cue-fade.scroll-cue-down {
  bottom: 36px;
  background: linear-gradient(to top, var(--scroll-cue-bg), transparent);
}

.scroll-cue-button {
  z-index: 3;
  left: 50%;
  right: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 193, 7, 0.9);
  border-radius: 999px;
  background: #1c2638;
  color: var(--gold);
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  transform: translateX(-50%);
}

.scroll-cue-button.scroll-cue-up {
  top: 4px;
  right: 16px;
  left: auto;
  width: 28px;
  height: 28px;
  transform: none;
}

.scroll-cue-button.scroll-cue-down {
  position: static;
  left: auto;
  flex: none;
  align-self: center;
  height: 28px;
  margin: 4px auto 0;
  padding: 0 10px 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transform: none;
}

.scroll-cue-button.scroll-cue-down.is-quiet {
  visibility: hidden;
  pointer-events: none;
}

.scroll-cue-button:hover {
  border-color: #ffe082;
  background: #243044;
}

.scroll-cue-button:focus-visible {
  outline: 2px solid #fff6d6;
  outline-offset: 2px;
}

.scroll-cue-bob {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  animation-duration: 1.6s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.scroll-cue-down .scroll-cue-bob {
  animation-name: scroll-cue-bob-down;
}

.scroll-cue-up .scroll-cue-bob {
  animation-name: scroll-cue-bob-up;
}

@keyframes scroll-cue-bob-down {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(3px);
  }
}

@keyframes scroll-cue-bob-up {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.buckets {
  border-left: 1px solid var(--line);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

h2 {
  font-size: 17px;
  margin: 0;
}

.center {
  padding: 16px 20px 40px;
  min-width: 0;
}

.sort-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.narrow-only {
  display: none;
}

/* ---------- filters ---------- */

.filter-section {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.filter-section:first-of-type {
  border-top: 0;
}

.filter-section h3 {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.filter-section p {
  margin: 0 0 8px;
}

.add-filter {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(420px, calc(100dvh - 160px));
  margin-top: 10px;
  padding: 6px 2px 14px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.add-filter-button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  flex: none;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 7px 14px;
  border: 1px solid rgba(255, 214, 120, 0.9);
  border-radius: 14px;
  background:
    radial-gradient(120px 46px at 22% 45%, rgba(255, 193, 7, 0.28), transparent 72%),
    linear-gradient(180deg, #2a3b5c 0%, #151c2e 100%);
  color: #fff8e4;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 170, 0.55),
    inset 0 -10px 16px rgba(0, 0, 0, 0.28),
    0 0 0 3px rgba(255, 193, 7, 0.14),
    0 8px 18px rgba(0, 0, 0, 0.38);
}

.add-filter-button::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 0;
  right: 18px;
  left: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 244, 210, 0.95), transparent);
  pointer-events: none;
}

.add-filter-button::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background: linear-gradient(105deg, transparent 32%, rgba(255, 236, 190, 0.28) 50%, transparent 68%);
  transform: translateX(-140%);
  animation: add-filter-sheen 4.4s ease-in-out infinite;
  pointer-events: none;
}

.add-filter-button iconify-icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  flex: 0 0 28px;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff4c8, #ffd54a 36%, #e0a400 70%, #8d6200);
  color: #1a1203;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -2px 4px rgba(110, 68, 0, 0.45),
    0 2px 6px rgba(0, 0, 0, 0.45);
}

.add-filter-button span {
  position: relative;
  z-index: 1;
}

.add-filter-button:hover:not(:disabled),
.add-filter-button:focus-visible {
  border-color: #ffe082;
  color: #fff8e4;
  background:
    radial-gradient(140px 50px at 22% 45%, rgba(255, 214, 80, 0.42), transparent 72%),
    linear-gradient(180deg, #34486e 0%, #1a2438 100%);
}

.add-filter-button:focus-visible {
  outline: 2px solid #fff6d6;
  outline-offset: 3px;
}

.add-filter-button[aria-expanded="true"] {
  border-color: #ffc107;
  background:
    radial-gradient(120px 46px at 22% 45%, rgba(255, 193, 7, 0.34), transparent 72%),
    linear-gradient(180deg, #1b2740 0%, #0e1422 100%);
}

.add-filter-button[aria-expanded="true"]::after {
  animation: none;
  opacity: 0;
}

@keyframes add-filter-sheen {
  0%,
  58% {
    transform: translateX(-140%);
  }
  82%,
  100% {
    transform: translateX(140%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .add-filter-button::after {
    animation: none;
    display: none;
  }

  .scroll-cue-bob {
    animation: none;
  }
}

.add-filter-menu {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 12px;
  min-height: 0;
  margin-top: 0;
  padding: 10px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}

.add-filter-menu[hidden] {
  display: none;
}

.add-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.add-filter-group h4 {
  flex: 1 1 100%;
  margin: 0 0 2px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.add-filter-option {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  cursor: pointer;
  text-align: left;
  overflow-wrap: anywhere;
}

.add-filter-option:hover,
.add-filter-option:focus-visible {
  border-color: var(--gold);
  color: var(--gold);
}

.filter-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.filter-row-head h3 {
  margin: 0;
  min-width: 0;
}

.filter-remove {
  flex: 0 0 auto;
  min-width: 34px;
  min-height: 34px;
  border-color: transparent;
  color: var(--muted);
}

.filter-remove:hover,
.filter-remove:focus-visible {
  border-color: var(--line);
  color: var(--text);
}

.filter-row .range-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.filter-row .range-label {
  display: none;
}

.type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.type-chip,
.seg {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  min-height: 34px;
}

.type-chip.active,
.seg.active {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: var(--gold);
}

.type-chip:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.full-select {
  width: 100%;
  margin-bottom: 8px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  cursor: pointer;
}

.check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
  accent-color: var(--gold);
}

.check span {
  min-width: 0;
  line-height: 1.35;
}

.range-row {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) minmax(0, 76px) minmax(0, 76px);
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.range-label {
  font-size: 14px;
}

.range-input,
.city-input {
  width: 100%;
  min-width: 0;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 8px;
}

.range-input.invalid {
  border-color: var(--danger);
}

.range-input[type="time"] {
  color-scheme: dark;
}

.city-picker {
  margin-bottom: 10px;
}

.city-input {
  text-transform: uppercase;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 4px 2px 10px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  font-weight: 600;
}

.chip-x {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
}

/* ---------- search across buckets ---------- */

.search-hits {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.search-hits-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.search-hits-head p {
  margin: 0;
  font-weight: 600;
}

.search-hits-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 280px;
  margin-top: 10px;
  overflow: auto;
}

.search-hits-body:empty {
  display: none;
}

.search-hit-group h3 {
  margin: 0;
  flex: 1 1 auto;
  font-size: 13px;
  font-weight: 600;
}

.search-hit-row > .btn {
  margin-left: auto;
}

.search-hit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 40px;
  padding: 4px 0;
}

.search-hit-row .line-number {
  font-weight: 700;
}

.search-hit-note {
  flex: 1 1 160px;
  min-width: 0;
}

.search-hit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.card.search-located,
.cal-row.search-located {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

body.calendar-focus .search-hits {
  flex: none;
  margin: 8px 12px;
}

/* ---------- days-off notice ---------- */

.days-off-notice {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: var(--gold-soft);
  color: var(--gold);
}

/* ---------- line cards ---------- */

.line-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.card.selected {
  border-color: var(--gold);
}

.line-check {
  width: 16px;
  height: 16px;
  margin: 2px 2px 0 0;
  accent-color: var(--gold);
  flex-shrink: 0;
}

.card.type-edw,
.card.type-edw-turn {
  border-left-color: var(--warn);
}

.card.type-base {
  border-left-color: var(--gold);
}

.card.type-non-edw {
  border-left-color: #7eb6a4;
}

.card.type-turn {
  border-left-color: #c4b5fd;
}

.card.type-international {
  border-left-color: var(--info);
}

.card.type-mixed {
  border-left-color: var(--danger);
}

.card.type-reserve {
  border-left-color: var(--info);
}

.card.type-vto,
.card.type-vtor {
  border-left-color: var(--success);
}

.card.dragging {
  opacity: 0.5;
}

.card.drop-before {
  box-shadow: inset 0 4px 0 var(--gold);
}

.card.drop-after {
  box-shadow: inset 0 -4px 0 var(--gold);
}

.reorderable .card {
  cursor: grab;
}

.card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.line-totals {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: baseline;
  gap: 6px 18px;
  width: 100%;
  margin: 0 0 8px;
  padding: 2px 4px 8px;
  border-bottom: 1px solid var(--line);
}

.line-total {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.line-total-label {
  margin-right: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.line-trip-count {
  margin-right: auto;
  font-size: 13px;
  font-weight: 600;
}

.drag-handle {
  color: var(--muted);
  display: inline-flex;
}

.rank {
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--gold);
  color: #111;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 160px;
  min-width: 0;
  flex-wrap: wrap;
}

.line-number {
  font-size: 18px;
  font-weight: 700;
}

.type-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
}

.type-badge.type-edw,
.type-badge.type-edw-turn {
  color: var(--warn);
}

.type-badge.type-base {
  color: var(--gold);
}

.type-badge.type-non-edw {
  color: #7eb6a4;
}

.type-badge.type-turn {
  color: #c4b5fd;
}

.type-badge.type-international,
.type-badge.type-reserve {
  color: var(--info);
}

.type-badge.type-mixed {
  color: var(--danger);
}

.type-badge.type-vto,
.type-badge.type-vtor {
  color: var(--success);
}

.stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(56px, auto));
  gap: 4px 16px;
}

.card-captains {
  flex-basis: 100%;
  min-width: 0;
  font-size: 13px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.crew-group-head h3 {
  margin: 8px 0 0;
  font-size: 15px;
  color: var(--gold);
}

.crew-group-head:first-child h3 {
  margin-top: 0;
}

.crew-bucket {
  white-space: nowrap;
}

.crew-tag {
  display: inline-block;
  padding: 0 5px;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.crew-tag-fly {
  color: var(--gold);
}

.crew-tag-no-fly {
  color: var(--danger);
}

.card-captains-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.stat-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.halves,
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.tags {
  gap: 6px;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--panel-2);
  font-size: 12px;
  color: var(--text);
}

.tag-warn {
  color: var(--warn);
}

.tag-info {
  color: var(--info);
}

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

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

.tag-gold {
  color: var(--gold);
  font-weight: 700;
}

.surrounding {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--panel-2);
  font-size: 13px;
}

.surrounding-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.surrounding-dates {
  font-weight: 700;
  color: var(--gold);
}

.card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 10px;
}

.move-group,
.order-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.move {
  min-height: 34px;
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}

.move:hover {
  border-color: var(--gold);
}

.move-eliminated {
  color: var(--danger);
}

.move-bidding {
  color: var(--gold);
}

.move-flagged {
  color: var(--info);
}

.specials {
  margin-top: 6px;
}

.card-detail {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pairing-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}

.pairing-trip {
  font-weight: 700;
}

.pairing-dates {
  color: var(--gold);
  font-weight: 600;
}

.pairing-meta {
  color: var(--muted);
  font-size: 13px;
}

.pairing-flags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.duty {
  margin: 8px 0 0 10px;
  padding-left: 10px;
  border-left: 2px solid var(--line);
}

.duty-head {
  font-size: 13px;
  color: var(--muted);
}

.legs {
  list-style: none;
  margin: 4px 0;
  padding: 0;
}

.leg {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding: 3px 0;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

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

.leg-route {
  font-weight: 600;
  min-width: 96px;
}

.leg-flight,
.leg-equip {
  color: var(--muted);
}

.layover {
  font-size: 13px;
  color: var(--info);
  margin-top: 2px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
}

/* ---------- buckets ---------- */

.bucket-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.bucket {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  cursor: pointer;
  text-align: left;
}

.bucket.active {
  border-color: var(--gold);
  background: var(--gold-soft);
  color: var(--gold);
}

.bucket.drop-target {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-soft);
}

.bucket-name {
  flex: 1;
  font-weight: 600;
}

.bucket-count {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.bucket-hint {
  font-size: 13px;
  margin-top: 14px;
}

.bid-close {
  margin-top: 16px;
  padding: 12px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  text-align: center;
}

.bid-close-label {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.bid-close-time {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.bid-close-when {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.bid-close.open {
  border-color: rgba(61, 220, 151, 0.45);
}

.bid-close.open .bid-close-time {
  color: var(--success);
}

.bid-close.urgent {
  border-color: var(--danger);
}

.bid-close.urgent .bid-close-time,
.bid-close.urgent .bid-close-label {
  color: var(--danger);
}

.bid-close.closed .bid-close-time {
  color: var(--muted);
  font-size: 18px;
}

/* ---------- dialogs ---------- */

.dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
}

.dialog.wide {
  width: min(760px, calc(100vw - 24px));
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.dialog-inner {
  padding: 18px;
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.month-title {
  font-weight: 700;
  margin-bottom: 6px;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.weekday {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.day {
  aspect-ratio: 1;
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}

.day:disabled {
  opacity: 0.2;
  cursor: default;
}

.day.marked {
  background: var(--gold);
  border-color: var(--gold);
  color: #111;
  font-weight: 700;
}

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 16px;
  margin-top: 12px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  cursor: pointer;
  text-align: center;
}

.drop-zone.over {
  border-color: var(--gold);
  color: var(--gold);
}

.drop-zone input {
  max-width: 100%;
}

.upload-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.upload-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--panel-2);
  border-left: 4px solid var(--line);
  overflow-wrap: anywhere;
}

.upload-item.ready {
  border-left-color: var(--gold);
}

.upload-item.done {
  border-left-color: var(--success);
}

.upload-item.error {
  border-left-color: var(--danger);
}

.upload-item.error .upload-status {
  color: var(--danger);
}

.upload-name {
  font-weight: 700;
}

.upload-summary,
.upload-status,
.upload-note {
  font-size: 13px;
  color: var(--muted);
}

.award-paste {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.award-paste p {
  margin: 0;
}

.award-paste-label {
  font-weight: 700;
}

.award-paste-input {
  width: 100%;
  min-height: 96px;
  max-height: 40vh;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.award-paste-input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.award-paste-input[readonly] {
  opacity: 0.6;
}

.award-note {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.award-note.error {
  color: var(--danger);
}

.award-list {
  margin-top: 4px;
}

.award-confirm {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
  cursor: pointer;
}

.award-confirm input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--gold);
}

.award-skipped {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.award-skipped summary {
  cursor: pointer;
}

.award-skipped-list {
  margin: 4px 0 0;
  padding-left: 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 39;
  background: rgba(0, 0, 0, 0.55);
}

/* ---------- reflow: filters become a sheet ---------- */

@media (max-width: 1100px) {
  .board,
  .board.unfiltered {
    grid-template-columns: minmax(0, 1fr) 210px;
  }

  .narrow-only {
    display: inline-flex;
  }

  .filters {
    position: fixed;
    z-index: 40;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(340px, 90vw);
    height: 100vh;
    transform: translateX(-102%);
    transition: transform 0.2s ease;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.4);
  }

  body.filters-open .filters {
    transform: translateX(0);
  }
}

/* ---------- reflow: buckets become a bottom bar ---------- */

@media (max-width: 760px) {
  .topbar {
    position: static;
    padding: 10px 12px;
  }

  .banner {
    top: 0;
  }

  .topbar-center,
  .topbar-right {
    flex: 1 1 100%;
  }

  .topbar-right {
    justify-content: flex-start;
  }

  .topbar-center {
    flex-wrap: wrap;
  }

  .search-wrap {
    flex: 1 1 220px;
  }

  .board,
  .board.unfiltered {
    grid-template-columns: minmax(0, 1fr);
  }

  .center {
    padding: 12px 12px 96px;
  }

  .packet-toolbar .head-tools {
    align-items: stretch;
  }

  .packet-toolbar .view-tools,
  .packet-toolbar .sort-controls {
    width: 100%;
  }

  .packet-toolbar .display-toggle {
    flex: 0 0 auto;
  }

  .packet-toolbar .display-toggle .seg {
    flex: 0 0 auto;
  }

  .packet-toolbar #enterFocusButton {
    min-width: 34px;
    padding-inline: 8px;
  }

  .packet-toolbar #enterFocusButton span {
    display: none;
  }

  .packet-toolbar .sort-controls {
    margin-left: 0;
  }

  .packet-toolbar .sort-controls select {
    flex: 1 1 130px;
  }

  .packet-toolbar .quiet-action {
    flex: 0 0 auto;
  }

  .buckets {
    position: fixed;
    z-index: 35;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    height: auto;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .wide-only {
    display: none;
  }

  .bucket-nav {
    flex-direction: row;
    margin-top: 0;
    overflow-x: auto;
  }

  .bucket {
    flex: 1 0 auto;
    width: auto;
    flex-direction: column;
    gap: 2px;
    min-width: 64px;
    padding: 6px 8px;
    text-align: center;
  }

  .bucket-name {
    font-size: 12px;
  }

  .bucket-count {
    font-size: 12px;
  }

  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .stat {
    align-items: flex-start;
  }
}

/* ---------- rank and trip inspector ---------- */

.rank-dialog {
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.rank-group {
  margin-top: 16px;
}

.rank-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.rank-preset-note {
  margin: 0 0 12px;
}

.rank-share {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.rank-group h3 {
  margin: 0 0 4px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.rank-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.rank-copy {
  min-width: 0;
}

.rank-label {
  font-weight: 600;
}

.rank-hint {
  color: var(--muted);
  font-size: 12px;
}

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel-2);
}

.stepper button {
  min-width: 36px;
  min-height: 36px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
}

.stepper button:hover {
  color: var(--gold);
}

.stepper-value {
  min-width: 36px;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.weight-pos {
  color: var(--gold);
}

.weight-neg {
  color: var(--info);
}

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

.rank-cities {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.score-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 8px;
  font-size: 13px;
}

.score-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}

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

.reason.pos {
  color: var(--gold);
}

.reason.neg {
  color: var(--info);
}

.head-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  width: 100%;
}

.packet-toolbar {
  margin-bottom: 14px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.view-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.display-toggle {
  display: inline-flex;
  gap: 6px;
}

.packet-toolbar .display-toggle {
  gap: 0;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(24, 32, 50, 0.62);
}

.packet-toolbar .display-toggle .seg {
  min-height: 30px;
  padding: 5px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.packet-toolbar .display-toggle .seg:hover {
  color: var(--text);
}

.packet-toolbar .display-toggle .seg.active {
  background: var(--gold-soft);
  color: var(--gold);
}

.packet-toolbar .quiet-action {
  min-height: 34px;
  padding: 5px 8px;
  border-color: transparent;
  color: var(--muted);
  font-size: 12px;
}

.packet-toolbar .quiet-action:hover:not(:disabled),
.packet-toolbar .quiet-action[aria-pressed="true"] {
  border-color: var(--line);
}

.packet-toolbar .sort-controls {
  margin-left: auto;
}

.packet-toolbar .sort-controls select {
  min-height: 34px;
  padding: 5px 28px 5px 9px;
  border-radius: 8px;
  font-size: 12px;
}

.packet-toolbar .sort-controls .icon-button {
  min-width: 34px;
  min-height: 34px;
  border-color: transparent;
}

.month-track {
  /* One day column for every line. Labels never change this width. */
  --day-col: 34px;
  --lane-h: 30px;
  width: 100%;
  margin-top: 10px;
  border-radius: 8px;
  background: var(--panel-2);
  padding: 8px 8px 10px;
}

.month-layout {
  display: grid;
  /* 124px label plus the 16px gap, so the row divider runs through the gap. */
  grid-template-columns: 140px minmax(0, 1fr);
  align-items: stretch;
}

/* Labels stay in their own column. The day grid scrolls beside them, so trip
   bars cannot pass behind the pay-period cell. */
.month-scroll {
  grid-column: 2;
  /* grid-row is 1 / span N, set where the rows are built. -1 would stop at the
     explicit grid, and these rows are implicit. */
  display: grid;
  grid-template-rows: subgrid;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.period-scale {
  width: calc(var(--days, 28) * var(--day-col));
  max-width: calc(var(--days, 28) * var(--day-col));
  justify-self: start;
}

.period-split {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

/* Overlay scrollbars paint on top of the last row. This pad is the strip they
   sit in, on both columns so the pay-period label stays aligned. */
.period-scroll-pad {
  padding-bottom: 16px;
}

.period-label {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  align-self: stretch;
  padding: 2px 16px 2px 6px;
  background: var(--panel-2);
}

.period-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.period-range {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.month-scale {
  position: relative;
  z-index: 0;
  width: 100%;
  min-width: calc(var(--days, 28) * var(--day-col));
}

.month-off-bands {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  grid-template-columns: repeat(var(--days), var(--day-col));
  width: calc(var(--days, 28) * var(--day-col));
  pointer-events: none;
}

.month-off-band.off {
  background-color: var(--cal-off);
  background-image: var(--cal-off-x);
  background-repeat: no-repeat;
  background-position: center bottom 6px;
  background-size: 24px 24px;
  box-shadow: inset 0 4px 0 var(--gold);
}

.month-names,
.month-dows,
.month-days,
.month-bars {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(var(--days), var(--day-col));
  width: calc(var(--days, 28) * var(--day-col));
  max-width: calc(var(--days, 28) * var(--day-col));
}

.month-label {
  min-width: 0;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--muted);
  padding-left: 1px;
  white-space: nowrap;
  overflow: hidden;
}

.month-dow,
.month-day-num {
  min-width: 0;
  line-height: 1.2;
  text-align: center;
  color: var(--muted);
  overflow: hidden;
}

.month-dow {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.month-day-num {
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.month-dow.weekend,
.month-day-num.weekend {
  color: var(--text);
  opacity: 0.72;
}

.month-day-num.weekend.off,
.month-day-num.off {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  height: 16px;
  margin: 1px 2px;
  border-radius: 4px;
  background: var(--gold);
  color: var(--cal-off-ink);
  font-weight: 800;
  opacity: 1;
}

.month-bars {
  height: calc(var(--lanes, 1) * var(--lane-h, 22px));
  margin-top: 4px;
}

.month-bar {
  position: relative;
  /* Stay on the assigned lane. Auto-placement drops a trip that shares a
     day onto the next row, then keeps later trips there, and the lane clips them. */
  grid-row: var(--lane, 1);
  height: 26px;
  align-self: center;
  min-width: 0;
  max-width: 100%;
  margin: 0 1px;
  border: 0;
  border-radius: 3px;
  padding: 0;
  background: var(--bar-non-edw);
  cursor: pointer;
  color: var(--bar-text);
}

/* Layover city on the arrival day, L/O on each later day of that layover. */
.month-bar.cal-day-labels {
  display: grid;
  grid-template-columns: repeat(var(--length), minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  overflow: hidden;
}

.month-bar.cal-day-labels.mark-commute .cal-day-label:first-child,
.month-bar.cal-day-labels.mark-dh .cal-day-label:first-child,
.month-bar.cal-day-labels.mark-ground .cal-day-label:first-child {
  padding-left: 4px;
}

.month-bar .cal-day-code {
  max-width: 100%;
  overflow: hidden;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: var(--bar-text);
  text-overflow: ellipsis;
}

.month-bar .cal-day-label.stacked {
  gap: 1px;
}

.month-bar .cal-day-label.stacked .cal-day-code {
  font-size: 10px;
  line-height: 1;
}

.month-bar.month-hs {
  display: flex;
  align-items: center;
  padding: 0 3px;
  overflow: hidden;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.month-bar:hover,
.month-bar:focus-visible {
  z-index: 1;
  outline: 2px solid var(--text);
  outline-offset: 1px;
}

.month-bar.month-special-bar {
  cursor: default;
  display: flex;
  align-items: center;
  padding: 0 3px;
  overflow: hidden;
  color: var(--bar-text);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.month-bar.month-special-bar:hover,
.month-bar.month-special-bar:focus-visible {
  outline: none;
}

.month-bar.month-special-bar.type-reserve,
.month-bar.month-special-bar.type-hot {
  background: var(--bar-reserve);
}

.month-bar.month-special-bar.type-lco {
  background: var(--bar-lco);
}

.month-bar.month-special-bar.type-other {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

/* VTO, VOR, and VOIR: the code sits in each day. No box around the run. */
.month-special.month-day-labels {
  grid-row: var(--lane, 1);
  display: grid;
  grid-template-columns: repeat(var(--length), minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  align-self: center;
  height: 26px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  color: var(--success);
  background: transparent;
}

.month-day-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.month-day-code {
  max-width: 100%;
  overflow: hidden;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--success);
}

.trip-chip.static {
  cursor: default;
}

.trip-chip.static:hover,
.trip-chip.static:focus-visible {
  border-color: var(--line);
}

.trip-length-day.type-reserve,
.trip-length-day.type-hot {
  background: var(--bar-reserve);
}

.trip-length-day.type-lco {
  background: var(--bar-lco);
}

.trip-length-day.type-vto,
.trip-length-day.type-vtor {
  background: var(--success);
}

.trip-length-day.type-other {
  background: var(--muted);
}

.trip-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.trip-chip {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  flex: 0 0 auto;
  width: max-content;
  min-width: 200px;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  cursor: pointer;
  text-align: left;
}

.trip-chip:hover,
.trip-chip:focus-visible {
  border-color: var(--gold);
}

.trip-chip-top,
.trip-chip-flags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.trip-chip-top {
  flex-wrap: nowrap;
}

.trip-chip-flags {
  gap: 4px;
}

.trip-chip-flags .tag {
  padding: 2px 7px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
}

.trip-chip-id {
  font-weight: 700;
}

.trip-chip-when,
.trip-chip-len {
  color: var(--muted);
  font-size: 13px;
}

.trip-length-track {
  display: flex;
  gap: 3px;
  height: 8px;
}

.trip-length-day {
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--bar-non-edw);
}

.trip-length-day.fill-international {
  background: var(--bar-international);
}

.trip-length-day.fill-edw {
  background: var(--bar-edw);
}

.trip-length-day.fill-non-edw {
  background: var(--bar-non-edw);
}

.trip-cities {
  color: var(--info);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.trip-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
}

.trip-mode .seg {
  --tactical-corner: rgba(255, 255, 255, 0.22);
  position: relative;
  min-height: 36px;
  padding: 8px 16px;
  border: 0;
  border-radius: 2px;
  color: var(--muted);
  background:
    linear-gradient(var(--tactical-corner) 0 0) left 5px top 5px / 10px 1px no-repeat,
    linear-gradient(var(--tactical-corner) 0 0) left 5px top 5px / 1px 10px no-repeat,
    linear-gradient(var(--tactical-corner) 0 0) right 5px top 5px / 10px 1px no-repeat,
    linear-gradient(var(--tactical-corner) 0 0) right 5px top 5px / 1px 10px no-repeat,
    linear-gradient(var(--tactical-corner) 0 0) left 5px bottom 5px / 10px 1px no-repeat,
    linear-gradient(var(--tactical-corner) 0 0) left 5px bottom 5px / 1px 10px no-repeat,
    linear-gradient(var(--tactical-corner) 0 0) right 5px bottom 5px / 10px 1px no-repeat,
    linear-gradient(var(--tactical-corner) 0 0) right 5px bottom 5px / 1px 10px no-repeat;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

.trip-mode .seg:hover {
  --tactical-corner: rgba(255, 255, 255, 0.42);
  color: var(--text);
  background-color: rgba(255, 255, 255, 0.018);
}

.trip-mode .seg.active {
  --tactical-corner: var(--gold);
  color: var(--gold);
  background-color: rgba(255, 193, 7, 0.045);
}

.trip-mode .seg:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 2px;
}

.trip-dialog {
  width: min(960px, calc(100vw - 24px));
}

.trip-dialog #tripDialogTitle {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px 9px;
  margin: 0;
  min-width: 0;
}

.trip-title-group {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}

.trip-title-label {
  color: #a78bfa;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.trip-title-value {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  font-variant-numeric: tabular-nums;
}

.trip-title-primary .trip-title-value {
  font-size: 24px;
  line-height: 1;
}

.trip-title-divider {
  color: rgba(167, 139, 250, 0.38);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -1px;
}

.trip-dialog .dialog-inner {
  max-height: calc(100vh - 24px);
  overflow: auto;
}

.tl {
  width: 100%;
  min-width: 0;
  margin: 0 0 16px;
  background: transparent;
}

.tl-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  /* Keep macOS overlay scrollbars in an empty strip below the annotations. */
  padding-bottom: 16px;
}

.tl-score {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: max-content;
  min-width: 100%;
}

.tl-band {
  display: grid;
  align-items: center;
}

.tl-band-dims,
.tl-band-notes {
  height: auto;
  background: transparent;
}

.tl-band-bar {
  height: 28px;
  max-height: 28px;
  overflow: hidden;
  background: transparent;
}

.tl-dim {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 16px;
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
}

.tl-dim-arm {
  width: 1.5px;
  height: 8px;
  background: currentColor;
  flex: 0 0 auto;
}

.tl-dim-rule {
  flex: 1;
  height: 1.5px;
  background: currentColor;
  min-width: 4px;
}

.tl-dim.rest {
  color: var(--gold);
}

.tl-dim.rest strong {
  color: var(--gold);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.tl-dim.connection {
  color: #8dd8ff;
}

.tl-dim.connection span:not(.tl-dim-arm):not(.tl-dim-rule) {
  color: #d6ebff;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tl-cap {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: auto;
  pointer-events: none;
}

.tl-cap-start {
  left: 0;
}

.tl-cap-end {
  right: 0;
}

.tl-disc {
  width: 60px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.tl-disc iconify-icon {
  width: calc(100% - 4px);
  height: calc(100% - 4px);
  max-width: 60px;
  max-height: 60px;
}

.tl-disc.cml {
  color: var(--info);
}

.tl-disc.gnd {
  color: #d5dbe6;
}

.tl-disc.dom {
  color: var(--gold);
}

.tl-leg,
.tl-lo,
.tl-connection {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px;
  min-height: 0;
  min-width: 0;
  padding: 0 6px;
  white-space: nowrap;
  font-weight: 500;
  font-size: 12px;
}

.tl-leg {
  color: var(--bar-text);
  background: var(--bar-non-edw);
}

.tl.tl-fill-edw .tl-leg {
  background: var(--bar-edw);
}

.tl.tl-fill-international .tl-leg {
  background: var(--bar-international);
}

.tl.tl-fill-non-edw .tl-leg {
  background: var(--bar-non-edw);
}

.tl-seg-start {
  border-radius: 6px 0 0 6px;
}

.tl-seg-end {
  border-radius: 0 6px 6px 0;
}

.tl-seg-start.tl-seg-end {
  border-radius: 6px;
}

.tl-leg-split {
  border-left: 1px solid rgba(0, 0, 0, 0.35);
}

.tl-lo {
  background: #2c2416;
  color: var(--text);
}

.tl-lo iconify-icon {
  color: var(--gold);
}

.tl-connection {
  color: #d6ebff;
  background:
    linear-gradient(90deg, rgba(75, 164, 214, 0.14), rgba(75, 164, 214, 0.3), rgba(75, 164, 214, 0.14)),
    #13283a;
  border-left: 1px solid rgba(141, 216, 255, 0.5);
  border-right: 1px solid rgba(141, 216, 255, 0.5);
}

.tl-connection iconify-icon {
  flex: 0 0 auto;
  color: #8dd8ff;
}

.tl-chip {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: max-content;
  max-width: 100%;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.tl-duty-notes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.tl-chip.cml {
  gap: 5px;
  padding: 2px 7px;
  background: #16345c;
  color: #d6ebff;
}

.tl-chip.dh {
  background: #8b5a2b;
  color: #fff;
}

.trip-summary-panel {
  overflow: hidden;
  margin: 0 0 12px;
  border: 1px solid #2a3444;
  border-left: 2px solid #a78bfa;
  border-radius: 8px;
  background: #121823;
}

.trip-summary-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 9px 11px;
  background: #192131;
}

.trip-window {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.trip-summary-eyebrow,
.trip-summary-days-label {
  color: #a78bfa;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

.trip-summary-dates {
  color: #f0f2f6;
  font-size: 15px;
}

.trip-summary-statuses {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.trip-summary-statuses .tag {
  padding: 3px 7px;
  border: 1px solid rgba(133, 145, 164, 0.24);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.018);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.trip-chip-flags .tag-dh,
.trip-summary-statuses .tag-dh {
  color: #351c15;
  background: #f97316;
  border-color: #f97316;
}

.trip-chip-flags .tag-info,
.trip-summary-statuses .tag-info {
  color: #d7ecff;
  background: rgba(35, 78, 148, 0.72);
  border-color: rgba(95, 180, 255, 0.45);
}

.trip-chip-flags .tag-intl,
.trip-summary-statuses .tag-intl {
  color: #f3fff7;
  background: rgba(20, 118, 56, 0.9);
  border-color: rgba(61, 220, 151, 0.4);
}

.trip-chip-flags .tag-warn,
.trip-summary-statuses .tag-warn {
  color: #fff4e5;
  background: rgba(143, 41, 41, 0.9);
  border-color: rgba(255, 181, 71, 0.35);
}

.trip-chip-flags .tag-muted,
.trip-summary-statuses .tag-muted {
  color: var(--muted);
  background: rgba(143, 154, 176, 0.12);
  border-color: rgba(143, 154, 176, 0.35);
}

.trip-summary-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(68px, 1fr));
  border-top: 1px solid #2a3444;
  border-bottom: 1px solid #2a3444;
  background: #101620;
}

.trip-summary-metrics .stat {
  align-items: flex-start;
  gap: 2px;
  padding: 9px 11px;
  border-right: 1px solid rgba(98, 111, 131, 0.22);
}

.trip-summary-metrics .stat:last-child {
  border-right: 0;
}

.trip-summary-metrics .stat-value {
  color: #eef1f6;
  font-size: 16px;
  line-height: 1;
}

.trip-summary-metrics .stat-label {
  color: #7f8998;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.65px;
  text-transform: uppercase;
}

.trip-summary-days-section {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 11px;
}

.trip-summary-days {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.day-cell {
  min-width: 39px;
  padding: 4px 5px;
  border: 1px solid rgba(126, 139, 158, 0.22);
  border-radius: 4px;
  background: #0f151f;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.day-cell strong {
  display: block;
  color: #eef1f6;
  font-size: 14px;
  line-height: 1.1;
}

.day-weekday,
.day-month {
  display: block;
  color: #7f8998;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.45px;
  line-height: 1.15;
  text-transform: uppercase;
}

@media (max-width: 520px) {
  .trip-summary-metrics {
    grid-template-columns: repeat(3, minmax(68px, 1fr));
  }

  .trip-summary-metrics .stat {
    border-bottom: 1px solid rgba(98, 111, 131, 0.22);
  }

  .trip-summary-days-section {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

.duty-card {
  overflow: hidden;
  margin-top: 8px;
  border: 1px solid #293343;
  border-radius: 8px;
  background: #141a25;
}

.duty-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 9px 11px;
  background: #192131;
}

.duty-identity {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.duty-eyebrow {
  color: #a78bfa;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

.duty-window {
  color: var(--text);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.duty-totals {
  display: flex;
  align-items: center;
  gap: 14px;
}

.duty-total {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}

.duty-total-label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.duty-total-value {
  color: #d9dee8;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.duty-columns,
.clean-trip .leg {
  display: grid;
  grid-template-columns: minmax(116px, 1.35fr) 108px 58px 68px minmax(74px, auto);
  align-items: center;
  gap: 8px;
}

.duty-columns {
  padding: 5px 11px;
  border-top: 1px solid #2a3443;
  background: #101620;
  color: #798495;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.clean-trip .legs {
  margin: 0;
}

.clean-trip .leg {
  padding: 7px 11px;
  border-top: 1px solid rgba(91, 104, 124, 0.2);
  color: #cbd2dd;
  font-size: 12px;
}

.clean-trip .leg:nth-child(even) {
  background: rgba(255, 255, 255, 0.012);
}

.clean-trip .leg.deadhead {
  background: rgba(66, 118, 168, 0.055);
  color: #cbd2dd;
}

.leg-route-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 7px;
  min-width: 0;
}

.leg-cml-badge {
  flex: 0 0 auto;
  color: #f97316;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.35px;
  white-space: nowrap;
}

.clean-trip .leg-route {
  min-width: 0;
  color: #f0f2f6;
  font-weight: 700;
}

.clean-trip .leg-time {
  color: #c7ced9;
}

.clean-trip .leg-flight,
.clean-trip .leg-equip {
  color: #929dad;
}

.leg-type {
  min-width: 0;
}

.leg-operating {
  color: #778293;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.layover-card {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 5px 0;
  padding: 6px 10px;
  border: 1px solid rgba(126, 138, 154, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--muted);
  font-size: 11px;
}

.layover-card iconify-icon {
  color: #b89a54;
}

.layover-label {
  color: #7f8998;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.layover-city {
  color: #cbd2dc;
}

.layover-divider {
  color: #525d6c;
}

.layover-rest {
  color: #d6b662;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 620px) {
  .duty-columns {
    display: none;
  }

  .clean-trip .leg {
    grid-template-columns: minmax(92px, 1fr) auto auto;
    row-gap: 5px;
  }

  .clean-trip .leg-time {
    grid-column: 2 / span 2;
  }

  .clean-trip .leg-flight {
    grid-column: 1;
  }
}

.dh-board {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 0 0 12px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
}

.dh-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dh-head h3 {
  margin: 0;
  font-size: 13px;
}

.dh-head iconify-icon {
  color: var(--gold);
}

.dh-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.dh-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.dh-tile {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.dh-tile-top {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.dh-details {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.dh-subs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.dh-sub {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.dh-sub-icon {
  display: inline-flex;
  flex: 0 0 auto;
}

.dh-sub-business .dh-sub-icon {
  color: var(--gold);
}

.dh-sub-coach .dh-sub-icon {
  color: var(--success);
}

.dh-sub-value {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.dh-sub-label {
  color: var(--muted);
  font-size: 12px;
}

.dh-tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--info);
}

.dh-tile-company .dh-tile-icon {
  color: var(--gold);
  background: #241810;
}

.dh-tile-ground .dh-tile-icon {
  color: var(--warn);
}

.dh-tile-business .dh-tile-icon {
  color: var(--gold);
}

.dh-tile-coach .dh-tile-icon {
  color: var(--success);
}

.dh-tile-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dh-tile-value {
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.dh-tile-label {
  color: var(--muted);
  font-size: 11px;
}

.dh-tickets {
  display: flex;
  flex: 1 1 220px;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.dh-duty {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.dh-ticket {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border-radius: 6px;
  background: var(--bg);
}

.dh-ticket-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
}

.dh-ticket-icon {
  display: inline-flex;
  color: var(--success);
}

.dh-ticket-business {
  color: var(--gold);
}

.dh-route {
  font-weight: 700;
}

.dh-blocks {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dh-time,
.dh-flight {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 520px) {
  .dh-tile-icon {
    display: none;
  }

  .dh-tickets {
    flex-basis: 100%;
    justify-content: flex-start;
  }
}

.cms-legacy-card {
  margin: 4px 0 0;
  overflow: hidden;
  border: 1px solid #287447;
  border-radius: 2px;
  background: #f5f4d8;
  color: #151515;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.28);
  font-family: Arial, Helvetica, sans-serif;
}

.cms-legacy-accent {
  height: 6px;
  background:
    linear-gradient(
      90deg,
      #086a36 0 34%,
      #832c2f 34% 35%,
      #b39125 35% 39%,
      #217d72 39% 55%,
      #086a36 55% 100%
    );
}

.cms-legacy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 9px;
  border-bottom: 1px solid #c9c7b0;
  background: #e8e6ca;
  color: #1f2b24;
  font-size: 11px;
}

.cms-legacy-head strong {
  font-size: 12px;
}

.cms-legacy-head span {
  color: #267c70;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.cms-legacy-scroll {
  overflow-x: auto;
  padding: 8px;
}

.cms-legacy-rows {
  width: max-content;
  min-width: 100%;
  border: 1px solid #c5c2b5;
  background: #dedbdf;
}

.cms-legacy-row {
  display: grid;
  grid-template-columns: 8fr 15fr 8fr 4fr 13fr 6fr 6fr 12fr 6fr 6fr 8fr;
  min-width: 600px;
  color: #151515;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.1;
}

.cms-legacy-row > span {
  min-width: 0;
  padding: 3px 2px;
  overflow: hidden;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap;
}

.cms-legacy-columns {
  background: #4e9f9c;
  color: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 9px;
  font-weight: 700;
}

.cms-legacy-odd {
  background: #dedbdf;
}

.cms-legacy-even {
  background: #eeecee;
}

.cms-legacy-duty {
  display: block;
  padding: 3px 6px;
  border-top: 1px solid #bbb7bc;
  border-bottom: 1px solid #bbb7bc;
  background: #cbc8cc;
  text-align: center;
}

.cms-legacy-summary {
  display: block;
  padding: 3px 6px;
  background: #bdb9bf;
  text-align: center;
}

.pairing-text {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: #0b0f17;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre;
  overflow: auto;
  max-width: 100%;
}

/* ---------- row flag and X ---------- */

.row-flag,
.row-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.row-flag:hover:not(:disabled),
.row-x:hover {
  border-color: var(--line);
}

.row-flag.on {
  color: var(--info);
}

.row-x.on {
  color: var(--danger);
}

.row-flag:disabled {
  opacity: 0.3;
  cursor: default;
}

/* ---------- list toolbar ---------- */

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.packet-toolbar .list-toolbar {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid rgba(36, 48, 73, 0.62);
}

.kind-toggle {
  flex-wrap: wrap;
}

.packet-toolbar .kind-toggle {
  flex-wrap: nowrap;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.packet-toolbar .kind-toggle::-webkit-scrollbar {
  display: none;
}

.kind-toggle .seg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.kind-label {
  font-weight: 600;
}

.kind-count {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
}

.bulk-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.bulk-bar .btn {
  min-height: 36px;
  padding: 6px 12px;
}

.bulk-menu {
  position: relative;
}

.bulk-menu > summary {
  list-style: none;
  cursor: pointer;
}

.bulk-menu > summary::-webkit-details-marker {
  display: none;
}

.bulk-menu-list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.bulk-menu-list .btn {
  justify-content: flex-start;
}

/* ---------- active filter chips ---------- */

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 32px;
  padding: 4px 10px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--gold);
  font-size: 13px;
  cursor: pointer;
  overflow-wrap: anywhere;
  text-align: left;
}

/* ---------- calendar legend ---------- */

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 12px;
  font-size: 12px;
}

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

.swatch {
  display: inline-block;
  width: 18px;
  height: 10px;
  border-radius: 3px;
  background: var(--panel-2);
}

.swatch.band-weekend {
  background: var(--cal-weekend);
  outline: 1px solid var(--line);
}

.swatch.band-off {
  background: var(--gold);
  outline: 1px solid var(--gold);
}

/* ---------- calendar view ---------- */

.cal-board {
  --day-w: 34px;
  --id-w: 220px;
  --lane-h: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.cal-scroll {
  max-height: max(320px, calc(100dvh - var(--topbar-h) - 32px));
  overflow: auto;
  overscroll-behavior: contain;
}

.cal-grid {
  width: max-content;
}

.cal-head,
.cal-row {
  display: grid;
  grid-template-columns: var(--id-w) calc(var(--days) * var(--day-w));
}

.cal-head {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.cal-corner {
  position: sticky;
  left: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 6px 10px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  font-weight: 600;
}

.cal-weeks,
.cal-daynums {
  display: grid;
  grid-template-columns: repeat(var(--days), var(--day-w));
}

.cal-week {
  padding: 6px 8px 2px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 1px solid var(--line);
}

.cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 0 6px;
  font-size: 11px;
  line-height: 1.2;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
}

.cal-day.weekend {
  background: var(--cal-weekend);
  color: var(--text);
}

.cal-day.off {
  background-color: var(--gold);
  background-image: var(--cal-off-x-soft);
  background-repeat: no-repeat;
  background-position: center;
  background-size: min(20px, 74%) min(20px, 68%);
  color: var(--cal-off-ink);
  box-shadow: inset 1px 0 0 rgba(11, 15, 23, 0.28);
}

.cal-day.off .cal-dow,
.cal-day.off .cal-dom {
  color: var(--cal-off-ink);
  font-weight: 800;
}

.cal-day.week-start {
  border-left: 1px solid var(--line);
}

.cal-dow {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cal-dom {
  font-weight: 600;
}

.cal-row {
  border-bottom: 1px solid var(--line);
}

.cal-row.dragging {
  opacity: 0.5;
}

.cal-row.drop-before {
  box-shadow: inset 0 3px 0 var(--gold);
}

.cal-row.drop-after {
  box-shadow: inset 0 -3px 0 var(--gold);
}

.cal-id {
  position: sticky;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  min-width: 0;
}

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

.cal-check {
  width: 16px;
  height: 16px;
  margin: 0 4px 0 0;
  accent-color: var(--gold);
}

.cal-handle {
  cursor: grab;
  padding: 4px;
}

.cal-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cal-line {
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.cal-meta {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.cal-captains {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.25;
  color: var(--text);
}

.cal-group-head {
  position: sticky;
  left: 0;
  width: max-content;
  max-width: 100vw;
  padding: 10px 12px 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
}

.cal-crew {
  overflow-wrap: anywhere;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--gold);
}

.cal-off-x {
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  left: calc(var(--offset) * var(--day-w));
  width: var(--day-w);
  pointer-events: none;
  background: center / min(28px, 72%) min(28px, 72%) no-repeat var(--cal-off-x);
}

.cal-track {
  position: relative;
  min-height: calc(var(--lanes, 1) * var(--lane-h) + 8px);
  background-image:
    repeating-linear-gradient(
      to right,
      transparent 0,
      transparent calc(var(--day-w) - 1px),
      rgba(255, 255, 255, 0.04) calc(var(--day-w) - 1px),
      rgba(255, 255, 255, 0.04) var(--day-w)
    ),
    var(--cal-bands);
}

.cal-pill,
.cal-special {
  position: absolute;
  top: calc(var(--lane) * var(--lane-h) + 4px);
  left: calc(var(--offset) * var(--day-w) + 2px);
  /* --label-w is the measured route. The column width is raised to match a
     trip's own days; a bar clipped by the bid window can still grow into
     open days so the last city is not cut off. Padding, border, and the
     4px gap are shared with calendarColumnWidth in lib/bidpro.js. */
  width: max(calc(var(--length) * var(--day-w) - 4px), var(--label-w, 0px));
  height: calc(var(--lane-h) - 4px);
  display: flex;
  align-items: center;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.15;
  overflow: hidden;
  text-align: left;
}

.cal-board.whole-bid .cal-scroll {
  scrollbar-gutter: stable;
}

.cal-board.whole-bid .cal-pill,
.cal-board.whole-bid .cal-special {
  width: max(2px, calc(var(--length) * var(--day-w) - 4px));
}

.cal-board.whole-bid .cal-pill-text,
.cal-board.whole-bid .cal-special {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-board.whole-bid .cal-special {
  line-height: calc(var(--lane-h) - 6px);
}

.cal-board.whole-bid .cal-dow,
.cal-board.fit-tight .cal-day .cal-dow,
.cal-board.fit-tight .cal-day .cal-dom,
.cal-board.fit-tight .cal-week .muted {
  display: none;
}

/* Dates that do not fit still leave a gold block on each day wanted off.
   Hidden days stay in their columns so the blocks do not slide left. */
.cal-board.fit-tight .cal-day:not(.off) {
  align-self: start;
  height: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: transparent;
}

.cal-board.fit-tight .cal-day.off {
  min-height: 8px;
  padding: 4px 0;
}

.cal-board.fit-tight .cal-track {
  background-image: var(--cal-bands);
}

.cal-board.fit-plain .cal-pill.mark-commute,
.cal-board.fit-plain .cal-pill.mark-dh,
.cal-board.fit-plain .cal-pill.mark-ground {
  box-shadow: none;
  padding-left: 6px;
}

.cal-pill {
  cursor: pointer;
  color: var(--bar-text);
}

.cal-pill:hover,
.cal-pill:focus-visible {
  z-index: 1;
  outline: 2px solid var(--text);
  outline-offset: 1px;
}

.cal-pill-text {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  white-space: nowrap;
}

.cal-pill-city {
  flex: 0 0 auto;
}

.cal-pill-measure {
  position: fixed;
  left: 0;
  top: 0;
  visibility: hidden;
  pointer-events: none;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.15;
}

.fill-edw {
  background: var(--bar-edw);
}

.fill-non-edw {
  background: var(--bar-non-edw);
}

.fill-international {
  background: var(--bar-international);
}

.fill-reserve {
  background: var(--bar-reserve);
}

.fill-lco {
  background: var(--bar-lco);
}

.cal-pill.mark-commute,
.swatch.mark-commute,
.month-bar.mark-commute {
  box-shadow: inset 5px 0 0 var(--info);
}

.cal-pill.mark-dh,
.swatch.mark-dh,
.month-bar.mark-dh {
  box-shadow: inset 5px 0 0 #8b5a2b;
}

.cal-pill.mark-ground,
.swatch.mark-ground,
.month-bar.mark-ground {
  box-shadow: inset 5px 0 0 #5b6475;
}

.cal-pill.mark-commute,
.cal-pill.mark-dh,
.cal-pill.mark-ground {
  padding-left: 9px;
}

/* One cell per day: layover city, or L/O while that layover continues. */
.cal-pill.cal-day-labels,
.cal-board.whole-bid .cal-pill.cal-day-labels {
  left: calc(var(--offset) * var(--day-w) + 2px);
  width: calc(var(--length) * var(--day-w) - 4px);
  display: grid;
  grid-template-columns: repeat(var(--length), minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  padding: 0;
  overflow: hidden;
  text-overflow: clip;
  white-space: normal;
  text-align: center;
}

.cal-pill.cal-day-labels.mark-commute,
.cal-pill.cal-day-labels.mark-dh,
.cal-pill.cal-day-labels.mark-ground {
  padding-left: 0;
}

.cal-pill.cal-day-labels.mark-commute .cal-day-label:first-child,
.cal-pill.cal-day-labels.mark-dh .cal-day-label:first-child,
.cal-pill.cal-day-labels.mark-ground .cal-day-label:first-child {
  padding-left: 5px;
}

.cal-special {
  background: var(--panel-2);
  border-color: var(--line);
  color: var(--text);
}

.cal-special.type-reserve,
.cal-special.type-hot {
  background: var(--bar-reserve);
  border-color: var(--bar-reserve);
  color: var(--bar-text);
}

.cal-special.type-lco {
  background: var(--bar-lco);
  border-color: var(--bar-lco);
  color: var(--bar-text);
}

.cal-special.type-vto,
.cal-special.type-vtor {
  background: transparent;
  border-color: transparent;
  color: var(--success);
}

/* VTO and VOR: the code sits in each day column. No box around the run. */
.cal-special.cal-day-labels,
.cal-board.whole-bid .cal-special.cal-day-labels {
  left: calc(var(--offset) * var(--day-w));
  width: calc(var(--length) * var(--day-w));
  display: grid;
  grid-template-columns: repeat(var(--length), minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.15;
}

.cal-day-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: inherit;
}

.cal-day-label.stacked .cal-day-code {
  font-size: 10px;
  line-height: 1;
}

.cal-day-code {
  /* 11px "VOR" is about 24px wide. Scale down so each day still holds the word. */
  font-size: min(11px, calc((var(--day-w) - 2px) * 0.45));
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
}

@media (max-width: 760px) {
  .cal-board {
    --day-w: 30px;
    --id-w: 172px;
  }

  .cal-scroll {
    max-height: max(320px, calc(100dvh - 160px));
  }

  .cal-controls .row-flag,
  .cal-controls .row-x {
    min-width: 28px;
  }

  .cal-line {
    font-size: 15px;
  }

  .cal-meta {
    white-space: normal;
  }
}

/* ---------- calendar full screen ---------- */

.focus-chrome,
.focus-move,
#focusSortSlot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.focus-select {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 0;
  max-width: 220px;
  font-weight: 600;
}

body.calendar-focus {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

body.calendar-focus .topbar {
  position: sticky;
  top: 0;
  flex: none;
}

body.calendar-focus .topbar-left {
  order: 1;
}

body.calendar-focus .focus-chrome {
  order: 2;
  flex: 1 1 320px;
}

body.calendar-focus .topbar-center {
  order: 3;
  flex: 1 1 220px;
}

body.calendar-focus .topbar-right {
  order: 4;
}

#focusLegendButton[aria-pressed="true"],
#wholeBidButton[aria-pressed="true"] {
  border-color: var(--gold);
  color: var(--gold);
}

#wholeBidHome,
#focusWholeBidSlot {
  display: contents;
}

body.calendar-focus .brand,
body.calendar-focus #openFiltersButton,
body.calendar-focus #uploadButton {
  display: none !important;
}

body.calendar-focus .banner {
  position: static;
  flex: none;
}

body.calendar-focus .board,
body.calendar-focus .board.unfiltered {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
}

body.calendar-focus .buckets {
  display: none !important;
}

body.calendar-focus .filters {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(340px, 90vw);
  height: 100dvh;
  transform: translateX(-102%);
  transition: transform 0.2s ease;
  box-shadow: 8px 0 24px rgba(0, 0, 0, 0.4);
}

body.calendar-focus.filters-open .filters {
  transform: translateX(0);
}

body.calendar-focus .filters .narrow-only {
  display: inline-flex;
}

body.calendar-focus .center {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

body.calendar-focus .packet-toolbar,
body.calendar-focus #listToolbar,
body.calendar-focus #filterChips,
body.calendar-focus #daysOffNotice,
body.calendar-focus #rankNotice {
  display: none !important;
}

body.calendar-focus #calendarLegend {
  margin: 0;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

body.calendar-focus #emptyList {
  padding: 28px 16px;
}

body.calendar-focus .cal-board:not([hidden]) {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 0;
  border-radius: 0;
}

body.calendar-focus .cal-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  height: auto;
}

@media (hover: hover) and (pointer: fine) {
  body.calendar-focus .cal-controls .cal-check,
  body.calendar-focus .cal-controls .cal-handle,
  body.calendar-focus .cal-controls .row-flag:not(.on):not(:disabled),
  body.calendar-focus .cal-controls .row-x:not(.on) {
    opacity: 0.38;
  }

  body.calendar-focus .cal-row:hover .cal-controls .cal-check,
  body.calendar-focus .cal-row:hover .cal-controls .cal-handle,
  body.calendar-focus .cal-row:hover .cal-controls .row-flag,
  body.calendar-focus .cal-row:hover .cal-controls .row-x,
  body.calendar-focus .cal-row:focus-within .cal-controls .cal-check,
  body.calendar-focus .cal-row:focus-within .cal-controls .cal-handle,
  body.calendar-focus .cal-row:focus-within .cal-controls .row-flag,
  body.calendar-focus .cal-row:focus-within .cal-controls .row-x,
  body.calendar-focus .cal-row:has(.cal-check:checked) .cal-controls .cal-check,
  body.calendar-focus .cal-row:has(.cal-check:checked) .cal-controls .cal-handle,
  body.calendar-focus .cal-row:has(.cal-check:checked) .cal-controls .row-flag,
  body.calendar-focus .cal-row:has(.cal-check:checked) .cal-controls .row-x {
    opacity: 1;
  }
}

@media (max-width: 760px) {
  body.calendar-focus .topbar {
    position: sticky;
    top: 0;
  }

  body.calendar-focus .search-wrap,
  body.calendar-focus .focus-select {
    flex: 1 1 140px;
  }
}
