/* OneTutor's shared look (docs/REDESIGN_PLAN.md, "Approved design"): the colours, type and
   components every redesigned page uses. Identical in both portals (tools/checks.py, copies).
   Every class starts "ot-", so nothing here restyles a page that has not opted in; a page
   opts in by loading this file and putting class="ot-app" on its body. */

/* ---------- Tokens ---------- */
:root {
  --ot-blue: #2087C9;            /* brand blue: accents, indicators, decoration */
  --ot-blue-strong: #1657C4;     /* strong blue: primary buttons, links, focus (white text 6.6:1) */
  --ot-blue-strong-hover: #124AA6;
  --ot-blue-strong-press: #0F3F8F;
  --ot-blue-soft: #EAF4FB;
  --ot-blue-soft-line: #CFE6F7;
  --ot-blue-tint: #F5FAFE;
  --ot-ink: #1F2933;
  --ot-ink-2: #3E4C59;
  --ot-muted: #5B6B7A;           /* supporting text: #647382 measured 4.49:1 on the canvas */
  --ot-canvas: #F4F6F8;
  --ot-surface: #FFFFFF;
  --ot-line: #DCE3EA;
  --ot-line-soft: #E8EDF2;
  --ot-line-input: #8494A3;      /* a field's edge, 3.1:1 on white */
  --ot-line-button: #C5CFD9;
  --ot-ok: #137A3A;   --ot-ok-bg: #E7F7EC;   --ot-ok-line: #B9E6C9;
  --ot-warn: #8A5D00; --ot-warn-bg: #FFF5E6; --ot-warn-line: #F3D9A4;
  --ot-bad: #B42318;  --ot-bad-bg: #FDECEC;  --ot-bad-line: #F5C2C0;
  --ot-r-sm: 8px; --ot-r-md: 12px; --ot-r-lg: 16px;
  --ot-shadow-float: 0 16px 40px rgba(31,41,51,.18), 0 2px 8px rgba(31,41,51,.08);
  --ot-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --ot-t: 150ms;
  --ot-side-w: 248px;
}

/* ---------- Base, for pages that opt in ----------
   Element rules sit inside :where(), which adds no weight, so any class (a button, a link styled as
   a button) overrides them. */
.ot-app, .ot-app *, .ot-app *::before, .ot-app *::after { box-sizing: border-box; }
.ot-app { margin: 0; font-family: var(--ot-font); font-size: 16px; line-height: 1.5; color: var(--ot-ink); background: var(--ot-canvas); -webkit-text-size-adjust: 100%; }
:where(.ot-app) :where(h1, h2, h3) { margin: 0; line-height: 1.25; color: var(--ot-ink); }
:where(.ot-app) h1 { font-size: 30px; font-weight: 750; letter-spacing: -0.015em; }
:where(.ot-app) h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
:where(.ot-app) h3 { font-size: 16px; font-weight: 700; }
:where(.ot-app) a { color: var(--ot-blue-strong); text-underline-offset: 2px; }
:where(.ot-app) a:hover { color: var(--ot-blue-strong-hover); }
:where(.ot-app) :focus-visible { outline: 3px solid var(--ot-blue-strong); outline-offset: 2px; }
:where(.ot-app) [tabindex="-1"]:focus { outline: none; }
.ot-sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ot-hidden, .ot-app [hidden] { display: none !important; }
.ot-num { font-variant-numeric: tabular-nums; }
.ot-muted { color: var(--ot-muted); }
.ot-nowrap { white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .ot-app *, .ot-app *::before, .ot-app *::after { transition: none !important; animation: none !important; } }

/* ---------- Icons (assets/icons.svg) ---------- */
.ot-ic { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.ot-ic-sm { width: 16px; height: 16px; }
.ot-ic-lg { width: 24px; height: 24px; }

/* ---------- Buttons ---------- */
.ot-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; margin: 0;
  border-radius: var(--ot-r-sm); border: 1px solid transparent; font: 600 15px/1.2 var(--ot-font); cursor: pointer; text-decoration: none;
  transition: background var(--ot-t), border-color var(--ot-t), color var(--ot-t); white-space: nowrap; }
