/* HERS Portal — Coded Energy design system. One token set; presentation only. */

/* ---------- Tokens: light ---------- */
:root {
  color-scheme: light;
  --navy: #002d45;
  --navy-2: #0a3d5a;
  --cyan-50: #e6faff;
  --cyan-100: #ccf4ff;
  --cyan-300: #7fe3ff;
  --cyan-500: #04c9fe;
  --cyan-600: #0389b5;
  --cyan-700: #025f7e;
  --amber-50: #fff8ec;
  --amber-100: #fef0d5;
  --amber-200: #fde3b3;
  --amber-300: #f7c27a;
  --amber-500: #f79214;
  --amber-600: #d97d08;
  --amber-700: #764200;

  --bg: #f5f7fa;
  --card: #fff;
  --text: #1a2530;
  --muted: #56626e;
  --border: #e3e8ee;
  --input-border: #8a94a0;
  --table-line: #e3e7ec;
  --stripe: #f8fafc;
  --th-bg: #eef4f8;
  --th-text: #33475b;
  --filter-bg: #f7fafc;

  --accent: var(--cyan-500);
  --accent-strong: var(--cyan-600);
  --accent-text: var(--cyan-700);
  --accent-soft: var(--cyan-50);
  --accent-soft-border: var(--cyan-100);
  --on-accent-soft: var(--navy);
  --primary: var(--cyan-700);
  --primary-hover: var(--navy);
  --on-primary: #fff;
  --secondary-bg: var(--amber-100);
  --secondary-border: var(--amber-300);
  --secondary-hover: var(--amber-200);
  --secondary-text: var(--amber-700);
  --attention-bg: var(--amber-50);
  --attention-edge: var(--amber-500);
  --focus: var(--cyan-700);
  --danger: #b3261e;

  --tone-good-bg: #e3f6ea; --tone-good-border: #9ad5b3; --tone-good-fg: #14532d;
  --tone-info-bg: var(--cyan-50); --tone-info-border: #99e4f9; --tone-info-fg: var(--cyan-700);
  --tone-attention-bg: var(--amber-100); --tone-attention-border: var(--amber-300); --tone-attention-fg: var(--amber-700);
  --tone-bad-bg: #fdecea; --tone-bad-border: #f2b8b5; --tone-bad-fg: #9f1f19;
  --tone-muted-bg: #f1f3f5; --tone-muted-border: #d9dee3; --tone-muted-fg: #56626e;

  --shadow: 0 1px 2px rgba(0, 45, 69, .05), 0 8px 24px rgba(0, 45, 69, .07);
  --shadow-pop: 0 18px 44px rgba(0, 45, 69, .18);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --control-h: 40px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --egusa-logo: url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCAzMDAwIDExNDcuOCI+CiAgPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDMwLjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDIuMS4zIEJ1aWxkIDE4MikgIC0tPgogIDxkZWZzPgogICAgPHN0eWxlPgogICAgICAuc3QwIHsKICAgICAgICBmaWxsOiAjZTZiNTEwOwogICAgICB9CgogICAgICAuc3QxIHsKICAgICAgICBmaWxsOiAjZTZiNTEwOwogICAgICB9CgogICAgICAuc3QyIHsKICAgICAgICBmaWxsOiAjZmVmZmZlOwogICAgICB9CgogICAgICAuc3QzIHsKICAgICAgICBmaWxsOiAjNDBiYmVjOwogICAgICB9CgogICAgICAuc3Q0IHsKICAgICAgICBmaWxsOiAjZmYxYzQxOwogICAgICB9CiAgICA8L3N0eWxlPgogIDwvZGVmcz4KICA8cGF0aCBjbGFzcz0ic3Q0IiBkPSJNMjg3Mi4zLDQ2MC40Yy02OS41LDAtMTE5LjItNTAuNi0xMTkuMi0xMjEuNXM0OC4zLTEyMS45LDExNy44LTEyMS45LDExNy4zLDQ3LjQsMTE3LjMsMTIyLjR2MTcuOWwtMTY3LC45YzQuMSwzMC40LDIxLjIsNDQuNiw1Mi40LDQ0LjZzNDUuNi05LjcsNTAuNi0yNi4yaDY0LjljLTguMyw1MS4xLTUzL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2LTI1LjdaIi8+CiAgPHBhdGggY2xhc3M9InN0NCIgZD0iTTI0ODAuMSw4OTkuM2gtNDg2djI1LjdoNDg2di0yNS43WiIvPgogIDxwYXRoIGNsYXNzPSJzdDQiIGQ9Ik0yMzYyLjUsOTYwLjNoLTM2OC40djI1LjdoMzY4LjR2LTI1LjdaIi8+Cjwvc3ZnPg==");
  --nav-icon-size: 20px;
  --nav-icon-color: var(--muted);
  --nav-icon-hover: var(--text);
  --nav-icon-active: var(--accent-text);
}

