/* ===========================================================================
   "Studio Yoke" theme — an alternative skin, applied only when the <html>
   element carries data-theme="yoke". Without that attribute nothing in this
   file matches, so the standard RTX skin in cns.css stays the default and is
   left untouched. The picker in the topbar (and in the mobile menu) switches
   it; cns.js remembers the choice in localStorage, per device.

   Modelled on studioyoke.co.uk, which is pure black, pure white, Neue Montreal
   at weight 400 throughout, letter-spacing normal, body type at 19-21px, and
   no borders, shadows, gradients or radii at all. The brand palette is kept,
   per PROJECT_BRIEF_FOR_AI.md. What this theme removes is the decoration:
   panel gradients, double rims, inset highlights, drop shadows and the
   text-shadow glow that sat on nearly every heading. Green stays as the single
   accent, spent only on the primary action, the focus ring and the current
   page.

   To drop the theme entirely: delete this file, its <link> in
   templates/base.html, the theme bootstrap <script> in that same <head>, the
   two .theme-picker blocks in the markup, and the theme section at the end of
   cns.js. Nothing else in the app refers to it.
   =========================================================================== */

[data-theme="yoke"] {
  --cns-bg: #05121f;
  --cns-panel: #081a2b;
  --cns-panel-raised: #0b2135;
  --cns-line: #16304a;
  --cns-line-bright: #224c6d;
  --cns-text: #e8f1f8;
  --cns-muted: #8aa3b5;
  --cns-green: #45e878;
  --cns-cyan: #6fc9e8;
  --cns-amber: #ffbf69;
}

/* Everything below is visual only, so it is scoped to `screen`. Printed quotes
   and completed-repair reports keep their own black-on-white rules. */