.ot-btn-primary { background: var(--ot-blue-strong); color: #fff; }
.ot-btn-primary:hover { background: var(--ot-blue-strong-hover); color: #fff; }
.ot-btn-primary:active { background: var(--ot-blue-strong-press); }
.ot-btn-secondary { background: var(--ot-surface); color: var(--ot-ink); border-color: var(--ot-line-button); }
.ot-btn-secondary:hover { background: #F5F8FA; border-color: var(--ot-line-input); color: var(--ot-ink); }
.ot-btn-text { background: none; border: none; color: var(--ot-blue-strong); padding: 0 8px; min-height: 36px; }
.ot-btn-text:hover { text-decoration: underline; color: var(--ot-blue-strong-hover); }
.ot-btn-danger { background: var(--ot-surface); color: var(--ot-bad); border-color: var(--ot-bad-line); }
.ot-btn-danger:hover { background: var(--ot-bad-bg); color: var(--ot-bad); }
.ot-btn-danger-solid { background: var(--ot-bad); color: #fff; }
.ot-btn-danger-solid:hover { background: #962016; color: #fff; }
.ot-btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.ot-btn-block { width: 100%; }
.ot-btn:disabled { background: #E9EDF1; color: #6B7884; border-color: transparent; cursor: not-allowed; }
.ot-btn[aria-busy="true"] { cursor: progress; }
.ot-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; animation: ot-spin .8s linear infinite; flex: none; }
.ot-btn-secondary .ot-spin, .ot-btn-danger .ot-spin { border-color: rgba(31,41,51,.2); border-top-color: var(--ot-ink); }
@keyframes ot-spin { to { transform: rotate(360deg); } }

/* A small button in a panel heading that goes to another page */
.ot-panel-link { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px 0 12px; border-radius: var(--ot-r-sm); border: 1px solid var(--ot-line-button);
  background: var(--ot-surface); color: var(--ot-ink); font: 600 14px/1.2 var(--ot-font); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background var(--ot-t), border-color var(--ot-t), color var(--ot-t); }
.ot-panel-link:hover { background: var(--ot-blue-soft); border-color: var(--ot-blue-soft-line); color: var(--ot-blue-strong); }
.ot-panel-link .ot-ic { width: 16px; height: 16px; color: var(--ot-blue-strong); transition: transform var(--ot-t); }
.ot-panel-link:hover .ot-ic { transform: translateX(2px); }
.ot-pl-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #EEF2F6; color: var(--ot-ink-2); font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Forms ---------- */
.ot-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.ot-form-grid.ot-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ot-form-grid .ot-full { grid-column: 1 / -1; }
.ot-field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.ot-field > label, .ot-label { font-size: 14px; font-weight: 600; color: var(--ot-ink); margin: 0; }
.ot-opt { font-weight: 400; color: var(--ot-muted); }
.ot-hint { font-size: 13.5px; color: var(--ot-muted); line-height: 1.45; margin: 0; }
.ot-input, .ot-select, .ot-textarea { width: 100%; min-height: 44px; padding: 10px 12px; margin: 0; font: 16px/1.4 var(--ot-font); color: var(--ot-ink);
  background-color: var(--ot-surface); border: 1px solid var(--ot-line-input); border-radius: var(--ot-r-sm); transition: border-color var(--ot-t), box-shadow var(--ot-t); }
.ot-textarea { min-height: 96px; resize: vertical; }
.ot-input:focus, .ot-input:focus-within, .ot-select:focus, .ot-textarea:focus { outline: 2px solid transparent; outline-offset: 0; border-color: var(--ot-blue-strong); box-shadow: 0 0 0 3px rgba(22,87,196,.22); }
.ot-select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ot-ink-2) 50%), linear-gradient(135deg, var(--ot-ink-2) 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.ot-input:disabled, .ot-select:disabled { background-color: #F1F4F7; color: #6B7884; border-color: var(--ot-line-button); }
.ot-input-prefix { position: relative; }
.ot-input-prefix > span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ot-muted); font-weight: 600; pointer-events: none; }
.ot-input-prefix > .ot-input { padding-left: 28px; }
.ot-has-error .ot-input, .ot-has-error .ot-select, .ot-has-error .ot-textarea, .ot-input.ot-invalid, .ot-select.ot-invalid, .ot-textarea.ot-invalid { border-color: var(--ot-bad); background-color: #FFFBFB; }
.ot-err { display: flex; gap: 6px; align-items: flex-start; font-size: 13.5px; font-weight: 600; color: var(--ot-bad); margin: 0; }
.ot-err .ot-ic { width: 16px; height: 16px; margin-top: 2px; }
.ot-check { display: flex; gap: 10px; align-items: center; font-size: 15px; font-weight: 500; cursor: pointer; min-height: 44px; }
.ot-check input { width: 20px; height: 20px; accent-color: var(--ot-blue-strong); margin: 0; }
.ot-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.ot-fieldset > legend { float: left; width: 100%; font-size: 16px; font-weight: 700; padding: 0; margin-bottom: 4px; }
.ot-fieldset > legend + * { clear: both; }
.ot-fieldset + .ot-fieldset { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--ot-line-soft); }

/* Segmented choice (a radio group) */
.ot-seg { display: inline-flex; padding: 3px; gap: 3px; background: #EEF2F6; border-radius: 10px; }
.ot-seg label { position: relative; margin: 0; }
.ot-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ot-seg span { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: 8px; font-size: 14.5px; font-weight: 600; color: var(--ot-ink-2); }
.ot-seg input:checked + span { background: var(--ot-surface); color: var(--ot-blue-strong); box-shadow: 0 1px 3px rgba(31,41,51,.14); }
.ot-seg input:focus-visible + span { outline: 3px solid var(--ot-blue-strong); outline-offset: 1px; }

/* Choice cards (radio) */
.ot-choices { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.ot-choice { position: relative; display: block; cursor: pointer; margin: 0; }
.ot-choice input { position: absolute; z-index: 1; opacity: 0; inset: 0; margin: 0; cursor: pointer; }   /* above the box, so a click reaches it */
.ot-choice .ot-box { display: grid; gap: 2px; min-height: 64px; padding: 12px 14px 12px 42px; border: 1.5px solid var(--ot-line-button); border-radius: var(--ot-r-md); background: var(--ot-surface); position: relative; transition: border-color var(--ot-t), background var(--ot-t); }
.ot-choice .ot-box::before { content: ""; position: absolute; left: 14px; top: 15px; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--ot-line-input); background: #fff; }
.ot-choice:hover .ot-box { border-color: var(--ot-line-input); }
.ot-choice input:checked + .ot-box { border-color: var(--ot-blue-strong); background: var(--ot-blue-tint); box-shadow: inset 0 0 0 1px var(--ot-blue-strong); }
.ot-choice input:checked + .ot-box::before { border-color: var(--ot-blue-strong); background: radial-gradient(circle, var(--ot-blue-strong) 0 5px, #fff 5.5px); }
.ot-choice input:focus-visible + .ot-box { outline: 3px solid var(--ot-blue-strong); outline-offset: 2px; }
.ot-choice .ot-t { font-weight: 700; font-size: 16px; }
.ot-choice .ot-s { font-size: 13.5px; color: var(--ot-muted); }

/* A 1 to 10 scale */
.ot-scale { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; max-width: 520px; }
.ot-scale label { position: relative; margin: 0; }
.ot-scale input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ot-scale span { display: grid; place-items: center; min-height: 44px; border: 1.5px solid var(--ot-line-button); border-radius: 8px; font-weight: 700; font-variant-numeric: tabular-nums; background: #fff; }
.ot-scale label:hover span { border-color: var(--ot-line-input); }
.ot-scale input:checked + span { background: var(--ot-blue-strong); border-color: var(--ot-blue-strong); color: #fff; }
.ot-scale input:focus-visible + span { outline: 3px solid var(--ot-blue-strong); outline-offset: 2px; }

/* ---------- Badges (status, never clickable) ---------- */
.ot-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; line-height: 1.35; white-space: nowrap; cursor: default; }
.ot-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.ot-badge.ot-ok { background: var(--ot-ok-bg); color: var(--ot-ok); }
.ot-badge.ot-warn { background: var(--ot-warn-bg); color: var(--ot-warn); }
.ot-badge.ot-bad { background: var(--ot-bad-bg); color: var(--ot-bad); }
.ot-badge.ot-info { background: var(--ot-blue-soft); color: var(--ot-blue-strong); }
.ot-badge.ot-neutral { background: #EEF2F6; color: var(--ot-ink-2); }
.ot-badge.ot-plain::before { display: none; }
.ot-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--ot-blue-strong); color: #fff; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Surfaces ---------- */
.ot-panel { background: var(--ot-surface); border: 1px solid var(--ot-line); border-radius: var(--ot-r-md); }
.ot-panel-pad { padding: 24px; }
.ot-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 20px 24px 0; }
.ot-panel-head h2 { font-size: 18px; }
.ot-panel-body { padding: 16px 24px 24px; }
.ot-panel-foot { padding: 14px 24px; border-top: 1px solid var(--ot-line-soft); }
.ot-section-title { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ot-muted); }
.ot-callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--ot-r-md); border: 1px solid var(--ot-blue-soft-line); background: var(--ot-blue-soft); color: var(--ot-ink); font-size: 15px; line-height: 1.5; }
.ot-callout > .ot-ic { color: var(--ot-blue-strong); margin-top: 1px; }
.ot-callout.ot-warn { background: var(--ot-warn-bg); border-color: var(--ot-warn-line); }
.ot-callout.ot-warn > .ot-ic { color: var(--ot-warn); }
.ot-callout.ot-ok { background: var(--ot-ok-bg); border-color: var(--ot-ok-line); }
.ot-callout.ot-ok > .ot-ic { color: var(--ot-ok); }
.ot-callout.ot-bad { background: var(--ot-bad-bg); border-color: var(--ot-bad-line); }
.ot-callout.ot-bad > .ot-ic { color: var(--ot-bad); }
.ot-callout-title { font-weight: 700; margin-bottom: 2px; }
.ot-empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 32px 20px; }
.ot-empty h3 { font-size: 17px; }
.ot-empty p { color: var(--ot-muted); max-width: 42ch; margin: 0; }
.ot-skel { display: block; height: 14px; border-radius: 6px; background: linear-gradient(90deg, #EDF1F5 0%, #F6F8FA 50%, #EDF1F5 100%); background-size: 200% 100%; animation: ot-shimmer 1.4s ease-in-out infinite; }
@keyframes ot-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.ot-av { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ot-blue-soft); color: var(--ot-blue-strong); font-size: 13px; font-weight: 700; flex: none; letter-spacing: .02em; }
.ot-av.ot-b2 { background: #E1ECFB; color: #124AA6; }
.ot-av.ot-b3 { background: #DDF0F8; color: #0D5F86; }
.ot-av.ot-lg { width: 56px; height: 56px; font-size: 19px; }
.ot-av.ot-sm { width: 28px; height: 28px; font-size: 11.5px; }

/* ---------- Tables, lists ---------- */
.ot-table-wrap { position: relative; overflow-x: auto; }   /* relative: hidden labels inside stay inside */
.ot-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.ot-table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--ot-muted); background: #F8FAFB; padding: 10px 16px; border-bottom: 1px solid var(--ot-line); white-space: nowrap; }
.ot-table td { padding: 12px 16px; border-bottom: 1px solid var(--ot-line-soft); vertical-align: middle; }
.ot-table tr:last-child td { border-bottom: 0; }
.ot-table .ot-num, .ot-table th.ot-num { text-align: right; font-variant-numeric: tabular-nums; }
.ot-dl { display: grid; grid-template-columns: minmax(140px, 200px) 1fr; gap: 10px 20px; font-size: 15px; margin: 0; }
.ot-dl dt { color: var(--ot-muted); }
.ot-dl dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.ot-subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--ot-line); overflow-x: auto; scrollbar-width: none; }
.ot-subnav button, .ot-subnav a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 0; background: none; font: 600 15px var(--ot-font); color: var(--ot-muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.ot-subnav button:hover, .ot-subnav a:hover { color: var(--ot-ink); }
.ot-subnav [aria-selected="true"], .ot-subnav [aria-current="page"] { color: var(--ot-blue-strong); border-bottom-color: var(--ot-blue-strong); }

/* Breakdown lists: one bar per row, the exact figures beside it */
.ot-blist { list-style: none; margin: 0; padding: 0; }
.ot-blist li { padding: 12px 0; }
.ot-blist li + li { border-top: 1px solid var(--ot-line-soft); }
.ot-bl-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.ot-bl-name { font-weight: 600; overflow-wrap: anywhere; }
.ot-bl-val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ot-bl-track { display: block; height: 8px; margin: 7px 0 6px; border-radius: 0 4px 4px 0; background: var(--ot-blue-soft); }
.ot-bar { display: block; height: 8px; border-radius: 0 4px 4px 0; background: var(--ot-blue); }
.ot-bl-sub { font-size: 13.5px; color: var(--ot-muted); }

/* ---------- Dialogs (native <dialog>: focus kept inside, the page behind inert, Escape closes) ---------- */
dialog.ot-dlg { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: var(--ot-r-lg); box-shadow: var(--ot-shadow-float); color: var(--ot-ink); font-family: var(--ot-font); }
dialog.ot-dlg::backdrop { background: rgba(31,41,51,.45); }
dialog.ot-dlg[open] { display: flex; flex-direction: column; animation: ot-pop 160ms ease-out; }
@keyframes ot-pop { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
dialog.ot-dlg.ot-dlg-lg { width: min(920px, calc(100vw - 48px)); }
.ot-dlg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 4px; }
.ot-dlg-head h2 { font-size: 20px; }
.ot-dlg-sub { font-size: 14.5px; color: var(--ot-muted); margin: 4px 0 0; }
.ot-dlg-body { padding: 16px 24px 8px; overflow-y: auto; }
.ot-dlg-body > * + * { margin-top: 12px; }
.ot-dlg-foot { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 16px 24px 22px; }
.ot-x { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 0; background: none; color: var(--ot-ink-2); cursor: pointer; flex: none; margin: -6px -10px 0 0; }
.ot-x:hover { background: #F1F4F7; }
.ot-summary-box { border: 1px solid var(--ot-line); border-radius: var(--ot-r-md); background: #FAFBFC; padding: 14px 16px; }
.ot-summary-box .ot-dl { grid-template-columns: 120px 1fr; gap: 8px 16px; }
/* A small menu of further choices, opened by a "More" button (initMenus in ui.js). */
.ot-popmenu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 200px; padding: 6px; background: var(--ot-surface); border: 1px solid var(--ot-line); border-radius: var(--ot-r-md); box-shadow: var(--ot-shadow-float); }
.ot-popmenu[hidden] { display: none; }
.ot-popmenu-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: var(--ot-r-sm); background: none; font: 600 15px var(--ot-font); color: var(--ot-ink); text-align: left; white-space: nowrap; cursor: pointer; }
.ot-popmenu-item:hover, .ot-popmenu-item:focus-visible { background: #F4F7FA; }
.ot-popmenu-item.ot-danger { color: var(--ot-bad); }
.ot-popmenu-item.ot-danger:hover, .ot-popmenu-item.ot-danger:focus-visible { background: var(--ot-bad-bg); }
[data-ot-menu][aria-expanded="true"] > .ot-ic { transform: rotate(180deg); }
.ot-saved { display: inline-flex; align-items: center; gap: 8px; color: var(--ot-ok); font-weight: 600; }
.ot-tick { width: 22px; height: 22px; border-radius: 50%; background: var(--ot-ok); display: inline-grid; place-items: center; flex: none; }
.ot-tick svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 3; fill: none; stroke-dasharray: 20; stroke-dashoffset: 20; animation: ot-draw 260ms 80ms ease-out forwards; }
@keyframes ot-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .ot-tick svg { stroke-dashoffset: 0; } }

/* ---------- The sidebar shell (manager and staff) ---------- */
.ot-shell { display: grid; grid-template-columns: var(--ot-side-w) minmax(0, 1fr); min-height: 100vh; }
.ot-side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--ot-surface); border-right: 1px solid var(--ot-line); display: flex; flex-direction: column; z-index: 90; }
.ot-side-brand { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 22px 20px 18px; }
.ot-side-brand img { height: 40px; width: auto; display: block; }
.ot-side-brand a { align-self: flex-start; display: inline-flex; }
.ot-portal-name { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ot-muted); }
.ot-nav { padding: 4px 12px 16px; flex: 1; }
.ot-nav ul { list-style: none; margin: 0; padding: 0; }
.ot-nav-link, .ot-nav-group > button { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 42px; padding: 0 12px; border: 0; background: none; border-radius: var(--ot-r-sm);
  font: 500 15px/1.2 var(--ot-font); color: var(--ot-ink-2); text-decoration: none; cursor: pointer; text-align: left; transition: background var(--ot-t), color var(--ot-t); }