/* ---------- Tokens: dark (explicit choice, and first paint before the script runs) ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #071521;
  --card: #0f2433;
  --text: #f2f6f9;
  --muted: #b5c5ce;
  --border: #244253;
  --input-border: #5f7d8e;
  --table-line: #22404f;
  --stripe: #0c1f2c;
  --th-bg: #0b1d2a;
  --th-text: #cfe0e8;
  --filter-bg: #0b1d2a;
  --accent: #33d4fe;
  --accent-strong: #04c9fe;
  --accent-text: #5edcfe;
  --accent-soft: #0b3445;
  --accent-soft-border: #155066;
  --on-accent-soft: #ccf4ff;
  --primary: #33d4fe;
  --primary-hover: #7fe3ff;
  --on-primary: #001b2e;
  --secondary-bg: #0f2433;
  --secondary-border: #3f5c6d;
  --secondary-hover: #0b3445;
  --secondary-text: #f2f6f9;
  --attention-bg: #2a2110;
  --attention-edge: #f7a53b;
  --focus: #5edcfe;
  --danger: #fca5a5;
  --tone-good-bg: #0f2f21; --tone-good-border: #1f6b45; --tone-good-fg: #a7f3d0;
  --tone-info-bg: #0b3445; --tone-info-border: #1d6a86; --tone-info-fg: #ccf4ff;
  --tone-attention-bg: #33260a; --tone-attention-border: #7a5a17; --tone-attention-fg: #fde68a;
  --tone-bad-bg: #3a1414; --tone-bad-border: #7f2a2a; --tone-bad-fg: #fecaca;
  --tone-muted-bg: #13293a; --tone-muted-border: #2c4a5c; --tone-muted-fg: #b5c5ce;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .28);
  --shadow-pop: 0 20px 48px rgba(0, 0, 0, .45);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #071521; --card: #0f2433; --text: #f2f6f9; --muted: #b5c5ce; --border: #244253;
    --input-border: #5f7d8e; --table-line: #22404f; --stripe: #0c1f2c; --th-bg: #0b1d2a; --th-text: #cfe0e8;
    --filter-bg: #0b1d2a; --accent: #33d4fe; --accent-strong: #04c9fe; --accent-text: #5edcfe;
    --accent-soft: #0b3445; --accent-soft-border: #155066; --on-accent-soft: #ccf4ff;
    --primary: #33d4fe; --primary-hover: #7fe3ff; --on-primary: #001b2e;
    --secondary-bg: #0f2433; --secondary-border: #3f5c6d; --secondary-hover: #0b3445; --secondary-text: #f2f6f9;
    --attention-bg: #2a2110; --attention-edge: #f7a53b; --focus: #5edcfe; --danger: #fca5a5;
    --tone-good-bg: #0f2f21; --tone-good-border: #1f6b45; --tone-good-fg: #a7f3d0;
    --tone-info-bg: #0b3445; --tone-info-border: #1d6a86; --tone-info-fg: #ccf4ff;
    --tone-attention-bg: #33260a; --tone-attention-border: #7a5a17; --tone-attention-fg: #fde68a;
    --tone-bad-bg: #3a1414; --tone-bad-border: #7f2a2a; --tone-bad-fg: #fecaca;
    --tone-muted-bg: #13293a; --tone-muted-border: #2c4a5c; --tone-muted-fg: #b5c5ce;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .28);
    --shadow-pop: 0 20px 48px rgba(0, 0, 0, .45);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { min-width: 300px; max-width: 100%; overflow-x: clip; background: var(--bg); scroll-behavior: smooth; }
body { max-width: 100%; margin: 0; min-height: 100vh; overflow-x: clip; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a { touch-action: manipulation; }
a { color: var(--accent-text); }
[hidden] { display: none !important; }
h1, h2, h3 { color: var(--text); }
h2 { font-size: 20px; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 16px; font-weight: 650; }
button, a, input, select, textarea, summary { transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease; }

/* One visible focus ring everywhere (2px, high contrast in both themes). */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, .table-wrap:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link { position: fixed; z-index: 40; left: 8px; top: -60px; padding: 8px 12px; border: 2px solid var(--focus); border-radius: var(--radius-sm); background: var(--card); color: var(--accent-text); font-weight: 650; }
.skip-link:focus { top: 8px; }

/* ---------- Banner and top bar ---------- */
.brand-banner { display: flex; min-height: 96px; align-items: center; overflow: hidden; background: var(--navy); border-bottom: 3px solid var(--amber-500); }
.brand-banner::after { content: ""; align-self: stretch; flex: 1; min-width: 80px; background: linear-gradient(118deg, transparent 0 54%, rgba(4,201,254,.14) 54% 68%, rgba(247,146,20,.08) 68%); }
.brand-lockup { display: flex; width: min(1280px, calc(100% - 40px)); min-width: 0; margin-left: max(20px, calc((100vw - 1280px) / 2)); align-items: center; gap: 22px; padding: 12px 0; }
.brand-mark { display: block; flex: 0 0 auto; width: clamp(200px, 22vw, 280px); aspect-ratio: 3000 / 1147.8; background: var(--egusa-logo) center / contain no-repeat; }
.brand-divider { width: 1px; height: 48px; background: rgba(255,255,255,.24); }
.brand-portal { display: grid; gap: 2px; min-width: 0; color: #fff; }
.brand-portal strong { font-size: clamp(17px, 1.7vw, 22px); letter-spacing: -.01em; }
.brand-portal small { color: var(--cyan-300); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.top-bar { display: flex; min-height: 56px; align-items: center; justify-content: flex-end; gap: 16px; padding: 8px max(20px, calc((100vw - 1280px) / 2)); border-bottom: 1px solid var(--border); background: var(--card); color: var(--text); }
.identity-cells { display: grid; grid-template-columns: minmax(120px, auto); margin-right: auto; min-width: 0; overflow: hidden; border: 1px solid var(--accent-soft-border); border-radius: var(--radius-md); background: var(--accent-soft); }
.identity-cell { min-width: 0; padding: 5px 12px; }
.identity-cell span, .identity-cell strong { display: block; overflow-wrap: anywhere; }
.identity-cell span { color: var(--accent-text); font-size: 11px; font-weight: 700; letter-spacing: .08em; line-height: 1.2; text-transform: uppercase; }
.identity-cell strong { color: var(--on-accent-soft); font-size: 14px; line-height: 1.35; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.theme-button, .reset-button { display: inline-flex; min-height: var(--control-h); align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--input-border); border-radius: var(--radius-md); background: var(--card); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; }
.theme-button { width: var(--control-h); padding: 0; }
.theme-button .nav-icon { width: 20px; height: 20px; }
.theme-button:hover, .reset-button:hover { border-color: var(--accent-text); background: var(--accent-soft); color: var(--accent-text); }

/* ---------- Sign-in ---------- */
.login-main { width: min(1280px, calc(100% - 32px)); margin: clamp(28px, 7vh, 72px) auto; }
.login-card { position: relative; max-width: 520px; margin: 0 auto; padding: clamp(24px, 5vw, 44px); text-align: center; border-top: 4px solid var(--accent); }
.login-card .page-title { margin-bottom: 10px; font-size: clamp(24px, 3.6vw, 30px); }
.login-card .subtitle { max-width: 440px; margin: 0 auto 24px; }
.login-card > .notice { max-width: 440px; margin: 0 auto 16px; text-align: left; }
.login-form { display: grid; gap: 14px; max-width: 440px; margin: 0 auto; text-align: left; }
.login-form .primary-button { width: 100%; margin-top: 4px; }
.login-card #login-status { max-width: 440px; margin: 16px auto 0; text-align: left; }
.checkbox-field { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; }
.checkbox-field input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }
.help-popover { position: relative; display: inline-block; margin-top: 18px; }
.help-trigger { padding: 4px 6px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--accent-text); font-size: 14px; font-weight: 600; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; cursor: pointer; }
.help-trigger[aria-expanded="true"] { text-decoration-style: solid; }
.help-panel { position: absolute; z-index: 20; left: 50%; top: calc(100% + 8px); width: min(340px, calc(100vw - 48px)); padding: 14px 16px; transform: translateX(-50%); border: 1px solid var(--border); border-top: 3px solid var(--amber-500); border-radius: var(--radius-md); background: var(--card); box-shadow: var(--shadow-pop); color: var(--text); font-size: 14px; text-align: left; }
.help-panel p { margin: 0 0 8px; }
.help-panel p:last-child { margin-bottom: 0; }
.help-panel a { overflow-wrap: anywhere; font-weight: 600; }

