    :root {
      --font-sans: "Inter", "SF Pro Text", "Avenir Next", "Segoe UI", Roboto, Arial, sans-serif;
      --space-1: 4px;
      --space-2: 8px;
      --space-3: 12px;
      --space-4: 16px;
      --space-5: 20px;
      --radius-sm: 10px;
      --radius-md: 12px;
      --radius-lg: 18px;
      --focus-ring: 0 0 0 2px rgba(192, 22, 27, 0.14);
      --z-nav: 20;
      --brand-primary: #1f5a26;
      --brand-accent: #c0161b;
      --brand-background: #f6eadc;
      --brand-text: #111111;
      --paper: var(--brand-background);
      --card: #fff8ee;
      --ink: var(--brand-text);
      --ink-soft: #3f3a35;
      --line: #cdb79b;
      --line-strong: #a78b6c;
      --accent: var(--brand-accent);
      --accent-dark: #7a0f12;
      --forest: var(--brand-primary);
      --gold: #e3b23c;
      --cream: #fff1e0;
    }
    body {
      font-family: var(--font-sans);
      font-size: 12px;
      margin: 20px;
      background: radial-gradient(circle at 8% -12%, #f7efe4 0%, #f3e6d6 40%, #efe0cd 100%);
      color: var(--ink);
      letter-spacing: 0.1px;
    }
    h1, h2, h3, .section-title {
      font-weight: 500;
      letter-spacing: 0.4px;
    }
    .card {
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 14px;
      margin: 12px 0;
      background: var(--card);
      box-shadow: 0 6px 14px rgba(46, 30, 18, 0.08);
    }
    input[type=file] { display:block; margin-top: 6px; }
    button {
      padding: 10px 14px;
      border-radius: 10px;
      border: 1px solid var(--line);
      background: linear-gradient(180deg, #fff 0%, #fff5e6 100%);
      cursor: pointer;
      color: var(--ink);
    }
    button:hover { border-color: var(--accent); }
    .topbar {
      display: flex;
      align-items: stretch;
      gap: 8px;
      margin-bottom: 12px;
      position: sticky;
      top: 0;
      z-index: var(--z-nav);
      transition: transform 180ms ease, opacity 180ms ease;
    }
    .topbar.mobile-hidden {
      transform: translateY(calc(-100% - 8px));
      opacity: 0.98;
      pointer-events: none;
    }
    .nav {
      display:flex;
      flex-wrap:wrap;
      align-items:center;
      gap:4px;
      margin-bottom:0;
      background: rgba(255, 255, 255, 0.92);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      padding:8px 10px;
      border: 1px solid var(--line);
      border-radius: 14px;
      box-shadow: 0 8px 18px rgba(46, 30, 18, 0.12);
      position: relative;
      overflow: visible;
      flex: 1 1 auto;
    }
    .nav::before {
      content: "";
      position: absolute;
      left: 0;
      top: 0;
      right: 0;
      height: 2px;
      border-radius: 14px 14px 0 0;
      background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 38%, rgba(192,22,27,0) 100%);
      pointer-events: none;
    }
    .nav.nav-clear {
      background: rgba(255, 255, 255, 0.92);
      border: 1px solid var(--line);
      border-radius: 14px;
      padding: 8px 10px;
    }
    .nav-item { position: relative; display:inline-flex; align-items:center; }
    .nav a {
      display:inline-flex;
      align-items:center;
      justify-content:center;
      min-height: 36px;
      padding: 0 12px;
      border-radius: 10px;
      border: 1px solid transparent;
      background: transparent;
      color: var(--ink-soft);
      text-decoration:none;
      letter-spacing: 0.2px;
      font-size: 13px;
      font-weight: 500;
      transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
      box-sizing: border-box;
    }
    .nav a:hover {
      border-color: var(--line);
      background: #faf4ea;
      color: var(--ink);
    }
    .nav a.app-nav-brand {
      gap: 8px;
      justify-content: flex-start;
      padding: 0 10px 0 6px;
      margin-right: 4px;
      border-color: rgba(205, 183, 155, 0.7);
      background: rgba(255, 248, 238, 0.78);
      color: var(--ink);
      font-weight: 700;
      letter-spacing: 0;
      white-space: nowrap;
    }
    .nav a.app-nav-brand img {
      width: 28px;
      height: 28px;
      border-radius: 8px;
      display: block;
      flex: 0 0 auto;
    }
    .nav a.app-nav-brand:hover {
      border-color: var(--line-strong);
      background: #fff8ee;
      color: var(--ink);
    }
    .nav a.active {
      background: #fff;
      border-color: var(--accent-dark);
      color: var(--accent-dark);
      box-shadow: inset 0 -2px 0 rgba(122, 15, 18, 0.28);
    }
    .nav-role-chip {
      margin-left: auto;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      min-height: 36px;
      padding: 0 12px;
      border-radius: 10px;
      border: 1px solid var(--line);
      background: #fff;
      color: var(--ink-soft);
      font-size: 12px;
      font-weight: 500;
      letter-spacing: 0.2px;
      line-height: 1;
      box-sizing: border-box;
    }
    .nav-role-chip-text {
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .nav-tenant-logo {
      width: 22px;
      height: 22px;
      border-radius: 6px;
      object-fit: contain;
      background: rgba(255, 248, 238, 0.86);
      border: 1px solid rgba(205, 183, 155, 0.72);
      flex: 0 0 auto;
      display: none;
    }
    .nav-role-chip.is-switchable {
      cursor: pointer;
      user-select: none;
    }
    .nav-role-chip.is-switchable:hover {
      border-color: var(--line-strong);
      background: #fff8ee;
      color: var(--ink);
    }
    .nav-role-chip::before {
      content: "";
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--accent);
      box-shadow: 0 0 0 2px rgba(192, 22, 27, 0.15);
      flex: 0 0 auto;
    }
    .nav-role-chip.has-tenant-logo::before {
      display: none;
    }
    .nav-site-switcher {
      position: fixed;
      top: -9999px;
      left: -9999px;
      width: min(360px, calc(100vw - 24px));
      max-height: min(520px, calc(100vh - 40px));
      overflow: auto;
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 12px;
      box-shadow: 0 14px 28px rgba(46, 30, 18, 0.18);
      display: none;
      padding: 10px;
      z-index: calc(var(--z-nav) + 20);
    }
    .nav-site-switcher.is-open { display: block; }
    .nav-site-switcher-title {
      font-size: 12px;
      font-weight: 800;
      color: var(--ink);
      margin: 2px 4px 8px;
    }
    .nav-site-company {
      margin: 10px 4px 4px;
      color: var(--muted);
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
    .nav-site-option {
      width: 100%;
      min-height: 38px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      border: 1px solid transparent;
      border-radius: 10px;
      background: transparent;
      color: var(--ink);
      text-align: left;
      font: inherit;
      padding: 8px 10px;
      cursor: pointer;
    }
    .nav-site-option:hover {
      background: #faf4ea;
      border-color: var(--line);
    }
    .nav-site-option.is-active {
      background: rgba(41, 105, 84, 0.10);
      border-color: rgba(41, 105, 84, 0.28);
      color: var(--green-dark);
      font-weight: 800;
    }
    .nav-site-option-role {
      color: var(--muted);
      font-size: 11px;
      font-weight: 700;
      white-space: nowrap;
    }
    .nav-dropdown {
      position:fixed;
      top: -9999px;
      left: -9999px;
      min-width: 180px;
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 10px;
      box-shadow: 0 10px 22px rgba(46, 30, 18, 0.14);
      display: none;
      padding: 6px;
      z-index: 40;
    }
    .nav-item:hover .nav-dropdown { display: block; }
    .nav-item.open .nav-dropdown { display: block; }
    .nav-dropdown a {
      display: block;
      padding: 8px 10px;
      border-radius: 8px;
      border: 1px solid transparent;
      background: transparent;
      margin: 2px 0;
    }
    .nav-dropdown a:hover { border-color: var(--line); background: #faf4ea; color: var(--ink); }
    #globalHoverTooltip {
      position: fixed;
      top: -9999px;
      left: -9999px;
      z-index: 1200;
      max-width: min(320px, calc(100vw - 16px));
      background: rgba(24, 20, 16, 0.96);
      color: #fff;
      font-size: 11px;
      line-height: 1.35;
      white-space: pre-wrap;
      padding: 7px 9px;
      border-radius: 8px;
      box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
      pointer-events: none;
      opacity: 0;
      transition: opacity 120ms ease;
    }
    #globalHoverTooltip.is-visible {
      opacity: 1;
    }
    .auth-controls {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 4px;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: rgba(255, 255, 255, 0.92);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      box-shadow: 0 8px 18px rgba(46, 30, 18, 0.12);
      flex: 0 0 auto;
    }
    .header-tools {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      flex: 0 0 auto;
    }
    .theme-toggle {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 32px;
      padding: 0 10px;
      border-radius: 10px;
      border: 1px solid var(--line);
      background: rgba(255, 255, 255, 0.92);
      color: var(--ink-soft);
      font-family: var(--font-sans);
      font-size: 12px;
      font-weight: 500;
      letter-spacing: 0.2px;
      box-shadow: 0 8px 18px rgba(46, 30, 18, 0.12);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      white-space: nowrap;
    }
    .theme-toggle:hover {
      border-color: var(--line-strong);
      background: #faf4ea;
      color: var(--ink);
    }
    .theme-toggle[aria-pressed="true"] {
      border-color: var(--accent-dark);
      color: var(--accent-dark);
      box-shadow: inset 0 -2px 0 rgba(122, 15, 18, 0.28), 0 8px 18px rgba(46, 30, 18, 0.12);
    }
    .auth-controls a {
      display:inline-flex;
      align-items:center;
      justify-content:center;
      min-height: 32px;
      padding: 0 10px;
      border-radius: 10px;
      border: 1px solid transparent;
      background: transparent;
      color: var(--ink-soft);
      text-decoration:none;
      letter-spacing: 0.2px;
      font-size: 12px;
      font-weight: 500;
      transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
      box-sizing: border-box;
      white-space: nowrap;
    }
    .auth-controls a:hover {
      border-color: var(--line);
      background: #faf4ea;
      color: var(--ink);
    }
    .auth-controls a.active,
    .auth-controls a.is-authed {
      background: #fff;
      border-color: var(--accent-dark);
      color: var(--accent-dark);
      box-shadow: inset 0 -2px 0 rgba(122, 15, 18, 0.28);
    }
    .auth-controls .nav-dropdown {
      display: none !important;
    }
    @media (max-width: 760px) {
      .topbar {
        flex-direction: column;
        gap: 6px;
      }
      .nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 6px;
        padding: 7px 8px;
      }
      .nav::-webkit-scrollbar {
        display: none;
      }
      .nav-item {
        flex: 0 0 auto;
      }
      .nav a {
        min-height: 34px;
        padding: 0 10px;
        font-size: 12px;
      }
      .nav a.app-nav-brand {
        padding: 0 7px;
      }
      .nav a.app-nav-brand span {
        display: none;
      }
      .nav a.app-nav-brand img {
        width: 26px;
        height: 26px;
      }
      .nav-dropdown {
        display: none !important;
      }
      .header-tools {
        width: 100%;
      }
      .theme-toggle {
        width: 100%;
      }
      .auth-controls {
        width: 100%;
        justify-content: flex-start;
      }
      .nav-role-chip {
        width: 100%;
        justify-content: flex-start;
        margin-left: 0;
      }
    }
    table { border-collapse: collapse; width: 100%; }
    th, td { border-bottom: 1px solid #e6d6c0; padding: 8px; text-align: left; font-size: 14px; }
    code { background:#f6f1ea; padding:2px 6px; border-radius:6px; }
    .pill { display:inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; border:1px solid var(--line); background:#fff; }
    .assistive-dismiss,
    .assistive-reset-hidden {
      border: 1px solid #e4d5c1;
      border-radius: 999px;
      background: #fffaf2;
      color: #6b5f54;
      font-size: 10px;
      font-weight: 700;
      min-height: 24px;
      padding: 0 8px;
      cursor: pointer;
    }
    .assistive-dismiss:hover,
    .assistive-reset-hidden:hover {
      border-color: var(--accent);
      color: var(--accent-dark);
    }
    .assistive-hidden-note {
      display: flex;
      gap: 8px;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
    }
    .banner { border-radius: 10px; padding: 10px 12px; margin: 12px 0; }
    .banner-error { background:#fde7e7; border:1px solid #f5c2c2; }
    .subnav {
      display:flex;
      gap:6px;
      flex-wrap:wrap;
      margin:6px 0 12px 0;
    }
    .subnav a {
      display:inline-flex;
      align-items:center;
      justify-content:center;
      min-height: 36px;
      padding: 0 12px;
      border:1px solid transparent;
      border-radius:10px;
      background: transparent;
      text-decoration:none;
      color:var(--ink-soft);
      font-size: 13px;
      font-weight: 500;
      transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
    }
    .subnav a:hover {
      border-color: var(--line);
      background: #faf4ea;
      color: var(--ink);
    }
    .subnav a.active {
      background: #fff;
      border-color: var(--accent-dark);
      color: var(--accent-dark);
      box-shadow: inset 0 -2px 0 rgba(122, 15, 18, 0.28);
    }
    body.route-standard {
      --ux-surface: #ffffff;
      --ux-line: #d8cab8;
      --ux-line-strong: #bda892;
      --ux-text: #221d18;
      --ux-text-muted: #6b5f54;
      --ux-shadow: 0 10px 24px rgba(46, 30, 18, 0.08);
      --ux-control-h: 36px;
      --ux-btn-radius: 12px;
      --ux-btn-px: 12px;
      --ux-btn-fs: 13px;
      --ux-btn-compact-h: 30px;
      --ux-btn-compact-radius: 10px;
      --ux-btn-compact-px: 10px;
      --ux-btn-compact-fs: 12px;
      --ux-focus: 0 0 0 2px rgba(192, 22, 27, 0.14);
      font-family: var(--font-sans);
      color: var(--ux-text);
    }
    body.route-rota {
      --ux-surface: #ffffff;
      --ux-line: #d8cab8;
      --ux-line-strong: #bda892;
      --ux-text: #221d18;
      --ux-text-muted: #6b5f54;
      --ux-shadow: 0 10px 24px rgba(46, 30, 18, 0.08);
      --ux-control-h: 36px;
      --ux-btn-radius: 12px;
      --ux-btn-px: 12px;
      --ux-btn-fs: 13px;
      --ux-btn-compact-h: 30px;
      --ux-btn-compact-radius: 10px;
      --ux-btn-compact-px: 10px;
      --ux-btn-compact-fs: 12px;
      --ux-focus: 0 0 0 2px rgba(192, 22, 27, 0.14);
      font-family: var(--font-sans);
      color: var(--ux-text);
    }
    body.route-standard h1 {
      display: none;
      margin: 2px 0 10px 0;
      font-size: 22px;
      line-height: 1.2;
      color: var(--accent-dark);
      letter-spacing: 0.3px;
    }
    body.route-standard .home-hero h1 {
      display: block;
    }
    body.route-standard .card {
      border: 1px solid var(--ux-line);
      border-radius: 18px;
      padding: 16px 18px;
      margin: 12px 0;
      background: var(--ux-surface);
      box-shadow: var(--ux-shadow);
      position: relative;
      overflow: hidden;
      transition: transform 130ms ease, box-shadow 160ms ease, border-color 160ms ease;
    }
    body.route-standard .card::before {
      content: "";
      position: absolute;
      left: 0;
      top: 0;
      right: 0;
      height: 2px;
      background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 42%, rgba(192, 22, 27, 0) 100%);
      pointer-events: none;
    }
    body.route-standard .card:hover {
      transform: translateY(-1px);
      border-color: #c7b19b;
      box-shadow: 0 14px 30px rgba(46, 30, 18, 0.12);
    }
    body.route-standard input,
    body.route-standard select,
    body.route-standard textarea {
      border: 1px solid var(--ux-line-strong);
      border-radius: 12px;
      min-height: var(--ux-control-h);
      height: var(--ux-control-h);
      padding: 0 10px;
      font-family: var(--font-sans);
      font-size: 13px;
      background: #fff;
      color: var(--ux-text);
      box-sizing: border-box;
    }
    body.route-standard input:focus,
    body.route-standard select:focus,
    body.route-standard textarea:focus {
      outline: none;
      border-color: var(--accent);
      box-shadow: 0 0 0 2px rgba(192, 22, 27, 0.14);
    }
    body.route-standard button,
    body.route-standard .btn,
    body.route-standard a.primary,
    body.route-rota button,
    body.route-rota .btn,
    body.route-rota a.primary {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: var(--ux-control-h);
      height: var(--ux-control-h);
      padding: 0 var(--ux-btn-px);
      border-radius: var(--ux-btn-radius);
      border: 1px solid var(--ux-line-strong);
      background: #fff;
      color: var(--ux-text);
      font-family: var(--font-sans);
      font-size: var(--ux-btn-fs);
      font-weight: 500;
      text-decoration: none;
      box-shadow: 0 1px 0 rgba(46, 30, 18, 0.08);
      transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
      box-sizing: border-box;
    }
    body.route-standard button,
    body.route-rota button {
      cursor: pointer;
    }
    body.route-standard button:hover,
    body.route-standard .btn:hover,
    body.route-standard a.primary:hover,
    body.route-rota button:hover,
    body.route-rota .btn:hover,
    body.route-rota a.primary:hover {
      border-color: #9f846c;
      box-shadow: inset 0 2px 0 rgba(46, 30, 18, 0.08);
      transform: translateY(1px);
    }
    body.route-standard button:active,
    body.route-standard .btn:active,
    body.route-standard a.primary:active,
    body.route-rota button:active,
    body.route-rota .btn:active,
    body.route-rota a.primary:active {
      box-shadow: inset 0 3px 0 rgba(46, 30, 18, 0.12);
      transform: translateY(2px);
    }
    body.route-standard button:focus-visible,
    body.route-standard .btn:focus-visible,
    body.route-standard a.primary:focus-visible,
    body.route-rota button:focus-visible,
    body.route-rota .btn:focus-visible,
    body.route-rota a.primary:focus-visible,
    body.route-standard input:focus-visible,
    body.route-standard select:focus-visible,
    body.route-standard textarea:focus-visible,
    body.route-rota input:focus-visible,
    body.route-rota select:focus-visible,
    body.route-rota textarea:focus-visible {
      outline: 3px solid rgba(122, 15, 18, 0.24);
      outline-offset: 2px;
    }
    body.route-standard th, body.route-standard td {
      font-size: 13px;
    }
    body.route-standard th {
      background: #fff;
      color: #5a4d3e;
      font-weight: 500;
      letter-spacing: 0.45px;
      text-transform: uppercase;
    }
    body.route-standard h1,
    body.route-standard h2,
    body.route-standard h3,
    body.route-standard .section-title,
    body.route-standard b,
    body.route-standard strong,
    body.route-standard th,
    body.route-standard summary,
    body.route-standard button,
    body.route-standard .btn,
    body.route-standard .pill,
    body.route-standard label {
      font-weight: 500 !important;
    }
    body.route-standard input,
    body.route-standard textarea,
    body.route-standard select,
    body.route-standard td,
    body.route-standard span,
    body.route-standard p,
    body.route-standard li,
    body.route-standard label {
      font-weight: 400;
    }
    body.route-standard label {
      font-weight: 400 !important;
    }
    body.route-rota h1,
    body.route-rota h2,
    body.route-rota h3,
    body.route-rota .section-title,
    body.route-rota b,
    body.route-rota strong,
    body.route-rota th,
    body.route-rota summary,
    body.route-rota button,
    body.route-rota .btn,
    body.route-rota .pill,
    body.route-rota label {
      font-weight: 500 !important;
    }
    body.route-rota input,
    body.route-rota textarea,
    body.route-rota select,
    body.route-rota td,
    body.route-rota span,
    body.route-rota p,
    body.route-rota li,
    body.route-rota label {
      font-weight: 400;
    }
    body.route-rota label {
      font-weight: 400 !important;
    }
    html[data-theme="dark"] {
      color-scheme: dark;
      --paper: #171614;
      --card: #211e1b;
      --ink: #e8dfd4;
      --ink-soft: #b9ac9d;
      --line: #453c34;
      --line-strong: #5c5148;
      --accent: #c97562;
      --accent-dark: #f1c9c0;
      --forest: #7daa87;
      --gold: #caa55e;
      --cream: #2a2621;
    }
    html[data-theme="dark"] body {
      background: radial-gradient(circle at 8% -12%, #23211e 0%, #1b1917 42%, #141311 100%);
      color: var(--ink);
    }
    html[data-theme="dark"] .card,
    html[data-theme="dark"] body.route-standard .card,
    html[data-theme="dark"] body.route-rota .card {
      background: var(--card) !important;
      border-color: var(--line) !important;
      box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28) !important;
    }
    html[data-theme="dark"] .card::before,
    html[data-theme="dark"] body.route-standard .card::before {
      background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 42%, rgba(216,107,92,0) 100%);
    }
    html[data-theme="dark"] .nav,
    html[data-theme="dark"] .nav.nav-clear,
    html[data-theme="dark"] .auth-controls,
    html[data-theme="dark"] .theme-toggle {
      background: rgba(31, 28, 25, 0.92) !important;
      border-color: var(--line) !important;
      box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28) !important;
    }
    html[data-theme="dark"] .nav a,
    html[data-theme="dark"] .auth-controls a,
    html[data-theme="dark"] .subnav a {
      color: var(--ink-soft);
    }
    html[data-theme="dark"] .nav a:hover,
    html[data-theme="dark"] .auth-controls a:hover,
    html[data-theme="dark"] .subnav a:hover,
    html[data-theme="dark"] .theme-toggle:hover {
      background: #2a2622 !important;
      border-color: var(--line-strong) !important;
      color: var(--ink) !important;
    }
    html[data-theme="dark"] .nav a.app-nav-brand {
      background: rgba(42, 38, 34, 0.86) !important;
      border-color: var(--line) !important;
      color: #f5eee5 !important;
    }
    html[data-theme="dark"] .nav a.active,
    html[data-theme="dark"] .auth-controls a.active,
    html[data-theme="dark"] .auth-controls a.is-authed,
    html[data-theme="dark"] .subnav a.active,
    html[data-theme="dark"] .theme-toggle[aria-pressed="true"] {
      background: #312823 !important;
      border-color: var(--accent) !important;
      color: #ffdacf !important;
      box-shadow: inset 0 -2px 0 rgba(216, 107, 92, 0.34), 0 12px 24px rgba(0, 0, 0, 0.28) !important;
    }
    html[data-theme="dark"] .nav-role-chip,
    html[data-theme="dark"] .nav-dropdown,
    html[data-theme="dark"] .nav-site-switcher,
    html[data-theme="dark"] .accessibility-panel,
    html[data-theme="dark"] .ui-filterbar,
    html[data-theme="dark"] .ui-table-wrap,
    html[data-theme="dark"] .ui-empty,
    html[data-theme="dark"] .feedback-modal-card,
    html[data-theme="dark"] .rota-smart-dialog-card {
      background: #1d1a17 !important;
      border-color: var(--line) !important;
      color: var(--ink) !important;
    }
    html[data-theme="dark"] .accessibility-option {
      color: var(--ink) !important;
    }
    html[data-theme="dark"] .accessibility-option:hover,
    html[data-theme="dark"] .accessibility-option:focus-visible {
      background: rgba(216, 107, 92, 0.12) !important;
    }
    html[data-theme="dark"] .accessibility-option[data-enabled="1"] {
      background: rgba(216, 107, 92, 0.14) !important;
      border-color: rgba(216, 107, 92, 0.38) !important;
      box-shadow: inset 4px 0 0 rgba(216, 107, 92, 0.9), 0 10px 18px rgba(0, 0, 0, 0.2) !important;
    }
    html[data-theme="dark"] .accessibility-option-icon {
      background: #16120f !important;
      border-color: var(--line) !important;
      color: #ffdacf !important;
    }
    html[data-theme="dark"] .accessibility-option[data-enabled="1"] .accessibility-option-icon {
      background: #312823 !important;
      border-color: var(--accent) !important;
      color: #ffdacf !important;
    }
    html[data-theme="dark"] .accessibility-option-title {
      color: var(--ink) !important;
    }
    html[data-theme="dark"] .accessibility-option-note {
      color: var(--ink-soft) !important;
    }
    html[data-theme="dark"] .ui-table-wrap thead th,
    html[data-theme="dark"] body.route-standard th,
    html[data-theme="dark"] body.route-rota th {
      background: #27231f !important;
      color: var(--ink-soft) !important;
    }
    html[data-theme="dark"] body.route-standard input,
    html[data-theme="dark"] body.route-standard select,
    html[data-theme="dark"] body.route-standard textarea,
    html[data-theme="dark"] body.route-rota input,
    html[data-theme="dark"] body.route-rota select,
    html[data-theme="dark"] body.route-rota textarea,
    html[data-theme="dark"] input,
    html[data-theme="dark"] select,
    html[data-theme="dark"] textarea {
      background: #191715 !important;
      color: var(--ink) !important;
      border-color: var(--line-strong) !important;
    }
    html[data-theme="dark"] body.route-standard button,
    html[data-theme="dark"] body.route-standard .btn,
    html[data-theme="dark"] body.route-standard a.primary,
    html[data-theme="dark"] body.route-rota button,
    html[data-theme="dark"] body.route-rota .btn,
    html[data-theme="dark"] body.route-rota a.primary,
    html[data-theme="dark"] button,
    html[data-theme="dark"] .btn {
      background: linear-gradient(180deg, #2f2a25 0%, #26221e 100%) !important;
      color: var(--ink) !important;
      border-color: var(--line-strong) !important;
      box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset !important;
    }
    html[data-theme="dark"] code,
    html[data-theme="dark"] .pill {
      background: #27231f !important;
      border-color: var(--line) !important;
      color: var(--ink) !important;
    }
    html[data-theme="dark"] h1,
    html[data-theme="dark"] h2,
    html[data-theme="dark"] h3,
    html[data-theme="dark"] .section-title,
    html[data-theme="dark"] .ui-page-title,
    html[data-theme="dark"] .ui-section-title,
    html[data-theme="dark"] .panel-title,
    html[data-theme="dark"] summary,
    html[data-theme="dark"] strong,
    html[data-theme="dark"] b {
      color: var(--ink) !important;
    }
    html[data-theme="dark"] th,
    html[data-theme="dark"] td {
      border-bottom-color: var(--line) !important;
      color: var(--ink);
    }
    html[data-theme="dark"] .ui-muted,
    html[data-theme="dark"] .ui-page-subtitle,
    html[data-theme="dark"] .banner,
    html[data-theme="dark"] small,
    html[data-theme="dark"] label,
    html[data-theme="dark"] .help-hint {
      color: var(--ink-soft) !important;
    }
    html[data-theme="dark"] .ui-table-wrap tbody tr:hover td {
      background: #241d17 !important;
    }
    html[data-theme="dark"] .banner-error {
      background: rgba(127, 36, 28, 0.22) !important;
      border-color: rgba(216, 107, 92, 0.4) !important;
      color: #ffd7d0 !important;
    }
    html[data-theme="dark"] #globalHoverTooltip {
      background: rgba(10, 8, 7, 0.96);
      color: #f8efe6;
    }
    html[data-theme="dark"] #salesPage,
    html[data-theme="dark"] #rotaMain,
    html[data-theme="dark"] #settingsPage,
    html[data-theme="dark"] #reportsPage {
      color: var(--ink);
    }
    html[data-theme="dark"] #salesPage .sales-embedded-card,
    html[data-theme="dark"] #salesPage .sales-day-card,
    html[data-theme="dark"] #salesPage .sales-day-details,
    html[data-theme="dark"] #salesPage .sales-breakdown-details,
    html[data-theme="dark"] #salesPage .sales-day-metric,
    html[data-theme="dark"] #salesPage .sales-dash-kpi,
    html[data-theme="dark"] #salesPage .sales-dash-footer,
    html[data-theme="dark"] #salesPage .sales-dash-detail-row > div,
    html[data-theme="dark"] #salesPage .sales-week-field,
    html[data-theme="dark"] #salesPage #salesWeekSettingsCard,
    html[data-theme="dark"] #salesPage #openingTimesSection,
    html[data-theme="dark"] #salesPage #nonProdPatternSection,
    html[data-theme="dark"] #salesPage #summaryTableWrap,
    html[data-theme="dark"] #salesPage #salesPlanChartCard,
    html[data-theme="dark"] #salesPage .sales-plan-kpi,
    html[data-theme="dark"] #salesPage .sales-plan-day-pill,
    html[data-theme="dark"] #salesPage .sales-overflow-menu,
    html[data-theme="dark"] #salesPage #costDashboard {
      background: #211e1b !important;
      border-color: var(--line) !important;
      color: var(--ink) !important;
      box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18) !important;
    }
    html[data-theme="dark"] #salesPage .sales-day-summary,
    html[data-theme="dark"] #salesPage .sales-dash-footer-copy,
    html[data-theme="dark"] #salesPage .sales-forecast-toolbar,
    html[data-theme="dark"] #salesPage .sales-week-row,
    html[data-theme="dark"] #salesPage .sales-day-total-controls,
    html[data-theme="dark"] #salesPage .sales-day-actual-total-controls,
    html[data-theme="dark"] #salesPage .sales-day-events-controls {
      color: var(--ink) !important;
    }
    html[data-theme="dark"] #salesPage .sales-header-subtext,
    html[data-theme="dark"] #salesPage .sales-header-meta,
    html[data-theme="dark"] #salesPage .panel-subtitle,
    html[data-theme="dark"] #salesPage .sales-dash-kpi-note,
    html[data-theme="dark"] #salesPage .sales-dash-footer-text,
    html[data-theme="dark"] #salesPage .sales-day-metric-label,
    html[data-theme="dark"] #salesPage #salesFinancialWeek,
    html[data-theme="dark"] #salesPage #salesEventQuickSummary,
    html[data-theme="dark"] #salesPage #dashCostBreakdown,
    html[data-theme="dark"] #salesPage #dashNote,
    html[data-theme="dark"] #salesPage #dashVersionStamp,
    html[data-theme="dark"] #salesPage #dashParityStatus,
    html[data-theme="dark"] #salesPage .sales-inline-hint {
      color: var(--ink-soft) !important;
    }
    html[data-theme="dark"] #salesPage #summaryTable thead th,
    html[data-theme="dark"] #salesPage #openingTimesContainer th,
    html[data-theme="dark"] #salesPage .sales-day-content th {
      background: #28241f !important;
      color: var(--ink-soft) !important;
    }
    html[data-theme="dark"] #salesPage #summaryTable tbody tr:hover td,
    html[data-theme="dark"] #salesPage .sales-day-content tbody tr:hover td {
      background: #292520 !important;
    }
    html[data-theme="dark"] #rotaMain .card,
    html[data-theme="dark"] #rotaMain #costDashboard,
    html[data-theme="dark"] #rotaMain #rotaTopControls,
    html[data-theme="dark"] #rotaMain .rota-week-kpi,
    html[data-theme="dark"] #rotaMain #rotaTableContainer,
    html[data-theme="dark"] #rotaMain #rotaDemandSide,
    html[data-theme="dark"] #rotaMain #availabilityCalendarCard,
    html[data-theme="dark"] #rotaMain .rota-template-modal-card,
    html[data-theme="dark"] #rotaSummaryBar,
    html[data-theme="dark"] #shiftPopover,
    html[data-theme="dark"] #shiftContextMenu,
    html[data-theme="dark"] #timeOffModal > div {
      background: #211e1b !important;
      border-color: var(--line) !important;
      color: var(--ink) !important;
      box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22) !important;
    }
    html[data-theme="dark"] #rotaMain .staff-card,
    html[data-theme="dark"] #rotaMain .shift-cell,
    html[data-theme="dark"] #rotaMain .availability-day-card,
    html[data-theme="dark"] #rotaMain .availability-slot-cell {
      background: #26221e !important;
      border-color: var(--line) !important;
      color: var(--ink) !important;
      box-shadow: none !important;
    }
    html[data-theme="dark"] #rotaMain .staff-card[data-state="open"] {
      background: #2c2620 !important;
      border-color: #7a6146 !important;
    }
    html[data-theme="dark"] #rotaMain table th,
    html[data-theme="dark"] #rotaMain #rotaTableContainer th,
    html[data-theme="dark"] #rotaMain #rotaTableContainer th[data-day-idx] {
      background: #292520 !important;
      color: var(--ink-soft) !important;
      border-bottom-color: var(--line) !important;
    }
    html[data-theme="dark"] #rotaMain table tbody tr:nth-child(even) {
      background: #1c1916 !important;
    }
    html[data-theme="dark"] #rotaMain #rotaTableContainer tr:hover,
    html[data-theme="dark"] #rotaMain table tbody tr:hover td {
      background: #25211d !important;
    }
    html[data-theme="dark"] #rotaMain .holiday-pill {
      background: rgba(202, 165, 94, 0.14) !important;
      color: #ecd8ac !important;
      border-color: rgba(202, 165, 94, 0.24) !important;
    }
    html[data-theme="dark"] #rotaMain .timeoff-pill {
      background: rgba(201, 117, 98, 0.16) !important;
      color: #f2c9c1 !important;
      border-color: rgba(201, 117, 98, 0.24) !important;
    }
    html[data-theme="dark"] #rotaMain #suggestedDebugLine,
    html[data-theme="dark"] #rotaMain #rotaHealthMeta,
    html[data-theme="dark"] #rotaMain #rotaPredictiveMeta,
    html[data-theme="dark"] #rotaMain #rotaPredictiveHelp,
    html[data-theme="dark"] #rotaMain #availabilityCalendarMeta,
    html[data-theme="dark"] #rotaMain .meta,
    html[data-theme="dark"] #rotaMain .availability-slot-time,
    html[data-theme="dark"] #rotaMain .demand-mini-val,
    html[data-theme="dark"] #rotaMain .demand-mini-label {
      color: var(--ink-soft) !important;
    }
    html[data-theme="dark"] #rotaMain .demand-mini-bar,
    html[data-theme="dark"] #rotaMain .demand-bar {
      background: #2a2622 !important;
      border-color: var(--line) !important;
    }
    html[data-theme="dark"] .status-pill,
    html[data-theme="dark"] .pill-status,
    html[data-theme="dark"] .clock-pill,
    html[data-theme="dark"] .staff-status-pill {
      border-color: var(--line) !important;
    }
    .ui-page {
      max-width: 1620px;
      margin: 10px auto 0 auto;
      display: grid;
      gap: 12px;
      align-content: start;
    }
    .ui-page-header {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 12px;
      flex-wrap: wrap;
      padding: 14px 16px !important;
    }
    .ui-page-title {
      margin: 0;
      color: var(--ux-text, var(--ink));
      font-size: clamp(28px, 3vw, 36px);
      line-height: 1.1;
      font-weight: 500;
      letter-spacing: -0.4px;
      text-wrap: balance;
    }
    .ui-page-subtitle {
      margin-top: 6px;
      color: var(--ux-text-muted, var(--ink-soft));
      font-size: 13px;
      font-weight: 500;
    }
    .ui-toolbar {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .ui-toolbar-end {
      margin-left: auto;
    }
    .ui-filterbar {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      border: 1px solid var(--ux-line, var(--line));
      border-radius: 12px;
      background: #fff;
      padding: 8px 10px;
    }
    .ui-grid-2 {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 12px;
      align-items: start;
    }
    .ui-col {
      min-width: 0;
      display: grid;
      gap: 12px;
      align-content: start;
    }
    .ui-section-title {
      color: var(--ux-text, var(--ink));
      font-weight: 500;
      letter-spacing: -0.2px;
      font-size: clamp(18px, 1.5vw, 22px);
      line-height: 1.2;
      margin: 0;
    }
    .ui-muted {
      color: var(--ux-text-muted, var(--ink-soft));
      font-size: 12px;
    }
    .ui-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 2px 8px;
      border-radius: 999px;
      border: 1px solid var(--ux-line, var(--line));
      background: #fff;
      color: var(--ux-text-muted, var(--ink-soft));
      font-size: 12px;
      line-height: 1.2;
    }
    :is(
      #setLastWeek, #setThisWeek, #setNextWeek,
      #salesSetLastWeek, #salesSetThisWeek, #salesSetNextWeek,
      #availabilityWeekLast, #availabilityWeekThis, #availabilityWeekNext,
      #timeOffWeekLast, #timeOffWeekThis, #timeOffWeekNext,
      #signLastWeek, #signThisWeek, #signNextWeek,
      #payLastWeek, #payThisWeek, #payNextWeek,
      #clockLastWeek, #clockThisWeek, #clockNextWeek,
      #reportLastWeek, #reportThisWeek, #reportNextWeek
    ) {
      min-height: 36px;
      height: 36px;
      min-width: 96px;
      padding: 0 12px;
      border-radius: 12px;
      border: 1px solid #d8b48a;
      background: #fffdf9;
      color: var(--ux-text, var(--ink));
      font-size: 12px;
      font-weight: 500;
      line-height: 1;
      letter-spacing: 0;
      box-shadow: none;
    }
    .ui-table-wrap {
      overflow: auto;
      border: 1px solid var(--ux-line, var(--line));
      border-radius: 12px;
      background: #fff;
    }
    .site-week-nav-card {
      width: 100%;
      min-width: 0;
      display: grid;
      gap: 8px;
      padding: 14px 18px;
      border: 1px solid var(--ux-line, var(--line));
      border-radius: 20px;
      background: var(--ux-surface, #fff);
      box-shadow: var(--ux-shadow, 0 10px 24px rgba(46, 30, 18, 0.08));
      box-sizing: border-box;
    }
    .site-week-nav-main {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
    }
    .site-week-nav-input {
      display: inline-flex;
      align-items: center;
      gap: 12px;
      min-height: 40px;
      padding: 0;
      border: 0;
      border-radius: 0;
      background: transparent;
      box-shadow: none;
      box-sizing: border-box;
      max-width: 100%;
    }
    .site-week-nav-input-label {
      font-size: 13px;
      font-weight: 500;
      color: var(--ux-text-muted, var(--ink-soft));
      white-space: nowrap;
    }
    .site-week-nav-input input[type="date"] {
      min-width: 164px;
      min-height: 40px;
      height: 40px;
      padding: 0 12px;
      border-radius: 14px;
      background: #fff;
      box-shadow: none;
    }
    .site-week-nav-buttons {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
    }
    .site-week-nav-meta {
      font-size: 12px;
      color: var(--ux-text-muted, var(--ink-soft));
      padding-left: 14px;
      min-height: 18px;
    }
    #rotaWeekNavCard,
    #availabilityWeekNavCard,
    #timeOffWeekNavCard,
    #signWeekNavCard,
    #payWeekNavCard,
    #clockWeekNavCard,
    #reportWeekNavCard {
      width: 100%;
      padding: 0 !important;
      border: 0 !important;
      border-radius: 0 !important;
      background: transparent !important;
      box-shadow: none !important;
    }
    #availabilityWeekNavCard .site-week-nav-meta,
    #timeOffWeekNavCard .site-week-nav-meta,
    #signWeekNavCard .site-week-nav-meta,
    #clockWeekNavCard .site-week-nav-meta,
    #rotaWeekNavCard .site-week-nav-meta,
    #payWeekNavCard .site-week-nav-meta,
    #reportWeekNavCard .site-week-nav-meta {
      padding-left: 0 !important;
    }
    #rotaWeekControls .site-week-nav-main {
      align-items: center;
    }
    #rotaWeekControls label,
    #rotaWeekControls label.site-week-nav-input,
    .availability-page-controls label.site-week-nav-input,
    .timeoff-controls label.site-week-nav-input,
    .signoff-controls label.site-week-nav-input,
    .payroll-controls label.site-week-nav-input,
    .clock-controls label.site-week-nav-input,
    .reports-search label.site-week-nav-input {
      padding: 0 !important;
      border: 0 !important;
      border-radius: 0 !important;
      background: transparent !important;
      box-shadow: none !important;
    }
    .ui-table-wrap table {
      width: 100%;
      border-collapse: separate;
      border-spacing: 0;
      margin: 0;
    }
    .ui-table-wrap thead th {
      position: sticky;
      top: 0;
      z-index: 1;
      background: #fff;
    }
    .ui-table-wrap tbody tr:hover td {
      background: #fffcf8;
    }
    .ui-empty {
      border: 1px dashed var(--ux-line-strong, var(--line-strong));
      border-radius: 12px;
      padding: 10px 12px;
      background: #fff;
      color: var(--ux-text-muted, var(--ink-soft));
      font-size: 12px;
    }
    @media (max-width: 1024px) {
      .ui-grid-2 {
        grid-template-columns: 1fr;
      }
    }
	    @media (max-width: 768px) {
	      body {
	        margin: 6px;
	        font-size: 13px;
	        -webkit-text-size-adjust: 100%;
	      }
	      body.route-standard,
	      body.route-rota {
	        --ux-control-h: 42px;
	        --ux-btn-px: 12px;
	        --ux-btn-fs: 13px;
	      }
	      body.route-standard input,
	      body.route-standard select,
	      body.route-standard textarea,
	      body.route-rota input,
	      body.route-rota select,
	      body.route-rota textarea {
	        min-height: 42px;
	        font-size: 16px;
	      }
	      body.route-standard button,
	      body.route-standard .btn,
	      body.route-standard a.primary,
	      body.route-rota button,
	      body.route-rota .btn,
	      body.route-rota a.primary {
	        min-height: 42px;
	        height: auto;
	        white-space: normal;
	        line-height: 1.2;
	      }
	      body.route-standard .card {
	        padding: 14px;
	      }
	      body.route-standard .card,
	      body.route-rota .card {
	        border-radius: 16px;
	        margin: 10px 0;
	      }
	      .topbar {
	        top: 4px;
	        gap: 4px !important;
	        margin-bottom: 8px !important;
	      }
	      .nav.nav-clear {
	        padding: 6px;
	      }
	      .nav a,
	      .auth-controls a,
	      .theme-toggle {
	        min-height: 32px;
	        font-size: 11px;
	      }
	      .header-tools {
	        display: flex !important;
	        justify-content: flex-end !important;
	        align-self: flex-end !important;
	        width: 100% !important;
	        gap: 4px !important;
	      }
	      .auth-controls {
	        width: auto !important;
	        padding: 3px !important;
	        border-radius: 10px !important;
	        justify-content: flex-end !important;
	      }
	      .theme-toggle,
	      .auth-controls a {
	        width: auto !important;
	        min-width: 0 !important;
	        min-height: 28px !important;
	        height: 28px !important;
	        padding: 0 8px !important;
	        font-size: 10px !important;
	        border-radius: 9px !important;
	        box-shadow: 0 4px 10px rgba(46, 30, 18, 0.10) !important;
	      }
	      .ui-page {
	        margin-top: 8px;
	        gap: 10px;
	      }
	      .ui-page-header {
	        padding: 12px 14px !important;
	        align-items: flex-start;
	      }
	      .ui-page-title {
	        font-size: 24px;
	      }
	      .ui-toolbar,
	      .ui-filterbar,
	      .subnav,
	      .reports-search,
	      .report-grid-actions,
	      .help-controls,
	      .settings-tabbar,
	      .settings-subtabbar {
	        display: grid !important;
	        grid-template-columns: 1fr;
	        align-items: stretch;
	        width: 100%;
	      }
	      .ui-toolbar > *,
	      .ui-filterbar > *,
	      .subnav > *,
	      .reports-search > *,
	      .report-grid-actions > *,
	      .help-controls > *,
	      .settings-tabbar > *,
	      .settings-subtabbar > * {
	        width: 100%;
	        box-sizing: border-box;
	      }
	      .subnav {
	        grid-template-columns: repeat(2, minmax(0, 1fr));
	      }
	      .subnav a {
	        min-height: 40px;
	      }
	      .site-week-nav-card {
	        padding: 12px 14px;
	      }
      .site-week-nav-input {
        width: 100%;
        justify-content: space-between;
      }
      .site-week-nav-input input[type="date"] {
        min-width: 0;
        width: 100%;
      }
	      .site-week-nav-buttons {
	        width: 100%;
	        display: grid;
	        grid-template-columns: repeat(3, minmax(0, 1fr));
	        gap: 6px;
	      }
	      .site-week-nav-buttons button {
	        min-width: 0;
	        width: 100%;
	      }
	      .ui-table-wrap,
	      .report-table-wrap,
	      .labour-grid-wrap,
	      #reportOutput,
	      #summaryTableWrap,
	      #openingTimesSection,
	      #nonProdPatternSection {
	        overflow-x: auto;
	        -webkit-overflow-scrolling: touch;
	      }
	      .ui-table-wrap table,
	      .report-table,
	      #summaryTable,
	      #openingTimesContainer table {
	        min-width: 680px;
	      }
	      #salesPage .sales-hero-toolbar,
	      #salesPage .sales-forecast-toolbar,
	      #salesPage .sales-week-row,
	      #salesPage .sales-day-total-controls,
	      #salesPage .sales-day-actual-total-controls,
	      #salesPage .sales-day-events-controls,
	      #salesPage .sales-dash-footer,
	      #salesPage .sales-dash-actions {
	        display: grid !important;
	        grid-template-columns: 1fr;
	        align-items: stretch;
	      }
	      #salesPage .sales-hero-toolbar *,
	      #salesPage .sales-forecast-toolbar *,
	      #salesPage .sales-week-row *,
	      #salesPage .sales-dash-actions > *,
	      #salesPage .sales-day-total-controls > *,
	      #salesPage .sales-day-actual-total-controls > *,
	      #salesPage .sales-day-events-controls > * {
	        max-width: 100%;
	      }
	      #salesPage .sales-days-grid,
	      #salesPage .sales-week-grid,
	      #salesPage .sales-dash-kpis,
	      #salesPage .sales-dash-detail-grid,
	      .home-kpi-grid,
	      .home-status-grid {
	        grid-template-columns: 1fr !important;
	      }
	      #salesPage .sales-day-content {
	        overflow-x: auto;
	        -webkit-overflow-scrolling: touch;
	      }
	      #salesPage .sales-day-content table {
	        min-width: 620px;
	      }
	      .home-hero {
	        padding: 18px !important;
	      }
	      .home-hero h1 {
	        font-size: 28px;
	      }
	      #siteGeofenceMap {
	        min-height: 240px;
	        height: 240px;
	      }
	      .feedback-modal {
	        align-items: center;
	        padding: 8px;
	      }
	      .feedback-modal-card,
	      .rota-smart-dialog-card {
	        width: 100%;
	        max-height: calc(100vh - 18px);
	        border-radius: 22px 22px 18px 18px;
	      }
	      .rota-smart-dialog-card {
	        padding: 18px;
	      }
	      .rota-smart-dialog-title {
	        font-size: 20px;
	      }
	      .rota-smart-dialog-actions {
	        display: grid;
	        grid-template-columns: 1fr;
	      }
	      .rota-smart-dialog-actions button {
	        width: 100%;
	      }
	      .home-brand {
	        display: none !important;
	      }
	      .home-hero {
	        margin-bottom: 6px !important;
	        gap: 8px !important;
	      }
	      .home-hero > div:last-child,
	      .home-actions {
	        width: 100%;
	      }
	      .home-actions {
	        display: grid !important;
	        grid-template-columns: repeat(3, minmax(0, 1fr));
	        gap: 6px;
	      }
	      .home-actions a {
	        text-align: center;
	        padding: 8px 6px !important;
	        font-size: 12px;
	      }
	    }
	    .rota-smart-dialog-overlay[data-variant="release"] .rota-smart-dialog-card {
	      width: min(640px, 100%);
	      max-height: min(760px, calc(100vh - 36px));
	      display: flex;
	      flex-direction: column;
	      overflow: hidden;
	      text-align: left;
	    }
	    .rota-smart-dialog-overlay[data-variant="release"] .rota-smart-dialog-icon {
	      margin-left: 0;
	      color: #c0161b;
	      font-weight: 900;
	      font-family: Georgia, "Times New Roman", serif;
	    }
	    .rota-smart-dialog-overlay[data-variant="release"] .rota-smart-dialog-title {
	      padding-right: 46px;
	    }
	    .rota-smart-dialog-overlay[data-variant="release"] .rota-smart-dialog-message {
	      max-height: min(520px, calc(100vh - 250px));
	      overflow: auto;
	      padding-right: 8px;
	      text-align: left;
	    }
	    .rota-smart-dialog-overlay[data-variant="release"] .rota-smart-dialog-actions {
	      flex: 0 0 auto;
	    }
	    .feedback-fab-wrap {
	      position: fixed;
	      right: 18px;
	      bottom: 18px;
      z-index: 55;
    }
    .feedback-fab-btn {
      min-height: 40px;
      border-radius: 999px;
      padding: 0 14px;
      border: 1px solid var(--accent-dark);
      background: linear-gradient(180deg, #fff 0%, #fff2e4 100%);
      color: var(--accent-dark);
      font-size: 12px;
      font-weight: 500;
      box-shadow: 0 10px 22px rgba(46, 30, 18, 0.2);
    }
    #salesAssistiveCard,
    #rotaAssistiveCard,
    #staffAssistiveCard,
    #settingsAssistiveCard,
    #reportsAssistiveCard {
      display: none !important;
    }
    .assistive-helper {
      position: relative;
      right: auto;
      bottom: auto;
      z-index: 12;
      display: none;
      font-family: var(--font-sans);
      flex: 0 0 auto;
    }
    .assistive-helper[data-visible="1"] {
      display: inline-flex;
    }
    .assistive-helper-button {
      min-height: 44px !important;
      height: 44px !important;
      display: inline-flex !important;
      align-items: center !important;
      gap: 8px !important;
      border-radius: 999px !important;
      border: 1px solid rgba(122, 15, 18, 0.24) !important;
      background: linear-gradient(180deg, #fffdf9 0%, #fff2e4 100%) !important;
      color: #2f271f !important;
      padding: 0 12px 0 7px !important;
      box-shadow: 0 8px 18px rgba(46, 30, 18, 0.12) !important;
      transform: none !important;
    }
    .assistive-helper-button:hover {
      border-color: var(--accent-dark) !important;
      transform: translateY(-1px) !important;
    }
    .assistive-helper-mark {
      width: 30px;
      height: 30px;
      border-radius: 10px;
      display: block;
      overflow: hidden;
      background: #c0161b;
      box-shadow: 0 2px 8px rgba(122, 15, 18, 0.18);
      flex: 0 0 auto;
    }
    .assistive-helper-mark img {
      width: 100%;
      height: 100%;
      display: block;
    }
    .assistive-helper-label {
      font-size: 12px;
      font-weight: 700;
      white-space: nowrap;
    }
    .assistive-helper-badge {
      min-width: 18px;
      height: 18px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0 5px;
      background: var(--forest);
      color: #fff;
      font-size: 10px;
      font-weight: 800;
    }
    .assistive-helper[data-critical="1"] .assistive-helper-badge {
      background: var(--accent);
    }
    .assistive-helper[data-critical="1"] .assistive-helper-button {
      animation: assistiveHelperPulse 2.2s ease-in-out infinite;
    }
    @keyframes assistiveHelperPulse {
      0%, 100% { box-shadow: 0 8px 18px rgba(46, 30, 18, 0.12); }
      50% { box-shadow: 0 10px 24px rgba(192, 22, 27, 0.26); }
    }
    .assistive-helper-panel {
      position: fixed;
      right: 18px;
      top: 78px;
      bottom: auto;
      width: min(360px, calc(100vw - 36px));
      max-height: min(72vh, 560px);
      overflow: auto;
      border: 1px solid #d8c3ae;
      border-radius: 22px;
      background:
        radial-gradient(circle at 14% 8%, rgba(255, 244, 214, 0.94), transparent 34%),
        linear-gradient(145deg, #fffdf9, #fff4e5);
      box-shadow: 0 22px 55px rgba(46, 30, 18, 0.24);
      padding: 14px;
      color: var(--ink);
      display: none;
    }
    .assistive-helper[data-open="1"] .assistive-helper-panel {
      display: block;
    }
    .assistive-helper-panel-head {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 10px;
      margin-bottom: 10px;
    }
    .assistive-helper-kicker {
      color: #7a5a3b;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }
    .assistive-helper-title {
      margin-top: 3px;
      font-size: 17px;
      line-height: 1.2;
      font-weight: 800;
      color: #221d18;
    }
    .assistive-helper-close {
      min-width: 30px !important;
      min-height: 30px !important;
      height: 30px !important;
      width: 30px !important;
      padding: 0 !important;
      border-radius: 999px !important;
      font-size: 16px !important;
      line-height: 1 !important;
    }
    .assistive-helper-list {
      display: grid;
      gap: 8px;
    }
    .assistive-helper-item {
      display: grid;
      gap: 6px;
      border: 1px solid #eadcc9;
      border-radius: 14px;
      background: rgba(255, 255, 255, 0.76);
      padding: 10px;
    }
    .assistive-helper-item[data-kind="critical"] {
      border-color: rgba(192, 22, 27, 0.35);
      background: #fff7f6;
    }
    .assistive-helper-item[data-kind="warning"] {
      border-color: rgba(227, 178, 60, 0.45);
      background: #fffaf0;
    }
    .assistive-helper-item-top {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      align-items: flex-start;
    }
    .assistive-helper-item-title {
      font-size: 12px;
      line-height: 1.25;
      font-weight: 800;
      color: #2f271f;
    }
    .assistive-helper-pill {
      flex: 0 0 auto;
      border-radius: 999px;
      padding: 3px 7px;
      border: 1px solid #d9c1a3;
      background: #fff;
      color: #6b5f54;
      font-size: 10px;
      font-weight: 800;
      text-transform: uppercase;
    }
    .assistive-helper-meta,
    .assistive-helper-reason,
    .assistive-helper-action {
      font-size: 11px;
      color: #5f554c;
      line-height: 1.35;
    }
    .assistive-helper-evidence {
      display: flex;
      gap: 5px;
      flex-wrap: wrap;
    }
    .assistive-helper-evidence span {
      display: inline-flex;
      gap: 4px;
      align-items: center;
      border: 1px solid #eadcc9;
      border-radius: 999px;
      padding: 3px 7px;
      background: #fff;
      color: #6b5f54;
      font-size: 10px;
    }
    .assistive-helper-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      margin-top: 10px;
    }
    .assistive-helper-action-button {
      min-height: 32px;
      border-radius: 999px;
      border: 1px solid rgba(122, 15, 18, 0.28);
      background: #fff7f2;
      color: #7a0f12;
      font-weight: 700;
      cursor: pointer;
      padding: 0 12px;
      margin: 8px 6px 0 0;
      font-size: 11px;
    }
    .assistive-helper-dismiss {
      min-height: 26px !important;
      height: 26px !important;
      border-radius: 999px !important;
      padding: 0 9px !important;
      font-size: 10px !important;
    }
    .assistive-helper-empty {
      font-size: 12px;
      color: #6b5f54;
      line-height: 1.4;
    }
    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }
    .ask-help-widget {
      position: relative;
      display: none;
      flex: 0 0 auto;
      font-family: var(--font-sans);
      z-index: 13;
    }
    .ask-help-widget[data-visible="1"] {
      display: inline-flex;
    }
    .ask-help-button {
      min-height: 44px !important;
      height: 44px !important;
      display: inline-flex !important;
      align-items: center !important;
      gap: 8px !important;
      border-radius: 999px !important;
      border: 1px solid rgba(26, 89, 65, 0.26) !important;
      background: linear-gradient(180deg, #fffdf9 0%, #eff8ef 100%) !important;
      color: #1a5a40 !important;
      padding: 0 13px 0 8px !important;
      font-size: 12px !important;
      font-weight: 800 !important;
      box-shadow: 0 8px 18px rgba(46, 30, 18, 0.12) !important;
    }
    .ask-help-button:hover {
      border-color: #1a5a40 !important;
      transform: translateY(-1px) !important;
    }
    .ask-help-icon {
      width: 28px;
      height: 28px;
      border-radius: 999px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: #1f6a3b;
      color: #fff;
      font-size: 16px;
      font-weight: 900;
      flex: 0 0 auto;
    }
    .ask-help-label {
      white-space: nowrap;
    }
    .ask-help-panel {
      position: fixed;
      right: 18px;
      top: 78px;
      width: min(420px, calc(100vw - 36px));
      max-height: min(78vh, 680px);
      display: none;
      grid-template-rows: auto auto minmax(120px, 1fr) auto;
      gap: 10px;
      overflow: hidden;
      border: 1px solid #d8c3ae;
      border-radius: 22px;
      background:
        radial-gradient(circle at 14% 8%, rgba(232, 247, 231, 0.9), transparent 34%),
        linear-gradient(145deg, #fffdf9, #fff5e7);
      box-shadow: 0 22px 55px rgba(46, 30, 18, 0.24);
      padding: 14px;
      color: var(--ink);
    }
    .ask-help-widget[data-open="1"] .ask-help-panel {
      display: grid;
    }
    .ask-help-head {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 10px;
    }
    .ask-help-kicker {
      color: #1f6a3b;
      font-size: 11px;
      font-weight: 900;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }
    .ask-help-title {
      margin-top: 3px;
      font-size: 18px;
      line-height: 1.2;
      font-weight: 900;
      color: #221d18;
    }
    .ask-help-close {
      min-width: 30px !important;
      min-height: 30px !important;
      height: 30px !important;
      width: 30px !important;
      padding: 0 !important;
      border-radius: 999px !important;
      font-size: 16px !important;
      line-height: 1 !important;
    }
    .ask-help-suggestions {
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
    }
    .ask-help-chip {
      min-height: 30px !important;
      border-radius: 999px !important;
      padding: 0 10px !important;
      border: 1px solid rgba(26, 89, 65, 0.22) !important;
      background: #f6fff6 !important;
      color: #1a5a40 !important;
      font-size: 11px !important;
      font-weight: 800 !important;
    }
    .ask-help-messages {
      display: grid;
      align-content: start;
      gap: 10px;
      overflow: auto;
      padding-right: 4px;
    }
    .ask-help-message {
      border: 1px solid #eadcc9;
      border-radius: 14px;
      background: rgba(255, 255, 255, 0.78);
      padding: 10px;
      font-size: 12px;
      line-height: 1.45;
      color: #332d27;
    }
    .ask-help-message[data-role="user"] {
      justify-self: end;
      max-width: 86%;
      background: #eff8ef;
      border-color: rgba(26, 89, 65, 0.22);
      color: #173d2d;
    }
    .ask-help-message[data-role="assistant"] {
      justify-self: stretch;
    }
    .ask-help-message p {
      margin: 0 0 7px 0;
    }
    .ask-help-message p:last-child {
      margin-bottom: 0;
    }
    .ask-help-citations,
    .ask-help-links,
    .ask-help-answer-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 9px;
    }
    .ask-help-pill,
    .ask-help-link {
      border: 1px solid #eadcc9;
      border-radius: 999px;
      padding: 4px 8px;
      background: #fff;
      color: #6b5f54;
      font-size: 10px;
      font-weight: 800;
      text-decoration: none;
    }
    .ask-help-link {
      color: #1a5a40;
      border-color: rgba(26, 89, 65, 0.22);
    }
    .ask-help-answer-actions button {
      min-height: 28px !important;
      border-radius: 999px !important;
      padding: 0 10px !important;
      font-size: 11px !important;
      font-weight: 800 !important;
    }
    .ask-help-form {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      align-items: end;
      border-top: 1px solid #eadcc9;
      padding-top: 10px;
    }
    .ask-help-form textarea {
      width: 100%;
      resize: vertical;
      min-height: 46px;
      max-height: 110px;
      border-radius: 14px;
      border: 1px solid #d8c3ae;
      padding: 10px 11px;
      font: inherit;
    }
    .ask-help-send {
      min-height: 46px !important;
      border-radius: 14px !important;
      padding: 0 14px !important;
      background: #1f6a3b !important;
      border-color: #1f6a3b !important;
      color: #fff !important;
      font-weight: 900 !important;
    }
    .accessibility-menu {
      position: relative;
      display: inline-flex;
      align-items: center;
    }
    .accessibility-panel {
      position: absolute;
      right: 0;
      top: calc(100% + 8px);
      min-width: 300px;
      display: none;
      background: #fffaf2;
      border: 1px solid rgba(167, 139, 108, 0.65);
      border-radius: 14px;
      box-shadow: 0 16px 32px rgba(46, 30, 18, 0.18);
      padding: 8px;
      z-index: 80;
    }
    .accessibility-menu[data-open="1"] .accessibility-panel {
      display: grid;
      gap: 6px;
    }
    .accessibility-panel .accessibility-option {
      width: 100%;
      display: grid !important;
      grid-template-columns: 42px 1fr;
      align-items: center;
      justify-content: stretch !important;
      gap: 10px;
      min-height: 58px !important;
      height: auto !important;
      border-radius: 12px;
      border: 1px solid transparent;
      background: transparent;
      padding: 8px 12px !important;
      color: var(--ink);
      font: inherit;
      text-align: left;
      cursor: pointer;
      transition: background 0.16s ease, border-color 0.16s ease, padding-left 0.16s ease, box-shadow 0.16s ease;
      box-sizing: border-box;
      line-height: 1.2;
      white-space: normal;
      transform: none !important;
    }
    .accessibility-panel .accessibility-option:hover,
    .accessibility-panel .accessibility-option:focus-visible {
      background: rgba(45, 94, 74, 0.08);
      outline: none;
      transform: none !important;
    }
    .accessibility-panel .accessibility-option[data-enabled="1"] {
      background: rgba(45, 94, 74, 0.12);
      border-color: rgba(45, 94, 74, 0.28);
      box-shadow: inset 4px 0 0 rgba(45, 94, 74, 0.82);
      padding-left: 18px !important;
    }
    .accessibility-panel .accessibility-option-icon {
      width: 38px;
      height: 38px;
      min-width: 38px;
      border-radius: 12px;
      border: 1px solid rgba(45, 94, 74, 0.22);
      background: #fff;
      color: #245642;
      display: inline-grid !important;
      place-items: center;
      align-self: center;
      justify-self: center;
      font-weight: 800;
      position: relative;
      overflow: hidden;
      box-shadow: 0 6px 14px rgba(46, 30, 18, 0.08);
    }
    .accessibility-panel .accessibility-option[data-enabled="1"] .accessibility-option-icon {
      background: #245642;
      color: #fffaf2;
      border-color: #245642;
    }
    .accessibility-panel .accessibility-option-copy {
      display: grid;
      gap: 2px;
      min-width: 0;
    }
    .accessibility-panel .accessibility-option-title {
      font-size: 13px;
      font-weight: 800;
      color: var(--ink);
      line-height: 1.15;
    }
    .accessibility-panel .accessibility-option-note {
      font-size: 11px;
      color: var(--ink-soft);
      line-height: 1.25;
      overflow-wrap: anywhere;
    }
    .accessibility-icon-dark::before {
      content: "";
      width: 16px;
      height: 16px;
      border-radius: 999px;
      background: currentColor;
      box-shadow: 7px -2px 0 0 #fff;
      transform: translateX(-3px);
    }
    .accessibility-icon-text {
      grid-template-columns: auto auto;
      column-gap: 2px;
      align-items: end;
    }
    .accessibility-icon-text .small-a {
      font-size: 15px;
      line-height: 1;
    }
    .accessibility-icon-text .large-a {
      font-size: 25px;
      line-height: 0.9;
    }
    .accessibility-icon-contrast::before,
    .accessibility-icon-contrast::after {
      content: "";
      position: absolute;
      width: 22px;
      height: 22px;
      border-radius: 999px;
      border: 2px solid currentColor;
    }
    .accessibility-icon-contrast::before {
      background: currentColor;
      clip-path: inset(0 50% 0 0);
    }
    .accessibility-icon-colour {
      grid-template-columns: repeat(2, 10px);
      grid-template-rows: repeat(2, 10px);
      gap: 3px;
    }
    .accessibility-colour-dot {
      width: 10px;
      height: 10px;
      border-radius: 999px;
      background: currentColor;
    }
    .accessibility-colour-dot:nth-child(2) {
      opacity: 0.7;
    }
    .accessibility-colour-dot:nth-child(3) {
      opacity: 0.45;
    }
    .accessibility-colour-dot:nth-child(4) {
      opacity: 0.25;
    }
    .accessibility-icon-motion::before,
    .accessibility-icon-motion::after {
      content: "";
      position: absolute;
      border-radius: 999px;
      background: currentColor;
    }
    .accessibility-icon-motion::before {
      width: 22px;
      height: 3px;
      top: 13px;
      left: 8px;
      box-shadow: 4px 7px 0 currentColor;
    }
    .accessibility-icon-motion::after {
      width: 30px;
      height: 3px;
      transform: rotate(-42deg);
      background: #cf332d;
    }
    html[data-text-size="large"] body {
      font-size: 14px !important;
    }
    html[data-text-size="large"] body.route-standard,
    html[data-text-size="large"] body.route-rota {
      --ux-control-h: 42px;
      --ux-btn-fs: 14px;
      --ux-btn-px: 14px;
      --ux-btn-compact-h: 36px;
      --ux-btn-compact-fs: 13px;
      font-size: 14px !important;
    }
    html[data-text-size="large"] .nav a,
    html[data-text-size="large"] .auth-controls a,
    html[data-text-size="large"] .theme-toggle,
    html[data-text-size="large"] button,
    html[data-text-size="large"] input,
    html[data-text-size="large"] select,
    html[data-text-size="large"] textarea {
      font-size: 14px !important;
    }
    html[data-text-size="large"] th,
    html[data-text-size="large"] td,
    html[data-text-size="large"] label,
    html[data-text-size="large"] .pill,
    html[data-text-size="large"] .ui-muted,
    html[data-text-size="large"] .home-kpi-label,
    html[data-text-size="large"] .rota-week-kpi-label,
    html[data-text-size="large"] .sales-summary-kpi-label {
      font-size: 13px !important;
      line-height: 1.35 !important;
    }
    html[data-text-size="large"] .home-kpi-value,
    html[data-text-size="large"] .rota-week-kpi-value,
    html[data-text-size="large"] .sales-summary-kpi-value,
    html[data-text-size="large"] .metric-value {
      font-size: 125% !important;
      line-height: 1.18 !important;
    }
    html[data-text-size="large"] .accessibility-panel .accessibility-option-title {
      font-size: 14px !important;
    }
    html[data-text-size="large"] .accessibility-panel .accessibility-option-note {
      font-size: 12px !important;
    }
    html[data-contrast="high"] body {
      --line: #2e241c;
      --line-strong: #0f0f0f;
      --ink: #050505;
      --ink-soft: #1f1f1f;
      --ux-line: #2e241c;
      --ux-line-strong: #050505;
      --ux-text: #050505;
      --ux-text-muted: #1f1f1f;
      background: #fffaf0 !important;
      color: #050505 !important;
    }
    html[data-theme="dark"][data-contrast="high"] body {
      --line: #f0e5d8;
      --line-strong: #ffffff;
      --ink: #ffffff;
      --ink-soft: #f4eadf;
      --ux-line: #f0e5d8;
      --ux-line-strong: #ffffff;
      --ux-text: #ffffff;
      --ux-text-muted: #f4eadf;
      background: #050505 !important;
      color: #ffffff !important;
    }
    html[data-contrast="high"] .card,
    html[data-contrast="high"] .nav,
    html[data-contrast="high"] .auth-controls,
    html[data-contrast="high"] .theme-toggle,
    html[data-contrast="high"] .accessibility-panel,
    html[data-contrast="high"] .assistive-helper-button,
    html[data-contrast="high"] .assistive-helper-panel,
    html[data-contrast="high"] .ask-help-button,
    html[data-contrast="high"] .ask-help-panel,
    html[data-contrast="high"] .ui-table-wrap,
    html[data-contrast="high"] .report-table,
    html[data-contrast="high"] .rota-week-kpi,
    html[data-contrast="high"] .home-kpi,
    html[data-contrast="high"] .sales-summary-kpi,
    html[data-contrast="high"] .staff-card-mini,
    html[data-contrast="high"] input,
    html[data-contrast="high"] select,
    html[data-contrast="high"] textarea,
    html[data-contrast="high"] button {
      border-color: currentColor !important;
      box-shadow: none !important;
    }
    html[data-contrast="high"] .card,
    html[data-contrast="high"] .nav,
    html[data-contrast="high"] .auth-controls,
    html[data-contrast="high"] .theme-toggle,
    html[data-contrast="high"] .accessibility-panel,
    html[data-contrast="high"] .ui-table-wrap,
    html[data-contrast="high"] input,
    html[data-contrast="high"] select,
    html[data-contrast="high"] textarea,
    html[data-contrast="high"] button {
      background: #ffffff !important;
      color: #050505 !important;
    }
    html[data-theme="dark"][data-contrast="high"] .card,
    html[data-theme="dark"][data-contrast="high"] .nav,
    html[data-theme="dark"][data-contrast="high"] .auth-controls,
    html[data-theme="dark"][data-contrast="high"] .theme-toggle,
    html[data-theme="dark"][data-contrast="high"] .accessibility-panel,
    html[data-theme="dark"][data-contrast="high"] .ui-table-wrap,
    html[data-theme="dark"][data-contrast="high"] input,
    html[data-theme="dark"][data-contrast="high"] select,
    html[data-theme="dark"][data-contrast="high"] textarea,
    html[data-theme="dark"][data-contrast="high"] button {
      background: #050505 !important;
      color: #ffffff !important;
    }
    html[data-contrast="high"] a,
    html[data-contrast="high"] button {
      text-decoration-thickness: 2px;
    }
    html[data-contrast="high"] :focus-visible {
      outline: 3px solid #000 !important;
      outline-offset: 2px !important;
      box-shadow: none !important;
    }
    html[data-theme="dark"][data-contrast="high"] :focus-visible {
      outline-color: #fff !important;
    }
    html[data-colour-mode="colourblind"] {
      --success: #2563eb;
      --danger: #d55e00;
      --warning: #7c3aed;
      --accent: #005f9e;
      --accent-dark: #003f6b;
      --app-dark-success: #8ec7ff;
      --app-dark-warning: #d4b5ff;
      --app-dark-danger: #ffb36b;
    }
    html[data-colour-mode="colourblind"] .home-kpi[data-tone="ok"],
    html[data-colour-mode="colourblind"] .rota-week-kpi[data-tone="ok"],
    html[data-colour-mode="colourblind"] #salesPage .rota-week-kpi[data-tone="ok"],
    html[data-colour-mode="colourblind"] #salesPage .sales-summary-kpi[data-tone="positive"],
    html[data-colour-mode="colourblind"] .dash-good,
    html[data-colour-mode="colourblind"] .payroll-ok,
    html[data-colour-mode="colourblind"] .status-approved,
    html[data-colour-mode="colourblind"] .pill-status.approved,
    html[data-colour-mode="colourblind"] .demand-band.high {
      background: #eef6ff !important;
      border-color: #2563eb !important;
      color: #123d82 !important;
      box-shadow: inset 4px 0 0 #2563eb !important;
    }
    html[data-colour-mode="colourblind"] .home-kpi[data-tone="ok"] .home-kpi-value,
    html[data-colour-mode="colourblind"] .rota-week-kpi[data-tone="ok"] .rota-week-kpi-value,
    html[data-colour-mode="colourblind"] #salesPage .rota-week-kpi[data-tone="ok"] .rota-week-kpi-value,
    html[data-colour-mode="colourblind"] #salesPage .sales-summary-kpi[data-tone="positive"] .sales-summary-kpi-value,
    html[data-colour-mode="colourblind"] .status-approved,
    html[data-colour-mode="colourblind"] .pill-status.approved {
      color: #123d82 !important;
    }
    html[data-colour-mode="colourblind"] .home-light.green,
    html[data-colour-mode="colourblind"] .panel-status-dot.green,
    html[data-colour-mode="colourblind"] .status-dot.green {
      background: #2563eb !important;
      border-color: #2563eb !important;
    }
    html[data-colour-mode="colourblind"] .home-kpi[data-tone="warn"],
    html[data-colour-mode="colourblind"] .rota-week-kpi[data-tone="warn"],
    html[data-colour-mode="colourblind"] #salesPage .rota-week-kpi[data-tone="warn"],
    html[data-colour-mode="colourblind"] #salesPage .sales-summary-kpi[data-tone="warning"],
    html[data-colour-mode="colourblind"] .dash-warn,
    html[data-colour-mode="colourblind"] .status-pending,
    html[data-colour-mode="colourblind"] .pill-status.disputed,
    html[data-colour-mode="colourblind"] .demand-band.medium {
      background: #f6f1ff !important;
      border-color: #7c3aed !important;
      color: #4c1d95 !important;
      box-shadow: inset 4px 0 0 #7c3aed !important;
    }
    html[data-colour-mode="colourblind"] .home-kpi[data-tone="warn"] .home-kpi-value,
    html[data-colour-mode="colourblind"] .rota-week-kpi[data-tone="warn"] .rota-week-kpi-value,
    html[data-colour-mode="colourblind"] #salesPage .rota-week-kpi[data-tone="warn"] .rota-week-kpi-value,
    html[data-colour-mode="colourblind"] #salesPage .sales-summary-kpi[data-tone="warning"] .sales-summary-kpi-value {
      color: #4c1d95 !important;
    }
    html[data-colour-mode="colourblind"] .home-kpi[data-tone="alert"],
    html[data-colour-mode="colourblind"] .rota-week-kpi[data-tone="alert"],
    html[data-colour-mode="colourblind"] .rota-week-kpi[data-tone="bad"],
    html[data-colour-mode="colourblind"] #salesPage .rota-week-kpi[data-tone="alert"],
    html[data-colour-mode="colourblind"] #salesPage .sales-summary-kpi[data-tone="negative"],
    html[data-colour-mode="colourblind"] .dash-bad,
    html[data-colour-mode="colourblind"] .payroll-warn,
    html[data-colour-mode="colourblind"] .status-declined,
    html[data-colour-mode="colourblind"] .pill-status.pending,
    html[data-colour-mode="colourblind"] .demand-band.low {
      background: #fff4e8 !important;
      border-color: #d55e00 !important;
      color: #8a3b00 !important;
      box-shadow: inset 4px 0 0 #d55e00 !important;
    }
    html[data-colour-mode="colourblind"] .home-kpi[data-tone="alert"] .home-kpi-value,
    html[data-colour-mode="colourblind"] .rota-week-kpi[data-tone="alert"] .rota-week-kpi-value,
    html[data-colour-mode="colourblind"] .rota-week-kpi[data-tone="bad"] .rota-week-kpi-value,
    html[data-colour-mode="colourblind"] #salesPage .rota-week-kpi[data-tone="alert"] .rota-week-kpi-value,
    html[data-colour-mode="colourblind"] #salesPage .sales-summary-kpi[data-tone="negative"] .sales-summary-kpi-value,
    html[data-colour-mode="colourblind"] .status-declined,
    html[data-colour-mode="colourblind"] .pill-status.pending {
      color: #8a3b00 !important;
    }
    html[data-colour-mode="colourblind"] .home-light.red,
    html[data-colour-mode="colourblind"] .panel-status-dot.red,
    html[data-colour-mode="colourblind"] .status-dot.red {
      background: #d55e00 !important;
      border-color: #d55e00 !important;
    }
    html[data-colour-mode="colourblind"] .rota-summary-pie,
    html[data-colour-mode="colourblind"] #dashPie {
      filter: hue-rotate(170deg) saturate(1.2) !important;
    }
    html[data-colour-mode="colourblind"] .shift-cell,
    html[data-colour-mode="colourblind"] .rota-shift,
    html[data-colour-mode="colourblind"] .shift-pill {
      background-image: repeating-linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0, rgba(37, 99, 235, 0.08) 7px, rgba(255, 255, 255, 0.08) 7px, rgba(255, 255, 255, 0.08) 14px) !important;
    }
    html[data-colour-mode="colourblind"] .assistive-helper-item[data-kind="critical"],
    html[data-colour-mode="colourblind"] .settings-assistive-item[data-kind="critical"],
    html[data-colour-mode="colourblind"] .staff-assistive-item[data-kind="critical"],
    html[data-colour-mode="colourblind"] .reports-assistive-item[data-kind="critical"] {
      border-color: #d55e00 !important;
      box-shadow: inset 4px 0 0 #d55e00 !important;
    }
    html[data-colour-mode="colourblind"] .assistive-helper-item[data-kind="warning"],
    html[data-colour-mode="colourblind"] .settings-assistive-item[data-kind="warning"],
    html[data-colour-mode="colourblind"] .staff-assistive-item[data-kind="warning"],
    html[data-colour-mode="colourblind"] .reports-assistive-item[data-kind="warning"] {
      border-color: #7c3aed !important;
      box-shadow: inset 4px 0 0 #7c3aed !important;
    }
    html[data-colour-mode="colourblind"] .btn.primary,
    html[data-colour-mode="colourblind"] .primary-btn,
    html[data-colour-mode="colourblind"] button.primary,
    html[data-colour-mode="colourblind"] a.primary,
    html[data-colour-mode="colourblind"] [data-open-demo] {
      background: #005f9e !important;
      border-color: #003f6b !important;
      color: #ffffff !important;
      box-shadow: 0 10px 22px rgba(0, 63, 107, 0.18) !important;
    }
    html[data-colour-mode="colourblind"] .btn.ghost,
    html[data-colour-mode="colourblind"] button.ghost,
    html[data-colour-mode="colourblind"] .ghost-btn {
      border-color: #005f9e !important;
      color: #003f6b !important;
    }
    html[data-reduce-motion="1"] *,
    html[data-reduce-motion="1"] *::before,
    html[data-reduce-motion="1"] *::after {
      animation: none !important;
      animation-duration: 0.001ms !important;
      animation-iteration-count: 1 !important;
      scroll-behavior: auto !important;
      transition: none !important;
      transition-duration: 0.001ms !important;
      transform: none !important;
    }
    html[data-reduce-motion="1"] .topbar.mobile-hidden {
      transform: none !important;
      opacity: 1 !important;
      pointer-events: auto !important;
    }
    html[data-reduce-motion="1"] [data-reveal],
    html[data-reduce-motion="1"] [data-reveal].in {
      opacity: 1 !important;
      transform: none !important;
    }
    html[data-reduce-motion="1"] #rotaEngineBusyOverlay,
    html[data-reduce-motion="1"] .rota-engine-busy-emoji,
    html[data-reduce-motion="1"] .rota-engine-busy-bar::after,
    html[data-reduce-motion="1"] .assistive-helper[data-critical="1"] .assistive-helper-button {
      animation: none !important;
    }
	    @media (max-width: 760px) {
	      .assistive-helper {
	        position: relative;
	        right: auto;
	        bottom: auto;
	        z-index: 12;
	      }
	      .assistive-helper-button {
	        min-height: 28px !important;
	        height: 28px !important;
	        padding: 0 8px !important;
	        gap: 5px !important;
	      }
	      .assistive-helper-mark {
	        width: 22px;
	        height: 22px;
	        border-radius: 8px;
	      }
	      .feedback-fab-wrap {
	        right: 10px;
	        bottom: calc(env(safe-area-inset-bottom, 0px) + 62px);
	        z-index: 54;
	      }
	      .feedback-fab-btn {
	        min-height: 32px;
	        height: 32px;
	        padding: 0 10px;
	        font-size: 11px;
	      }
	      .assistive-helper-label {
	        display: none;
	      }
	      .assistive-helper-panel {
	        left: 10px;
	        right: 10px;
	        top: 108px;
	        width: auto;
	        max-height: calc(100vh - 128px);
	        bottom: auto;
	      }
	      .ask-help-button {
	        min-height: 28px !important;
	        height: 28px !important;
	        padding: 0 8px !important;
	        gap: 5px !important;
	      }
	      .ask-help-icon {
	        width: 22px;
	        height: 22px;
	        font-size: 13px;
	      }
	      .ask-help-label {
	        display: none;
	      }
	      .ask-help-panel {
	        left: 10px;
	        right: 10px;
	        top: auto;
	        bottom: 10px;
	        width: auto;
	        max-height: calc(100vh - 92px);
	        border-radius: 22px 22px 18px 18px;
	      }
	    }
    @media (prefers-reduced-motion: reduce) {
      .assistive-helper[data-critical="1"] .assistive-helper-button {
        animation: none;
      }
    }
    .feedback-modal {
      position: fixed;
      inset: 0;
      z-index: 60;
      background: rgba(14, 11, 8, 0.45);
      display: none;
      align-items: center;
      justify-content: center;
      padding: 16px;
    }
    .feedback-modal-card {
      width: min(520px, 100%);
      max-height: 88vh;
      overflow: auto;
      border: 1px solid var(--line);
      border-radius: 14px;
      background: #fff;
      box-shadow: 0 20px 36px rgba(46, 30, 18, 0.22);
      padding: 14px;
    }
    .feedback-modal-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 8px;
    }
    .feedback-modal-card textarea {
      min-height: 120px !important;
      height: auto !important;
      padding: 8px 10px !important;
      resize: vertical;
      line-height: 1.35;
    }
    .rota-smart-dialog-overlay {
      position: fixed;
      inset: 0;
      z-index: 13000;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 18px;
      background: rgba(46, 30, 18, 0.34);
      backdrop-filter: blur(2px);
      -webkit-backdrop-filter: blur(2px);
    }
    .rota-smart-dialog-overlay[data-open="1"] {
      display: flex;
    }
    .rota-smart-dialog-card {
      width: min(430px, 100%);
      border: 1px solid #d8c3ae;
      border-radius: 24px;
      background:
        radial-gradient(circle at 18% 12%, rgba(255, 244, 214, 0.95), transparent 30%),
        linear-gradient(145deg, #fffdf9, #fff4e5);
      box-shadow: 0 22px 55px rgba(46, 30, 18, 0.28);
      padding: 24px;
      color: var(--ink);
      text-align: center;
    }
    .rota-smart-dialog-kicker {
      margin-bottom: 10px;
      color: #7a5a3b;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }
    .rota-smart-dialog-icon {
      width: 72px;
      height: 72px;
      margin: 0 auto 14px;
      border: 2px solid #c8a57e;
      border-radius: 24px;
      display: grid;
      place-items: center;
      background: #fffaf2;
      box-shadow: inset 0 -8px 0 rgba(122, 15, 18, 0.08);
      font-size: 34px;
      line-height: 1;
    }
    .rota-smart-dialog-title {
      margin: 0;
      font-size: 22px;
      line-height: 1.18;
      font-weight: 800;
    }
    .rota-smart-dialog-message {
      margin-top: 10px;
      color: #6b5f54;
      font-size: 14px;
      line-height: 1.45;
      white-space: pre-line;
    }
    .rota-smart-dialog-input {
      width: 100%;
      min-height: 42px;
      margin-top: 16px;
      border-radius: 14px;
      border: 1px solid var(--line);
      padding: 0 12px;
      box-sizing: border-box;
      font: inherit;
    }
    .rota-smart-dialog-actions {
      display: flex;
      justify-content: center;
      gap: 10px;
      flex-wrap: wrap;
      margin-top: 18px;
    }
    .rota-smart-dialog-actions button {
      min-width: 108px;
    }
    .rota-smart-dialog-actions .dialog-primary {
      border-color: var(--accent-dark);
      background: linear-gradient(180deg, #fff 0%, #fff2e4 100%);
      color: var(--accent-dark);
      box-shadow: inset 0 -2px 0 rgba(122, 15, 18, 0.18);
      font-weight: 700;
    }
    .rota-smart-dialog-actions .dialog-danger {
      border-color: #9f2d24;
      color: #8f2118;
    }
    .rota-smart-dialog-close {
      position: absolute;
      top: 14px;
      right: 14px;
      width: 38px;
      min-width: 38px;
      height: 38px;
      border-radius: 999px;
      padding: 0;
      display: none;
      align-items: center;
      justify-content: center;
      font-size: 22px;
      line-height: 1;
      background: rgba(255, 255, 255, 0.82);
      color: var(--ink);
    }
    .rota-smart-dialog-overlay[data-variant="release"] .rota-smart-dialog-card {
      position: relative;
    }
    .rota-smart-dialog-overlay[data-variant="release"] .rota-smart-dialog-close {
      display: flex;
    }
    @media (prefers-reduced-motion: reduce) {
      .rota-smart-dialog-overlay {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
      }
    }
    .help-hint {
      cursor: help;
      text-decoration: underline dotted rgba(90, 70, 55, 0.45);
      text-underline-offset: 2px;
    }
    /* Hide debug chrome unless explicitly enabled with ?debug=1 or localStorage rotaSmart.uiDebug=1 */
    #buildStamp,
    #wiringDebug,
    #uiBadge,
    #uiInitDebug,
    #salesTruthParity,
    #dashParityStatus,
    #suggestedDebugLine,
    #builderWarning,
    .debug-only {
      display: none !important;
    }
    body.debug-ui #buildStamp,
    body.debug-ui #wiringDebug,
    body.debug-ui #uiBadge,
    body.debug-ui #uiInitDebug,
    body.debug-ui #salesTruthParity,
    body.debug-ui #dashParityStatus,
    body.debug-ui #suggestedDebugLine,
    body.debug-ui #builderWarning,
    body.debug-ui .debug-only {
      display: block !important;
    }
