/* Optional TravelSync preview. Every rule is limited to the beta theme and to
   screen presentation; switching themes never changes data or print layouts. */
@media screen {
  :root[data-theme="beta"] {
    color: #20252b;
    background: #f6f7f8;
    --beta-ink: #20252b;
    --beta-muted: #525c66;
    --beta-accent: #214f77;
    --beta-line: #d9dde1;
    --beta-surface: #ffffff;
    --muted: #525c66;
    --border: #d9dde1;
    --accent: #214f77;
    --blue: #214f77;
    --soft: #f0f2f4;
    --green: #247450;
    --shadow: 0 8px 24px rgba(20, 26, 32, .10);
  }

  [data-theme="beta"] body { background: #f6f7f8; color: var(--beta-ink); }
  [data-theme="beta"] ::selection { background: #c9e1f4; color: #172f49; }
  [data-theme="beta"] :is(input, textarea) { caret-color: #214f77; }
  [data-theme="beta"] :is(button, a, input, select, textarea, summary, [tabindex="0"]):focus-visible {
    outline: 3px solid #1674c2;
    outline-offset: 3px;
  }
  [data-theme="beta"] :is(button, .button-link) {
    border-color: #c7cdd3;
    border-radius: 8px;
    color: #303b45;
    transition: background-color .16s ease-out, border-color .16s ease-out, color .16s ease-out;
  }
  [data-theme="beta"] :is(button, .button-link):hover { background: #f2f4f5; border-color: #aeb8c1; }
  [data-theme="beta"] button:disabled { opacity: .56; }
  [data-theme="beta"] :is(button.primary, a.primary, .button-link.primary) {
    color: #fff;
    background: #214f77;
    border-color: #214f77;
  }
  [data-theme="beta"] :is(button.primary, a.primary, .button-link.primary):hover {
    color: #fff;
    background: #173d5f;
    border-color: #173d5f;
  }
  [data-theme="beta"] :is(input:not([type="checkbox"]), select, textarea, .select-trigger, .date-range-control) {
    border-color: #b8c1c9;
    border-radius: 8px;
    color: #26323c;
    background: #fff;
  }
  [data-theme="beta"] :is(input, textarea)::placeholder { color: #677c90; opacity: 1; }
  [data-theme="beta"] input[type="checkbox"] { accent-color: #214f77; }
  [data-theme="beta"] a { color: #18588d; text-underline-offset: 3px; }

  /* Keep the familiar light navigation while giving its controls more space. */
  [data-theme="beta"] .sidebar { background: #fff; border-color: #d9dde1; color: #303b45; }
  [data-theme="beta"] .sidebar .brand { color: #214f77; letter-spacing: -.025em; }
  [data-theme="beta"] .sidebar .brand-icon { background: #214f77; color: #fff; }
  [data-theme="beta"] :is(.workspace-label, .nav-section) { color: #59636d; letter-spacing: .02em; }
  [data-theme="beta"] .nav-button { color: #46515c; border-radius: 8px; font-weight: 500; min-height: 40px; padding: 8px 12px; margin: 2px 0; }
  [data-theme="beta"] .nav-button:hover { color: #263c4e; background: #f1f3f5; border-color: transparent; }
  [data-theme="beta"] .nav-button.active { color: #174a76; background: #e9f1f8; box-shadow: none; font-weight: 600; }
  [data-theme="beta"] .nav-button .badge-count { background: #eaf0f6; color: #315e85; }
  [data-theme="beta"] .nav-button.active .badge-count { background: #cfe0ef; color: #1e527c; }
  [data-theme="beta"] .connection, [data-theme="beta"] .connection strong,
  [data-theme="beta"] .connection small { color: #45637b; }
  [data-theme="beta"] .connection-dot { background: #298255; }
  [data-theme="beta"] .connection-dot.offline { background: #ac6a19; }
  [data-theme="beta"] .account-card { border-color: #d1dce7; color: #244561; }
  [data-theme="beta"] .account-card:hover { background: #f1f6fb; }
  [data-theme="beta"] .sidebar .avatar { background: #e6eef6; color: #2c587c; }
  [data-theme="beta"] .account-copy :is(strong, small) { color: #2d4962; }
  [data-theme="beta"] .logout { color: #4b637a; }
  [data-theme="beta"] .logout:hover { color: #174a76; background: transparent; }

  [data-theme="beta"] .topbar {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #fff;
    border-bottom: 1px solid #e2e5e8;
  }
  [data-theme="beta"] .breadcrumb { color: #597186; }
  [data-theme="beta"] .breadcrumb strong { color: #345671; font-weight: 650; }
  [data-theme="beta"] .web-tag { color: #46637d; background: #edf3f9; border-radius: 7px; }
  [data-theme="beta"] .theme-toggle {
    min-height: 36px;
    padding: 7px 11px;
    color: #18588d;
    background: #edf3f9;
    border-color: #cedbe7;
    font-size: 13px;
    white-space: nowrap;
  }
  [data-theme="beta"] .theme-toggle:hover { color: #173d5f; background: #e2edf8; }
  [data-theme="beta"] .notification-count { background: #214f77; color: #fff; }
  [data-theme="beta"] main { color: #20252b; }
  [data-theme="beta"] .page-heading { margin-bottom: 20px; }
  [data-theme="beta"] .page-heading h1 { color: #20252b; letter-spacing: -.02em; font-weight: 600; }
  [data-theme="beta"] .page-heading p { color: #525c66; }
  [data-theme="beta"] :is(.card, .settings-card, .status-card) {
    border: 1px solid #d9dde1;
    border-radius: 12px;
    background: #fff;
    box-shadow: none;
  }
  [data-theme="beta"] :is(.page-note, .form-help, .selection-note, .filter-summary) { color: #525c66; }
  [data-theme="beta"] #sputnik-sync-status > .page-note {
    margin: 0 0 14px;
    color: #526b81;
    font-size: 13px;
  }

  /* Period controls stay visible and keyboard-accessible, with less visual noise. */
  [data-theme="beta"] .period-workspace { padding: 16px 20px; background: #fff; border-bottom-color: #e2e5e8; }
  [data-theme="beta"] .period-title h3, [data-theme="beta"] .month-nav strong { color: #26323c; }
  [data-theme="beta"] .month-grid { gap: 4px; margin-bottom: 12px; }
  [data-theme="beta"] .month-button { min-height: 48px; padding: 4px; color: #36424d; background: #fff; font-size: 12px; font-weight: 500; flex-direction: column; flex-wrap: nowrap; gap: 2px; white-space: nowrap; }
  [data-theme="beta"] .month-button :is(.tab-number, .badge-count) { background: #eff1f3; color: #4f5a65; }
  [data-theme="beta"] :is(.month-button.active, .month-button[aria-pressed="true"]) {
    color: #fff; background: #214f77; border-color: #214f77; box-shadow: none;
  }
  [data-theme="beta"] :is(.month-button.active, .month-button[aria-pressed="true"]) :is(.tab-number, .badge-count) {
    color: #fff; background: #3e6e97;
  }
  [data-theme="beta"] .period-presets button { min-height: 40px; font-weight: 500; }
  [data-theme="beta"] :is(.period-presets button.active, .period-presets button[aria-pressed="true"]) {
    color: #174a76; background: #e2edf8; border-color: #8fb3d2; box-shadow: none;
  }
  [data-theme="beta"] .period-range { border-color: #e2e5e8; margin-top: 12px; padding-top: 12px; }
  [data-theme="beta"] .analytics-panel > summary { color: #1d5b92; }
  [data-theme="beta"] .analytics-panel .summary-card { background: #fafbfb; }

  /* The queue is a single, legible working surface, not a stack of cards. */
  [data-theme="beta"] #orders-card { overflow: hidden; }
  [data-theme="beta"] .queue-tabs { gap: 20px; border-color: #e2e5e8; scrollbar-color: #aeb8c1 #f2f4f5; scrollbar-width: thin; }
  [data-theme="beta"] .queue-tab { color: #46515c; padding-top: 12px; padding-bottom: 12px; }
  [data-theme="beta"] .queue-tab.active { color: #174f7e; }
  [data-theme="beta"] .queue-tab.active::after { background: #276ca3; height: 2px; }
  [data-theme="beta"] .queue-tab.active .tab-number { color: #1e527b; background: #e2edf8; }
  [data-theme="beta"] .filterbar .filter-active { color: #1e527b; background: #e2effb; border-color: #79a8d0; }
  [data-theme="beta"] .filter-summary { background: #f6f7f8; }
  [data-theme="beta"] .orders-table { font-variant-numeric: tabular-nums; }
  [data-theme="beta"] .orders-table th { color: #46515c; background: #f2f4f5; border-color: #e2e5e8; letter-spacing: 0; }
  [data-theme="beta"] .orders-table td { color: #36424d; border-color: #e8ebed; }
  [data-theme="beta"] .orders-table tbody tr:hover { background: #f6f8f9; }
  [data-theme="beta"] .orders-table tbody tr.selected { background: #e9f1f8; box-shadow: none; }
  [data-theme="beta"] .orders-table .month-group td { color: #303b45; background: #f0f2f4; border-color: #dfe3e6; }
  [data-theme="beta"] :is(.order-date strong, .price-cell strong) { color: #234867; }
  [data-theme="beta"] :is(.order-date small, .order-title small, .price-cell small) { color: #597187; }
  [data-theme="beta"] :is(.table-link, .order-number) { color: #18588d; text-underline-offset: 3px; }
  [data-theme="beta"] .source-tag { color: #42637d; background: #eaf1f7; }
  [data-theme="beta"] :is(.owner-dot, .avatar) { color: #315f82; background: #e3edf6; }
  [data-theme="beta"] .status { border-radius: 7px; }
  [data-theme="beta"] .status.new { color: #315e72; background: #e6f2f6; }
  [data-theme="beta"] .status.progress { color: #35548a; background: #e9effa; }
  [data-theme="beta"] .status.waiting { color: #805717; background: #fff2db; }
  [data-theme="beta"] .status.processed { color: #246348; background: #e0f1e7; }
  [data-theme="beta"] .status.cancelled { color: #914545; background: #fae8e7; }
  [data-theme="beta"] .status.review { color: #8c531c; background: #fff0de; }
  [data-theme="beta"] .table-scroll { scrollbar-color: #aeb8c1 #f2f4f5; scrollbar-width: thin; }
  [data-theme="beta"] .overflow-hint { margin: 0 0 8px; color: #525c66; font-size: 12px; line-height: 16px; }
  [data-theme="beta"] #orders-card > .overflow-hint { margin: 0; padding: 4px 20px 8px; }

  [data-theme="beta"] :is(.detail-ref, .detail-field span, .history-list small, .notification-time) { color: #597187; }
  [data-theme="beta"] :is(.detail-field strong, .detail-field p, .detail-top h2) { color: #234867; }
  [data-theme="beta"] .modal { border-color: #cbd9e7; border-radius: 15px; color: #1b3047; box-shadow: 0 22px 70px rgba(27, 48, 71, .24); }
  [data-theme="beta"] .modal-header { background: #fff; border-color: #e1e9f1; }
  [data-theme="beta"] .select-popup, [data-theme="beta"] .calendar-dialog { border-color: #cbd9e7; box-shadow: 0 16px 38px rgba(27, 48, 71, .18); }
  [data-theme="beta"] :is(.select-option.focused, .calendar-day.selected) { background: #e2edf8; color: #174a76; }
  [data-theme="beta"] .notification-item { color: #244561; border-color: #e2eaf2; }
  [data-theme="beta"] .notification-item.unread { background: #f0f6fc; }
  [data-theme="beta"] .notification-item .notification-mark { background: #276ca3; }
  [data-theme="beta"] .notification-item strong { color: #243f58; }
  [data-theme="beta"] .notification-item p { color: #526b81; }
  [data-theme="beta"] .profile-identity { background: #f0f6fc; border-color: #d1dfed; }
  [data-theme="beta"] .profile-identity > div { min-width: 0; overflow-wrap: anywhere; }
  [data-theme="beta"] .profile-identity h2 { color: #1b4265; }
  [data-theme="beta"] .profile-identity p { color: #496780; }
  [data-theme="beta"] .profile-avatar { background: #dceaf7; color: #214f77; }
  [data-theme="beta"] .profile-summary-heading h2 { color: #1b4265; }
  [data-theme="beta"] .profile-period-note { color: #526b81; }
  [data-theme="beta"] .profile-metrics { border-color: #d1dfed; background: #fff; }
  [data-theme="beta"] .profile-metric { border-color: #dce7f1; }
  [data-theme="beta"] .profile-metric:nth-child(-n+2) { background: #f5f9fd; }
  [data-theme="beta"] .profile-metric dt { color: #486780; font-size: 13px; }
  [data-theme="beta"] .profile-metric dd { color: #214f77; font-size: 30px; }
  [data-theme="beta"] .profile-metric p { color: #526b81; }
  [data-theme="beta"] .profile-explanation { max-width: 90ch; color: #526b81; font-size: 13px; }
  [data-theme="beta"] .toast { background: #214f77; color: #fff; }
  [data-theme="beta"] .toast.error { background: #963f3c; }

  /* The notification center has its own base styles; keep its states in the same palette. */
  html[data-theme="beta"] .beta-notifications-filters { background: #edf3f9; }
  html[data-theme="beta"] .beta-notification-filter { color: #54677b; }
  html[data-theme="beta"] .beta-notification-filter.is-active { color: #174a76; box-shadow: 0 1px 4px #1b304717; }
  html[data-theme="beta"] .beta-notifications .beta-notification-item { border-color: #e1e9f1; }
  html[data-theme="beta"] .beta-notifications .beta-notification-item.unread { background: #f0f6fc; }
  html[data-theme="beta"] .beta-notifications .beta-notification-item:hover { background: #e6f0fa; }
  html[data-theme="beta"] .beta-notifications .beta-notification-item .notification-mark { background: #214f77; }
  html[data-theme="beta"] .beta-notifications .beta-notification-item.read .notification-mark { background: #c1d0de; }
  html[data-theme="beta"] .beta-notification-kind { color: #18588d; }
  html[data-theme="beta"] .beta-notification-item.read .beta-notification-kind { color: #54677b; }
  html[data-theme="beta"] .beta-notification-received time { color: #345671; }
  html[data-theme="beta"] .beta-notification-item > .icon { color: #597187; }
  html[data-theme="beta"] .beta-notifications-empty > .icon { color: #214f77; }
  html[data-theme="beta"] .beta-notifications-note { border-color: #e1e9f1; }

  @media (max-width: 700px) {
    [data-theme="beta"] .topbar { height: 60px; }
    [data-theme="beta"] .web-tag { display: none; }
    [data-theme="beta"] .topbar-actions { gap: 4px; }
    [data-theme="beta"] .theme-toggle { min-height: 36px; padding: 6px 8px; font-size: 12px; }
    [data-theme="beta"] .breadcrumb strong { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    [data-theme="beta"] main { padding: 20px 16px 32px; }
    [data-theme="beta"] .page-heading h1 { font-size: 25px; }
    [data-theme="beta"] .page-heading p { font-size: 14px; }
    [data-theme="beta"] .period-workspace { padding: 16px; }
    [data-theme="beta"] .month-nav { gap: 4px; }
    [data-theme="beta"] .month-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(88px, auto); gap: 4px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; scrollbar-color: #aeb8c1 #f2f4f5; }
    [data-theme="beta"] .month-button { min-height: 48px; font-size: 12px; padding: 4px; }
    [data-theme="beta"] .period-presets { gap: 8px; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; scrollbar-color: #aeb8c1 #f2f4f5; }
    [data-theme="beta"] .period-presets button { min-height: 44px; font-size: 12px; padding: 8px 12px; white-space: nowrap; flex: none; }
    [data-theme="beta"] .queue-tabs { gap: 16px; }
    [data-theme="beta"] .notification-item { padding: 15px 13px; }
    [data-theme="beta"] .profile-metric:nth-child(even) { border-right: 0; }
    [data-theme="beta"] .profile-metric:last-child { grid-column: 1 / -1; border-bottom: 0; }
    [data-theme="beta"] .profile-metric dd { font-size: 25px; }
    [data-theme="beta"] #orders-card > .overflow-hint { padding-left: 14px; padding-right: 14px; }
  }

  [data-theme="beta"] :is(.month-grid, .period-presets, .queue-tabs, .table-scroll)::-webkit-scrollbar { height: 6px; }
  [data-theme="beta"] :is(.month-grid, .period-presets, .queue-tabs, .table-scroll)::-webkit-scrollbar-track { background: #f2f4f5; }
  [data-theme="beta"] :is(.month-grid, .period-presets, .queue-tabs, .table-scroll)::-webkit-scrollbar-thumb { background: #aeb8c1; border-radius: 4px; }

  /* The period's common choices stay at hand; monthly navigation opens on demand. */
  [data-theme="beta"] .period-workspace { padding: 20px 24px; }
  [data-theme="beta"] .period-title { margin-bottom: 16px; }
  [data-theme="beta"] .period-title h3 { font-size: 16px; font-weight: 650; }
  [data-theme="beta"] .period-title .page-note { font-size: 12px; }
  [data-theme="beta"] #period-caption { color: #214f77; font-size: 14px; font-variant-numeric: tabular-nums; }
  [data-theme="beta"] .period-presets { gap: 6px; }
  [data-theme="beta"] .period-presets button { min-height: 36px; padding: 7px 12px; border-color: #d5dce2; background: #fff; color: #36424d; font-size: 13px; }
  [data-theme="beta"] .period-presets button:hover { background: #f3f7fa; border-color: #aabac7; }
  [data-theme="beta"] .period-presets button[aria-pressed="true"] { color: #174a76; background: #e5f0f8; border-color: #8fb3d2; }
  [data-theme="beta"] .period-range { margin-top: 16px; padding-top: 0; border: 0; align-items: end; }
  [data-theme="beta"] .period-range .date-range-label { flex: 0 1 340px; }
  [data-theme="beta"] .period-range .form-help { margin-bottom: 10px; }
  [data-theme="beta"] .period-month-picker { margin-top: 14px; border-top: 1px solid #e4e8eb; }
  [data-theme="beta"] .period-month-picker > summary { display: flex; align-items: center; gap: 8px; width: fit-content; min-height: 44px; padding: 8px 0; color: #245a83; font-size: 13px; font-weight: 600; cursor: pointer; list-style: none; }
  [data-theme="beta"] .period-month-picker > summary::-webkit-details-marker { display: none; }
  [data-theme="beta"] .period-month-picker > summary::before { content: ''; width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); margin-right: 3px; }
  [data-theme="beta"] .period-month-picker[open] > summary::before { transform: rotate(45deg); }
  [data-theme="beta"] .period-month-picker > summary:focus-visible { outline: 3px solid #1674c2; outline-offset: 3px; border-radius: 4px; }
  [data-theme="beta"] .period-month-year { padding: 2px 7px; border-radius: 4px; background: #eff3f6; color: #4a5b69; font-variant-numeric: tabular-nums; font-weight: 500; }
  [data-theme="beta"] .period-month-picker .month-nav { margin: 4px 0 12px; gap: 8px; }
  [data-theme="beta"] .period-month-picker .month-nav button { min-height: 40px; }
  [data-theme="beta"] .period-month-picker .month-grid { margin-bottom: 4px; }
  /* Range calendar uses the month selector instead of a second month grid. */
  [data-theme="beta"] .calendar-range-dialog { width: 384px; padding: 20px; color: #263744; border: 1px solid #d4dde4; border-radius: 12px; box-shadow: 0 12px 32px rgba(20, 36, 49, .18); }
  [data-theme="beta"] .calendar-range-dialog::backdrop { background: rgba(31, 50, 65, .14); }
  [data-theme="beta"] .calendar-range-dialog .calendar-range-preview { padding: 12px; margin-bottom: 8px; background: #f1f6fa; border-color: #e0e9ef; }
  [data-theme="beta"] .calendar-range-dialog .calendar-range-preview strong { color: #1d405c; }
  [data-theme="beta"] .calendar-range-dialog .calendar-range-hint { min-height: 0; margin-bottom: 12px; color: #526574; }
  [data-theme="beta"] .calendar-range-dialog .calendar-head { margin-bottom: 12px; }
  [data-theme="beta"] .calendar-range-dialog .calendar-body { display: block; }
  [data-theme="beta"] .calendar-range-dialog .calendar-months { display: none; }
  [data-theme="beta"] .calendar-range-dialog .calendar-caption { margin-bottom: 6px; font-size: 14px; color: #263744; }
  [data-theme="beta"] .calendar-range-dialog .calendar-day { min-height: 38px; border-color: transparent; background: #fff; color: #263744; }
  [data-theme="beta"] .calendar-range-dialog .calendar-day.outside { background: #f6f7f8; color: #6b7985; }
  [data-theme="beta"] .calendar-range-dialog .calendar-day.today { border-color: #7fa6c3; font-weight: 700; }
  [data-theme="beta"] .calendar-range-dialog .calendar-day.in-range { background: #e5f0f8; color: #244d6a; border-radius: 4px; }
  [data-theme="beta"] .calendar-range-dialog .calendar-day.in-range:hover { background: #d4e8f6; color: #173f5f; }
  [data-theme="beta"] .calendar-range-dialog .calendar-day:is(.range-start,.range-end,.selected) { background: #214f77; color: #fff; border-color: #214f77; font-weight: 700; }
  [data-theme="beta"] .calendar-range-dialog .calendar-day:is(.range-start,.range-end,.selected):hover { background: #173d5f; color: #fff; border-color: #173d5f; }
  [data-theme="beta"] .calendar-range-dialog .calendar-day:disabled { color: #8c969e; background: #f6f7f8; }
  [data-theme="beta"] .calendar-range-dialog .calendar-month.active { background: #214f77; color: #fff; border-color: #214f77; }
  [data-theme="beta"] .calendar-range-dialog .calendar-month.active:hover { background: #173d5f; color: #fff; }
  @media (max-width: 700px) {
    [data-theme="beta"] .period-workspace { padding: 16px; }
    [data-theme="beta"] .period-title { align-items: flex-start; gap: 8px; }
    [data-theme="beta"] .period-range .date-range-label { flex-basis: 100%; }
    [data-theme="beta"] .period-month-picker { margin-top: 12px; }
    [data-theme="beta"] .calendar-range-dialog { padding: 16px; }
  }

  @media (prefers-reduced-motion: reduce) {
    [data-theme="beta"] :is(button, .button-link) { transition: none; }
  }
}
