/* Paint the existing screens in the gallery's default appearance. Grid definitions,
   navigation, document order, print styles, and the optional palettes belong to the app. */
@media screen {
  :root:is(:not([data-theme]), [data-theme="sage"]) {
    --gallery-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 6%, transparent),
      0 8px 24px color-mix(in srgb, var(--ink) 8%, transparent);
    --gallery-inverse-line: color-mix(in srgb, var(--surface) 20%, var(--ink));
    --gallery-action-wash: color-mix(in srgb, var(--accent) 14%, var(--surface));
    --gallery-field-line: color-mix(in srgb, var(--ink) 38%, var(--surface));

    & body { background-color: var(--bg); color: var(--ink); }
    & .shell.office-desk > aside { background: var(--ink); color: var(--surface); }
    & .shell.office-desk aside .desk-nav button.active {
      background: color-mix(in srgb, var(--surface) 10%, var(--ink));
      color: var(--surface);
      box-shadow: inset 4px 0 var(--accent);
    }
    & .shell.office-desk .wrap :is(.panel, .dp-box, .ac-panel, .tlb-list, .tlb-review),
    & :is(.driver, .dp-driver-page) .panel {
      background-color: var(--surface); border-color: var(--line);
      border-radius: var(--radius-panel); box-shadow: var(--gallery-shadow);
    }
    & .shell.office-desk .wrap :is(.panel, .dp-box, .ac-panel) > header {
      color: var(--ink); background: var(--surface); border-bottom-color: var(--line);
    }
    & .shell.office-desk .wrap :is(h1, h2, h3), & .driver :is(h1, h2, h3) {
      font-family: var(--heading-font); font-weight: 700;
    }
    & .shell.office-desk .wrap h1 { letter-spacing: -.05em; }
    & .shell.office-desk .wrap h2 { letter-spacing: -.035em; }
    & .shell.office-desk .wrap :is(.scroll, .support-table, .ld-scroll, .ac) thead th {
      background-color: var(--bg); color: var(--muted); font-weight: 700;
    }
    & .shell.office-desk .wrap :is(td, dd, .money),
    & :is(.driver, .dp-driver-page) :is(td, dd) { font-variant-numeric: tabular-nums; }
    & .shell.office-desk .wrap :is(.tools, .dp-tools, .tlb-tools) { border-color: var(--line); }
    & :is(.shell.office-desk .wrap, .driver, .dp-driver-page) :is(textarea, select, input:is([type=text], [type=email], [type=search], [type=tel], [type=password], [type=date], [type=number]))
      :where(option) { color: var(--ink); background: var(--surface); }
    & :is(.shell.office-desk .wrap, .driver, .dp-driver-page) :is(textarea, select, input:is([type=text], [type=email], [type=search], [type=tel], [type=password], [type=date], [type=number])):not([aria-invalid=true]):not(:disabled):not(:user-invalid) {
      border-color: var(--gallery-field-line); border-radius: var(--radius-control);
    }

    /* Give the existing dashboard totals the same inverse number band as the gallery. */
    & .shell.office-desk[data-area=overview] .desk-metrics,
    & .shell.office-desk[data-area=overview] .desk-metrics > .metric {
      background: var(--ink); color: var(--surface); border-color: var(--gallery-inverse-line);
    }
    & .shell.office-desk[data-area=overview] .desk-metrics > .metric :is(strong, b, span, em, small, svg) { color: var(--surface); }
    & .shell.office-desk[data-area=overview] .desk-metrics > .metric:hover { background: var(--gallery-inverse-line); }
    & .shell.office-desk[data-area=overview] .desk-metrics > .metric:focus-visible { outline-offset: -4px; }

    & .shell.office-desk .carrier-guide :is(.federal-guide-body, .state-guide-body, .guide-reference-body) { color: var(--ink); }
    & .shell.office-desk .carrier-guide :is(.federal-guide-body, .state-guide-domain, .guide-reference-body) p { color: var(--muted); }
    & .shell.office-desk .carrier-guide :is(.guide-link-list, .state-guide-citation, .guide-reference-body) a,
    & .shell.office-desk .wrap a[href^="tel:"] {
      color: var(--ink); text-decoration: underline; text-underline-offset: .18em;
    }
    & .shell.office-desk .carrier-guide :is(.state-guide-note, .guide-note) {
      background-color: var(--gallery-action-wash); border-inline-start-color: var(--accent);
    }
    & :is(.shell.office-desk, .driver, .dp-driver-page, #pilot-main) :is(.primary, .cta):not(:disabled) {
      background: var(--accent); color: var(--ink); border-color: transparent; border-radius: 8px;
    }
    & :is(.shell.office-desk, .driver, .dp-driver-page, #pilot-main) :is(.primary, .cta):not(:disabled):hover {
      background: color-mix(in srgb, var(--accent) 86%, var(--surface));
    }
    & :is(button, a, summary, input, select, textarea):focus-visible {
      outline: 2px solid var(--accent); outline-offset: 2px;
      box-shadow: 0 0 0 2px var(--ink);
    }
  }
}