.ot-nav-link:hover, .ot-nav-group > button:hover { background: #F2F6F9; color: var(--ot-ink); }
.ot-nav-link .ot-ic, .ot-nav-group > button .ot-ic { color: #6B7B8A; }
.ot-nav-link[aria-current="page"] { background: var(--ot-blue-soft); color: var(--ot-blue-strong); font-weight: 650; }
.ot-nav-link[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--ot-blue-strong); }
.ot-nav-link[aria-current="page"] .ot-ic { color: var(--ot-blue-strong); }
.ot-nav-group > button .ot-chev { margin-left: auto; width: 16px; height: 16px; transition: transform var(--ot-t); }
.ot-nav-group > button[aria-expanded="true"] .ot-chev { transform: rotate(90deg); }
.ot-nav-group > button .ot-count + .ot-chev { margin-left: 6px; }
.ot-nav-group > button.ot-has-current { color: var(--ot-ink); font-weight: 650; }
.ot-nav-sub { margin: 2px 0 6px 21px !important; padding-left: 12px !important; border-left: 1px solid var(--ot-line); }
.ot-nav-sub .ot-nav-link { min-height: 38px; font-size: 14.5px; }
.ot-nav-sub .ot-nav-link[aria-current="page"]::before { left: -13px; }
.ot-nav-link .ot-count, .ot-nav-group > button .ot-count { margin-left: auto; }
.ot-nav-sep { height: 1px; background: var(--ot-line-soft); margin: 10px 12px; }
.ot-side-foot { border-top: 1px solid var(--ot-line-soft); padding: 14px 16px 18px; display: grid; gap: 10px; }
.ot-who { display: flex; gap: 10px; align-items: center; min-width: 0; }
.ot-who-name { font-weight: 700; font-size: 15px; line-height: 1.2; overflow-wrap: anywhere; }
.ot-who-role { font-size: 13px; color: var(--ot-muted); line-height: 1.3; }
.ot-side-foot .ot-btn { justify-content: flex-start; }
.ot-main { min-width: 0; }
.ot-content { max-width: 1192px; margin: 0 auto; padding: 28px 40px 96px; }
.ot-crumbs { font-size: 14px; color: var(--ot-muted); display: flex; gap: 6px; align-items: center; margin: 0 0 8px; }
.ot-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.ot-page-head p { color: var(--ot-muted); margin: 6px 0 0; max-width: 70ch; }
.ot-topbar { display: none; }
.ot-drawer-close { display: none; position: absolute; right: 12px; top: 16px; }
.ot-scrim { position: fixed; inset: 0; background: rgba(31,41,51,.42); z-index: 80; opacity: 0; pointer-events: none; transition: opacity 180ms; }
.ot-drawer-open .ot-scrim { opacity: 1; pointer-events: auto; }
.ot-drawer-open #ot-help-wrap { display: none !important; }   /* it would float over the open menu and its Log out */
@media (max-width: 1024px) {
  .ot-shell { grid-template-columns: minmax(0, 1fr); }
  .ot-side { position: fixed; left: 0; top: 0; bottom: 0; width: min(320px, 86vw); height: auto; transform: translateX(-102%); visibility: hidden; transition: transform 200ms ease, visibility 0s 200ms; box-shadow: var(--ot-shadow-float); }
  .ot-drawer-open .ot-side { transform: none; visibility: visible; transition: transform 200ms ease; }
  .ot-drawer-close { display: grid; }
  .ot-topbar { display: flex; position: sticky; top: 0; z-index: 50; align-items: center; gap: 10px; min-height: 60px; padding: 8px 12px; background: var(--ot-surface); border-bottom: 1px solid var(--ot-line); }
  .ot-menu-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: var(--ot-r-sm); border: 1px solid var(--ot-line-button); background: #fff; font: 600 15px var(--ot-font); color: var(--ot-ink); cursor: pointer; }
  .ot-topbar-title { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
  .ot-topbar-title img { width: 28px; height: 28px; }
  .ot-topbar-title span { font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ot-content { padding: 20px 16px 96px; }
}

/* ---------- Keeping a focused field in view ----------
   A field reached by keyboard stops above the Help button and, on phones and tablets, below the
   top bar that stays on screen. */
:root:has(> .ot-app) { scroll-padding-bottom: 76px; }
@media (max-width: 1024px) { :root:has(> .ot-app .ot-topbar) { scroll-padding-top: 72px; } }

/* ---------- Forced colours (a Windows contrast theme) ----------
   The theme's colours replace these, backgrounds and shadows included, so a chosen option, the
   current page and a focused field each take a system colour to stay apart from the rest. */
@media (forced-colors: active) {
  .ot-input:focus, .ot-input:focus-within, .ot-select:focus, .ot-textarea:focus { outline-color: Highlight; }
  .ot-select { appearance: auto; -webkit-appearance: auto; }   /* its drawn arrow would vanish */
  .ot-seg input:checked + span, .ot-scale input:checked + span { forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight; }
  .ot-seg input:focus-visible + span, .ot-scale input:focus-visible + span, .ot-choice input:focus-visible + .ot-box { outline-color: CanvasText; }
  .ot-choice input:checked + .ot-box::after { content: ""; position: absolute; inset: -1.5px; border: 3px solid Highlight; border-radius: inherit; forced-color-adjust: none; pointer-events: none; }
  .ot-choice input:checked + .ot-box::before { forced-color-adjust: none; background: Highlight; border-color: Highlight; }
  .ot-nav-link[aria-current="page"]::before { forced-color-adjust: none; background: Highlight; }
  .ot-subnav button, .ot-subnav a { position: relative; border-bottom: 0; padding-bottom: 3px; margin-bottom: 0; }   /* the theme would draw the clear line */
  .ot-subnav [aria-selected="true"]::after, .ot-subnav [aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: Highlight; forced-color-adjust: none; }
}

/* ---------- Print: the page's content, without the menus or the Help button ---------- */
@media print {
  #ot-help-wrap, .ot-side, .ot-topbar, .ot-scrim { display: none !important; }
  .ot-app { background: #fff; }
  .ot-shell { display: block; }
  .ot-content { max-width: none; padding: 0; }
  .ot-table-wrap { overflow: visible; }   /* every column on the page, not cut off at a scroll edge */
  .ot-table { font-size: 10pt; }
  .ot-table th, .ot-table td { padding: 5px 6px; white-space: normal; }
}

/* ---------- The welcome card ---------- */
.ot-welcome { position: relative; overflow: hidden; border-radius: var(--ot-r-lg); padding: 26px 28px; background: linear-gradient(115deg, #E3F0FA 0%, #F2F8FD 55%, #FFFFFF 100%); border: 1px solid var(--ot-blue-soft-line); }
.ot-welcome h1 { font-size: 28px; position: relative; }
.ot-welcome-date { font-size: 14px; font-weight: 600; color: var(--ot-blue-strong); margin-bottom: 4px; position: relative; }
.ot-welcome p { color: var(--ot-ink-2); margin: 6px 0 0; position: relative; }
.ot-welcome-deco { position: absolute; right: -10px; top: -14px; width: 260px; height: 160px; pointer-events: none; }
.ot-welcome-actions { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; position: relative; }

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  :where(.ot-app) h1 { font-size: 25px; }
  .ot-page-head { margin-bottom: 18px; }
  .ot-page-head .ot-btn { width: 100%; }
  .ot-form-grid, .ot-form-grid.ot-cols-3 { grid-template-columns: minmax(0, 1fr); }
  .ot-panel-head { padding: 16px 16px 0; }
  .ot-panel-body { padding: 12px 16px 16px; }
  .ot-panel-pad { padding: 16px; }
  .ot-panel-foot { padding: 12px 16px; }
  .ot-dl { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .ot-dl dd { margin-bottom: 10px; }
  dialog.ot-dlg { width: 100vw; max-width: 100vw; max-height: 100dvh; height: fit-content; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  dialog.ot-dlg.ot-dlg-lg { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  .ot-dlg-head { padding: 18px 16px 4px; }
  .ot-dlg-body { padding: 12px 16px 8px; }
  .ot-dlg-foot { padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); }
  .ot-dlg-foot .ot-btn { flex: 1 1 auto; }
  .ot-scale { gap: 4px; }
  .ot-welcome { padding: 20px 18px; }
  .ot-welcome h1 { font-size: 23px; }
  .ot-welcome-deco { width: 150px; right: -36px; top: -34px; opacity: .45; }
  .ot-welcome-actions .ot-btn { flex: 1 1 auto; }
}
