:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1f2933;
  --muted: #64748b;
  --line: #d8dee8;
  --accent: #2457c5;
  --accent-dark: #173f95;
  --warn: #9a5b00;
  --warn-bg: #fff4d8;
  --today: #2457c5;
  --today-bg: #eaf0ff;
  --secondary-bg: #e8edf7;
  --secondary-hover: #dbe3f2;
}

:root[data-theme="night"] {
  --bg: #0f172a;
  --panel: #172033;
  --text: #e5edf7;
  --muted: #9fb0c7;
  --line: #2d3a52;
  --accent: #7aa2ff;
  --accent-dark: #d5e2ff;
  --warn: #ffd27a;
  --warn-bg: #3a2b10;
  --today: #7aa2ff;
  --today-bg: #1d2b4a;
  --secondary-bg: #26344d;
  --secondary-hover: #2f4060;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
  display: grid;
  gap: 10px;
  padding: 12px 28px 0;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { color: var(--text); font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: stretch; }
.main-nav a, .nav-more summary {
  display: flex; align-items: center; min-height: 40px; padding: 0 12px;
  color: var(--muted); font-weight: 650; border-bottom: 3px solid transparent; cursor: pointer;
}
.main-nav a:hover, .nav-more summary:hover { color: var(--text); text-decoration: none; }
.main-nav a.active, .nav-more.active summary { color: var(--accent-dark); border-bottom-color: var(--accent); }
.main-nav a.home { color: var(--text); }
.nav-more { position: relative; }
.nav-more summary { list-style: none; }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary::after { content: "▾"; margin-left: 6px; font-size: 11px; }
.nav-more-menu {
  position: absolute; right: 0; top: 100%; z-index: 20; display: grid; min-width: 190px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(15, 23, 42, .14);
}
.nav-more-menu a { min-height: 38px; border: 0; border-radius: 6px; color: var(--text); }
.nav-more-menu a:hover { background: var(--secondary-bg); }
.print-title { display: none; }
.page { max-width: 1180px; margin: 0 auto; padding: 28px; }
.page-header, .section-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
}
h1, h2 { margin: 0 0 10px; }
h1 { font-size: 34px; }
h2 { font-size: 22px; }
.eyebrow { margin: 0 0 6px; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
/* One button size everywhere: 40px tall (32px for .small, in tables and section headings). */
.button, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.button:hover, button:hover { text-decoration: none; filter: brightness(.95); }
.button.secondary, button.secondary { background: var(--secondary-bg); color: var(--accent-dark); }
:root[data-theme="night"] .button.secondary, :root[data-theme="night"] button.secondary { color: var(--text); }
.button.danger, button.danger { background: #b42318; color: #fff; }
.button.small, button.small { min-height: 32px; padding: 0 12px; font-size: 13px; }
.button.danger-outline, button.danger-outline { background: transparent; color: #b42318; box-shadow: inset 0 0 0 1px #f3b4ae; }
:root[data-theme="night"] .button.danger-outline { color: #ff9b91; box-shadow: inset 0 0 0 1px #7a2a24; }
.theme-toggle { width: auto; }
:root[data-theme="night"] .date-picker-button {
  background: #26344d;
  color: var(--text);
}
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.actions select { width: auto; min-height: 40px; padding: 0 10px; }
.actions .inline-form, .section-actions .inline-form { display: inline-flex; }
.inline-form { display: inline-flex; gap: 10px; align-items: center; margin: 0; }
.inline-form select { min-width: 190px; background: var(--panel); }
.inline-form label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.inline-form input[type="text"] { min-width: 150px; background: var(--panel); }
.date-entry { display: inline-grid; grid-template-columns: minmax(150px, 1fr) auto; gap: 6px; align-items: center; position: relative; }
.date-picker-button { padding: 0 12px; background: var(--secondary-bg); color: var(--accent-dark); }
.date-picker-native { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 26px; }
.metrics article, article, .confirm-panel, .calendar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.fc .fc-event {
  overflow: hidden;
}
.fc .fc-event-main {
  color: inherit;
}
.metrics span { display: block; font-size: 32px; font-weight: 800; }
.metrics p { margin: 4px 0 0; color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; margin-bottom: 26px; }
.list { display: grid; gap: 10px; }
.row {
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.row span, table span { display: block; color: var(--muted); margin-top: 3px; }
.google-profiles { margin-bottom: 26px; }
.profile-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.table-actions { display: flex; gap: 10px; flex-wrap: wrap; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: 0; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; background: #eef2f7; color: var(--text); font-size: 12px; font-weight: 700; }
.color-chip { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line); vertical-align: -3px; }
.warnings { margin-bottom: 22px; padding: 12px 16px; border: 1px solid #f1c979; border-radius: 8px; background: var(--warn-bg); color: var(--warn); }
.warnings p { margin: 6px 0; }
dl { display: grid; grid-template-columns: 130px 1fr; gap: 10px; }
dt { color: var(--muted); font-weight: 700; }
dd { margin: 0; }
.notes-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.notes-grid p { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.filters, .form {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.filters { grid-template-columns: 1fr 220px auto auto auto; align-items: center; }
.checkbox-filter { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 700; }
.checkbox-filter input { width: auto; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  font: inherit;
  background: var(--panel);
  color: var(--text);
}
textarea { min-height: 96px; }
.form p { margin: 0; }
.form label { display: block; margin-bottom: 5px; font-weight: 700; }
.empty { color: var(--muted); }
.confirm-panel { max-width: 620px; margin: 40px auto; }
.confirm-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.message { margin: 0 0 12px; padding: 10px 12px; border-radius: 6px; background: #e7f5ec; }
:root[data-theme="night"] .message { background: #173524; }
:root[data-theme="night"] .badge { background: #26344d; color: var(--text); }
:root[data-theme="night"] .fc {
  color: var(--text);
}
:root[data-theme="night"] .fc .fc-scrollgrid,
:root[data-theme="night"] .fc td,
:root[data-theme="night"] .fc th {
  border-color: var(--line);
}
:root[data-theme="night"] .fc .fc-daygrid-day-number,
:root[data-theme="night"] .fc .fc-col-header-cell-cushion,
:root[data-theme="night"] .fc .fc-list-day-text,
:root[data-theme="night"] .fc .fc-list-day-side-text {
  color: var(--text);
}

@media (max-width: 760px) {
  .topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    gap: 8px;
    padding: 10px 12px;
  }
  .brand { font-size: 17px; }
  .user-name { display: none; }
  .main-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .main-nav a, .nav-more summary {
    justify-content: center;
    min-height: 38px;
    padding: 0 4px;
    border: 0;
    border-radius: 6px;
    background: var(--secondary-bg);
    text-align: center;
    font-size: 13px;
  }
  .main-nav a.active, .nav-more.active summary { background: var(--accent); color: #fff; }
  .nav-more-menu { right: 0; }
  .page-header, .section-title { align-items: stretch; flex-direction: column; }
  .metrics, .grid-2, .notes-grid, .filters { grid-template-columns: 1fr; }
  .inline-form { align-items: stretch; flex-direction: column; }
  .confirm-actions { flex-direction: column; }
  .page-header .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-header .actions > *, .page-header .actions .inline-form, .page-header .actions .inline-form > button { width: 100%; }
  .page-header > .button { width: 100%; }
  .form .actions > * { flex: 1 1 0; }
  .user-menu .button, .user-menu button { width: auto; }
  .date-entry { grid-template-columns: 1fr auto; }
  .profile-row { align-items: stretch; flex-direction: column; }
  .page { padding: 14px; }
  h1 { font-size: 28px; }
  h2 { font-size: 20px; }
  .metrics span { font-size: 26px; }
  .metrics article, article, .confirm-panel, .calendar, .filters, .form { padding: 14px; }
  dl { grid-template-columns: 1fr; gap: 4px; }
  dd { margin-bottom: 10px; }
  th, td { padding: 11px 10px; }
  .fc .fc-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
  }
  .fc .fc-toolbar-title {
    font-size: 20px;
    text-align: center;
  }
  .fc .fc-button {
    padding: 7px 9px;
    font-size: 13px;
    width: auto;
  }
  .fc .fc-header-toolbar .fc-toolbar-chunk {
    display: flex;
    justify-content: center;
  }
}

/* User menu and buttons that look like links */
.user-menu { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.link-button { min-height: 0; background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: inherit; cursor: pointer; }
.table-actions .inline-form { display: inline; }

/* Crew needed checklist and assignment mode */
.crew-needed { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--muted); }
.badge.ok { background: #dcfce7; color: #166534; }
.badge.missing { background: #fee2e2; color: #991b1b; }
.badge.waiting { background: #fef3c7; color: #92400e; }
.badge.operates { background: #fef3c7; color: #92400e; }

/* Room board */
.page-wide { max-width: none; padding-left: 16px; padding-right: 16px; }
.board-nav { flex-wrap: wrap; }
.board-wrap { overflow-x: auto; }
/* Fixed layout with column widths from the view, so the whole month fits the screen width. */
.room-board { border-collapse: separate; border-spacing: 0; font-size: 12.5px; width: 100%; table-layout: fixed; }
.room-board th, .room-board td { padding: 4px 6px; vertical-align: top; white-space: normal; overflow-wrap: break-word; border-bottom: 1px solid var(--line); }
.room-board thead th { position: sticky; top: 0; background: var(--panel); z-index: 2; font-size: 11px; }
.room-board .board-room { text-align: left; font-size: 13px; text-transform: none; letter-spacing: 0; border-left: 2px solid var(--line); }
.room-board .room-start { border-left: 2px solid var(--line); }
.room-board .board-day { position: sticky; left: 0; z-index: 1; background: var(--panel); text-align: left; font-weight: 700; }
.room-board thead .board-day { z-index: 3; }
.room-board span { display: inline; margin-top: 0; }
.room-board .board-day span { display: block; color: var(--muted); font-weight: 500; font-size: 11px; }
.room-board tr.weekend > * { background: color-mix(in srgb, var(--panel) 92%, var(--muted)); }
.room-board tr.today > .board-day { box-shadow: inset 4px 0 0 #2457c5; }
.board-line { min-height: 20px; line-height: 20px; }
.board-event { white-space: normal; }
.board-load-in { white-space: nowrap; }
/* Start and end each stay whole; only if the column is still too narrow does the end move to the next line. */
.board-range > span { white-space: nowrap; }
.board-time { font-size: 12px; font-variant-numeric: tabular-nums; }
.board-load-in { color: var(--muted); font-size: 11px; }
.board-event a { font-weight: 650; }
.board-event.cancelled a:first-child { text-decoration: line-through; color: var(--muted); }
.board-tag { margin-left: 4px; font-size: 11px; color: var(--muted); }
.board-other { display: block; font-size: 11px; color: var(--muted); }
.room-board .crew-name, .room-board .whole-venue-crew { color: var(--text); margin-right: 4px; }
.room-board td .crew-name { font-size: 12px; }
.whole-venue-crew { white-space: nowrap; }
.room-board .crew-name.pending, .board-legend .crew-name.pending { color: var(--muted); font-style: italic; }
.room-board .crew-name.maybe { color: #b45309; }
.room-board .crew-name.declined, .board-legend .crew-name.declined { color: #b91c1c; text-decoration: line-through; }
.room-board .whole-venue { white-space: normal; border-left: 2px solid var(--line); }
.whole-venue-entry { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 4px 8px; border-radius: 6px; background: color-mix(in srgb, #2457c5 12%, var(--panel)); }
.whole-venue-entry .board-event { max-width: none; min-width: 0; }
.whole-venue-times { color: var(--muted); }
.board-legend { color: var(--muted); font-size: 12px; }
/* Too narrow to fit every room (phones): keep the layout and scroll sideways. */
@media (max-width: 1000px) { .room-board { width: 1200px; } }
@media print {
  .topbar, .board-nav, .board-legend { display: none; }
  .page-wide { padding: 0; }
  .room-board { font-size: 9px; }
  .room-board thead th, .room-board .board-day { position: static; }
}

/* Back button and "Go to" controls */
.back-button {
  display: inline-flex; align-items: center; gap: 6px; box-sizing: border-box;
  min-height: 32px; margin-bottom: 14px; padding: 0 12px; border-radius: 6px;
  background: var(--secondary-bg); color: var(--accent-dark);
  font-weight: 700; font-size: 13px; line-height: 1.2; text-decoration: none;
}
.back-button:hover { background: var(--secondary-hover); text-decoration: none; }
:root[data-theme="night"] .back-button { background: #26344d; color: var(--text); }
.go-to { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.go-to .go-to { margin: 0; }
.go-to label { color: var(--muted); font-size: 12px; font-weight: 700; }
.go-to select, .go-to input[type="date"], .go-to button {
  -webkit-appearance: none; appearance: none;
  box-sizing: border-box; height: 40px; width: auto; min-width: 0; margin: 0;
  font: inherit; font-size: 15px; line-height: 1.2; border-radius: 6px;
}
.go-to select, .go-to input[type="date"] {
  border: 1px solid var(--line); background-color: var(--panel); color: var(--text); padding: 0 10px;
}
.go-to select {
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23667085'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.go-to input[type="date"] { min-width: 150px; }
.go-to input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.go-to button { padding: 0 16px; width: auto; }
.go-to .divider { color: var(--line); }
.room-board tr.target > * { background: color-mix(in srgb, #f59e0b 18%, var(--panel)); }

/* WhatsApp */
.whatsapp-button {
  display: inline-flex; align-items: center; gap: 4px; box-sizing: border-box;
  min-height: 32px; padding: 0 12px; border-radius: 6px;
  background: #25d366; color: #073b1c; font-size: 13px; font-weight: 700; text-decoration: none;
}
.whatsapp-button::before { content: "💬"; font-size: 12px; }
.whatsapp-button:hover { background: #1ebe5a; }

/* Riders from Drive / Gmail */
.rider-sources { display: inline-flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.notice { border: 1px solid #f59e0b; background: color-mix(in srgb, #f59e0b 12%, var(--panel)); border-radius: 8px; padding: 14px 16px; margin-bottom: 18px; }
.notice p { margin: 0 0 8px; }
.rider-link-form input[type="url"], .go-to .rider-search {
  -webkit-appearance: none; appearance: none; box-sizing: border-box; height: 40px;
  border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; background: var(--panel); color: var(--text); font: inherit; font-size: 15px;
}
.rider-link-form input[type="url"] { flex: 1 1 360px; width: auto; }
.go-to .rider-search { flex: 0 1 380px; width: auto; }
.go-to .check, .import-bar .check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); font-weight: 500; }
.check input { width: auto; }
.rider-candidates td:first-child { width: 110px; }
.rider-candidates input[type="checkbox"] { width: 18px; height: 18px; }
.rider-candidates select { width: auto; padding: 6px 8px; }
.rider-candidates .nowrap { white-space: nowrap; }
.muted-row td { color: var(--muted); }
.email-result { margin-bottom: 14px; }
.email-result h3 { margin: 0 0 2px; font-size: 16px; }
.hint { color: var(--muted); font-size: 13px; }
.import-bar { align-items: center; margin-top: 14px; }
.message.error { background: #fde8e8; }
.message.warning { background: #fef3c7; }
:root[data-theme="night"] .message.error { background: #4a1d1d; }
:root[data-theme="night"] .message.warning { background: #45360f; }
.rider-link-form { margin-bottom: 28px; }

/* Gmail rider search */
.gmail-search { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; align-items: end; margin-bottom: 8px; }
.gmail-search label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 700; }
.gmail-search input {
  -webkit-appearance: none; appearance: none; box-sizing: border-box; height: 40px; width: 100%;
  border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; background: var(--panel); color: var(--text);
  font: inherit; font-size: 15px; font-weight: 400;
}
.gmail-search .wide { grid-column: span 3; }
.gmail-search-actions { display: flex; gap: 14px; align-items: center; }
.gmail-search-actions .button { height: 40px; width: auto; }
@media (max-width: 800px) {
  .gmail-search { grid-template-columns: 1fr 1fr; }
  .gmail-search .wide { grid-column: span 2; }
}
.related-heading { margin: 22px 0 2px; }
.email-result.same-conversation { border-left: 3px solid var(--accent); }
.rider-candidates th input[type="checkbox"] { width: 18px; height: 18px; }
.folder-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 16px; }
.go-to label[for="drive-q"] { color: var(--muted); font-size: 12px; font-weight: 700; }
.email-result h3 + .table-wrap { margin-top: 10px; }

/* Rider folder */
.page-wide { max-width: none; }
.rider-folder { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 18px; align-items: start; }
.folder-list-pane { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.drop-zone { border: 2px dashed var(--line); border-radius: 8px; padding: 12px; margin-bottom: 12px; text-align: center; transition: border-color .15s, background .15s; }
.drop-zone.dragging { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--panel)); }
.drop-zone.busy { opacity: .6; pointer-events: none; }
.drop-label { display: grid; gap: 2px; cursor: pointer; color: var(--accent-dark); }
.drop-label span { color: var(--muted); font-size: 13px; }
.drop-options { display: flex; gap: 8px; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: 13px; }
.drop-options select { width: auto; padding: 5px 8px; font-size: 13px; }
.folder-heading { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 10px 4px 4px; cursor: pointer; }
.folder-items { list-style: none; margin: 0; padding: 0; }
.folder-item { display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 6px; padding: 8px; border-radius: 6px; color: var(--text); text-decoration: none; }
.folder-item:hover { background: color-mix(in srgb, var(--accent) 6%, var(--panel)); }
.folder-item.active { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); }
.folder-icon { grid-row: span 2; font-size: 18px; line-height: 1.2; }
.folder-name { font-weight: 650; overflow-wrap: anywhere; }
.folder-meta { color: var(--muted); font-size: 12px; }
.older .folder-item { opacity: .75; }
.preview-pane { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; min-width: 0; }
.preview-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.preview-head h2 { margin: 0 0 2px; font-size: 20px; overflow-wrap: anywhere; }
.preview-head .hint { margin: 0; }
.preview-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.preview-actions .button { padding: 8px 12px; font-size: 14px; width: auto; }
.preview-body iframe { width: 100%; height: calc(100vh - 210px); min-height: 480px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.image-frame { text-align: center; background: color-mix(in srgb, var(--line) 30%, var(--panel)); border-radius: 6px; padding: 10px; }
.image-frame img { max-width: 100%; max-height: calc(100vh - 230px); object-fit: contain; }
.no-preview { display: grid; place-items: center; gap: 10px; min-height: 260px; text-align: center; color: var(--muted); }
@media (max-width: 900px) {
  .rider-folder { grid-template-columns: 1fr; }
  .folder-list-pane { position: static; max-height: none; }
  .preview-body iframe { height: 70vh; min-height: 360px; }
}
.folder-item:hover, .folder-item:hover * { text-decoration: none; }

/* PDFs drawn page by page on phones and tablets (pdf_viewer.js) */
.pdf-pages { display: grid; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: color-mix(in srgb, var(--line) 35%, var(--panel)); }
.pdf-page { width: 100%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); }
.pdf-page canvas { display: block; width: 100%; height: auto; }
.pdf-status { margin: 0; text-align: center; }

/* Reports */
.report-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.report-tabs a { padding: 8px 14px; border-radius: 6px; background: var(--panel); border: 1px solid var(--line); color: var(--text); font-weight: 650; }
.report-tabs a.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.report-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0 0 18px; }
.report-facts div { min-width: 120px; }
.report-facts dt { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.report-facts dd { margin: 2px 0 0; font-weight: 650; }
.report-table td.num, .report-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.report-table tfoot th { border-top: 2px solid var(--line); }
.report section { margin-bottom: 22px; }

/* Crew answers to their own calls */
.respond-form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.respond-form button.respond { width: auto; padding: 6px 12px; font-size: 13px; min-height: 34px; }
.respond-form button.confirm { background: #15803d; color: #fff; }
.respond-form button.maybe { background: #fef3c7; color: #92400e; }
.respond-form button.decline { background: #fee2e2; color: #991b1b; }
.badge.status-confirmed { background: #dcfce7; color: #166534; }
.badge.status-declined { background: #fee2e2; color: #991b1b; }
.badge.status-maybe { background: #fef3c7; color: #92400e; }
.answer-panel { border-left: 4px solid #f59e0b; }
@media (max-width: 760px) {
  .respond-form button.respond { flex: 1 1 0; width: auto; }
}
.row span.badge, table span.badge { display: inline-block; }
.respond-locked { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }

/* Section headings with small buttons on the right */
.section-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.table-actions { align-items: center; gap: 6px; }

/* Today, everywhere */
.badge.today { background: var(--today); color: #fff; }
tr.today > td, tr.today > th { background: var(--today-bg); }
tr.today > :first-child { box-shadow: inset 4px 0 0 var(--today); }
.row.today { border-color: var(--today); box-shadow: inset 4px 0 0 var(--today); background: var(--today-bg); }
/* The calendar marks today's show day (07:00 to 07:00) with .lav-today, not FullCalendar's own date. */
.fc { --fc-today-bg-color: transparent; }
.fc .lav-today { background: var(--today-bg); }
.fc .fc-daygrid-day.lav-today .fc-daygrid-day-number {
  background: var(--today); color: #fff !important; border-radius: 999px; min-width: 26px; text-align: center; margin: 2px; padding: 2px 6px;
}
.fc .fc-col-header-cell.lav-today { box-shadow: inset 0 -3px 0 var(--today); }
.fc .fc-col-header-cell.lav-today .fc-col-header-cell-cushion { color: var(--today) !important; font-weight: 800; }
.fc .fc-list-day.lav-today > * { background: var(--today) !important; }
.fc .fc-list-day.lav-today .fc-list-day-text, .fc .fc-list-day.lav-today .fc-list-day-side-text { color: #fff !important; }
.fc .fc-timegrid-now-indicator-line { border-color: #e11d48; }
.room-board tr.today > * { background: var(--today-bg); }
.room-board tr.today > .board-day { box-shadow: inset 4px 0 0 var(--today); color: var(--today); }

/* Calendar toolbar buttons: same size as the rest of the app */
.fc .fc-button { min-height: 36px; padding: 0 12px; font-size: 14px; font-weight: 650; text-transform: none; line-height: 1; }
.fc .fc-button-primary { background: var(--secondary-bg); border-color: var(--secondary-bg); color: var(--accent-dark); }
.fc .fc-button-primary:not(:disabled):hover { background: var(--secondary-hover); border-color: var(--secondary-hover); color: var(--accent-dark); }
.fc .fc-button-primary:not(:disabled).fc-button-active, .fc .fc-button-primary:not(:disabled):active { background: var(--accent); border-color: var(--accent); color: #fff; }
.fc .fc-button-primary:disabled { background: var(--secondary-bg); border-color: var(--secondary-bg); color: var(--muted); opacity: .7; }
:root[data-theme="night"] .fc .fc-button-primary { color: var(--text); }
@media (max-width: 760px) {
  .fc .fc-button { min-height: 34px; padding: 0 8px; font-size: 13px; }
  .fc .fc-timegrid-axis-cushion, .fc .fc-timegrid-slot-label-cushion { font-size: 11px; }
  .fc .fc-timegrid-event { font-size: 11px; }
}

@media print {
  .print-title { display: block; margin: 0 0 6px; font-weight: 800; font-size: 14px; }
  .topbar, .back-button, .actions, .section-actions, .table-actions, .respond-form { display: none !important; }
}

/* Dashboard import section */
.import-panel article { margin-bottom: 14px; }
.import-panel h3, .google-profiles h3 { margin: 0 0 10px; font-size: 16px; }
.google-import { flex-wrap: wrap; align-items: flex-end; }
.google-import select { min-height: 40px; }
.google-import .date-entry input { min-height: 40px; }
.google-profiles .profile-row { flex-wrap: wrap; }
.google-profiles .profile-row > div:first-child { flex: 1 1 240px; }
.google-profiles .profile-row .button { margin-left: 6px; }
.page > section { margin-bottom: 28px; }
.row .table-actions { margin-top: 8px; }
article h3 { margin: 16px 0 8px; font-size: 16px; }
.google-export { flex-wrap: wrap; }
.google-export select { width: auto; min-width: 200px; min-height: 40px; }

td.table-actions { display: table-cell; white-space: normal; }
td.table-actions > *, td.table-actions .inline-form { display: inline-flex; margin: 0 4px 4px 0; vertical-align: middle; }
.google-import select { width: auto; min-width: 220px; }
@media (max-width: 760px) {
  .page-header .actions > :only-child { grid-column: 1 / -1; }
  .go-to { gap: 6px; }
}
.form input[type="checkbox"], .form input[type="radio"] { width: auto; display: block; margin: 4px 0; }