/* ---------- Workspace shell and navigation ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: calc(100vh - 160px); }
.side-nav { position: sticky; top: 0; align-self: start; max-height: 100vh; min-width: 0; overflow-y: auto; padding: 20px 12px; border-right: 1px solid var(--border); background: var(--card); }
.side-nav .nav-item { display: flex; align-items: center; gap: 10px; min-width: 0; width: 100%; margin: 2px 0; padding: 9px 12px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text); font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.nav-label { min-width: 0; overflow-wrap: anywhere; }
.nav-item:hover { background: var(--stripe); }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--on-accent-soft); box-shadow: inset 3px 0 0 var(--accent-strong); }
.nav-item-unavailable .nav-label { color: var(--muted); font-weight: 600; }
.nav-symbol { display: inline-grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--nav-icon-color); font-size: 0; }
.nav-icon { display: block; flex: none; width: var(--nav-icon-size); height: var(--nav-icon-size); overflow: visible; pointer-events: none; }
.nav-item:hover .nav-symbol, .nav-item:focus-visible .nav-symbol { color: var(--nav-icon-hover); }
.nav-item[aria-current="page"] .nav-symbol, .nav-item[aria-current="page"]:hover .nav-symbol { color: var(--nav-icon-active); }
.nav-item-unavailable .nav-symbol { color: var(--nav-icon-color); opacity: .55; }
.nav-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; max-width: 100%; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.nav-layout-control, .nav-collapse { display: inline-flex; min-width: 0; height: 34px; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); border-radius: 9px; background: var(--card); color: var(--muted); font-size: 12px; font-weight: 650; cursor: pointer; }
.nav-layout-control { padding: 4px 10px 4px 8px; white-space: nowrap; }
.top-actions .nav-layout-control { height: 36px; }
.nav-collapse { width: 34px; }
.nav-control-symbol, .nav-collapse-symbol { display: inline-grid; place-items: center; }
.nav-control-symbol .nav-icon, .nav-collapse-symbol .nav-icon { --nav-icon-size: 18px; }
.nav-layout-control:hover, .nav-collapse:hover { border-color: var(--accent-text); background: var(--accent-soft); color: var(--accent-text); }
.shell.nav-side.nav-compact { grid-template-columns: 72px minmax(0, 1fr); }
.shell.nav-side.nav-compact .side-nav { padding-inline: 8px; }
.shell.nav-side.nav-compact .nav-item { justify-content: center; padding-inline: 4px; }
.shell.nav-side.nav-compact .nav-label, .shell.nav-side.nav-compact .nav-control-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.shell.nav-side.nav-compact .nav-tools { flex-direction: column; }
.shell.nav-side.nav-compact .nav-layout-control { width: 34px; padding: 0; }
.shell.nav-top { display: flex; flex-direction: column; }
.shell.nav-top .side-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px; max-height: none; padding: 8px max(20px, calc((100vw - 1280px) / 2)); border-right: 0; border-bottom: 1px solid var(--border); }
.shell.nav-top .nav-item { flex: 0 1 auto; width: auto; margin: 0; border-radius: var(--radius-sm); }
.shell.nav-top .nav-item[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent-strong); }
.shell.nav-top .nav-tools { flex: 0 1 auto; margin: 0 0 0 auto; padding: 0; border-top: 0; }
@media (min-width: 721px) {
  .shell.nav-side.nav-compact .nav-symbol { flex-basis: 32px; width: 32px; height: 32px; }
  .shell.nav-side.nav-compact .nav-icon { --nav-icon-size: 22px; }
  .shell.nav-side:not(.nav-compact) .nav-label, .shell.nav-top .nav-label { white-space: nowrap; overflow-wrap: normal; word-break: normal; }
}
@media (forced-colors: active) {
  .nav-symbol { color: CanvasText; }
  .nav-item[aria-current="page"] .nav-symbol { color: Highlight; }
}

/* ---------- Page layout ---------- */
.content { width: 100%; max-width: 1280px; margin: 0 auto; padding: clamp(20px, 4vw, 48px) clamp(16px, 4vw, 64px); }
.page-title { margin: 0 0 8px; color: var(--text); font-size: clamp(26px, 3vw, 32px); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.subtitle { max-width: 760px; margin: 0 0 24px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.eyebrow { display: block; margin-bottom: 4px; color: var(--accent-text); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.card { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); box-shadow: var(--shadow); }
.section-card { margin-bottom: 20px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.section-card h2, .title-row h2 { margin: 0 0 8px; }
.page-local-note { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.step-up-form .page-local-note, .practice-controls .page-local-note { margin: 0; }
.title-row { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; }
.title-row > div { min-width: 0; }
.title-row .page-local-note { margin: 0; }
.dashboard-recent { margin-top: 8px; }

/* ---------- Buttons ---------- */
.primary-button, .secondary-button { display: inline-flex; min-height: var(--control-h); width: fit-content; align-items: center; justify-content: center; gap: 6px; padding: 8px 18px; border: 1px solid transparent; border-radius: var(--radius-md); font-size: 14px; font-weight: 650; line-height: 1.2; cursor: pointer; }
.primary-button { background: var(--primary); color: var(--on-primary); }
.primary-button:hover { background: var(--primary-hover); }
.secondary-button { border-color: var(--secondary-border); background: var(--secondary-bg); color: var(--secondary-text); }
.secondary-button:hover { border-color: var(--amber-500); background: var(--secondary-hover); }
:root[data-theme="dark"] .secondary-button:hover { border-color: var(--accent); color: var(--text); }
.compact-button { min-height: 32px; padding: 4px 12px; font-size: 13px; }
button:disabled, input:disabled, select:disabled, textarea:disabled { opacity: .55; cursor: not-allowed; }
.primary-button:disabled:hover { background: var(--primary); }
.secondary-button:disabled:hover { border-color: var(--secondary-border); background: var(--secondary-bg); }
.practice-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.data-table button, .pagination button, .table-detail-actions button { white-space: nowrap; overflow-wrap: normal; word-break: normal; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; color: var(--text); font-size: 13px; font-weight: 600; }
.field input, .field select, .field textarea, .checklist-item input[type="number"] { min-height: var(--control-h); min-width: 150px; padding: 8px 12px; border: 1px solid var(--input-border); border-radius: 8px; background: var(--card); color: var(--text); font-size: 15px; font-weight: 400; }
.field textarea { min-height: 88px; line-height: 1.45; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .checklist-item input[type="number"]:focus { border-color: var(--accent-strong); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.field input[type="number"] { width: 130px; min-width: 0; }
.field input[type="search"] { width: min(320px, 70vw); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger) !important; }
.field-error { color: var(--danger); font-size: 13px; font-weight: 600; }
.provider-rater-edit-wide { grid-column: 1 / -1; }
.provider-rater-edit-form .field textarea { width: 100%; min-width: 0; }
.provider-rater-edit-notes .page-local-note { margin: 0 0 6px; }
.provider-rater-edit-confirm { border: 1px solid var(--danger); border-radius: 8px; padding: 12px 14px; margin: 12px 0; }
.provider-rater-edit-confirm-question { font-weight: 600; margin: 0 0 6px; overflow-wrap: anywhere; }
.provider-rater-edit-confirm-question:focus { outline: 2px solid var(--focus, currentColor); outline-offset: 2px; }
.provider-rater-edit .notice button { margin-inline-start: 8px; }
.field-note { color: var(--danger); font-size: 13px; font-weight: 600; }
.toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar-group { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.toolbar-apply { align-self: flex-end; min-height: var(--control-h); }
.toolbar-group .field-note, .toolbar-group .search-summary { flex: 1 0 100%; margin: 0; }
.search-summary { color: var(--accent-text); font-size: 14px; font-weight: 650; }
.step-up-form { display: grid; gap: 12px; max-width: 460px; }
.step-up-form .field input { width: 100%; min-width: 0; }
.search-dialog { width: min(760px, calc(100% - 28px)); }
.search-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-bottom: 12px; }
.search-form .field input { width: 100%; min-width: 0; }
.search-form .notice { margin: 0 0 14px; }

/* ---------- Notices ---------- */
.notice { margin: 16px 0; padding: 12px 14px; border: 0; border-radius: var(--radius-md); background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent-strong); color: var(--text); }
.notice:first-child { margin-top: 0; }
.notice:last-child { margin-bottom: 0; }
.notice.error { background: var(--tone-bad-bg); box-shadow: inset 4px 0 0 var(--tone-bad-fg); color: var(--tone-bad-fg); }
.notice.success { background: var(--tone-good-bg); box-shadow: inset 4px 0 0 var(--tone-good-border); color: var(--tone-good-fg); }
.notice.loading:not(.error) { display: flex; align-items: center; gap: 10px; background: var(--stripe); box-shadow: inset 4px 0 0 var(--border); color: var(--muted); }
.notice.loading:not(.error)::before { content: ""; flex: 0 0 16px; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent-strong); border-radius: 50%; animation: portal-spin .8s linear infinite; }
.notice[hidden] { display: none !important; }
@keyframes portal-spin { to { transform: rotate(360deg); } }

/* ---------- Metrics, profile grids, announcements ---------- */
.summary-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.dashboard-summary-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 720px; }
.metric-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; padding: 18px 20px; border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: var(--radius-lg); background: var(--card); box-shadow: var(--shadow); }
.metric-card:nth-child(2) { border-top-color: var(--amber-500); }
.metric-card:nth-child(3) { border-top-color: var(--cyan-700); }
.metric-card:nth-child(4) { border-top-color: var(--navy); }
:root[data-theme="dark"] .metric-card:nth-child(4) { border-top-color: var(--cyan-300); }
.metric-card span { color: var(--text); font-size: 28px; font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric-card small { min-width: 0; color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: .06em; line-height: 1.3; text-transform: uppercase; overflow-wrap: anywhere; }
.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin: 12px 0; }
.review-item { min-width: 0; padding: 12px 0; border-top: 1px solid var(--border); }
.review-item dt { color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.review-item dd { min-width: 0; margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.announcement-list { display: grid; gap: 14px; }
.announcement-item { margin: 0; border-left: 4px solid var(--accent); }
.announcement-item h2 { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.announcement-date { display: block; margin: 6px 0 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.announcement-body { margin: 10px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.announcement-note { margin: 10px 0 0; color: var(--muted); font-size: 13px; }

/* ---------- Registration ---------- */
.registration-stage-form { display: grid; gap: 0; }
.registration-stage-form h2, .registration-result h2 { margin-top: 0; }
.upload-zone { margin-bottom: 20px; border-left: 4px solid var(--accent); }
.registration-file-field { margin: 12px 0 6px; color: var(--text); }
.registration-stage-form input[type="file"] { width: min(100%, 520px); min-height: 44px; padding: 8px 10px; border: 1px dashed var(--input-border); border-radius: 8px; background: var(--accent-soft); color: var(--text); font-size: 14px; }
.registration-stage-form .primary-button { margin-top: 8px; }
.registration-file-review { max-width: 760px; }
.registration-result .notice { margin-top: 8px; }
.registration-result .notice:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.registration-stage-form[aria-busy="true"] { cursor: progress; }

/* ---------- Tables ---------- */
.filter-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 10px; }
.filter-summary { flex: 1 1 260px; margin: 0; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent-strong); color: var(--text); font-size: 13px; overflow-wrap: anywhere; }
.column-filter-collapse { display: inline-flex; height: 32px; align-items: center; gap: 6px; padding: 0 12px 0 10px; border: 1px solid var(--input-border); border-radius: 999px; background: var(--card); color: var(--text); font-size: 13px; font-weight: 650; cursor: pointer; }
.column-filter-collapse .nav-icon { width: 16px; height: 16px; }
.column-filter-collapse .filter-toggle-chevron { width: 14px; height: 14px; transition: transform .15s; }
.column-filter-collapse[aria-expanded="true"] { border-color: var(--accent-soft-border); background: var(--accent-soft); color: var(--accent-text); }
.column-filter-collapse.is-collapsed .filter-toggle-chevron { transform: rotate(-90deg); }
.column-filter-collapse:hover:not(:disabled) { border-color: var(--accent-text); color: var(--accent-text); }
.quick-filter-button { display: inline-flex; height: 32px; align-items: center; padding: 0 12px; border: 1px solid var(--input-border); border-radius: 999px; background: var(--card); color: var(--text); font-size: 13px; font-weight: 650; cursor: pointer; }
.quick-filter-button:hover:not(:disabled) { border-color: var(--tone-bad-fg); color: var(--tone-bad-fg); }
.quick-filter-button.is-active { border-color: var(--tone-bad-border); background: var(--tone-bad-bg); color: var(--tone-bad-fg); }
.quick-filter-button:disabled { opacity: .55; cursor: default; }

.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background:
    linear-gradient(to right, var(--card) 30%, transparent) left center / 40px 100% no-repeat local,
    linear-gradient(to left, var(--card) 30%, transparent) right center / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0,45,69,.16), transparent) left center / 14px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0,45,69,.16), transparent) right center / 14px 100% no-repeat scroll,
    var(--card); box-shadow: var(--shadow); }