@media screen {
  /* --- Canvas and type ---------------------------------------------------- */
  [data-theme="yoke"],
  [data-theme="yoke"] body {
    background: #05121f;
    font-family: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  }
  [data-theme="yoke"] body {
    background-image: none;
    color: #e8f1f8;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: normal;
  }
  /* The faint blueprint grid is decoration; the reference has none. */
  [data-theme="yoke"] body::before { display: none; }

  /* One family, one weight. The reference never goes above 400 and never
     tracks letters apart, which is most of why it reads as calm. */
  [data-theme="yoke"] h1,
  [data-theme="yoke"] h2,
  [data-theme="yoke"] h3,
  [data-theme="yoke"] strong,
  [data-theme="yoke"] legend,
  [data-theme="yoke"] label,
  [data-theme="yoke"] th,
  [data-theme="yoke"] .eyebrow,
  [data-theme="yoke"] .badge,
  [data-theme="yoke"] .button,
  [data-theme="yoke"] .brand span,
  [data-theme="yoke"] .dashboard-stats span {
    font-family: inherit;
    font-weight: 400;
    letter-spacing: normal;
    text-shadow: none;
  }
  [data-theme="yoke"] h1 {
    margin-bottom: 26px;
    color: #ffffff;
    font-size: clamp(34px, 5vw, 54px);
    line-height: 1.06;
  }
  [data-theme="yoke"] h2 { font-size: 21px; line-height: 1.3; }
  [data-theme="yoke"] h3 { font-size: 18px; }
  [data-theme="yoke"] .eyebrow {
    margin-bottom: 14px;
    color: #8aa3b5;
    font-size: 13px;
    text-transform: uppercase;
  }
  [data-theme="yoke"] .muted { color: #8aa3b5; font-size: 15px; }
  [data-theme="yoke"] a,
  [data-theme="yoke"] a:hover { text-shadow: none; }

  /* --- Shell -------------------------------------------------------------- */
  [data-theme="yoke"] .topbar {
    background: #05121f;
    border-bottom: 1px solid #16304a;
    box-shadow: none;
    backdrop-filter: none;
  }
  [data-theme="yoke"] .topbar::after { display: none; }
  [data-theme="yoke"] .brand img {
    border: 1px solid #16304a;
    border-radius: 2px;
    box-shadow: none;
  }
  [data-theme="yoke"] .brand span {
    color: #8aa3b5;
    font-size: 13px;
    text-transform: uppercase;
  }
  [data-theme="yoke"] .desktop-nav a {
    color: #8aa3b5;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  [data-theme="yoke"] .desktop-nav a:hover { color: #ffffff; text-decoration: none; }
  [data-theme="yoke"] .desktop-nav a[aria-current="page"] {
    color: #45e878;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  /* --- Surfaces ----------------------------------------------------------- */
  [data-theme="yoke"] .panel,
  [data-theme="yoke"] .record-form,
  [data-theme="yoke"] .field-group,
  [data-theme="yoke"] .metric,
  [data-theme="yoke"] .dashboard-stats article,
  [data-theme="yoke"] .detail-panel,
  [data-theme="yoke"] .mobile-menu-sheet {
    background-color: #081a2b;
    background-image: none;
    border: 1px solid #16304a;
    border-radius: 4px;
    box-shadow: none;
  }
  [data-theme="yoke"] .panel { padding: 28px; }
  [data-theme="yoke"] .metric:hover,
  [data-theme="yoke"] .conversation-card:hover,
  [data-theme="yoke"] .attachment-card:hover {
    transform: none;
    border-color: #224c6d;
    box-shadow: none;
  }
  [data-theme="yoke"] .page-heading { border-bottom-color: #16304a; }
  [data-theme="yoke"] .field-group legend { color: #8aa3b5; }
  /* Big enough to read, small enough that "READY TO RETURN" stays on one line
     in the three-up grid at phone width. */
  [data-theme="yoke"] .dashboard-stats span { font-size: 12px; }

  /* --- Controls ----------------------------------------------------------- */
  [data-theme="yoke"] input,
  [data-theme="yoke"] select,
  [data-theme="yoke"] textarea {
    color: #e8f1f8;
    background: #07182a;
    background-image: none;
    border: 1px solid #16304a;
    border-radius: 4px;
    box-shadow: none;
  }
  /* The one glow this theme keeps, because it has a job: showing focus. */
  [data-theme="yoke"] input:focus,
  [data-theme="yoke"] select:focus,
  [data-theme="yoke"] textarea:focus {
    border-color: #45e878;
    box-shadow: 0 0 0 1px #45e878;
    outline: none;
  }
  [data-theme="yoke"] label { color: #e8f1f8; }

  [data-theme="yoke"] .button {
    color: #e8f1f8;
    background: transparent;
    background-image: none;
    border: 1px solid #224c6d;
    border-radius: 4px;
    box-shadow: none;
  }
  [data-theme="yoke"] .button:hover {
    color: #ffffff;
    border-color: #45e878;
    box-shadow: none;
  }
  [data-theme="yoke"] .button:active { transform: none; }
  [data-theme="yoke"] .button.primary {
    color: #04140f;
    background: #45e878;
    background-image: none;
    border-color: #45e878;
    box-shadow: none;
  }
  [data-theme="yoke"] .button.primary:hover {
    background: #8affb8;
    border-color: #8affb8;
    box-shadow: none;
  }
  [data-theme="yoke"] .button.subtle {
    color: #8aa3b5;
    background: transparent;
    border-color: #224c6d;
    box-shadow: none;
  }
  [data-theme="yoke"] .button.subtle:hover { color: #ffffff; border-color: #45e878; }
  [data-theme="yoke"] .repair-status-option {
    color: #8aa3b5;
    background: transparent;
    border-color: #16304a;
    border-radius: 4px;
  }
  [data-theme="yoke"] .repair-status-option:has(input:checked) {
    color: #e8f1f8;
    background: #0b2135;
    border-color: #45e878;
  }

  /* --- Tables ------------------------------------------------------------- */
  [data-theme="yoke"] .table-wrap {
    border-color: #16304a;
    border-radius: 4px;
    box-shadow: none;
  }
  [data-theme="yoke"] th {
    color: #8aa3b5;
    background: transparent;
    border-bottom: 1px solid #16304a;
    font-size: 12px;
    text-transform: uppercase;
  }
  [data-theme="yoke"] td { border-color: #16304a; }
  [data-theme="yoke"] tbody tr:hover { background: #0b2135; }
  [data-theme="yoke"] .dashboard-queue-table tr {
    background-color: #081a2b;
    background-image: none;
    border-color: #16304a;
    border-radius: 4px;
    box-shadow: none;
  }

  /* Outline chips rather than filled pills; the status colours still carry. */
  [data-theme="yoke"] .badge {
    color: #cfe0ec;
    background: transparent;
    border: 1px solid #224c6d;
    border-radius: 2px;
    font-size: 12px;
  }
  [data-theme="yoke"] .badge-overdue,
  [data-theme="yoke"] .fleet-inventory-table .badge-overdue,
  [data-theme="yoke"] #service-schedule .badge-overdue {
    color: #ff9e8a;
    background: transparent;
    border-color: #a84e3f;
  }
  [data-theme="yoke"] .workflow-step.is-complete::before { box-shadow: none; }

  /* --- Mobile chrome ------------------------------------------------------ */
  /* Geometry is deliberately not touched here -- the bar's position, its
     safe-area padding and `overflow: visible` are load-bearing and live in
     cns.css. This only restyles the surface. */
  [data-theme="yoke"] .mobile-tabbar {
    background: #05121f;
    background-image: none;
    border: 0;
    border-top: 1px solid #16304a;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
  }
  [data-theme="yoke"] .mobile-tabbar a,
  [data-theme="yoke"] .mobile-tabbar button { color: #8aa3b5; }
  [data-theme="yoke"] .mobile-tabbar small { font-size: 11px; }
  [data-theme="yoke"] .mobile-tabbar a[aria-current="page"],
  [data-theme="yoke"] .mobile-tabbar button[aria-expanded="true"] {
    color: #45e878;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  [data-theme="yoke"] .mobile-new-repair > span {
    color: #04140f;
    background: #45e878;
    background-image: none;
    border: 0;
    box-shadow: none;
  }
  [data-theme="yoke"] .record-form > .form-actions {
    background: #05121f;
    background-image: none;
    border-color: #16304a;
    box-shadow: none;
  }
  [data-theme="yoke"] .mobile-menu-nav a[aria-current="page"] {
    color: #45e878;
    background: transparent;
    border-color: #16304a;
  }

  /* --- The picker itself, styled for both themes --------------------------- */
  .theme-picker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    font-size: 13px;
    white-space: nowrap;
  }
  .theme-picker select { padding: 6px 8px; font-size: 13px; }
  .mobile-menu-sheet .theme-picker { display: flex; margin-top: 14px; }
  @media (max-width: 780px) {
    [data-theme="yoke"] .dashboard-stats span { font-size: 11px; }
  }
  .mobile-menu-sheet .theme-picker select { flex: 1; min-height: 42px; }
}
