    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --navy:      #00395A;
      --cyan:      #00B3D8;
      --white:     #FFFFFF;
      --gray-lt:   #E6E6E6;
      --gray-md:   #919295;
      --bg:        #F4F6F7;
      --text:      #1a1a1a;
      --text-muted:#919295;
      --border:    #E6E6E6;
      --green-bg:  #ECFDF5;
      --green-txt: #065f46;
      --red-bg:    #FEF2F2;
      --red-txt:   #991b1b;
    }

    body {
      background: var(--bg);
      color: var(--text);
      font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
      font-size: 14px;
      line-height: 1.5;
      min-height: 100vh;
    }
    body.modal-open { overflow: hidden; }

    /* ── Header ── */
    .header {
      position: sticky;
      top: 0;
      z-index: 40;
      background: var(--navy);
      box-shadow: 0 1px 4px rgba(0,0,0,0.18);
    }

    .header-inner {
      max-width: 1400px;
      margin: 0 auto;
      padding: 0 24px;
      height: 56px;
      display: flex;
      align-items: center;
      gap: 16px;
    }

    /* ── Feedback button ── */
    .btn-feedback {
      font-size: 12px;
      color: rgba(255,255,255,0.7);
      background: rgba(255,255,255,0.08);
      border: 1px solid rgba(255,255,255,0.18);
      border-radius: 6px;
      padding: 5px 12px;
      cursor: pointer;
      transition: background 0.15s, color 0.15s;
      white-space: nowrap;
    }
    .btn-feedback:hover { background: rgba(255,255,255,0.15); color: #fff; }

    /* ── Feedback modal ── */
    .fb-modal-overlay {
      display: none; position: fixed; inset: 0; z-index: 999;
      background: rgba(0,0,0,0.45);
      align-items: flex-end; justify-content: flex-end;
      padding: 80px 24px 24px;
    }
    .fb-modal-overlay.open { display: flex; }
    .fb-modal {
      background: var(--white); border-radius: 12px;
      width: 360px; max-width: calc(100vw - 48px);
      box-shadow: 0 12px 40px rgba(0,57,90,0.22);
      overflow: hidden; display: flex; flex-direction: column;
    }
    .fb-header {
      background: var(--navy); color: var(--white);
      padding: 14px 18px; display: flex; align-items: center; justify-content: space-between;
    }
    .fb-title  { font-size: 14px; font-weight: 700; }
    .fb-close  { background: none; border: none; color: rgba(255,255,255,0.7); font-size: 18px; cursor: pointer; }
    .fb-close:hover { color: #fff; }
    .fb-body   { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
    .fb-sub    { font-size: 12px; color: var(--gray-md); }
    .fb-textarea {
      width: 100%; box-sizing: border-box;
      border: 1px solid var(--border); border-radius: 6px;
      padding: 10px 12px; font-size: 13px; font-family: inherit;
      color: #374151; resize: vertical; min-height: 100px;
      transition: border-color 0.15s; outline: none;
    }
    .fb-textarea:focus { border-color: var(--cyan); }
    .fb-footer { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
    .fb-char   { font-size: 11px; color: var(--gray-md); flex: 1; }
    .fb-send {
      background: var(--navy); color: var(--white);
      border: none; border-radius: 6px; padding: 8px 18px;
      font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.15s;
    }
    .fb-send:hover    { background: #004f80; }
    .fb-send:disabled { opacity: 0.5; pointer-events: none; }
    .fb-status { font-size: 12px; padding: 8px 12px; border-radius: 6px; display: none; }
    .fb-status.ok  { background: var(--green-bg); color: var(--green-txt); display: block; }
    .fb-status.err { background: var(--red-bg);   color: var(--red-txt);   display: block; }

    .brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

    .brand img { height: 30px; width: auto; display: block; }

    .brand-divider {
      width: 1px;
      height: 24px;
      background: rgba(255,255,255,0.2);
    }

    .brand-title {
      font-size: 13px;
      font-weight: 600;
      color: rgba(255,255,255,0.9);
      letter-spacing: 0.01em;
    }

    .header-sep { flex: 1; }

    .header-meta {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .header-range {
      font-size: 12px;
      color: rgba(255,255,255,0.55);
    }

    .header-date {
      font-size: 12px;
      color: rgba(255,255,255,0.85);
      font-weight: 500;
    }

    .btn-refresh {
      font-size: 12px;
      color: rgba(255,255,255,0.7);
      background: rgba(255,255,255,0.08);
      border: 1px solid rgba(255,255,255,0.18);
      border-radius: 6px;
      padding: 5px 12px;
      cursor: pointer;
      transition: background 0.15s, color 0.15s;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .btn-refresh:hover {
      background: rgba(255,255,255,0.15);
      color: #fff;
    }

    .btn-refresh.loading { opacity: 0.6; pointer-events: none; }

    /* ── Feedback button ── */
    .btn-feedback {
      font-size: 12px;
      color: rgba(255,255,255,0.7);
      background: rgba(255,255,255,0.08);
      border: 1px solid rgba(255,255,255,0.18);
      border-radius: 6px;
      padding: 5px 12px;
      cursor: pointer;
      transition: background 0.15s, color 0.15s;
      white-space: nowrap;
    }
    .btn-feedback:hover { background: rgba(255,255,255,0.15); color: #fff; }
    .user-profile-wrap { position: relative; }
    .user-profile-dropdown {
      display: none; position: absolute; right: 0; top: 100%;
      background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
      padding: 14px 16px; min-width: 230px;
      box-shadow: 0 6px 20px rgba(0,0,0,.14); z-index: 300;
    }
    .user-profile-wrap:hover .user-profile-dropdown { display: block; }

    /* ── Feedback modal ── */
    .fb-modal-overlay {
      display: none; position: fixed; inset: 0; z-index: 999;
      background: rgba(0,0,0,0.45);
      align-items: flex-end;
      justify-content: flex-end;
      padding: 80px 24px 24px;
    }
    .fb-modal-overlay.open { display: flex; }
    .fb-modal {
      background: var(--white);
      border-radius: 12px;
      width: 360px;
      max-width: calc(100vw - 48px);
      box-shadow: 0 12px 40px rgba(0,57,90,0.22);
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }
    .fb-header {
      background: var(--navy);
      color: var(--white);
      padding: 14px 18px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .fb-title { font-size: 14px; font-weight: 700; letter-spacing: 0.01em; }
    .fb-close  { background: none; border: none; color: rgba(255,255,255,0.7); font-size: 18px; cursor: pointer; line-height: 1; padding: 0 2px; }
    .fb-close:hover { color: #fff; }
    .fb-body   { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
    .fb-sub    { font-size: 12px; color: var(--gray-md); line-height: 1.5; }
    .fb-textarea {
      width: 100%; box-sizing: border-box;
      border: 1px solid var(--border); border-radius: 6px;
      padding: 10px 12px; font-size: 13px; font-family: inherit;
      color: #374151; resize: vertical; min-height: 100px;
      transition: border-color 0.15s;
      outline: none;
    }
    .fb-textarea:focus { border-color: var(--cyan); }
    .fb-footer { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
    .fb-char   { font-size: 11px; color: var(--gray-md); flex: 1; }
    .fb-send {
      background: var(--navy); color: var(--white);
      border: none; border-radius: 6px;
      padding: 8px 18px; font-size: 13px; font-weight: 600;
      cursor: pointer; transition: background 0.15s;
    }
    .fb-send:hover    { background: #004f80; }
    .fb-send:disabled { opacity: 0.5; pointer-events: none; }
    .fb-status { font-size: 12px; padding: 8px 12px; border-radius: 6px; display: none; }
    .fb-status.ok  { background: #ecfdf5; color: #065f46; display: block; }
    .fb-status.err { background: #fef2f2; color: #991b1b; display: block; }

    /* ── Main ── */
    .main {
      max-width: 1400px;
      margin: 0 auto;
      padding: 24px;
      display: flex;
      flex-direction: column;
      gap: 24px;
    }

    /* ── Section label ── */
    .section-label {
      font-size: 11px;
      font-weight: 600;
      color: var(--navy);
      text-transform: uppercase;
      letter-spacing: 0.07em;
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      gap: 7px;
    }

    /* ── Skeletons ── */
    .skeleton {
      background: linear-gradient(90deg, #e9ecef 25%, #dee2e6 50%, #e9ecef 75%);
      background-size: 200% 100%;
      animation: shimmer 1.5s ease-in-out infinite;
      border-radius: 6px;
    }

    @keyframes shimmer {
      0%   { background-position: 200% 0; }
      100% { background-position: -200% 0; }
    }

    .skeleton-card {
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 16px;
    }

    /* ── KPI Ticker ── */
    .ticker-outer {
      overflow: hidden;
      position: relative;
      background: #0b1829;
      border-radius: 8px;
      height: 50px;
      border: 1px solid #1a2e42;
      flex-shrink: 0;
    }

    /* gradient edge fade */
    .ticker-outer::before,
    .ticker-outer::after {
      content: '';
      position: absolute;
      top: 0; bottom: 0;
      width: 80px;
      z-index: 2;
      pointer-events: none;
    }
    .ticker-outer::before { left:  0; background: linear-gradient(to right, #0b1829 20%, transparent); }
    .ticker-outer::after  { right: 0; background: linear-gradient(to left,  #0b1829 20%, transparent); }

    .ticker-track {
      display: flex;
      align-items: center;
      height: 100%;
      white-space: nowrap;
      will-change: transform;
      animation: ticker-scroll 55s linear infinite;
    }
    .ticker-track:hover { animation-play-state: paused; }

    @keyframes ticker-scroll {
      0%   { transform: translateX(0); }
      100% { transform: translateX(-50%); }
    }

    .ticker-item {
      display: inline-flex;
      align-items: center;
      gap: 9px;
      padding: 0 28px;
      border-right: 1px solid #1a2e42;
      height: 100%;
    }

    .ticker-lbl {
      font-size: 10px;
      font-weight: 700;
      color: #4a6282;
      text-transform: uppercase;
      letter-spacing: 0.09em;
      font-family: system-ui, sans-serif;
    }

    .ticker-val {
      font-family: 'Courier New', monospace;
      font-size: 15px;
      font-weight: 700;
      color: #e2e8f0;
      letter-spacing: -0.3px;
    }

    .ticker-chg {
      font-family: 'Courier New', monospace;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.01em;
    }

    .ticker-up   { color: #22c55e; }
    .ticker-down { color: #f43f5e; }
    .ticker-flat { color: #4a6282; }

    /* ── KPI Cards ── */
    .kpi-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 12px;
    }

    @media (max-width: 1024px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
    @media (max-width: 600px)  { .kpi-grid { grid-template-columns: 1fr; } }

    .kpi-card {
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 16px;
      position: relative;
    }

    .kpi-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      margin-bottom: 6px;
    }

    .kpi-name {
      font-size: 11px;
      font-weight: 500;
      color: var(--gray-md);
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    .info-btn {
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: none;
      border: 1px solid var(--gray-lt);
      color: var(--gray-md);
      font-size: 10px;
      font-weight: 700;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      line-height: 1;
      flex-shrink: 0;
      transition: border-color 0.15s, color 0.15s;
    }

    .info-btn:hover { border-color: var(--cyan); color: var(--cyan); }

    .kpi-row {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 10px;
    }

    .kpi-value {
      font-size: 26px;
      font-weight: 700;
      color: var(--navy);
      line-height: 1;
      letter-spacing: -0.5px;
    }

    .kpi-badge {
      font-size: 11px;
      font-weight: 600;
      padding: 2px 7px;
      border-radius: 4px;
      white-space: nowrap;
    }

    .badge-up   { background: var(--green-bg); color: var(--green-txt); }
    .badge-down { background: var(--red-bg);   color: var(--red-txt);   }
    .badge-flat { background: #F3F4F6;          color: var(--gray-md);   }

    .kpi-divider { width: 100%; height: 1px; background: var(--gray-lt); margin-bottom: 10px; }

    .kpi-prior { display: flex; gap: 20px; }

    .kpi-prior-item { display: flex; flex-direction: column; gap: 1px; }

    .kpi-prior-label {
      font-size: 10px;
      color: var(--gray-md);
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .kpi-prior-val {
      font-size: 13px;
      font-weight: 500;
      color: #374151;
    }

    /* ── Definition modal ── */
    .modal-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,57,90,0.35);
      z-index: 200;
      align-items: center;
      justify-content: center;
    }

    .modal-overlay.open { display: flex; }

    .modal-box {
      background: var(--white);
      border-radius: 10px;
      padding: 24px 28px;
      max-width: 480px;
      width: calc(100% - 32px);
      box-shadow: 0 8px 32px rgba(0,57,90,0.18);
      max-height: 80vh;
      overflow-y: auto;
      min-width: 320px;
    }
    .modal-box::-webkit-scrollbar { width: 5px; }
    .modal-box::-webkit-scrollbar-track { background: transparent; }
    .modal-box::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; }
    .modal-box::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

    .modal-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 12px;
    }

    .modal-title {
      font-size: 14px;
      font-weight: 700;
      color: var(--navy);
    }

    .modal-close {
      background: none;
      border: none;
      font-size: 18px;
      color: var(--gray-md);
      cursor: pointer;
      line-height: 1;
      padding: 0 2px;
    }

    .modal-close:hover { color: var(--navy); }

    .modal-text {
      font-size: 13px;
      color: #374151;
      line-height: 1.7;
    }
    .modal-text ul { margin: 8px 0 8px 18px; padding: 0; }
    .modal-text li { margin-bottom: 4px; }
    .modal-text strong { color: var(--navy); }
    .modal-text .def-formula { background:#f1f5f9; border-left:3px solid var(--cyan); padding:6px 10px; border-radius:0 4px 4px 0; font-family:monospace; font-size:12px; margin:8px 0; display:block; }

    /* info-btn inside th — prevent sort click propagation confusion */
    .kpi-tbl th .info-btn { display:inline-flex; vertical-align:middle; margin-left:5px; }
    /* info-btn inside sig-stat tile */
    .sig-info { position:absolute; top:4px; right:4px; width:13px; height:13px; font-size:8px; }
    .sig-stat { position:relative; }

    /* ── Charts ── */
    .charts-row {
      display: grid;
      grid-template-columns: 1.5fr 1fr;
      gap: 16px;
    }

    @media (max-width: 900px) { .charts-row { grid-template-columns: 1fr; } }

    .chart-card {
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 20px;
    }

    .chart-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 6px;
      flex-wrap: wrap;
      gap: 8px;
    }

    .chart-title {
      font-size: 13px;
      font-weight: 600;
      color: var(--navy);
    }

    .chart-subtitle {
      font-size: 11px;
      color: var(--gray-md);
      margin-bottom: 8px;
    }

    .delta-summary {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin: 0 0 12px;
    }

    .delta-chip {
      font-size: 11px;
      border: 1px solid var(--border);
      border-radius: 999px;
      padding: 3px 10px;
      color: #334155;
      background: #f8fafc;
    }

    .delta-chip.up {
      color: #065f46;
      background: #ecfdf5;
      border-color: #bbf7d0;
    }

    .delta-chip.down {
      color: #991b1b;
      background: #fef2f2;
      border-color: #fecaca;
    }

    .chart-select {
      font-size: 12px;
      color: #374151;
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 4px 8px;
      outline: none;
      cursor: pointer;
    }

    .chart-select:focus { border-color: var(--cyan); }

    .chart-legend {
      display: flex;
      gap: 16px;
      margin-bottom: 14px;
      flex-wrap: wrap;
    }

    .legend-item {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 11px;
      color: var(--gray-md);
    }

    .legend-dot { width: 8px; height: 8px; border-radius: 50%; }
    .legend-dash {
      width: 16px;
      height: 2px;
      border-top: 2px dashed;
      display: inline-block;
    }

    .chart-wrap { position: relative; height: 240px; }

    /* ── Location table ── */
    .table-card {
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: 8px;
      overflow: hidden;
    }

    table { width: 100%; border-collapse: collapse; }

    thead { background: #F4F6F7; border-bottom: 1px solid var(--border); }

    th {
      font-size: 11px;
      font-weight: 600;
      color: var(--navy);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      padding: 10px 16px;
      text-align: left;
      white-space: nowrap;
    }

    th:not(:first-child) { text-align: right; }

    td {
      padding: 10px 16px;
      font-size: 13px;
      color: #374151;
      border-bottom: 1px solid #F3F4F6;
      white-space: nowrap;
    }

    td:not(:first-child) { text-align: right; font-weight: 500; }

    tr:last-child td { border-bottom: none; }
    tbody tr:hover td { background: #F8FAFB; }

    .bar-wrap { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }

    .bar-track {
      width: 80px;
      height: 4px;
      background: var(--gray-lt);
      border-radius: 2px;
      flex-shrink: 0;
    }

    .bar-fill { height: 100%; border-radius: 2px; }

    .kpi-drill-sub { font-size:11px; color:var(--gray-md); margin:0; }

    /* ── KPI Table v2 ── */
    .kpi-tbl { width:100%; border-collapse:collapse; }
    .kpi-tbl thead tr { background:#f1f5f9; }
    .kpi-tbl th {
      font-size:10px; font-weight:700; color:#475569; text-transform:uppercase;
      letter-spacing:0.07em; padding:10px 16px; white-space:nowrap;
      border-bottom:2px solid #dde3ea; text-align:left;
    }
    .kpi-tbl th:not(:first-child) { text-align:right; }
    .kpi-tbl th.ks { cursor:pointer; user-select:none; }
    .kpi-tbl th.ks:hover { background:#e2e8f0; color:var(--navy); }
    .kpi-tbl th.ks-on { color:var(--navy); }
    .kpi-tbl th.ks-on::after { content:' ↓'; font-weight:400; }
    .kpi-tbl th.ks-on.ks-asc::after { content:' ↑'; }
    .kpi-tbl td { padding:10px 16px; border-bottom:1px solid #f1f5f9; vertical-align:middle; white-space:nowrap; }
    .kpi-tbl td:not(:first-child) { text-align:right; }
    .kpi-tbl tbody tr:last-child td { border-bottom:none; }

    /* Practice rows */
    .prow { cursor:pointer; }
    .prow td:first-child { border-left:4px solid transparent; padding-left:12px; }
    .prow:hover td { background:#f8fafc; }
    .prow.sig-red    td:first-child { border-left-color:#dc2626; }
    .prow.sig-amber  td:first-child { border-left-color:#d97706; }
    .prow.sig-green  td:first-child { border-left-color:#16a34a; }

    /* Practice name cell */
    .pname-cell { display:flex; align-items:center; gap:7px; }
    .caret-icon { font-size:8px; color:#94a3b8; transition:transform 0.15s; flex-shrink:0; }
    .caret-icon.open { transform:rotate(90deg); }
    .pabbr { font-size:9px; font-weight:700; background:var(--navy); color:var(--white); border-radius:3px; padding:2px 5px; letter-spacing:0.04em; font-family:monospace; flex-shrink:0; }
    .pname { font-size:12px; font-weight:600; color:var(--navy); white-space:normal; line-height:1.3; }

    /* Location rows */
    .lrow td { background:#f9fafb; border-left:3px solid transparent; }
    .lrow td:first-child { padding-left:36px; border-left:3px solid #bae6fd; color:#374151; font-weight:500; font-size:12px; white-space:normal; }
    .lrow:hover td { background:#f0f8ff; }

    /* Metric cells */
    .mc { display:flex; flex-direction:column; align-items:flex-end; gap:2px; }
    .mc-val { font-size:13px; font-weight:700; color:#111827; }
    .mc-row { display:flex; align-items:center; gap:6px; justify-content:flex-end; }
    .mc-yoy { font-size:10px; font-weight:700; }
    .mc-yoy.up { color:#16a34a; }
    .mc-yoy.dn { color:#dc2626; }
    .mc-yoy.fl { color:#9ca3af; }
    .mc-y2  { font-size:10px; color:#9ca3af; font-weight:500; }

    /* Production mini-bar */
    .prod-bar { width:72px; height:3px; background:#e5e7eb; border-radius:2px; overflow:hidden; margin-top:3px; align-self:flex-end; }
    .prod-bar-fill { height:100%; border-radius:2px; background:var(--cyan); transition:width 0.3s; }

    /* ── Error ── */
    .error-wrap { display: none; padding: 80px 20px; text-align: center; }
    .error-wrap.active { display: block; }
    .error-icon { font-size: 32px; margin-bottom: 12px; }
    .error-title { font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
    .error-msg { font-size: 13px; color: var(--gray-md); max-width: 440px; margin: 0 auto 20px; line-height: 1.6; }
    .error-code {
      display: inline-block; text-align: left;
      background: #F4F6F7; border: 1px solid var(--border); border-radius: 8px;
      padding: 14px 20px; font-family: 'Courier New', monospace;
      font-size: 12px; color: #374151; line-height: 1.8;
    }

    /* ── Footer ── */
    .footer {
      border-top: 1px solid var(--border);
      padding-top: 16px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
    }

    .footer-text { font-size: 11px; color: var(--gray-md); }

    /* ── Tab bar ── */
    .tab-bar {
      background: var(--white);
      border-bottom: 1px solid var(--border);
      position: sticky;
      top: 56px;
      z-index: 30;
    }

    .tab-bar-inner {
      max-width: 1400px;
      margin: 0 auto;
      padding: 0 24px;
      display: flex;
    }

    .tab-btn {
      font-size: 13px;
      font-weight: 500;
      color: var(--gray-md);
      background: none;
      border: none;
      border-bottom: 2px solid transparent;
      padding: 10px 16px;
      cursor: pointer;
      transition: color 0.15s, border-color 0.15s;
      margin-bottom: -1px;
    }

    .tab-btn:hover { color: var(--navy); }
    .tab-btn.active { color: var(--navy); border-bottom-color: var(--cyan); font-weight: 600; }

    /* ── Audit tab ── */
    .audit-summary {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 12px;
    }

    @media (max-width: 768px) { .audit-summary { grid-template-columns: repeat(2, 1fr); } }

    .audit-stat {
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 16px;
    }

    .audit-stat-label {
      font-size: 11px;
      font-weight: 500;
      color: var(--gray-md);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin-bottom: 6px;
    }

    .audit-stat-value {
      font-size: 26px;
      font-weight: 700;
      color: var(--navy);
      line-height: 1;
    }

    .audit-filter-bar {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
    }

    .audit-search {
      flex: 1;
      min-width: 200px;
      font-size: 13px;
      color: var(--text);
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 7px 12px;
      outline: none;
    }

    .audit-search:focus { border-color: var(--cyan); }

    .audit-status-sel {
      font-size: 13px;
      color: var(--text);
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 7px 10px;
      outline: none;
      cursor: pointer;
    }

    .audit-status-sel:focus { border-color: var(--cyan); }

    .badge-success { background: var(--green-bg); color: var(--green-txt); }
    .badge-error   { background: var(--red-bg);   color: var(--red-txt);   }

    .call-row { cursor: pointer; }
    .call-row:hover td { background: #F8FAFB; }
    .call-row.expanded td { background: #F0F9FF; }

    .detail-row { display: none; }
    .detail-row.open { display: table-row; }
    .detail-row td { padding: 0 !important; border-bottom: 1px solid var(--border) !important; }

    .detail-inner {
      padding: 12px 16px;
      background: #FAFBFC;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px;
    }

    @media (max-width: 768px) { .detail-inner { grid-template-columns: 1fr; } }

    .detail-section-title {
      font-size: 11px;
      font-weight: 600;
      color: var(--navy);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin-bottom: 8px;
    }

    .detail-json {
      font-family: 'Courier New', monospace;
      font-size: 11px;
      color: #374151;
      background: var(--white);
      border: 1px solid var(--border);
      border-radius: 4px;
      padding: 8px 10px;
      white-space: pre-wrap;
      word-break: break-all;
      max-height: 200px;
      overflow-y: auto;
      margin: 0;
    }

    .expand-arrow {
      display: inline-block;
      transition: transform 0.15s;
      font-size: 10px;
      color: var(--gray-md);
    }

    .call-row.expanded .expand-arrow { transform: rotate(90deg); }

    /* ── Location Scatter ── */
    .q-legend { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; align-items:center; }
    .q-chip { font-size:11px; font-weight:600; padding:3px 10px; border-radius:999px; }
    .q-chip.q-red   { background:#FEF2F2; color:#991b1b; border:1px solid #fecaca; }
    .q-chip.q-amber { background:#FFFBEB; color:#92400e; border:1px solid #fde68a; }
    .q-chip.q-green { background:#ECFDF5; color:#065f46; border:1px solid #bbf7d0; }
    .q-hint { font-size:11px; color:var(--text-muted); }

    .sig-bar { display:flex; gap:8px; margin:14px 0 6px; flex-wrap:wrap; }
    .view-toggle { display:inline-flex; border:1px solid var(--border); border-radius:6px; overflow:hidden; }
    .view-toggle-btn { padding:4px 12px; font-size:11px; font-weight:600; background:#f8fafc; border:none; cursor:pointer; color:var(--gray-md); transition:background 0.15s, color 0.15s; letter-spacing:0.03em; }
    .view-toggle-btn:not(:last-child) { border-right:1px solid var(--border); }
    .view-toggle-btn.view-toggle-active { background:var(--navy); color:var(--white); }
    .sig-stat { flex:1; min-width:80px; background:#F8FAFC; border:1px solid var(--border); border-radius:6px; padding:8px 12px; text-align:center; cursor:pointer; user-select:none; transition:transform 0.1s, box-shadow 0.1s; }
    .sig-stat:hover { transform:translateY(-1px); box-shadow:0 3px 8px rgba(0,0,0,0.1); }
    .sig-stat-val { font-size:22px; font-weight:700; line-height:1.2; display:block; }
    .sig-stat-lbl { font-size:10px; font-weight:500; text-transform:uppercase; letter-spacing:0.06em; color:var(--gray-md); display:block; margin-top:2px; }
    .sig-stat.s-red   .sig-stat-val { color:#dc2626; }
    .sig-stat.s-amber .sig-stat-val { color:#d97706; }
    .sig-stat.s-green .sig-stat-val { color:#16a34a; }
    .sig-stat.s-navy  .sig-stat-val { color:var(--navy); }
    .sig-stat.sig-active.s-red   { outline:2px solid #dc2626; outline-offset:2px; background:#fef2f2; }
    .sig-stat.sig-active.s-amber { outline:2px solid #d97706; outline-offset:2px; background:#fffbeb; }
    .sig-stat.sig-active.s-green { outline:2px solid #16a34a; outline-offset:2px; background:#ecfdf5; }
    .sig-stat.sig-active.s-navy  { outline:2px solid var(--navy); outline-offset:2px; background:#f0f7ff; }

    /* Practice signal dot in KPI table */
    .ps-dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:7px; vertical-align:middle; flex-shrink:0; }
    .ps-dot.ps-red   { background:#dc2626; }
    .ps-dot.ps-amber { background:#d97706; }
    .ps-dot.ps-green { background:#16a34a; }
    .ps-dot.ps-gray  { background:#9ca3af; }

    /* ps-dot still used on lrow name cells */

    .focus-list { border:1px solid #fecaca; border-radius:6px; overflow:hidden; margin-top:10px; }
    .focus-list-hdr { font-size:10px; font-weight:700; color:#991b1b; text-transform:uppercase; letter-spacing:0.07em; padding:7px 14px; background:#FEF2F2; border-bottom:1px solid #fecaca; }
    .focus-row { display:flex; align-items:center; gap:10px; padding:8px 14px; border-bottom:1px solid #FEF2F2; background:#fff; }
    .focus-row:last-child { border-bottom:none; }
    .focus-row:hover { background:#FFF8F8; }
    .focus-name { flex:1; font-size:12px; font-weight:600; color:#1f2937; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .focus-sub  { font-size:10px; color:#6b7280; font-weight:400; }
    .focus-metric { display:flex; flex-direction:column; align-items:flex-end; min-width:64px; }
    .focus-metric-lbl { font-size:9px; color:#9ca3af; text-transform:uppercase; letter-spacing:0.05em; }
    .focus-metric-val { font-size:11px; font-weight:700; }
    .focus-metric-val.m-down { color:#dc2626; }
    .focus-metric-val.m-up   { color:#16a34a; }
    .focus-metric-val.m-flat { color:#6b7280; }

    /* ── Visibility ── */
    #loading   { display: none; }
    #loading.active { display: flex; }
    #dashboard { display: none; }

    /* ── WTD Breakdown Modal ── */
    .wtd-modal-box { max-width: 700px; width: 95vw; }
    .modal-sub { font-size: .8rem; color: #666; margin: -8px 0 14px; }
    .wtd-tbl-wrap { overflow-x: auto; max-height: 60vh; overflow-y: auto; }
    .wtd-tbl { width: 100%; border-collapse: collapse; font-size: .82rem; }
    .wtd-tbl thead { position: sticky; top: 0; z-index: 1; }
    .wtd-tbl th { background: #00395A; color: #fff; padding: 7px 10px; text-align: right; white-space: nowrap; }
    .wtd-tbl th[onclick] { cursor: pointer; user-select: none; }
    .wtd-tbl th[onclick]:hover { background: #004d78; }
    .th-sort { color: rgba(255,255,255,0.35); font-size: 9px; margin-left: 4px; vertical-align: middle; }
    .th-sort.on { color: #fff; }
    .wtd-tbl th:first-child { text-align: left; }
    .wtd-tbl td { padding: 6px 10px; border-bottom: 1px solid #eee; text-align: right; white-space: nowrap; }
    .wtd-tbl td:first-child { text-align: left; }
    .wtd-tbl tfoot td { font-weight: 700; background: #f8f9fb; border-top: 2px solid #dde3ea; border-bottom: none; }
    .wtd-prow td { font-weight: 600; background: #f8f9fb; cursor: pointer; }
    .wtd-prow:hover td { background: #eef3f8; }
    .wtd-lrow td:first-child { padding-left: 28px; color: #555; }
    .wtd-lrow { display: none; }
    .wtd-lrow.open { display: table-row; }
    #goals-heatmap-wrap { max-height:62vh; overflow-y:auto; }
    #goals-alerts [onclick]:hover { background:#f8fafc !important; }
    .hm-practice-row td { background:#f0f4f8;cursor:default; }
    .hm-loc-row { display: table-row; }
    .hm-loc-row:hover td { background:rgba(0,0,0,0.03); }
    .wtd-badge { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: .78rem; font-weight: 600; }
    .wtd-badge.up   { background: #e6f4ea; color: #1a7c3a; }
    .wtd-badge.dn   { background: #fdecea; color: #c0392b; }
    .wtd-badge.flat { background: #f0f0f0; color: #666; }
    .kpi-card.clickable { cursor: pointer; transition: box-shadow .15s, transform .15s; }
    .kpi-card.clickable:hover { box-shadow: 0 4px 16px rgba(0,57,90,.18); transform: translateY(-2px); }
    .wtd-loc-count { font-weight: 400; color: #999; font-size: .78rem; }
    .sig-stat-sub { font-size: 10px; color: inherit; opacity: .65; display: block; margin-top: -2px; }

    /* ── AR section ── */
    .ar-aging-tbl { width:100%; border-collapse:collapse; font-size:.82rem; }
    .ar-aging-tbl th { background:#00395A; color:#fff; padding:7px 10px; text-align:right; white-space:nowrap; }
    .ar-aging-tbl th:first-child { text-align:left; }
    .ar-aging-tbl td { padding:6px 10px; border-bottom:1px solid #eee; text-align:right; }
    .ar-aging-tbl td:first-child { text-align:left; white-space:normal; }
    .ar-aging-tbl tfoot td { font-weight:700; background:#f8f9fb; border-top:2px solid #dde3ea; }
    .ar-bucket-105 { color:#c0392b; font-weight:600; }
    .ar-bucket-91  { color:#d97706; }
    .ar-toggle-wrap { display:flex; gap:0; }
    .ar-toggle-btn { padding:3px 10px; font-size:11px; font-weight:600; border:1px solid var(--border); background:#fff; color:var(--gray-md); cursor:pointer; transition:background .15s,color .15s; }
    .ar-toggle-btn:first-child { border-radius:4px 0 0 4px; }
    .ar-toggle-btn:last-child  { border-radius:0 4px 4px 0; border-left:none; }
    .ar-toggle-btn.active { background:var(--navy); color:#fff; border-color:var(--navy); }
    .ar-detail-btn { margin-left:10px; font-size:11px; font-weight:600; color:var(--navy); background:none; border:none; cursor:pointer; padding:0; text-decoration:underline; text-underline-offset:2px; }
    .ar-detail-btn:hover { color:var(--cyan); }
    /* Period toggle */
    .period-toggle-wrap { display:flex; gap:0; margin-bottom:18px; }
    .period-btn { padding:6px 18px; font-size:12px; font-weight:600; border:1px solid var(--border); background:#fff; color:var(--gray-md); cursor:pointer; transition:background .15s,color .15s; }
    .period-btn:first-child { border-radius:6px 0 0 6px; }
    .period-btn:last-child  { border-radius:0 6px 6px 0; }
    .period-btn + .period-btn { border-left:none; }
    .period-btn.active { background:var(--navy); color:#fff; border-color:var(--navy); }

    /* ── Business Health Tab ── */
    .bh-controls { display:flex; align-items:flex-end; gap:14px; flex-wrap:wrap; margin-bottom:18px; background:#fff; border:1px solid var(--border); border-radius:8px; padding:12px 14px; }
    .bh-control-group { display:flex; flex-direction:column; gap:4px; }
    .bh-label { font-size:11px; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:.05em; }
    .bh-month-input { height:34px; border:1px solid var(--border); border-radius:6px; padding:0 10px; font-size:13px; outline:none; background:#fff; }
    .bh-month-input:focus { border-color:var(--navy); }
    .bh-load-btn { height:34px; padding:0 20px; background:var(--navy); color:#fff; border:none; border-radius:6px; font-size:13px; font-weight:600; cursor:pointer; }
    .bh-load-btn:hover { background:#005080; }
    .bh-load-btn:disabled { background:#b0bec5; cursor:not-allowed; }
    .bh-count { font-size:12px; color:var(--text-muted); align-self:center; }
    .bh-col-toggles { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-bottom:10px; }
    .bh-toggle-label { font-size:11px; font-weight:600; color:var(--text-muted); text-transform:uppercase; margin-right:4px; }
    .bh-col-btn { padding:4px 12px; font-size:12px; font-weight:500; border:1px solid var(--border); border-radius:4px; background:#fff; color:var(--text-muted); cursor:pointer; transition:all .15s; }
    .bh-col-btn.active { background:var(--navy); color:#fff; border-color:var(--navy); }
    .bh-table-wrap { overflow-x:auto; background:#fff; border:1px solid var(--border); border-radius:8px; }
    .bh-tbl { width:100%; border-collapse:collapse; font-size:12px; white-space:nowrap; }
    .bh-tbl th { background:var(--navy); color:#fff; padding:8px 12px; text-align:right; font-size:11px; font-weight:600; cursor:pointer; user-select:none; position:sticky; top:0; white-space:nowrap; }
    .bh-tbl th:first-child, .bh-tbl th:nth-child(2), .bh-tbl th:nth-child(3) { text-align:left; }
    .bh-tbl th.sort-asc::after  { content:' ↑'; opacity:.8; }
    .bh-tbl th.sort-desc::after { content:' ↓'; opacity:.8; }
    .bh-tbl th.bh-group-funnel     { background:#00395A; }
    .bh-tbl th.bh-group-conversion { background:#005580; }
    .bh-tbl th.bh-group-production { background:#006080; }
    .bh-tbl th.bh-group-financial  { background:#006a80; }
    .bh-tbl td { padding:7px 12px; border-bottom:1px solid #f0f0f0; text-align:right; color:var(--text); }
    .bh-tbl td:first-child, .bh-tbl td:nth-child(2), .bh-tbl td:nth-child(3) { text-align:left; font-weight:500; }
    .bh-tbl tr:hover td { background:#f5f8fb; }
    .bh-tbl tr:last-child td { border-bottom:none; }
    .bh-tbl td.bh-loc  { color:var(--navy); font-weight:600; }
    .bh-tbl td.bh-pct-good { color:#1a7c3a; font-weight:600; }
    .bh-tbl td.bh-pct-mid  { color:#b45309; font-weight:600; }
    .bh-tbl td.bh-pct-bad  { color:#c0392b; font-weight:600; }
    .bh-tbl .bh-col-funnel, .bh-tbl .bh-col-conversion, .bh-tbl .bh-col-production, .bh-tbl .bh-col-financial { transition:opacity .15s; }
    .bh-tbl .bh-col-hidden { display:none; }
    .bh-state { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; padding:40px 24px; color:var(--text-muted); text-align:center; }
    .bh-state-title { font-size:15px; font-weight:600; color:var(--navy); }
    .bh-state-sub { font-size:13px; }

    /* Loading steps */
    .bh-load-steps { text-align:left; display:inline-block; }
    .bh-load-step  { display:flex; align-items:center; gap:12px; font-size:13px; color:#94a3b8; padding:6px 0; transition:color .25s; }
    .bh-load-step .bls-icon { width:18px; height:18px; display:flex; align-items:center; justify-content:center; font-size:15px; font-weight:700; flex-shrink:0; position:relative; }
    /* pending: dim hollow ring */
    .bh-load-step.pending .bls-icon::before { content:''; display:block; width:12px; height:12px; border:2px solid #e2e8f0; border-radius:50%; }
    /* working: blue spinning ring */
    .bh-load-step.working .bls-icon::before { content:''; display:block; width:12px; height:12px; border:2px solid #dbeafe; border-top-color:#3b82f6; border-radius:50%; animation:bls-spin .6s linear infinite; }
    .bh-load-step.working { color:#1e40af; }
    /* done: green check */
    .bh-load-step.done    { color:#16a34a; }
    .bh-load-step.done .bls-icon { color:#16a34a; }
    /* error: red X */
    .bh-load-step.error   { color:#dc2626; }
    .bh-load-step.error .bls-icon { color:#dc2626; }
    @keyframes bls-spin { to { transform:rotate(360deg) } }
    .bh-stat-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:12px; margin-bottom:4px; }
    .bh-stat-card { background:#fff; border:1px solid var(--border); border-radius:8px; padding:14px 16px; }
    .bh-kpi-card { padding:16px; }
    .bh-kpi-card .kpi-row { margin-bottom:4px; }
    .bh-kpi-card .kpi-name { color:var(--gray-md); font-weight:500; }
    .bh-grade-chip.clickable { cursor:pointer; transition:opacity .15s,transform .15s; }
    .bh-grade-chip.clickable:hover { opacity:.85; transform:translateY(-2px); }
    .bh-stat-label { font-size:11px; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:.05em; margin-bottom:6px; }
    .bh-stat-value { font-size:24px; font-weight:700; color:var(--navy); line-height:1; }
    .bh-kpi-row { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; margin-bottom:2px; }
    @media (max-width:1200px) { .bh-kpi-row { grid-template-columns:repeat(3,1fr); } }
    @media (max-width:760px)  { .bh-kpi-row { grid-template-columns:repeat(2,1fr); } }
    @media (max-width:520px)  { .bh-kpi-row { grid-template-columns:1fr; } }
    .bh-two-col { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
    @media (max-width:980px)  { .bh-two-col { grid-template-columns:1fr; } }
    .bh-kpi-sub { font-size:10px; color:var(--text-muted); margin-top:5px; }
    .bh-health-chip { display:inline-block; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; padding:2px 7px; border-radius:999px; }
    .bh-health-chip.strong { background:#e6f4ea; color:#1a7c3a; }
    .bh-health-chip.watch  { background:#fef3cd; color:#92600a; }
    .bh-health-chip.risk   { background:#fdecea; color:#c0392b; }

    /* Featured Health Score tile */
    .bh-kpi-featured {
      background: linear-gradient(120deg, #00395A 0%, #005080 60%, #0066A1 100%);
      border: none;
      color: white;
    }
    .bh-kpi-featured .kpi-name { color: rgba(255,255,255,0.65); font-weight:500; }
    .bh-kpi-featured .kpi-value { color: white; font-size: 44px; line-height: 1; }
    .bh-kpi-featured .kpi-prior-label,
    .bh-kpi-featured .kpi-prior-val { color: rgba(255,255,255,0.55); }
    .bh-kpi-featured .kpi-divider { border-color: rgba(255,255,255,0.15); }
    .bh-kpi-featured .badge-up   { background: rgba(134,239,172,0.2); color: #86efac; }
    .bh-kpi-featured .badge-down { background: rgba(252,165,165,0.2); color: #fca5a5; }
    .bh-kpi-featured .badge-flat { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.5); }
    .bh-kpi-featured .info-btn   { background: rgba(255,255,255,0.15); color: rgba(255,255,255,0.8); border-color: rgba(255,255,255,0.25); }
    .bh-kpi-featured .info-btn:hover { background: rgba(255,255,255,0.25); }
    .bh-kpi-featured .bh-health-chip.strong { background: rgba(134,239,172,0.2); color: #86efac; }
    .bh-kpi-featured .bh-health-chip.watch  { background: rgba(253,230,138,0.2); color: #fde68a; }
    .bh-kpi-featured .bh-health-chip.risk   { background: rgba(252,165,165,0.2); color: #fca5a5; }
    .bh-kpi-featured .bh-kpi-sub { color: rgba(255,255,255,0.5); }
    .bh-funnel { display:flex; flex-direction:column; gap:10px; }
    .bh-funnel-stage { display:flex; align-items:center; gap:10px; }
    .bh-funnel-label { width:116px; font-size:11px; font-weight:600; color:var(--navy); text-transform:uppercase; flex-shrink:0; }
    .bh-funnel-bar-wrap { flex:1; background:#eef0f3; border-radius:5px; height:32px; overflow:hidden; }
    .bh-funnel-bar-fill { height:100%; background:linear-gradient(90deg,#00395A,#006c8f); border-radius:5px; display:flex; align-items:center; padding-left:9px; min-width:2px; }
    .bh-funnel-bar-val { color:#fff; font-size:12px; font-weight:700; white-space:nowrap; }
    .bh-funnel-pct { width:46px; text-align:right; font-size:12px; font-weight:700; color:var(--navy); }
    .bh-funnel-drop { width:130px; text-align:right; font-size:11px; white-space:nowrap; }
    .bh-funnel-drop.good  { color:#1a7c3a; }
    .bh-funnel-drop.warn  { color:#92600a; }
    .bh-funnel-drop.bad   { color:#c0392b; }
    .bh-quality-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; height:100%; align-content:space-between; }
    @media (max-width:560px) { .bh-quality-grid { grid-template-columns:1fr; } }
    .bh-quality-card { background:#f8fbff; border:1px solid #dce8f5; border-radius:8px; padding:10px 12px; }
    .bh-quality-label { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--text-muted); }
    .bh-quality-val { font-size:20px; font-weight:800; color:var(--navy); line-height:1.1; margin-top:4px; }
    .bh-quality-detail { font-size:11px; color:var(--text-muted); margin-top:4px; }
    .bh-health-bar-wrap { background:#edf2f7; border-radius:999px; height:8px; overflow:hidden; margin-top:6px; }
    .bh-health-bar { height:100%; border-radius:999px; }
    .bh-health-val { font-size:12px; font-weight:700; color:var(--navy); }
    .bh-pill { display:inline-block; padding:2px 8px; border-radius:999px; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
    .bh-pill.p-high { background:#fdecea; color:#c0392b; }
    .bh-pill.p-med  { background:#fef3cd; color:#92600a; }
    .bh-pill.p-low  { background:#e6f4ea; color:#1a7c3a; }
    .bh-pill.o-ops  { background:#e8f4fd; color:#1565c0; }
    .bh-pill.o-fin  { background:#ecfdf5; color:#1a7c3a; }
    .bh-pill.o-front { background:#fff7ed; color:#c2410c; }
    .bh-actions-meta { font-size:11px; color:var(--text-muted); text-transform:none; letter-spacing:0; font-weight:400; }
    .bh-tbl td .bh-mono { font-family:monospace; font-size:12px; color:var(--text-muted); }
    .bh-health-strong { color:#1a7c3a; font-weight:700; }
    .bh-health-watch  { color:#92600a; font-weight:700; }
    .bh-health-risk   { color:#c0392b; font-weight:700; }
    .bh-modal-toolbar { display:flex; align-items:center; justify-content:space-between; gap:8px; margin: 4px 0 10px; }
    .bh-modal-back { font-size:11px; font-weight:600; border:1px solid var(--border); background:#fff; color:var(--navy); border-radius:5px; padding:4px 10px; cursor:pointer; display:none; }
    .bh-modal-back:hover { background:#eef4fb; }
    .bh-modal-hint { font-size:11px; color:var(--text-muted); }
    .bh-modal-chart-wrap { border:1px solid var(--border); border-radius:8px; padding:10px 10px 4px; margin-bottom:10px; background:#fff; height:320px; }
    @media (max-width:700px) { .bh-modal-chart-wrap { height:240px; } }

    /* ── Sub-tabs (inside Audit) ── */
    .sub-tab-bar { display:flex; gap:0; border-bottom:2px solid var(--border); margin-bottom:20px; }
    .sub-tab-btn { background:none; border:none; border-bottom:2px solid transparent; margin-bottom:-2px; padding:8px 18px; font-size:13px; font-weight:500; color:var(--text-muted); cursor:pointer; transition:color .15s,border-color .15s; }
    .sub-tab-btn:hover { color:var(--navy); }
    .sub-tab-btn.active { color:var(--navy); border-bottom-color:var(--cyan); font-weight:600; }

    /* ── API Explorer ── */
    #sub-explorer { display:flex; flex-direction:column; height:calc(100vh - 160px); min-height:500px; }
    .exp-layout { display:grid; grid-template-columns:300px 1fr; gap:0; background:#fff; border:1px solid var(--border); border-radius:8px; overflow:hidden; flex:1; min-height:0; }
    @media(max-width:900px){ .exp-layout { grid-template-columns:1fr; } }

    /* Sidebar — fixed height, scrolls internally */
    .exp-sidebar { border-right:1px solid var(--border); display:flex; flex-direction:column; background:#fafbfc; overflow:hidden; }
    .exp-sidebar-search-wrap { padding:12px; border-bottom:1px solid var(--border); flex-shrink:0; }
    .exp-sidebar-search { width:100%; height:34px; border:1px solid var(--border); border-radius:6px; padding:0 10px; font-size:12px; outline:none; background:#fff; }
    .exp-sidebar-search:focus { border-color:var(--navy); }
    .exp-endpoint-list { flex:1; overflow-y:auto; min-height:0; }
    .exp-ep-group-label { padding:8px 12px 4px; font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--text-muted); background:#f0f2f4; border-bottom:1px solid var(--border); position:sticky; top:0; z-index:1; }
    .exp-ep-item { padding:9px 12px; cursor:pointer; border-bottom:1px solid #f0f0f0; transition:background .1s; }
    .exp-ep-item:hover { background:#eef4fb; }
    .exp-ep-item.exp-ep-active { background:#ddeeff; border-left:3px solid var(--navy); padding-left:9px; }
    .exp-ep-path { font-size:13px; font-family:monospace; color:var(--navy); font-weight:600; word-break:break-all; line-height:1.4; }
    .exp-ep-summary-text { font-size:12px; color:var(--text-muted); margin-top:4px; line-height:1.4; }

    /* Detail panel — sticky header, scrollable body */
    .exp-detail { display:flex; flex-direction:column; overflow:hidden; min-height:0; }
    .exp-placeholder { display:flex; flex-direction:column; align-items:center; justify-content:center; flex:1; gap:8px; color:var(--text-muted); padding:60px 24px; text-align:center; }
    .exp-placeholder-icon { font-size:36px; }
    .exp-placeholder-title { font-size:16px; font-weight:600; color:var(--navy); }
    .exp-placeholder-sub { font-size:13px; }
    #exp-detail-panel { display:flex; flex-direction:column; flex:1; min-height:0; overflow:hidden; }
    .exp-detail-header { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:14px 18px; border-bottom:1px solid var(--border); background:#f8f9fb; flex-wrap:wrap; flex-shrink:0; }
    .exp-detail-scrollbody { flex:1; overflow-y:auto; min-height:0; }
    .exp-method-badge { background:var(--navy); color:#fff; font-size:10px; font-weight:700; padding:3px 10px; border-radius:4px; letter-spacing:.08em; flex-shrink:0; }
    .exp-detail-path { font-size:13px; font-family:monospace; color:var(--navy); word-break:break-all; }
    .exp-send-btn { padding:7px 20px; background:var(--navy); color:#fff; border:none; border-radius:6px; font-size:13px; font-weight:600; cursor:pointer; flex-shrink:0; transition:background .15s; white-space:nowrap; }
    .exp-send-btn:hover { background:#005080; }
    .exp-detail-desc { padding:12px 18px; border-bottom:1px solid var(--border); font-size:12px; color:#444; line-height:1.6; background:#fff; }
    .exp-detail-desc strong { display:block; font-size:13px; color:var(--navy); margin-bottom:4px; }
    .exp-params-section { padding:16px 18px; border-bottom:1px solid var(--border); background:#fff; }
    .exp-params-title { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--text-muted); margin-bottom:14px; }
    .exp-params-grid { display:flex; flex-direction:column; gap:14px; }
    .exp-param-row { display:grid; grid-template-columns:220px 1fr; gap:12px; align-items:start; }
    @media(max-width:700px){ .exp-param-row { grid-template-columns:1fr; } }
    .exp-param-meta { display:flex; flex-direction:column; gap:3px; }
    .exp-param-name { font-size:12px; font-weight:700; color:var(--navy); font-family:monospace; }
    .exp-param-type { font-size:10px; color:var(--text-muted); font-family:monospace; }
    .exp-param-desc { font-size:11px; color:#555; line-height:1.4; }
    .exp-param-required { font-size:10px; color:#c0392b; font-weight:600; }
    .exp-param-input { border:1px solid var(--border); border-radius:5px; padding:7px 10px; font-size:12px; outline:none; width:100%; font-family:monospace; transition:border-color .15s; background:#fafbfc; }
    .exp-param-input:focus { border-color:var(--navy); background:#fff; }
    .exp-no-params { padding:14px 18px; font-size:12px; color:var(--text-muted); font-style:italic; border-bottom:1px solid var(--border); }
    .exp-response-section { flex:1; display:flex; flex-direction:column; min-height:0; }
    .exp-request-url { padding:8px 18px; background:#f0f2f5; border-bottom:1px solid var(--border); font-size:11px; font-family:monospace; color:#444; word-break:break-all; line-height:1.5; }
    .exp-request-url-label { font-weight:700; color:var(--navy); margin-right:6px; }
    .exp-response-bar { display:flex; justify-content:space-between; align-items:center; padding:10px 18px; background:#f8f9fb; border-bottom:1px solid var(--border); flex-shrink:0; }
    .exp-response-meta { display:flex; align-items:center; gap:10px; }
    .exp-status-ok  { background:#e6f4ea; color:#1a7c3a; font-size:12px; font-weight:700; padding:3px 9px; border-radius:4px; }
    .exp-status-err { background:#fdecea; color:#c0392b; font-size:12px; font-weight:700; padding:3px 9px; border-radius:4px; }
    .exp-timing { font-size:12px; color:var(--text-muted); }
    .exp-records { font-size:12px; color:var(--navy); font-weight:600; }
    .exp-copy-btn { font-size:11px; padding:5px 12px; border:1px solid var(--border); border-radius:4px; background:#fff; cursor:pointer; }
    .exp-copy-btn:hover { background:#eef4fb; color:var(--navy); }
    .exp-response-body { margin:0; padding:16px 18px; font-size:12px; font-family:monospace; white-space:pre-wrap; word-break:break-all; background:#1a1d2e; color:#a9b1d6; line-height:1.6; min-height:200px; }

    /* ── Patient Conversion Funnel ── */
    .funnel-wrap { padding:8px 0; }
    .funnel-stage { display:flex; align-items:center; gap:12px; margin-bottom:10px; flex-wrap:wrap; }
    .funnel-label { width:120px; font-size:11px; font-weight:600; color:#00395A; text-transform:uppercase; flex-shrink:0; }
    .funnel-bar-wrap { flex:1; min-width:120px; background:#f0f0f0; border-radius:4px; height:32px; position:relative; overflow:hidden; }
    .funnel-bar-fill { height:100%; background:#00395A; border-radius:4px; transition:width .4s ease; display:flex; align-items:center; padding-left:10px; min-width:2px; }
    .funnel-bar-val { color:#fff; font-size:12px; font-weight:700; white-space:nowrap; }
    .funnel-pct { width:48px; text-align:right; font-size:12px; font-weight:700; color:#00395A; flex-shrink:0; }
    .funnel-drop { font-size:11px; color:#c0392b; white-space:nowrap; }
    .leakage-box { background:#fef3cd; border:1px solid #f0c040; border-radius:8px; padding:16px 20px; margin-top:16px; }
    .leakage-box-title { font-size:11px; font-weight:700; text-transform:uppercase; color:#92600a; margin-bottom:4px; }
    .leakage-amount { font-size:24px; font-weight:800; color:#c0392b; }
    .leakage-detail { font-size:11px; color:#666; margin-top:4px; }

    /* ── Benchmark table ── */
    .bm-score-pos { background:#e6f4ea; color:#1a7c3a; padding:2px 8px; border-radius:4px; font-size:11px; font-weight:700; }
    .bm-score-neg { background:#fdecea; color:#c0392b; padding:2px 8px; border-radius:4px; font-size:11px; font-weight:700; }
    .bm-score-neu { background:#f0f0f0; color:#555; padding:2px 8px; border-radius:4px; font-size:11px; font-weight:700; }
    .bm-above { color:#1a7c3a; font-weight:600; }
    .bm-below { color:#c0392b; font-weight:600; }
    .month-nav { display:flex; gap:6px; margin-bottom:12px; flex-wrap:wrap; }
    .month-nav-btn { padding:4px 10px; border:1px solid var(--border); border-radius:4px; background:#fff; cursor:pointer; font-size:12px; }
    .month-nav-btn.active { background:#00395A; color:#fff; border-color:#00395A; }

    /* ── KPI grid 3-col variant (AR tiles) ── */
    .kpi-grid-3 { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
    @media (max-width:900px)  { .kpi-grid-3 { grid-template-columns:repeat(2,1fr); } }
    @media (max-width:600px)  { .kpi-grid-3 { grid-template-columns:1fr; } }

    /* ── Referral chart container ── */
    .referral-chart-wrap { position:relative; }
    /* ── EBITDA modal — dark ticker-style variant ── */
    .modal-box.modal-dark {
      background: #0b1829;
      border: 1px solid #1a2e42;
      box-shadow: 0 12px 48px rgba(0,0,0,0.6);
      color: #e2e8f0;
    }
    .modal-dark .modal-title        { color: #e2e8f0; }
    .modal-dark .modal-sub          { color: #4a6282; }
    .modal-dark .modal-close        { color: #4a6282; }
    .modal-dark .modal-close:hover  { color: #e2e8f0; }
    .modal-dark::-webkit-scrollbar-thumb { background: #1e3a52; }

    .kpi-card-dark {
      background: #0f2135;
      border: 1px solid #1a2e42;
      border-radius: 8px;
      padding: 14px 16px;
      position: relative;
    }
    .kpi-card-dark .kpi-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      margin-bottom: 8px;
    }
    .kpi-card-dark .kpi-name {
      font-size: 10px;
      font-weight: 700;
      color: #4a6282;
      text-transform: uppercase;
      letter-spacing: 0.09em;
    }
    .kpi-card-dark .kpi-value {
      font-family: 'Courier New', monospace;
      font-size: 22px;
      font-weight: 700;
      color: #e2e8f0;
      letter-spacing: -0.5px;
      line-height: 1;
      margin-bottom: 10px;
    }
    .kpi-card-dark .kpi-footer {
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .kpi-card-dark .kpi-prior-label { color: #4a6282; font-size: 10px; }
    .kpi-card-dark .info-btn        { border-color: #1a2e42; color: #4a6282; }
    .kpi-card-dark .info-btn:hover  { border-color: #22c55e; color: #22c55e; }

    /* EBITDA view toggle buttons (overrides grouped period-btn styles) */
    .ebitda-toggle-btn {
      border-left: 1px solid #1a2e42 !important;
      border-radius: 6px !important;
      background: transparent !important;
      border-color: #1a2e42 !important;
      color: #4a6282 !important;
    }
    .ebitda-toggle-btn.active {
      background: rgba(59,130,246,0.12) !important;
      border-color: #3b82f6 !important;
      color: #3b82f6 !important;
    }
    .ebitda-toggle-btn:hover:not(.active) {
      background: rgba(255,255,255,0.04) !important;
      color: #94a3b8 !important;
    }

    /* ── Practice Summary ── */

    /* Progress bar metrics */
    .pc-summary-metrics {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-bottom: 14px;
    }
    .pc-metric-bar {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .pc-metric-bar-header {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
    }
    .pc-metric-bar-label {
      font-size: 10.5px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: #64748b;
    }
    .pc-metric-bar-value {
      font-size: 15px;
      font-weight: 700;
      color: #1e3a4c;
    }
    .pc-metric-bar-of {
      font-size: 12px;
      font-weight: 400;
      color: #94a3b8;
    }
    .pc-progress-track {
      height: 6px;
      background: #dde8f0;
      border-radius: 3px;
      position: relative;
      overflow: visible;
    }
    .pc-progress-fill {
      height: 100%;
      background: var(--cyan);
      border-radius: 3px;
    }
    .pc-progress-fill--prod {
      background: #6366f1;
    }
    .pc-progress-pace-marker {
      position: absolute;
      top: -4px;
      width: 2px;
      height: 14px;
      background: #94a3b8;
      border-radius: 1px;
      transform: translateX(-50%);
    }
    .pc-metric-bar-footer {
      font-size: 11px;
      color: #64748b;
    }

    /* Rate tiles */
    .pc-rates-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 7px;
      margin-bottom: 10px;
    }
    .pc-rate-tile {
      background: #fff;
      border: 1px solid #dde8f0;
      border-radius: 7px;
      padding: 8px 10px;
    }
    .pc-rate-label {
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: #94a3b8;
      margin-bottom: 1px;
    }
    .pc-rate-value {
      font-size: 19px;
      font-weight: 700;
      color: #1e3a4c;
      line-height: 1.2;
    }
    .pc-rate-hint {
      font-size: 10.5px;
      color: #94a3b8;
      margin-top: 2px;
    }

    /* Comparison badges */
    .pc-comparison-badges {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }
    .pc-comparison-badge {
      display: inline-flex;
      align-items: center;
      font-size: 11.5px;
      font-weight: 500;
      padding: 3px 9px;
      border-radius: 12px;
      background: #f1f5f9;
      color: #475569;
    }
    .pc-comparison-badge.positive {
      color: var(--green-txt);
      background: #f0fdf4;
    }
    .pc-comparison-badge.negative {
      color: var(--red-txt);
      background: #fef2f2;
    }

    /* ── Practice Task List ── */

    .pc-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      margin-bottom: 16px;
      flex-wrap: wrap;
      gap: 8px;
    }
.pc-ai-summary {
      background: linear-gradient(135deg, #f0f9ff, #e8f4fd);
      border: 1px solid #bae6fd;
      border-left: 3px solid var(--cyan);
      border-radius: 0 8px 8px 0;
      padding: 14px 16px;
      font-size: 13.5px;
      line-height: 1.7;
      color: #1e3a4c;
      margin-bottom: 16px;
    }
    .pc-ai-summary-loading { color: #94a3b8; font-style: italic; }
    .pc-ai-summary-loading::after { content: 'Generating summary…'; }
    .pc-ai-summary-error { background: #fef2f2; border-color: #fca5a5; border-left-color: #ef4444; color: #991b1b; }
    .pc-ai-text {
      font-size: 13px;
      color: #1e3a4c;
      margin-bottom: 12px;
      line-height: 1.6;
    }
    .pc-ai-priorities {
      margin: 0 0 10px 0;
      padding: 0;
      list-style: none;
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .pc-ai-priorities li {
      display: flex;
      align-items: baseline;
      gap: 8px;
      font-size: 13px;
      color: #1e3a4c;
      line-height: 1.45;
    }
    .pc-ai-priorities li::before {
      content: counter(ai-item);
      counter-increment: ai-item;
      flex-shrink: 0;
      width: 18px;
      height: 18px;
      background: var(--navy);
      color: #fff;
      border-radius: 50%;
      font-size: 10px;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-top: 1px;
    }
    .pc-ai-priorities { counter-reset: ai-item; }
    .pc-ai-prompt-details { margin-top: 4px; }
    .pc-ai-prompt-details summary {
      font-size: 11px;
      font-weight: 600;
      color: #64748b;
      cursor: pointer;
      user-select: none;
      letter-spacing: 0.01em;
    }
    .pc-ai-prompt-details summary:hover { color: var(--navy); }
    .pc-ai-prompt-body {
      margin-top: 8px;
      padding: 10px 12px;
      background: #f1f5f9;
      border: 1px solid #e2e8f0;
      border-radius: 6px;
      font-size: 11.5px;
      line-height: 1.6;
      color: #475569;
      white-space: pre-wrap;
      font-family: ui-monospace, 'Cascadia Code', monospace;
    }
    .pc-identity {
      position: relative;
      cursor: pointer;
      user-select: none;
    }
    .pc-identity-practice {
      font-size: 20px;
      font-weight: 700;
      color: var(--navy);
      line-height: 1.2;
    }
    .pc-identity-loc-row {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-top: 3px;
    }
    .pc-identity-location {
      font-size: 13px;
      color: var(--text-muted);
    }
    .pc-identity-caret {
      font-size: 12px;
      color: #cbd5e1;
      line-height: 1;
    }
    .pc-identity:hover .pc-identity-location { color: var(--navy); }
    .pc-identity:hover .pc-identity-caret { color: var(--navy); }
    .pc-header-month {
      font-size: 12px;
      color: #94a3b8;
      white-space: nowrap;
    }
    /* ── Marketing tab ── */
    .mkt-hero {
      display: flex;
      align-items: center;
      gap: 32px;
      padding: 20px 24px;
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 10px;
      margin-bottom: 18px;
    }
    .mkt-hero-value {
      font-size: 42px;
      font-weight: 800;
      color: var(--navy);
      line-height: 1;
      letter-spacing: -1px;
    }
    .mkt-hero-label {
      font-size: 13px;
      color: var(--gray-md);
      margin-top: 4px;
    }

    .pc-loc-picker {
      position: absolute;
      top: calc(100% + 8px);
      left: 0;
      z-index: 100;
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 6px;
      box-shadow: 0 8px 24px rgba(0,0,0,0.12);
      min-width: 240px;
    }
    .pc-loc-list { display: flex; flex-direction: column; }
    .pc-loc-item {
      padding: 8px 12px;
      font-size: 13px;
      color: #374151;
      border-radius: 6px;
      cursor: pointer;
      white-space: nowrap;
    }
    .pc-loc-item:hover { background: #f1f5f9; }
    .pc-loc-item-active { font-weight: 600; color: var(--navy); background: #f0f4ff; }

    /* Summary + rank */
    .pc-summary {
      display: flex;
      gap: 16px;
      flex-wrap: wrap;
      font-size: 13px;
      color: #374151;
      font-weight: 500;
      padding: 10px 16px;
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 8px;
      margin-bottom: 10px;
    }
    .pc-summary span { white-space: nowrap; }
    /* Task cards */
    .pc-task {
      display: flex;
      align-items: flex-start;
      gap: 14px;
      padding: 14px 16px;
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 8px;
      margin-bottom: 8px;
      transition: box-shadow 0.12s;
    }
    .pc-task:hover { box-shadow: 0 2px 8px rgba(0,57,90,0.07); }
    .pc-task-high { border-left: 4px solid #dc2626; }
    .pc-task-med  { border-left: 4px solid #f59e0b; }
    .pc-task-low  { border-left: 4px solid #3b82f6; }
    .pc-task-icon {
      font-size: 16px;
      font-weight: 700;
      line-height: 1.2;
      flex-shrink: 0;
      margin-top: 1px;
      color: #94a3b8;
    }
    .pc-task-body { flex: 1; min-width: 0; }
    .pc-task-action {
      font-size: 15px;
      font-weight: 700;
      color: #1e293b;
      line-height: 1.35;
      margin-bottom: 3px;
    }
    .pc-task-context {
      font-size: 13px;
      color: #6b7280;
      line-height: 1.45;
    }
    .pc-task-link {
      color: #3b82f6;
      font-weight: 600;
      cursor: pointer;
      font-size: 12px;
      margin-left: 6px;
      white-space: nowrap;
    }
    .pc-task-link:hover { text-decoration: underline; }

    .pc-all-clear {
      font-size: 15px;
      color: #16a34a;
      background: #f0fdf4;
      border: 1px solid #bbf7d0;
      border-radius: 8px;
      padding: 20px;
      text-align: center;
      font-weight: 600;
    }
    .pc-empty {
      font-size: 13px;
      color: var(--text-muted);
      padding: 20px;
      text-align: center;
    }

    /* Patient intel panels */
    #pc-exams {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 16px;
      margin-top: 20px;
      align-items: start;
      padding-bottom: 80px;
    }
    .pc-intel-section { display: flex; flex-direction: column; max-height: 620px; }
    .pc-intel-header {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 8px;
    }
    .pc-intel-title {
      font-size: 11px;
      font-weight: 700;
      color: #374151;
      text-transform: uppercase;
      letter-spacing: 0.06em;
    }
    .pc-intel-badge {
      font-size: 11px;
      font-weight: 700;
      background: #e2e8f0;
      color: #374151;
      padding: 1px 8px;
      border-radius: 10px;
    }
    .pc-intel-badge-red {
      background: #fee2e2;
      color: #dc2626;
    }
    .pc-intel-list {
      border: 1px solid var(--border);
      border-radius: 8px;
      overflow-y: auto;
      background: #fff;
      flex: 1;
      min-height: 0;
    }
    .pc-patient-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 10px 14px;
      border-bottom: 1px solid var(--border);
    }
    .pc-patient-row:last-child { border-bottom: none; }
    .pc-patient-name {
      font-size: 13px;
      font-weight: 600;
      color: #1e293b;
      white-space: nowrap;
    }
    .pc-patient-meta {
      font-size: 12px;
      color: #6b7280;
    }
    .pc-patient-noshowed .pc-patient-name { color: #dc2626; }
    .pc-intel-loading {
      font-size: 12px;
      color: var(--text-muted);
      padding: 14px 0;
      text-align: center;
    }
    .pc-intel-badge-amber {
      background: #fef3c7;
      color: #92400e;
    }
    @keyframes pc-flash {
      0%   { background: #fef9c3; }
      100% { background: transparent; }
    }
    .pc-intel-highlight { animation: pc-flash 1.8s ease-out; }

    /* Patient detail modal */
    .pc-patient-modal-box { max-width: 420px; }
    .pc-patient-modal-box .modal-title { font-size: 17px; }
    .pc-patient-modal-box .modal-header { margin-bottom: 16px; }

    .pc-modal-name-row {
      display: flex;
      align-items: baseline;
      gap: 10px;
      flex-wrap: wrap;
    }
    .pc-modal-phone-chip {
      font-size: 13px;
      font-weight: 500;
      color: #3b82f6;
      text-decoration: none;
      white-space: nowrap;
    }
    .pc-modal-phone-chip:hover { text-decoration: underline; }

    .pc-modal-orthofi-links {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-left: 4px;
    }
    .pc-orthofi-btn {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 3px 9px;
      font-size: 11px;
      font-weight: 600;
      color: var(--navy);
      background: #f0f7ff;
      border: 1px solid #bfdbfe;
      border-radius: 5px;
      text-decoration: none;
      white-space: nowrap;
      transition: background .15s, border-color .15s;
    }
    .pc-orthofi-btn:hover {
      background: #dbeafe;
      border-color: #93c5fd;
    }

    .pc-pd-contact {
      background: #f8fafc;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 10px 12px;
      margin-bottom: 14px;
    }
    .pc-pd-guardian {
      font-size: 12px;
      color: #6b7280;
      margin-bottom: 8px;
    }
    .pc-pd-script-label {
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.07em;
      color: #9ca3af;
      margin-bottom: 6px;
    }
    .pc-pd-script {
      font-size: 12.5px;
      color: #374151;
      line-height: 1.65;
      border-left: 3px solid var(--cyan);
      padding: 7px 10px;
      background: #f0f9ff;
      border-radius: 0 5px 5px 0;
    }
    .pc-pd-no-phone {
      font-size: 13px;
      color: #94a3b8;
      font-style: italic;
    }
    .pc-pd-dob {
      font-size: 12px;
      color: #9ca3af;
      margin-bottom: 14px;
      padding-left: 2px;
    }
    .pc-pd-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px 16px;
      margin-bottom: 16px;
    }
    .pc-pd-field-label {
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: #9ca3af;
      margin-bottom: 2px;
    }
    .pc-pd-field-value {
      font-size: 13px;
      font-weight: 600;
      color: #1e293b;
    }
    /* history table — keep bordered rows only for schedule history */
    .pc-pd-rows {
      border: 1px solid var(--border);
      border-radius: 8px;
      overflow: hidden;
      margin-bottom: 16px;
    }
    .pc-pd-row {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      gap: 12px;
      padding: 7px 12px;
      border-bottom: 1px solid var(--border);
      font-size: 13px;
    }
    .pc-pd-row:last-child { border-bottom: none; }
    .pc-pd-label { color: #6b7280; white-space: nowrap; flex-shrink: 0; }
    .pc-pd-value { color: #1e293b; font-weight: 600; text-align: right; }
    .pc-pd-section-head {
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.07em;
      color: #9ca3af;
      margin-bottom: 8px;
      padding-left: 2px;
    }
    .pc-phone-link {
      font-size: 12px;
      font-weight: 600;
      color: #3b82f6;
      margin-left: 8px;
      text-decoration: none;
      white-space: nowrap;
    }
    .pc-phone-link:hover { text-decoration: underline; }
    .pc-no-phone { font-size: 11px; color: #94a3b8; margin-left: 4px; font-style: italic; }

    /* Gamification — done button, row collapse, float, score chip */
    .pc-row-body {
      flex: 1;
      cursor: pointer;
      min-width: 0;
    }
    .pc-done-btn {
      flex-shrink: 0;
      width: 22px;
      height: 22px;
      border-radius: 50%;
      border: 1.5px solid #d1d5db;
      background: transparent;
      color: #9ca3af;
      font-size: 11px;
      line-height: 1;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-left: 8px;
      transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.15s;
    }
    .pc-done-btn:hover {
      border-color: #16a34a;
      background: #dcfce7;
      color: #16a34a;
      transform: scale(1.12);
    }
    .pc-done-btn:active { transform: scale(0.95); }

    @keyframes pc-row-flash {
      0%   { background: #dcfce7; }
      60%  { background: #dcfce7; }
      100% { background: transparent; }
    }
    .pc-row-completing { animation: pc-row-flash 0.4s ease-out forwards; }

.pc-done-badge {
      display: inline-flex;
      align-items: center;
      font-size: 11px;
      font-weight: 700;
      color: #15803d;
      background: #dcfce7;
      border: 1px solid #86efac;
      border-radius: 10px;
      padding: 2px 8px;
      margin-left: 6px;
    }
    .pc-row-done {
      background: #f0fdf4 !important;
    }
    .pc-row-done .pc-done-btn {
      border-color: #16a34a;
      background: #dcfce7;
      color: #16a34a;
    }
    .pc-row-done .pc-done-btn:hover {
      background: #fee2e2;
      border-color: #dc2626;
      color: #dc2626;
    }
    .pc-show-done-btn {
      display: block;
      width: 100%;
      padding: 7px 14px;
      background: none;
      border: none;
      border-top: 1px solid var(--border);
      font-size: 12px;
      font-weight: 600;
      color: #16a34a;
      cursor: pointer;
      text-align: left;
      border-radius: 0 0 8px 8px;
    }
    .pc-show-done-btn:hover { background: #f0fdf4; }