.data-table { width: 100%; min-width: 480px; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.ratings-table, .qa-table { min-width: 960px; }
.provider-ratings-table, .provider-qa-table { min-width: 1040px; }
.report-table { min-width: 880px; }
.dashboard-ratings-table { min-width: 720px; }
.provider-roster-table { min-width: 480px; }
.data-table th { padding: 10px 8px 8px; border-bottom: 1px solid var(--table-line); background: var(--th-bg); color: var(--th-text); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-align: center; text-transform: uppercase; vertical-align: top; white-space: normal; }
/* Header: the name and its sort arrow on one line (Connor 2026-09-25); filter "+" lives in the filter row. */
.th-label { display: inline; line-height: 1.3; }
.th-tools { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; vertical-align: middle; }
.th-tools:empty { display: none; }
.data-table td { padding: 8px 10px; border-bottom: 1px solid var(--table-line); vertical-align: top; overflow-wrap: break-word; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table th:first-child, .data-table td:first-child { padding-left: 12px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 12px; }
.data-table tbody tr:nth-child(even) td { background: var(--stripe); }
.data-table tbody tr:hover td { background: color-mix(in srgb, var(--accent) 6%, var(--card)); }
.data-table tbody tr.needs-attention td { background: var(--attention-bg); }
.data-table tbody tr.needs-attention td:first-child { box-shadow: inset 3px 0 0 var(--attention-edge), inset -1px 0 0 var(--table-line); }
.data-table tbody tr.table-detail-active td, .data-table tr.table-detail-active td { background: var(--accent-soft); box-shadow: inset 0 2px var(--accent-strong), inset 0 -2px var(--accent-strong); }
.data-table tbody tr.table-detail-active td:first-child { box-shadow: inset 3px 0 var(--accent-strong), inset 0 2px var(--accent-strong), inset 0 -2px var(--accent-strong); }
.data-table .compact-button { min-height: 28px; padding: 3px 10px; border-radius: var(--radius-sm); font-size: 12px; }
.unavailable-row td { padding: 24px 12px; background: var(--card) !important; color: var(--muted); font-weight: 400; text-align: left; }
.row-note { display: block; margin-top: 4px; color: var(--tone-bad-fg); font-size: 12px; font-weight: 600; }

/* Keep the identifying first column in view whenever a table still scrolls sideways. */
.data-table th:first-child, .data-table tbody tr:not(.unavailable-row) td:first-child { position: sticky; left: 0; z-index: 1; box-shadow: inset -1px 0 0 var(--table-line); }
.data-table th:first-child { z-index: 2; }
.data-table td:first-child { background: var(--card); }

.ratings-sort-button { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; }
.ratings-sort-button:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent-text); }
.ratings-sort-button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.ratings-sort-indicator { display: inline-grid; place-items: center; }
.ratings-sort-indicator .sort-icon { width: 18px; height: 18px; }
.ratings-sort-indicator .sort-up, .ratings-sort-indicator .sort-down { opacity: .45; }
th[aria-sort="ascending"] .ratings-sort-indicator .sort-up, th[aria-sort="descending"] .ratings-sort-indicator .sort-down { opacity: 1; stroke: var(--accent-text); stroke-width: 2.6; }
th[aria-sort="ascending"] .ratings-sort-indicator .sort-down, th[aria-sort="descending"] .ratings-sort-indicator .sort-up { opacity: .2; }
th[aria-sort="ascending"], th[aria-sort="descending"] { color: var(--accent-text); }
.column-filter-add, .column-filter-remove { display: inline-grid; flex: 0 0 22px; width: 22px; height: 22px; place-items: center; padding: 0; border: 1px solid var(--input-border); border-radius: var(--radius-sm); background: var(--card); color: var(--muted); cursor: pointer; }
.column-filter-add svg, .column-filter-remove svg { display: block; width: 10px; height: 10px; }
.column-filter-add:hover:not(:disabled), .column-filter-remove:hover:not(:disabled) { border-color: var(--accent-text); background: var(--accent-soft); color: var(--accent-text); }
.column-filter-remove { flex-basis: 26px; width: 26px; height: 26px; }

.column-filter-row th, .column-filter-extra th { padding: 6px; background: var(--filter-bg); color: var(--text); font-size: 13px; letter-spacing: 0; text-transform: none; vertical-align: top; }
.column-filter-extra th { padding-top: 0; }
.column-filter-control { width: 100%; min-width: 3.5rem; min-height: 32px; padding: 4px 8px; border: 1px solid var(--input-border); border-radius: var(--radius-sm); background: var(--card); color: var(--text); font-size: 13px; font-weight: 500; }
.column-filter-control::placeholder { color: var(--muted); opacity: 1; }
.column-filter-cell { display: flex; align-items: center; gap: 4px; min-width: 0; }
.column-filter-cell .column-filter-control { flex: 1 1 auto; min-width: 3.5rem; }
.column-filter-stack { display: grid; gap: 4px; min-width: 0; }
.column-filter-join { justify-self: start; min-height: 22px; padding: 1px 10px; border: 1px solid var(--input-border); border-radius: 999px; background: var(--card); color: var(--accent-text); font-size: 12px; font-weight: 700; line-height: 1.2; cursor: pointer; }
.column-filter-join[aria-pressed="true"] { border-color: var(--accent-text); background: var(--accent-text); color: var(--card); }

.program-capsules { display: flex; flex-wrap: wrap; gap: 6px; }
.program-chip { display: inline-flex; max-width: 100%; padding: 2px 9px; border: 1px solid var(--accent-soft-border); border-radius: 999px; background: var(--accent-soft); color: var(--on-accent-soft); font-size: 12px; line-height: 1.35; white-space: nowrap; overflow-wrap: normal; word-break: keep-all; }
.rating-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table .rating-time { white-space: normal; }
.status-chip { display: inline-flex; max-width: 100%; padding: 2px 9px; border: 1px solid var(--tone-muted-border); border-radius: 999px; background: var(--tone-muted-bg); color: var(--text); font-size: 12px; font-weight: 700; line-height: 1.35; white-space: nowrap; }
.status-chip[data-tone="good"] { border-color: var(--tone-good-border); background: var(--tone-good-bg); color: var(--tone-good-fg); }
.status-chip[data-tone="info"] { border-color: var(--tone-info-border); background: var(--tone-info-bg); color: var(--tone-info-fg); }
.status-chip[data-tone="attention"] { border-color: var(--tone-attention-border); background: var(--tone-attention-bg); color: var(--tone-attention-fg); }
.status-chip[data-tone="bad"] { border-color: var(--tone-bad-border); background: var(--tone-bad-bg); color: var(--tone-bad-fg); }
.status-chip[data-tone="muted"] { color: var(--tone-muted-fg); font-weight: 600; }

.pagination { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.pagination span { min-width: 120px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; text-align: center; }

/* ---------- Dialogs ---------- */
.table-detail-dialog { width: min(760px, calc(100% - 28px)); max-height: calc(100dvh - 28px); padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); color: var(--text); box-shadow: var(--shadow-pop); }
.table-detail-dialog::backdrop { background: rgba(0, 20, 32, .56); }
.table-detail-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: calc(100dvh - 28px); padding: clamp(16px, 3vw, 26px); }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.dialog-heading h2 { margin: 0 0 14px; }
.dialog-close { width: 36px; height: 36px; flex: 0 0 36px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--card); color: var(--text); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.dialog-close:hover { border-color: var(--accent-text); color: var(--accent-text); }
.table-detail-content { min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding-inline-end: 4px; }
.table-detail-content h3 { margin: 20px 0 8px; }
.table-detail-content ol { margin-block: 8px 0; }
.table-detail-fields { margin: 0; }
.table-detail-actions { display: grid; grid-template-columns: auto minmax(70px, 1fr) auto; align-items: center; gap: 8px; margin-top: 20px; }
.table-detail-position { color: var(--muted); text-align: center; }
.checklist-dialog { width: min(980px, calc(100% - 28px)); }
.navigation-context-menu { position: fixed; z-index: 60; display: grid; width: min(250px, calc(100vw - 16px)); padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); box-shadow: var(--shadow-pop); }
.navigation-context-menu button { width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.navigation-context-menu button:hover, .navigation-context-menu button:focus-visible { background: var(--accent-soft); color: var(--accent-text); }

/* ---------- Checklist, drafts and decisions ---------- */
.checklist-reserved { margin: 16px 0; }
.checklist-reserved h3 { margin: 0 0 6px; }
.checklist-reserved .notice { margin: 0; }
.qa-document-list { margin: 8px 0 0; padding-left: 20px; }
.qa-document-list li { margin: 4px 0; overflow-wrap: anywhere; }
.detail-notify { margin: 16px 0; }
.detail-notify h3 { margin: 0 0 8px; }
.detail-notify h4 { margin: 12px 0 4px; font-size: 14px; }
.detail-notify .notice { margin: 10px 0 0; }
.detail-notify-text { margin: 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--accent-soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-notify-message .detail-notify-text { background: var(--tone-bad-bg); box-shadow: inset 3px 0 0 var(--tone-bad-fg); }
.detail-files { margin: 16px 0; }
.detail-files h3 { margin: 0 0 8px; }
.detail-files .notice { margin: 10px 0 0; }
.detail-files-note { margin: 0 0 8px; color: var(--muted); }
.detail-files-actions, .download-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.download-bar { margin: 12px 0; }
.download-count, .detail-file-meta { color: var(--muted); font-size: 13px; }
.detail-file-list { list-style: none; margin: 10px 0 0; padding: 0; }
.detail-file-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--table-line); }
.detail-file-text { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.data-table .select-column, .data-table .select-cell { width: 44px; text-align: center; }
.row-select { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; min-height: 28px; cursor: pointer; }
.row-select input { width: 16px; height: 16px; margin: 0; cursor: pointer; }
button[aria-busy="true"] { cursor: progress; }
.practice-summary { margin: 20px 0; padding: 16px; border: 1px solid var(--accent-soft-border); border-radius: var(--radius-lg); background: var(--accent-soft); }
.practice-summary h3 { margin: 0; color: var(--accent-text); }
.practice-summary p { margin: 4px 0 12px; color: var(--muted); }
.practice-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0; }
.practice-metrics div { min-width: 0; padding: 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); }
.practice-metrics dt { color: var(--muted); font-size: 12px; font-weight: 650; }
.practice-metrics dd { margin: 2px 0 0; font-weight: 750; overflow-wrap: anywhere; }
.checklist-items { display: grid; gap: 12px; margin: 0 0 14px; }
.draft-panel { margin: 20px 0; padding: 16px; border: 1px solid var(--border); border-left: 4px solid var(--accent-strong); border-radius: var(--radius-lg); background: var(--card); }
.draft-panel h3 { margin: 0 0 10px; color: var(--accent-text); }
.draft-panel .notice { margin: 0 0 12px; }
.draft-panel .practice-controls { margin: 0; }
.draft-note { flex: 1 1 260px; margin: 0; }
.decision-panel { margin-top: 16px; border-left-color: var(--amber-500); }
.decision-panel .draft-note { margin: 8px 0 0; }
.decision-panel .decision-done { margin-top: 12px; }
.decision-status-form { max-width: none; margin-top: 4px; }
.decision-status-form textarea { width: 100%; min-width: 0; }
.decision-choices { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.decision-choices legend { padding: 0 4px; color: var(--muted); font-size: 13px; font-weight: 650; }
.decision-choice { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-size: 14px; cursor: pointer; }
.decision-choice input { accent-color: var(--primary); }
.decision-confirm { padding: 12px 14px; border-radius: var(--radius-md); background: var(--tone-attention-bg); box-shadow: inset 4px 0 0 var(--attention-edge); }
.decision-confirm-text { margin: 0 0 10px; color: var(--tone-attention-fg); font-weight: 700; }
.decision-confirm .practice-controls { margin: 0; }
.checklist-dialog.is-editing .checklist-item { border-color: var(--accent-soft-border); }
.checklist-dialog.is-editing .checklist-item.is-changed { box-shadow: inset 4px 0 0 var(--amber-500); }
.checklist-dialog.is-editing .checklist-item .field select,
.checklist-dialog.is-editing .checklist-item input[type="number"],
.checklist-dialog.is-editing .checklist-item textarea { border-color: var(--accent-strong); }
.checklist-item { padding: 16px; box-shadow: none; }
.checklist-item h3 { margin: 0 0 6px; font-size: 15px; overflow-wrap: anywhere; }
.checklist-item-meta { margin: 0 0 10px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.checklist-photo-marker { display: inline-flex; align-items: center; margin-left: 4px; padding: 1px 8px; border: 1px solid var(--tone-attention-border); border-radius: 999px; background: var(--tone-attention-bg); color: var(--tone-attention-fg); font-size: 12px; font-weight: 700; vertical-align: middle; white-space: nowrap; }
.checklist-item-saved { margin: 0 0 12px; padding: 6px 9px; border-radius: var(--radius-sm); background: var(--stripe); color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.checklist-item .field { max-width: 420px; }
.checklist-item input[type="number"] { width: 140px; min-width: 0; margin-top: 8px; }
.checklist-line-score { margin: 10px 0 0; }
.checklist-item-comment { margin: 12px 0 0; }
.checklist-item-comment textarea { width: 100%; min-width: 0; min-height: 72px; padding: 8px 10px; border: 1px solid var(--input-border); border-radius: 8px; background: var(--card); color: var(--text); font-size: 14px; line-height: 1.45; resize: vertical; white-space: pre-wrap; overflow-wrap: anywhere; }
.checklist-item-comment textarea[readonly] { border-style: dashed; background: var(--stripe); }
.checklist-item details { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.checklist-item details summary { color: var(--accent-text); cursor: pointer; font-weight: 650; }
.checklist-item details p { white-space: pre-wrap; overflow-wrap: anywhere; }
.password-change .step-up-form { margin-top: 10px; }
.password-change .notice { max-width: 460px; }
.temporary-password { display: inline-block; padding: .4rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--stripe); font-family: ui-monospace, Consolas, monospace; font-size: 1.25rem; letter-spacing: .08em; user-select: all; }

/* ---------- Responsive ---------- */
@media (max-width: 1279px) {
  /* The audit queue keeps Rater and Work log in view together when it scrolls. */
  .provider-qa-table th:first-child, .provider-qa-table td:first-child { width: 8rem; min-width: 8rem; max-width: 8rem; }
  .provider-qa-table td:first-child { overflow-wrap: anywhere; }
  .provider-qa-table th:nth-child(2), .provider-qa-table tbody tr:not(.unavailable-row) td:nth-child(2) { position: sticky; left: 8rem; z-index: 1; box-shadow: inset -1px 0 0 var(--table-line); }
  .provider-qa-table th:first-child, .provider-qa-table tbody tr:not(.unavailable-row) td:first-child { box-shadow: none; }
  .provider-qa-table th:nth-child(2) { z-index: 2; }
  .provider-qa-table td:nth-child(2) { background: var(--card); }
}
@media (max-width: 1023px) {
  .shell { grid-template-columns: 200px minmax(0, 1fr); }
  .summary-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 721px) and (max-width: 1023px) {
  .shell.nav-side:not(.nav-compact) .side-nav { padding-inline: 8px; }
  .shell.nav-side:not(.nav-compact) .nav-item { gap: 8px; padding-inline: 8px; }
  .shell.nav-side:not(.nav-compact) .nav-label { white-space: normal; }
  .shell.nav-side:not(.nav-compact) .nav-symbol { flex-basis: 24px; width: 24px; height: 24px; }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  .brand-banner { min-height: 64px; }
  .brand-banner::after { display: none; }
  .brand-lockup { width: calc(100% - 32px); margin: 0 16px; gap: 12px; padding: 8px 0; }
  .brand-mark { width: min(140px, 40vw); }
  .brand-divider, .brand-portal small { display: none; }
  .brand-portal strong { font-size: 16px; }
  .top-bar { min-height: 48px; padding: 6px 16px; }
  .identity-cell { padding: 3px 10px; }
  .identity-cell span { display: none; }
  .theme-button, .reset-button { min-height: 36px; }
  .theme-button { width: 36px; }
  .shell, .shell.nav-top { display: block; }
  .side-nav, .shell.nav-top .side-nav, .shell.nav-side.nav-compact .side-nav { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: nowrap; gap: 4px; max-height: none; overflow-x: auto; overflow-y: hidden; padding: 8px 12px; border-right: 0; border-bottom: 1px solid var(--border); background: var(--card); scroll-snap-type: x proximity; scrollbar-width: thin; }
  .side-nav .nav-item, .shell.nav-side.nav-compact .nav-item { flex: 0 0 auto; width: auto; margin: 0; padding: 8px 12px; justify-content: flex-start; scroll-snap-align: start; white-space: nowrap; }
  .shell.nav-side.nav-compact .nav-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: nowrap; }
  .nav-item[aria-current="page"], .shell.nav-top .nav-item[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent-strong); }
  .nav-tools, .shell.nav-top .nav-tools, .shell.nav-side.nav-compact .nav-tools, .top-actions .nav-layout-control { display: none; }
  .content { padding: 20px 16px 32px; }
  .field input, .field select, .field textarea, .column-filter-control { font-size: 16px; }
  .summary-cards { gap: 12px; }
  .metric-card { padding: 14px 16px; }
  .metric-card span { font-size: 24px; }
  .review-grid, .search-grid { grid-template-columns: 1fr; }
  .title-row { display: block; }
  .title-row .secondary-button { margin-top: 8px; }
  .practice-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-main { width: calc(100vw - 32px); margin-block: 24px; }
  .login-card { width: 100%; }
  .login-card .page-title, .login-card .subtitle { overflow-wrap: anywhere; }
  .login-form, .login-form .field, .login-form .field input { width: 100%; min-width: 0; }
  .card { padding: 18px; }
}
@media (max-width: 520px) {
  .summary-cards { grid-template-columns: 1fr 1fr; }
  .pagination { justify-content: center; }
  .pagination span { order: -1; flex: 1 0 100%; min-width: 0; }
  .top-actions { gap: 6px; }
}
@media (max-width: 380px) {
  .summary-cards { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- P9: whole-window paging, View errors, supporting-document upload ---------- */
.page-size-field { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 0 12px; font-size: 13px; }
.page-size-field select { min-width: 5.5em; }
.view-errors-count { margin: 8px 0 0; font-weight: 600; }
.view-errors-list { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 8px; }
.view-errors-list strong { display: block; overflow-wrap: anywhere; }
.view-errors-output > p { margin: 8px 0 0; }
.view-errors-output > button { margin-top: 8px; }
.detail-extra { display: grid; gap: 12px; }
.support-upload { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border, #d0d7de); display: grid; gap: 8px; justify-items: start; }
.support-upload h4 { margin: 0; font-size: 15px; }
.support-upload input[type="file"] { max-width: 100%; }
.support-upload-results { margin: 0; padding-left: 18px; display: grid; gap: 4px; overflow-wrap: anywhere; }
.support-upload-results li.error { color: var(--danger, #b42318); }
