  /* ================= Workspace switch (sidebar) ================= */
  .ws { padding: 12px 14px 4px; }
  .ws-switch { display:grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; border-radius: 11px; background: var(--panel-2); border: 1px solid var(--line); }
  .ws-switch.single { grid-template-columns: 1fr; }
  .ws-btn { display:flex; align-items:center; justify-content:center; gap: 7px; border: 0; background: none; color: var(--muted); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; font-weight: 600; white-space: nowrap; transition: all .15s; }
  .ws-btn svg { width: 15px; height: 15px; }
  .ws-btn:hover { color: var(--ink); }
  .ws-btn[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.15), 0 0 0 1px var(--line-2); font-weight: 650; }
  .app.collapsed .ws-switch { grid-template-columns: 1fr; }
  .app.collapsed .ws-btn span { display: none; }
  @media (max-width: 820px) { .ws-switch { grid-template-columns: 1fr; } .ws-btn span { display: none; } }
  .app.qa-mode .name-field { display: none; }
  .q-mode-pill { display:none; align-items:center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); background: var(--panel-2); border-radius: 999px; padding: 4px 12px; white-space: nowrap; }
  .q-mode-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
  .q-mode-pill.live i { background: var(--ok); }
  .app.qa-mode .q-mode-pill { display:inline-flex; }

  /* ================= Page furniture ================= */
  .app.qa-mode .page { padding: 24px 32px 64px; }
  .app.qa-mode .page-inner { max-width: min(100%, 1880px); width: 100%; margin: 0 auto; }

  /* Full Space Table & Responsive Utilities */
  .table-wrapper { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .qt.audit-table, .qt.cond-table { width: 100%; border-collapse: collapse; }
  .qt.audit-table th, .qt.cond-table th {
    background: var(--panel-2);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    white-space: nowrap;
  }
  .qt.audit-table td, .qt.cond-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-size: 13.5px;
    vertical-align: middle;
  }
  .qt.audit-table tbody tr:hover, .qt.cond-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.025);
  }
  .audit-table th:first-child, .audit-table td:first-child,
  .cond-table th:first-child, .cond-table td:first-child {
    padding-left: 20px;
  }
  .audit-table th:last-child, .audit-table td:last-child,
  .cond-table th:last-child, .cond-table td:last-child {
    padding-right: 20px;
  }
  @media (max-width: 1280px) {
    .audit-table th:nth-child(5), .audit-table td:nth-child(5),
    .cond-table th:nth-child(5), .cond-table td:nth-child(5) {
      display: table-cell !important;
    }
  }
  .q-head { display:flex; align-items:flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
  .q-head h1 { font-size: 28px; margin: 0; font-weight: 750; letter-spacing: -.03em; line-height: 1.2; color: var(--ink); }
  .q-head p { margin: 6px 0 0; color: var(--muted); max-width: 65ch; font-size: 14.5px; line-height: 1.5; }
  .btn.icon-only { padding: 8px; width: 38px; height: 38px; }
  .btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
  .btn.danger:hover { filter: brightness(1.1); }
  .q-seg { display:inline-flex; padding: 3px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); gap: 2px; }
  .q-seg button { border: 0; background: none; color: var(--muted); padding: 6px 14px; border-radius: 7px; font-size: 13px; font-weight: 600; transition: all .15s; }
  .q-seg button:hover { color: var(--ink); }
  .q-seg button[aria-pressed="true"], .q-seg button.active { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.15); font-weight: 650; }
  .q-actions { display:flex; gap: 10px; align-items:center; flex-wrap: wrap; }
  .num { font-variant-numeric: tabular-nums; }
  .q-grid { display:grid; gap: 20px; margin-bottom: 24px; }
  .g-3-1 { grid-template-columns: minmax(0, 2.1fr) minmax(280px, 1fr); }
  .g-1-1 { grid-template-columns: 1fr 1fr; }
  .g-2-1 { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); }
  @media (max-width: 1080px) { .g-3-1, .g-1-1, .g-2-1 { grid-template-columns: 1fr; } }
  .q-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); min-width: 0; }
  .q-card.pad { padding: 24px 26px; }
  .q-card-h { display:flex; align-items:center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
  .q-card-h > div:first-child, .q-card-h h2 { margin-right: auto; }
  .q-card-h h2 { font-size: 16px; font-weight: 700; margin: 0 auto 0 0; letter-spacing: -.015em; }
  .q-card-h > div:first-child h2 { margin: 0; }
  .q-card-h .hint { margin-top: 3px; color: var(--muted); font-size: 13px; }
  .trend { margin-bottom: 24px; }
  .q-muted { color: var(--muted); }
  .q-link { color: var(--accent-text); background: none; border: 0; padding: 0; font-weight: 600; font-size: 13px; cursor: pointer; }
  .q-link:hover { text-decoration: underline; }

  /* ================= KPI tiles ================= */
  .kpis { display:grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }
  .kpis.kpis-5 { display:grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
  .kpis.kpis-5 .kpi { padding: 18px 20px 16px; }
  .kpis.kpis-5 .kpi .v { font-size: 28px; }
  @media (max-width: 1250px) { .kpis.kpis-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  @media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (max-width: 800px) { .kpis.kpis-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (max-width: 700px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (max-width: 520px) { .kpis.kpis-5 { grid-template-columns: 1fr; } }
  .kpi { padding: 22px 24px 20px; display:flex; flex-direction:column; overflow: hidden; position: relative; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); transition: border-color .15s; }
  .kpi:hover { border-color: var(--line-2); }
  .kpi .k { color: var(--muted); font-size: 12.5px; font-weight: 600; letter-spacing: .01em; }
  .kpi .row { display:flex; align-items: baseline; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
  .kpi .v { font-size: 32px; font-weight: 750; letter-spacing: -.035em; line-height: 1.05; font-variant-numeric: tabular-nums; }
  .split { display:flex; gap: 3px; height: 6px; margin-top: 18px; border-radius: 999px; overflow: hidden; background: var(--panel-2); }
  .split span { min-width: 2px; }
  .split-key { display:grid; grid-template-columns: repeat(3, auto); justify-content: space-between; margin-top: 12px; font-size: 12px; color: var(--muted); }
  .split-key span { display:flex; flex-direction:column; gap: 1px; }
  .split-key b { color: var(--ink); font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; display:flex; align-items:center; gap: 6px; }
  .split-key i { width: 7px; height: 7px; border-radius: 50%; }
  .kpi .v small { font-size: 14px; color: var(--muted); font-weight: 600; letter-spacing: 0; margin-left: 2px; }
  .kpi svg.spark { width: 100%; height: 36px; margin-top: 14px; display:block; }
  .delta { display:inline-flex; align-items:center; gap: 3px; padding: 2px 7px; border-radius: 6px; font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .delta.good { color: var(--ok); background: var(--ok-soft); border: 1px solid var(--ok-line); }
  .delta.bad { color: var(--bad); background: var(--bad-soft); border: 1px solid var(--bad-line); }
  .delta.flat { color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); }
  .delta svg { width: 11px; height: 11px; stroke-width: 2.5; }

  /* ================= Charts ================= */
  .chart { position: relative; width: 100%; }
  .chart svg { display:block; width: 100%; overflow: visible; }
  .chart .axis { fill: var(--faint); font-size: 11px; font-family: Inter, system-ui, sans-serif; font-variant-numeric: tabular-nums; }
  .chart .grid { stroke: var(--line); stroke-width: 1; }
  .chart .guide { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 3 3; }
  .q-tip { position: fixed; z-index: 80; pointer-events: none; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 11px; font-size: 12.5px; min-width: 150px; box-shadow: 0 12px 32px rgba(0,0,0,.28); display:none; }
  .q-tip b { display:block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 5px; }
  .q-tip .tr { display:flex; align-items:center; gap: 8px; margin-top: 3px; }
  .q-tip .tr span { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink); }
  .q-tip i, .legend i { width: 8px; height: 8px; border-radius: 3px; display:inline-block; flex-shrink: 0; }
  .legend { display:flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
  .legend span { display:inline-flex; align-items:center; gap: 6px; }

  /* Results donut + review pipeline */
  .donut-wrap { display:flex; align-items:center; gap: 18px; }
  .donut { position: relative; width: 132px; height: 132px; flex-shrink: 0; }
  .donut .mid { position: absolute; inset: 0; display:grid; place-items:center; text-align:center; }
  .donut .mid b { font-size: 24px; letter-spacing: -.03em; display:block; line-height: 1; }
  .donut .mid small { color: var(--muted); font-size: 11.5px; }
  .dl { display:grid; gap: 8px; flex: 1; min-width: 0; }
  .dl div { display:flex; align-items:center; gap: 8px; font-size: 13px; }
  .dl div span:last-child { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; }
  .dl i { width: 10px; height: 10px; border-radius: 3px; }
  .pipe { display:grid; gap: 4px; }
  .pipe-row { display:grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items:center; font-size: 13.5px; color: var(--ink-2); background: none; border: 0; padding: 8px 10px; margin: 0 -10px; border-radius: 12px; text-align: left; }
  .pipe-row:hover { background: var(--hover); }
  .pipe-row .bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
  .pipe-row .bar span { display:block; height: 100%; border-radius: 4px; }
  .pipe-row b { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
  .foot-note { display:flex; align-items:center; gap: 8px; margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
  .foot-note svg { width: 15px; height: 15px; }
  .lg-row { display:grid; grid-template-columns: minmax(0, 1.2fr) minmax(110px, 140px) 110px 85px; gap: 14px; align-items:center; width: calc(100% + 20px); margin: 0 -10px; padding: 10px; border: 0; border-radius: 12px; background: none; text-align: left; color: var(--ink); }
  .lg-row:hover { background: var(--hover); }
  .lg-row svg.spark { width: 110px; height: 28px; }
  .lg-score { display:flex; flex-direction:column; align-items:flex-end; }
  .lg-score b { font-size: 18px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
  @media (max-width: 900px) { .lg-row { grid-template-columns: minmax(0, 1.2fr) minmax(90px, 120px) 75px; } .lg-row svg.spark { display:none; } }
  @media (max-width: 600px) { .lg-row { grid-template-columns: minmax(0, 1fr) 75px; } .lg-row .stacked-outcome-bar { display:none; } }

  /* Missed criteria */
  .miss { display:grid; grid-template-columns: 40px minmax(0,1fr) 64px; gap: 14px; align-items:center; padding: 9px 0; }
  .miss .nm .hbar { display:block; margin-top: 7px; height: 6px; }
  .miss .pct small { display:block; font-size: 11px; font-weight: 650; } .miss .pct small.good { color: var(--ok); } .miss .pct small.bad { color: var(--bad); }
  .cid { font-size: 11.5px; font-weight: 700; color: var(--ink-2); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 7px; text-align:center; padding: 2px 0; font-variant-numeric: tabular-nums; }
  .cid.m { color: var(--bad); border-color: var(--bad-line); background: var(--bad-soft); }
  .miss .nm { font-size: 13.5px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .miss .nm small { display:block; color: var(--muted); font-size: 11.5px; }
  .hbar { height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
  .hbar span { display:block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--warn), var(--bad)); }
  .miss .pct { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; font-size: 13px; }

  /* Attention list */
  .att { display:flex; align-items:center; gap: 14px; padding: 11px 10px; margin: 0 -10px; border-radius: 12px; border: 0; width: calc(100% + 20px); background: none; text-align: left; color: var(--ink); font-size: 14px; font-weight: 550; }
  .att:hover { background: var(--hover); }
  .att.zero { opacity: .55; }
  .att .go { width: 16px; height: 16px; color: var(--faint); }
  .att .ico { width: 34px; height: 34px; border-radius: 10px; display:grid; place-items:center; flex-shrink: 0; }
  .att .ico.bad { background: var(--bad-soft); color: var(--bad); } .att .ico.warn { background: var(--warn-soft); color: var(--warn); }
  .att .ico.info { background: var(--info-soft); color: var(--info); }
  .att .tx { flex: 1; min-width: 0; }
  .att .tx b { display:block; font-weight: 600; font-size: 13.5px; }
  .att .tx small { color: var(--muted); font-size: 12px; display:block; overflow:hidden; text-overflow: ellipsis; white-space: nowrap; }
  .att .n { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

  /* Leaderboard */
  .lb td { padding: 11px 14px; }
  .lb .rank { color: var(--faint); font-weight: 650; width: 28px; font-variant-numeric: tabular-nums; }
  .lb svg.spark { width: 110px; height: 28px; display:block; }
  .person { display:flex; align-items:center; gap: 10px; }
  .person b { display:block; font-weight: 600; color: var(--ink); font-size: 13.5px; }
  .person small { color: var(--muted); font-size: 12px; }
  .q-av { width: 32px; height: 32px; border-radius: 10px; display:grid; place-items:center; font-weight: 700; font-size: 12.5px; flex-shrink: 0; }
  .q-av.lg { width: 60px; height: 60px; border-radius: 18px; font-size: 21px; }
  .q-av.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 11px; }
  .score-txt { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }

  /* Heatmap: lead generators x criteria */
  .heat { overflow-x: auto; }
  .heat table { border-collapse: separate; border-spacing: 4px; width: 100%; }
  .heat th { padding: 0 0 4px; border: 0; font-size: 11px; text-align: center; color: var(--muted); font-weight: 650; font-variant-numeric: tabular-nums; }
  .heat th.sec { text-align: left; color: var(--faint); font-weight: 600; }
  .heat td { padding: 0; border: 0; white-space: nowrap; }
  .heat td.who { padding-right: 10px; font-weight: 600; color: var(--ink); font-size: 13px; }
  .heat .cell { width: 100%; min-width: 34px; height: 34px; border-radius: 8px; border: 0; display:grid; place-items:center; font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink-2); }
  .heat .cell:hover { outline: 2px solid var(--accent-line); outline-offset: 1px; }
  .heat .gap td { height: 6px; }
  .heat-key { display:flex; align-items:center; gap: 8px; font-size: 12px; color: var(--muted); }
  .heat-key .ramp { width: 140px; height: 8px; border-radius: 4px; }
  tbody tr.nohover { cursor: default; } tbody tr.nohover:hover { background: none; }

  /* Switch Toggle */
  .switch { position: relative; display: inline-block; width: 44px; height: 24px; vertical-align: middle; flex-shrink: 0; }
  .switch input { opacity: 0; width: 0; height: 0; margin: 0; position: absolute; }
  .switch-slider {
    position: absolute; cursor: pointer; inset: 0;
    background-color: var(--line-2); transition: background-color .2s, border-color .2s; border-radius: 24px;
    border: 1px solid var(--line);
  }
  .switch-slider:before {
    position: absolute; content: ""; height: 18px; width: 18px; left: 2px; bottom: 2px;
    background-color: #fff; transition: transform .2s; border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  }
  .switch input:checked + .switch-slider { background-color: var(--accent); border-color: var(--accent); }
  .switch input:checked + .switch-slider:before { transform: translateX(20px); }

  /* Compact Criteria Performance Heatmap */
  .heat-attr-list { display: flex; flex-direction: column; gap: 4px; }
  .heat-attr-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 10px;
    height: 34px;
    box-sizing: border-box;
    border-radius: 6px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-left: 4px solid var(--line);
    transition: background 0.12s, border-color 0.12s;
  }
  .heat-attr-row:hover {
    background: var(--hover);
    border-color: var(--line-2);
  }
  .heat-attr-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
  }
  .heat-attr-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
  }
  .heat-attr-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  .heat-attr-stat {
    font-size: 11.5px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    min-width: 38px;
    text-align: right;
  }
  .heat-attr-bar {
    width: 42px;
    height: 4px;
    border-radius: 2px;
    background: var(--line);
    overflow: hidden;
    flex-shrink: 0;
  }
  .heat-attr-bar span {
    display: block;
    height: 100%;
    border-radius: 2px;
  }
  .heat-attr-pill {
    color: #fff;
    font-weight: 800;
    font-size: 11.5px;
    padding: 2px 7px;
    border-radius: 6px;
    min-width: 44px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
    flex-shrink: 0;
  }

  /* Queue */
  .q-filters { display:flex; flex-wrap: wrap; gap: 12px; align-items:center; margin-bottom: 16px; }
  .q-search { display:flex; align-items:center; gap: 8px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 0 14px; height: 38px; width: 240px; transition: border-color .15s; }
  .q-search:focus-within { border-color: var(--accent); }
  .q-search input { background: none; border: 0; outline: none; width: 100%; color: var(--ink); font-size: 13.5px; }
  .q-search svg { width: 16px; height: 16px; color: var(--muted); }
  .q-select { height: 40px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink); padding: 0 34px 0 12px; appearance: none; -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
  .q-toolbar { display:flex; align-items:center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
  .q-toolbar-r { display:flex; align-items:center; gap: 10px; flex-wrap: wrap; }
  .q-dd { display:inline-flex; align-items:center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); font-size: 13.5px; font-weight: 550; white-space: nowrap; transition: all .15s; }
  .q-dd:hover { background: var(--hover); border-color: var(--line); }
  .q-dd svg { width: 16px; height: 16px; color: var(--muted); }
  .q-dd svg.chev { width: 14px; height: 14px; margin-left: 2px; transition: transform .15s; }
  .q-dd[aria-expanded="true"] svg.chev { transform: rotate(180deg); }
  .q-dd.on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
  .q-dd.on svg { color: var(--accent-text); }
  .q-pop { position: fixed; z-index: 90; background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.12); }
  @media (prefers-reduced-motion: no-preference) { .q-pop { animation: qpop .12s ease-out; } }
  @keyframes qpop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
  .q-menu { padding: 6px; min-width: 220px; max-height: 340px; overflow: auto; }
  .q-menu button[role="option"] { display:flex; align-items:center; gap: 10px; width: 100%; border: 0; background: none; padding: 9px 10px; border-radius: 9px; color: var(--ink-2); font-size: 13.5px; text-align: left; }
  .q-menu button[role="option"]:hover, .q-menu button[role="option"]:focus-visible { background: var(--hover); color: var(--ink); outline: none; }
  .q-menu button[aria-selected="true"] { color: var(--ink); font-weight: 600; }
  .q-menu svg.ok { margin-left: auto; width: 16px; height: 16px; color: var(--accent-text); stroke-width: 2.4; }
  .q-menu .mk { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--line-2); display:grid; place-items:center; flex-shrink: 0; }
  .q-menu .mk svg { width: 12px; height: 12px; display: none; color: #fff; stroke-width: 3; }
  .q-menu .mk.on { background: var(--accent); border-color: var(--accent); } .q-menu .mk.on svg { display: block; }
  .q-menu-foot { border-top: 1px solid var(--line); margin-top: 4px; padding: 8px 10px 4px; }
  .cal { display:flex; }
  .cal-presets { display:flex; flex-direction:column; gap: 2px; padding: 10px; border-right: 1px solid var(--line); min-width: 158px; }
  .cal-presets button { border: 0; background: none; text-align: left; padding: 9px 12px; border-radius: 9px; color: var(--ink-2); font-size: 13.5px; white-space: nowrap; }
  .cal-presets button:hover { background: var(--hover); color: var(--ink); }
  .cal-presets button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
  .cal-main { padding: 12px 16px 12px; position: relative; }
  .cal-nav { position: absolute; left: 12px; right: 12px; top: 10px; display:flex; justify-content: space-between; pointer-events: none; }
  .cal-nav button { pointer-events: auto; }
  .cal-months { display:flex; gap: 26px; }
  .cal-t { text-align: center; font-weight: 650; font-size: 14px; padding: 6px 0 12px; }
  .cal-g { display:grid; grid-template-columns: repeat(7, 36px); row-gap: 3px; }
  .cal-w { text-align: center; font-size: 11.5px; color: var(--faint); font-weight: 600; padding-bottom: 6px; }
  .cal-d { height: 34px; border: 0; background: none; color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; border-radius: 9px; }
  .cal-d:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
  .cal-d.today { box-shadow: inset 0 0 0 1.5px var(--line-2); }
  .cal-d.in { background: var(--accent-soft); color: var(--ink); border-radius: 0; }
  .cal-d.edge, .cal-d.edge:hover:not(:disabled) { background: var(--accent); color: #fff; font-weight: 650; }
  .cal-d.in:hover:not(:disabled) { background: var(--accent-line); }
  .cal-d.start { border-radius: 9px 0 0 9px; } .cal-d.end { border-radius: 0 9px 9px 0; }
  .cal-d:disabled { color: var(--faint); opacity: .35; cursor: default; }
  .cal-foot { display:flex; align-items:center; gap: 8px; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
  .cal-foot span { margin-right: auto; font-size: 13px; }
  @media (max-width: 760px) {
    .cal { flex-direction: column; } .cal-presets { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
    .cal-m:first-child { display: none; }
  }
  .tog { display:inline-flex; align-items:center; gap: 6px; border: 1px solid var(--line-2); background: var(--panel); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; color: var(--ink-2); }
  .tog[aria-pressed="true"] { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); }
  .tog svg { width: 14px; height: 14px; }
  .flags { display:inline-flex; gap: 4px; }
  .flag { width: 24px; height: 24px; border-radius: 7px; display:grid; place-items:center; }
  .flag svg { width: 14px; height: 14px; }
  .flag.bad { background: var(--bad-soft); color: var(--bad); } .flag.warn { background: var(--warn-soft); color: var(--warn); }
  .flag.info { background: var(--info-soft); color: var(--info); } .flag.acc { background: var(--accent-soft); color: var(--accent-text); }
  .rs { display:inline-flex; align-items:center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--panel-2); color: var(--ink-2); border: 1px solid var(--line-2); }
  .rs::before { content:""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
  .rs.unreviewed { color: var(--info); background: var(--info-soft); border-color: var(--info-line); }
  .rs.in_review { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
  .rs.ready_for_feedback { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent-line); }
  .rs.feedback_given { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-line); }
  .rs.archived { color: var(--muted); }

  .q-select-status {
    appearance: none; -webkit-appearance: none;
    background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 999px;
    padding: 4px 24px 4px 11px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath fill='none' stroke='%237D879B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l3 3 3-3'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 8px center;
  }
  .q-select-status:hover { border-color: var(--accent); }
  .q-select-status.unreviewed { color: var(--info); background-color: var(--info-soft); border-color: var(--info-line); }
  .q-select-status.in_review { color: var(--warn); background-color: var(--warn-soft); border-color: var(--warn-line); }
  .q-select-status.ready_for_feedback { color: var(--accent-text); background-color: var(--accent-soft); border-color: var(--accent-line); }
  .q-select-status.feedback_given { color: var(--ok); background-color: var(--ok-soft); border-color: var(--ok-line); }
  .q-select-status.archived { color: var(--muted); background-color: var(--panel-2); border-color: var(--line); }

  .ring { width: 30px; height: 30px; vertical-align: middle; }
  .score-cell { display:inline-flex; align-items:center; gap: 8px; }
  .bulk { position: sticky; bottom: 16px; margin-top: 14px; display:flex; align-items:center; gap: 10px; padding: 12px 18px; border-radius: 14px; background: var(--ink); color: var(--bg); box-shadow: 0 16px 36px rgba(0,0,0,.35); z-index: 50; }
  .bulk .btn { background: transparent; color: var(--bg); border-color: rgba(127,127,127,.4); }
  .bulk b { margin-right: auto; font-size: 13.5px; }
  .cbx { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
  .qt th { padding: 13px 18px; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--panel-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
  .qt td { padding: 14px 18px; font-size: 13.5px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: middle; white-space: nowrap; }
  .qt th:first-child, .qt td:first-child { padding-left: 20px; }
  .qt th:last-child, .qt td:last-child { padding-right: 20px; }
  @media (max-width: 1280px) { .qt th:nth-child(5), .qt td:nth-child(5), .qt th:nth-child(8), .qt td:nth-child(8) { display: none; } }
  .pager { display:flex; align-items:center; gap: 12px; justify-content: flex-end; padding: 14px 20px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

  /* ================= Call review ================= */
  .c-hero { display:grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; padding: 22px; align-items:center; margin-bottom: 14px; }
  @media (max-width: 900px) { .c-hero { grid-template-columns: 1fr; } }
  .c-id { display:flex; gap: 16px; align-items:center; min-width: 0; }
  .c-id h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
  .c-meta { display:flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; color: var(--muted); font-size: 13px; }
  .c-meta span { display:inline-flex; align-items:center; gap: 6px; }
  .c-meta svg { width: 14px; height: 14px; }
  .c-scores { display:flex; gap: 12px; align-items:center; flex-wrap: wrap; }
  .c-score { display:flex; align-items:center; gap: 10px; padding: 8px 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
  .c-score .lbl2 { font-size: 11px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
  .c-score .val { font-size: 18px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
  .c-score .sub-txt { font-size: 11px; color: var(--muted); }
  .verdict { padding: 10px 14px; border-radius: 14px; border: 1px solid; min-width: 140px; display:flex; flex-direction:column; justify-content:center; }
  .verdict small { display:flex; align-items:center; justify-content:space-between; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; opacity: .85; }
  .verdict b { font-size: 18px; letter-spacing: -.02em; display:flex; align-items:center; gap: 6px; margin: 2px 0; }
  .verdict-actions { display:flex; align-items:center; gap: 8px; margin-top: 2px; }
  .verdict-btn { background: none; border: 0; padding: 0; font-size: 11.5px; font-weight: 600; text-decoration: underline; cursor: pointer; color: inherit; opacity: .85; }
  .verdict-btn:hover { opacity: 1; }
  .verdict.pass { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-line); }
  .verdict.pass_with_development { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-line); }
  .verdict.fail { color: var(--bad); background: var(--bad-soft); border-color: var(--bad-line); }
  .verdict.not_scorable { color: var(--muted); background: var(--panel-2); border-color: var(--line-2); }

  .badge.b-auto { opacity: .9; }
  .badge.b-qa { box-shadow: 0 0 0 1px currentColor inset; font-weight: 700; }

  .ovr-box { background: var(--panel-2); border-left: 3px solid var(--accent); padding: 8px 12px; border-radius: 6px; margin: 8px 0 6px 32px; font-size: 13px; }
  .ovr-header { display:flex; align-items:center; gap: 6px; color: var(--accent-text); font-weight: 600; font-size: 12.5px; }
  .ovr-text { margin: 4px 0; color: var(--ink); font-style: italic; }
  .ai-original { font-size: 12px; color: var(--muted); margin-top: 6px; padding-top: 4px; border-top: 1px dashed var(--line); }

  .stacked-outcome-bar { display:flex; height: 9px; border-radius: 4px; overflow: hidden; background: var(--panel-2); width: 100%; min-width: 100px; }
  .stacked-outcome-bar span { height: 100%; min-width: 1px; }
  .outcome-legend { display:flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12px; color: var(--muted); margin-top: 8px; }
  .outcome-legend span { display:inline-flex; align-items:center; gap: 5px; }
  .outcome-legend i { width: 8px; height: 8px; border-radius: 2px; }
  .dropoff-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px; margin-bottom: 20px; }
  .dropoff-banner { padding: 12px 16px; border-radius: 10px; font-size: 13px; line-height: 1.5; margin-top: 12px; display:flex; gap: 10px; align-items:flex-start; }
  .dropoff-banner.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); }
  .dropoff-banner.info { background: var(--info-soft); color: var(--info); border: 1px solid var(--info-line); }
  .dropoff-stats { display:flex; gap: 14px; align-items:center; }
  .kpi-mini { font-size: 13.5px; color: var(--muted); }
  .kpi-mini b { font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
  .outcome-day-row { transition: background .15s; }
  .outcome-day-row:hover { background: var(--hover); }
  .outcome-day-row.expanded { background: var(--panel-2); }
  .oc-val { font-variant-numeric: tabular-nums; font-size: 13px; }
  .oc-val small { color: var(--muted); font-size: 11px; margin-left: 2px; }
  .oc-val.t-pos b { color: #22c55e; font-weight: 700; }
  .oc-val.c-pos b { color: #3b82f6; font-weight: 700; }
  .oc-val.d-pos b { color: #f97316; font-weight: 700; }
  .sub-agent-table th, .sub-agent-table td { padding: 8px 12px; }

  .stepper { display:flex; align-items:center; gap: 14px; padding: 14px 18px; margin-bottom: 14px; flex-wrap: wrap; }
  .steps { display:flex; align-items:center; flex: 1; min-width: 300px; }
  .step { display:flex; align-items:center; gap: 8px; font-size: 12.5px; color: var(--faint); white-space: nowrap; }
  .step i { width: 22px; height: 22px; border-radius: 50%; display:grid; place-items:center; border: 1.5px solid var(--line-2); font-style: normal; font-size: 11px; font-weight: 700; }
  .step.done { color: var(--ink-2); } .step.done i { background: var(--ok); border-color: var(--ok); color: #fff; }
  .step.now { color: var(--ink); font-weight: 650; } .step.now i { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
  .step-line { flex: 1; height: 2px; background: var(--line-2); margin: 0 10px; min-width: 14px; border-radius: 1px; }
  .step-line.done { background: var(--ok); }

  .q-alerts { display:grid; gap: 8px; margin-bottom: 14px; }
  .q-alert { display:flex; gap: 12px; align-items:flex-start; padding: 12px 16px; border-radius: 12px; border: 1px solid; font-size: 13.5px; }
  .q-alert svg { margin-top: 1px; }
  .q-alert.bad { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); }
  .q-alert.warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
  .q-alert.info { background: var(--info-soft); border-color: var(--info-line); color: var(--info); }
  .q-alert span { color: var(--ink-2); }

  .glance { display:grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; align-items: stretch; }
  @media (max-width: 1240px) { .glance { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (max-width: 640px) { .glance { grid-template-columns: 1fr; } }
  .glance .q-card.pad { padding: 20px 22px; }
  .glance .q-card-h { margin-bottom: 14px; }
  .glance .q-card-h h2 { font-size: 15px; }
  .glance .mood { margin-bottom: 12px; }
  .glance-note { margin: 12px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
  .kv2.tight { grid-template-columns: 90px 1fr; gap: 8px 10px; font-size: 13px; }
  .kv2.info { grid-template-columns: 82px 1fr; } .kv2.info dt { font-size: 12.5px; line-height: 1.35; }
  .obj-row { display:flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
  .obj-row:last-child { border-bottom: 0; }
  .obj-row b { display:block; font-weight: 600; } .obj-row small { display:block; color: var(--muted); font-size: 12.5px; margin: 2px 0 4px; }
  .glance .timeline .tl { padding-bottom: 10px; } .glance .tl b, .glance .tl { font-size: 12.5px; }
  .summary-card { display:grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: 28px; margin-bottom: 28px; align-items: start; }
  @media (max-width: 980px) { .summary-card { grid-template-columns: 1fr; } }
  .sum-text p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.6; max-width: 62ch; }
  .sum-stats { display:flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 16px; color: var(--muted); font-size: 13px; }
  .sum-stats b { color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
  .tiles-h { font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 8px; }
  .tiles { display:grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; margin-bottom: 16px; }
  .tile { height: 34px; border-radius: 9px; border: 1px solid transparent; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; position: relative; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; margin: 0; box-sizing: border-box; cursor: pointer; transition: transform .1s ease, filter .15s ease; }
  .tile:hover { filter: brightness(1.15); transform: translateY(-1px); }

  /* Optional Met: Current Green Treatment */
  .tile.opt-pass, .tile.success:not(.mand):not(.mand-pass) {
    background: var(--ok-soft) !important;
    color: var(--ok) !important;
    border: 1px solid var(--ok-line) !important;
    font-weight: 700 !important;
  }

  /* Mandatory Met: Solid Green */
  .tile.mand-pass, .tile.success.mand {
    background: #10b981 !important;
    color: #ffffff !important;
    border: 1px solid #059669 !important;
    font-weight: 800 !important;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
  }

  /* Optional Fail: Light Red */
  .tile.opt-fail, .tile.failure:not(.mand):not(.mand-fail) {
    background: rgba(239, 68, 68, 0.16) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
    font-weight: 700 !important;
  }

  /* Mandatory Fail: Solid Red */
  .tile.mand-fail, .tile.failure.mand {
    background: #ef4444 !important;
    color: #ffffff !important;
    border: 1px solid #dc2626 !important;
    font-weight: 800 !important;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
  }

  .tile.unknown { background: var(--panel-2) !important; color: var(--faint) !important; border-color: var(--line) !important; }
  .tile.is-overridden, .tile.ovr { box-shadow: 0 0 0 2px var(--warn) !important; }

  .tiles-key { display:flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
  .tiles-key span { display:inline-flex; align-items:center; gap: 6px; }
  .tiles-key i { width: 11px; height: 11px; border-radius: 3px; display:inline-block; }
  .tiles-key i.mand-pass { background: #10b981; border: 1px solid #059669; }
  .tiles-key i.opt-pass { background: var(--ok-soft); border: 1px solid var(--ok-line); }
  .tiles-key i.opt-fail { background: rgba(239, 68, 68, 0.16); border: 1px solid rgba(239, 68, 68, 0.4); }
  .tiles-key i.mand-fail { background: #ef4444; border: 1px solid #dc2626; }
  .tiles-key i.ovrk { width: 11px; height: 11px; border-radius: 3px; box-shadow: 0 0 0 2px var(--warn); background: var(--panel-2); }

  /* CID Badges */
  .cid.mand-pass { background: #10b981 !important; color: #ffffff !important; border-color: #059669 !important; font-weight: 800; }
  .cid.opt-pass { background: var(--ok-soft) !important; color: var(--ok) !important; border-color: var(--ok-line) !important; }
  .cid.opt-fail { background: rgba(239, 68, 68, 0.16) !important; color: #f87171 !important; border-color: rgba(239, 68, 68, 0.4) !important; font-weight: 700; }
  .cid.mand-fail { background: #ef4444 !important; color: #ffffff !important; border-color: #dc2626 !important; font-weight: 800; }

  /* Criterion card highlights */
  .crit.crit-mand-fail { border-left: 3px solid #ef4444; padding-left: 10px; margin-left: -10px; border-radius: 4px; }
  .crit.crit-opt-fail { border-left: 3px solid rgba(239, 68, 68, 0.45); padding-left: 10px; margin-left: -10px; border-radius: 4px; }

  /* Result badges in crit card */
  .res.mand-pass { background: #10b981 !important; color: #fff !important; }
  .res.opt-fail { background: rgba(239, 68, 68, 0.16); color: #f87171 !important; border: 1px solid rgba(239, 68, 68, 0.35) !important; }
  .res.mand-fail { background: #ef4444 !important; color: #fff !important; }

  .rtag.mand-pass { background: rgba(16, 185, 129, 0.18); color: var(--ok); border: 1px solid var(--ok-line); font-weight: 700; }
  .rtag.opt-fail { background: rgba(239, 68, 68, 0.16); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.35); font-weight: 700; }
  .rtag.mand-fail { background: #ef4444; color: #ffffff; border: 1px solid #dc2626; font-weight: 800; }

  /* Prominent Failed Measures Box */
  .failed-measures-box {
    margin: 14px 0;
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.22);
    border-radius: 12px;
  }
  .fmb-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .fmb-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f87171;
    font-size: 13.5px;
    font-weight: 700;
  }
  .fmb-title svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2.5;
  }
  .fmb-hint {
    font-size: 12px;
    color: var(--muted);
  }
  .fmb-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .fmb-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12.5px;
    cursor: pointer;
    background: var(--panel-1);
    border: 1px solid var(--line-2);
    color: var(--ink);
    transition: all 0.15s ease;
    text-align: left;
  }
  .fmb-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
  }
  .fmb-btn.mand {
    border-color: rgba(239, 68, 68, 0.45);
    background: rgba(239, 68, 68, 0.08);
  }
  .fmb-btn.mand:hover {
    border-color: #ef4444;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
  }
  .fmb-btn.opt {
    border-color: rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.04);
  }
  .fmb-btn.opt:hover {
    border-color: rgba(239, 68, 68, 0.5);
  }
  .fmb-tag {
    font-size: 9.5px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .fmb-tag.mand {
    background: #ef4444;
    color: #fff;
  }
  .fmb-tag.opt {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
  }
  .fmb-cid {
    font-weight: 800;
    font-size: 13px;
    color: var(--ink);
  }
  .fmb-name {
    color: var(--ink-2);
    font-weight: 500;
  }
  .fmb-arrow {
    color: var(--muted);
    font-size: 12px;
    margin-left: 2px;
  }
  .fmb-all-good {
    margin: 14px 0;
    padding: 10px 14px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--ok);
  }
  .fmb-all-good .fmb-check {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    font-weight: 800;
    font-size: 11px;
  }
  .sec-title { font-size: 18px; letter-spacing: -.02em; margin: 0 0 14px; }
  .crit.flash { box-shadow: 0 0 0 2px var(--accent); border-radius: 10px; }
  details.gaps { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; }
  details.gaps summary { cursor: pointer; padding: 10px 0; font-size: 13px; color: var(--muted); font-weight: 600; }
  details.gaps[open] { padding-bottom: 10px; }
  .fb-card { margin-bottom: 20px; }
  .fb-cols { grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
  .fb-cols > .fb { align-content: start; }
  .fb textarea { overflow-y: auto; resize: vertical; }
  @media (max-width: 900px) { .fb-cols { grid-template-columns: 1fr; } }
  .rev { display:grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, 1fr); gap: 16px; align-items: start; margin-bottom: 16px; }
  @media (max-width: 1100px) { .rev { grid-template-columns: 1fr; } }
  .sticky { position: sticky; top: 0; }
  .tabs { display:flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px -22px 6px; padding: 0 18px; }
  .tabs button { border: 0; background: none; padding: 10px 10px 12px; color: var(--muted); font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; display:inline-flex; gap: 8px; align-items:center; }
  .tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--accent); }
  .crit { padding: 13px 0; border-bottom: 1px solid var(--line); }
  .crit:last-child { border-bottom: 0; }
  .crit-top { display:flex; align-items:center; gap: 10px; }
  .crit-top .name { flex: 1; font-weight: 550; color: var(--ink); font-size: 13.5px; min-width: 0; }
  .res { width: 22px; height: 22px; border-radius: 7px; display:grid; place-items:center; flex-shrink: 0; }
  .res svg { width: 14px; height: 14px; stroke-width: 2.4; }
  .res.success { background: var(--ok-soft); color: var(--ok); } .res.failure { background: var(--bad-soft); color: var(--bad); }
  .res.unknown { background: var(--panel-2); color: var(--faint); }
  .crit .why { margin: 5px 0 0 32px; color: var(--muted); font-size: 13px; }
  .crit .ev { display:flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0 32px; }
  .evb { display:inline-flex; gap: 8px; align-items:center; border: 1px solid var(--line); background: var(--panel-2); border-radius: 8px; padding: 4px 9px; font-size: 12.5px; color: var(--ink-2); max-width: 100%; text-align:left; }
  .evb b { color: var(--accent-text); font-variant-numeric: tabular-nums; }
  .evb q { font-style: italic; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .evb:hover { border-color: var(--accent-line); }
  .ovr-note { margin: 8px 0 0 32px; font-size: 12.5px; color: var(--warn); display:flex; gap: 8px; align-items:center; flex-wrap: wrap; }
  .chg { border: 1px solid var(--line-2); background: none; color: var(--muted); border-radius: 8px; padding: 3px 9px; font-size: 12px; font-weight: 600; }
  .chg:hover { color: var(--ink); background: var(--hover); }
  .crit-edit-box { margin: 10px 0 2px 32px; padding: 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); display:grid; gap: 10px; }
  .crit-edit-box .q-seg { background: var(--panel); }
  .crit-edit-box textarea, .fb textarea { width: 100%; resize: vertical; min-height: 64px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 11px; color: var(--ink); font: inherit; font-size: 13.5px; line-height: 1.5; outline: none; }
  .crit-edit-box textarea:focus, .fb textarea:focus { border-color: var(--accent-line); }

  .player { display:flex; align-items:center; gap: 10px; padding: 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); margin-bottom: 12px; }
  .player audio { flex: 1; }
  .player .note { color: var(--muted); font-size: 12.5px; }
  .tx { max-height: 560px; overflow: auto; display:flex; flex-direction:column; gap: 10px; padding-right: 4px; scroll-behavior: smooth; }
  .bub { max-width: 84%; padding: 9px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; transition: box-shadow .3s; }
  .bub .t { display:block; font-size: 11.5px; color: var(--muted); margin-bottom: 2px; font-variant-numeric: tabular-nums; }
  .bub.CUSTOMER { background: var(--panel-2); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
  .bub.USER { background: var(--accent-soft); border: 1px solid var(--accent-line); align-self: flex-end; border-bottom-right-radius: 4px; }
  .bub.OTHER { background: var(--panel); border: 1px dashed var(--line-2); align-self: flex-start; border-bottom-left-radius: 4px; color: var(--ink); }
  .bub.miss { box-shadow: inset 3px 0 0 var(--bad); }
  .bub.flash { box-shadow: 0 0 0 2px var(--accent); }
  .bub .tags { display:inline-flex; gap: 4px; margin-left: 6px; }
  .bub .tags em { font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--bad); background: var(--bad-soft); border-radius: 5px; padding: 0 5px; }

  .fb { display:grid; gap: 14px; }
  .fb label { font-size: 12.5px; font-weight: 600; color: var(--muted); display:block; margin-bottom: 6px; }
  .plan-row { display:flex; gap: 8px; align-items:flex-start; margin-bottom: 8px; }
  .plan-row span { width: 24px; height: 24px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-text); display:grid; place-items:center; font-weight: 700; font-size: 12px; flex-shrink: 0; margin-top: 6px; }
  .plan-row textarea, .sPlan, .fbPlan { min-height: 54px; resize: vertical; overflow-y: auto; line-height: 1.45; }
  .edited { font-size: 11px; font-weight: 700; color: var(--warn); background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: 6px; padding: 1px 7px; }

  .mood { display:grid; gap: 8px; margin-bottom: 16px; }
  .mood > div { display:flex; align-items:center; gap: 8px; flex-wrap: wrap; }
  .mood .chip2 { padding: 5px 12px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line-2); font-size: 13px; font-weight: 600; text-transform: capitalize; }
  .mood svg { color: var(--muted); }
  .pips { display:inline-flex; gap: 4px; }
  .pips i { width: 18px; height: 8px; border-radius: 4px; background: var(--panel-2); border: 1px solid var(--line-2); }
  .pips i.on { background: var(--accent); border-color: var(--accent); }
  .kv2 { display:grid; grid-template-columns: 150px 1fr; gap: 10px 14px; margin: 0; font-size: 13.5px; align-items:center; }
  .kv2 dt { color: var(--muted); } .kv2 dd { margin: 0; color: var(--ink); }
  .timeline { display:grid; gap: 0; }
  .tl { display:grid; grid-template-columns: 22px 1fr; gap: 12px; padding-bottom: 14px; position: relative; }
  .tl::before { content:""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
  .tl:last-child::before { display: none; }
  .tl i { width: 22px; height: 22px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line-2); display:grid; place-items:center; }
  .tl i svg { width: 12px; height: 12px; }
  .tl b { font-weight: 600; font-size: 13px; } .tl small { display:block; color: var(--muted); font-size: 12px; }

  /* ================= Sessions, upload ================= */
  .s-cards { display:grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 18px; }
  .s-card { cursor: pointer; padding: 22px 24px; display:flex; flex-direction:column; gap: 14px; text-align:left; border: 1px solid var(--line); background: var(--panel); border-radius: 16px; color: var(--ink); position: relative; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease; }
  .s-card:hover { transform: translateY(-2px); border-color: var(--line-2); background: var(--hover); box-shadow: 0 10px 28px rgba(0,0,0,.15); }
  .s-card.s-draft { border-color: var(--warn-line); background: linear-gradient(180deg, var(--warn-soft) 0%, var(--panel) 42px); }
  .s-card.s-draft:hover { border-color: var(--warn); }
  .s-card-top { display:flex; align-items:center; justify-content: space-between; gap: 10px; width: 100%; }
  .s-card h3 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.015em; line-height: 1.35; color: var(--ink); }
  .s-card .meta-date { display:flex; align-items:center; gap: 7px; font-size: 13px; color: var(--muted); }
  .s-card .meta-date svg { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; }
  .s-card .meta2 { display:flex; justify-content: space-between; color: var(--faint); font-size: 12px; padding-top: 10px; border-top: 1px solid var(--line); margin-top: auto; }
  .icon-btn.danger { color: var(--bad); }
  .icon-btn.danger:hover { background: var(--bad-soft); color: var(--bad); }
  .icon-btn.s-card-del, .s-card-del { padding: 6px; border: 1px solid transparent; background: none; cursor: pointer; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted) !important; opacity: .55; transition: all .15s ease; }
  .s-card:hover .s-card-del { opacity: .85; }
  .icon-btn.s-card-del:hover, .s-card-del:hover { opacity: 1 !important; color: var(--bad) !important; background: var(--bad-soft) !important; border-color: var(--bad-line) !important; }
  .s-card-del svg, .s-card-del path { pointer-events: none; }
  .agent-session-header { display:flex; align-items:center; justify-content:space-between; margin: 38px 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); flex-wrap:wrap; gap: 12px; }
  .agent-session-header .agent-title { display:flex; align-items:center; gap: 12px; }
  .agent-session-header h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
  .agent-session-pills { display:flex; gap: 8px; align-items:center; margin-top: 4px; font-size: 12px; flex-wrap:wrap; }
  .sessions-toolbar { display:flex; align-items:center; justify-content:space-between; gap: 16px; flex-wrap:wrap; margin-bottom: 28px; padding: 12px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
  .sessions-toolbar .tool-group { display:flex; align-items:center; gap: 10px; flex-wrap:wrap; }
  .q-select.sm { height: 36px; font-size: 13px; padding: 0 32px 0 12px; border-radius: 9px; }
  .ss { text-transform: capitalize; font-size: 12px; font-weight: 650; padding: 3px 10px; border-radius: 999px; border: 1px solid; letter-spacing: .01em; }
  .ss.delivered { color: var(--ok); border-color: var(--ok-line); background: var(--ok-soft); }
  .ss.ready { color: var(--accent-text); border-color: var(--accent-line); background: var(--accent-soft); }
  .ss.draft { color: var(--warn); border-color: var(--warn-line); background: var(--warn-soft); }
  .agg-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .agg-row:last-child { border-bottom: 0; }
  .agg-top { display:grid; grid-template-columns: 38px minmax(0, 1fr) 170px; gap: 12px; align-items: center; }
  .agg-top .lab { font-size: 12.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
  .dotrow { display:flex; gap: 3px; margin-top: 6px; }
  .dotrow i { width: 10px; height: 10px; border-radius: 3px; background: var(--ok-soft); border: 1px solid var(--ok-line); }
  .dotrow i.f { background: var(--bad); border-color: var(--bad); }
  .examples { margin: 10px 0 0 50px; display:grid; gap: 6px; }
  .pattern { display:flex; gap: 8px; align-items:flex-start; padding: 7px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line-2); font-size: 12.5px; margin-top: 6px; color: var(--ink-2); }
  .pattern::before { content:""; width: 6px; height: 6px; border-radius: 50%; background: var(--bad); margin-top: 6px; flex-shrink: 0; }
  .summary-box { padding: 16px; border-radius: 14px; background: linear-gradient(160deg, var(--accent-soft), transparent 70%); border: 1px solid var(--accent-line); }
  .summary-box p { margin: 0 0 10px; color: var(--ink-2); }
  .drop { border: 2px dashed var(--line-2); border-radius: 18px; padding: 42px 24px; text-align:center; background: var(--panel); transition: border-color .15s, background .15s; }
  .drop.over { border-color: var(--accent); background: var(--accent-soft); }
  .drop .big { width: 54px; height: 54px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-text); display:grid; place-items:center; margin: 0 auto 14px; }
  .drop .big svg { width: 26px; height: 26px; }
  .drop h2 { margin: 0 0 6px; font-size: 18px; letter-spacing: -.01em; }
  .drop p { margin: 0 0 16px; color: var(--muted); }
  .file-pill { display:inline-flex; align-items:center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); margin-top: 16px; }
  .prog { height: 8px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
  .prog span { display:block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .4s ease; }
  .ustep { display:flex; align-items:center; gap: 12px; padding: 10px 0; }
  .ustep i { width: 26px; height: 26px; border-radius: 50%; display:grid; place-items:center; background: var(--panel-2); border: 1px solid var(--line-2); flex-shrink: 0; }
  .ustep.done i { background: var(--ok); border-color: var(--ok); color: #fff; } .ustep.now i { background: var(--accent); border-color: var(--accent); color: #fff; }
  .ustep i svg { width: 14px; height: 14px; stroke-width: 2.4; }
  .ustep b { font-weight: 600; } .ustep small { color: var(--muted); display:block; font-size: 12.5px; }

  /* Agent outcome chip, rubric tags, costs, rubric matrix */
  .oc-chip { display:inline-flex; align-items:center; gap: 7px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
  .oc-chip b { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--muted); font-variant-numeric: tabular-nums; }
  .oc-chip.t b { background: var(--ok-soft); border-color: var(--ok-line); color: var(--ok); }
  .rtag { font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 5px; margin-left: 6px; color: var(--muted); background: var(--panel-2); vertical-align: 1px; }
  .rtag.m { color: var(--bad); background: var(--bad-soft); } .rtag.a { color: var(--warn); background: var(--warn-soft); }
  .cost-bars .row3 { display:grid; grid-template-columns: minmax(0, 1fr) 120px 70px 70px; gap: 12px; align-items:center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
  .cost-bars .row3:last-child { border-bottom: 0; }
  .cost-bars .row3 .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cost-bars .row3 b, .cost-bars .row3 small { text-align: right; font-variant-numeric: tabular-nums; }
  .cost-bars .row3 small { color: var(--muted); font-size: 12px; }
  .rub { overflow-x: auto; }
  .rub table { border-collapse: separate; border-spacing: 3px; width: 100%; }
  .rub th { border: 0; padding: 4px 2px; font-size: 11px; color: var(--muted); font-weight: 650; text-align: center; white-space: nowrap; }
  .rub th.l, .rub td.l { text-align: left; padding-right: 12px; }
  .rub td { border: 0; padding: 0; }
  .rub td.l { font-size: 13px; color: var(--ink); white-space: nowrap; }
  .rub td.l small { display:block; font-size: 11.5px; color: var(--faint); }
  .rub .rc { height: 30px; min-width: 32px; border-radius: 7px; display:grid; place-items:center; font-size: 11px; font-weight: 700; }
  .rub .rc.mandatory { background: var(--bad); color: #fff; } .rub .rc.scored { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-line); }
  .rub .rc.attempted { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); } .rub .rc.not_applicable { background: var(--panel-2); color: var(--faint); }
  .rub tr.def td .rc { opacity: .45; }
  .rub-key { display:flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 14px; }
  .rub-key span { display:inline-flex; align-items:center; gap: 7px; } .rub-key .rc { width: 22px; height: 18px; min-width: 0; font-size: 10px; display:inline-grid; }

  .rub button.rc { border: 0; cursor: pointer; width: 100%; font: inherit; font-size: 11px; font-weight: 700; }
  .rub button.rc:hover { outline: 2px solid var(--accent-line); outline-offset: 1px; }
  .rub button.rc.pending { outline: 2px dashed var(--accent); outline-offset: 1px; }
  .rub tr.def td button.rc:hover { opacity: 1; }
  .q-menu-h { font-size: 12px; color: var(--muted); padding: 6px 10px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; max-width: 280px; }
  .lvl { display:inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--faint); }
  .lvl.error { background: var(--bad); } .lvl.warning { background: var(--warn); } .lvl.info { background: var(--ok); }
  .stage { font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--ink-2); }
  .err-txt { display:block; overflow:hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--bad); font-size: 12.5px; }
  .fail-card .fail-top { display:flex; gap: 16px; align-items:flex-start; }
  .fail-card h2 { margin: 2px 0 6px; font-size: 17px; letter-spacing: -.01em; }
  .fail-card p { margin: 0; color: var(--ink-2); }
  .fail-card .ico { width: 40px; height: 40px; border-radius: 12px; display:grid; place-items:center; flex-shrink: 0; }
  .fail-card .ico.bad { background: var(--bad-soft); color: var(--bad); } .fail-card .ico.warn { background: var(--warn-soft); color: var(--warn); }
  .fail-card .ico.info { background: var(--info-soft); color: var(--info); }
  .fail-card.bad { border-color: var(--bad-line); }
  .retry-link { font-size: 12px; margin-left: 6px; display:inline-flex; align-items:center; gap: 3px; }
  .retry-link svg { width: 12px; height: 12px; }
  .worker-line { display:flex; align-items:center; gap: 9px; margin: -6px 0 18px; font-size: 13px; color: var(--muted); }
  .worker-line i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
  .worker-line.ok i { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); } .worker-line.bad i { background: var(--bad); }
  .versions { display:grid; gap: 12px; }
  .ver { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
  .ver-h { display:flex; align-items:center; gap: 12px; }
  .ver-h small { display:block; color: var(--muted); font-size: 12px; margin-top: 2px; }
  .ver-n { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-text); font-variant-numeric: tabular-nums; }
  .ver-ch { margin: 10px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); display:grid; gap: 3px; }
  .ver-ap { margin-top: 10px; display:grid; gap: 4px; font-size: 12.5px; color: var(--ok); }
  .ver-ap div { display:flex; gap: 6px; align-items:flex-start; } .ver-ap svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; }
  .ver-ap.none { color: var(--muted); }
  .opt { display:flex; gap: 10px; align-items:flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; cursor: pointer; font-weight: 400 !important; }
  .opt input { margin-top: 3px; accent-color: var(--accent); }
  .opt small { display:block; color: var(--muted); font-size: 12px; margin-top: 2px; }
  .opt:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }
  .ap-preview { margin: 6px 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); font-size: 13px; color: var(--ink-2); }
  .def { margin-bottom: 16px; border-radius: 14px; }
  .def-h { display:flex; align-items:center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
  .def-h h2 { margin: 0 auto 0 0; font-size: 16px; font-weight: 700; }
  .def-cols { display:grid; grid-template-columns: 1.25fr 1.15fr 0.8fr; gap: 14px; }
  @media (max-width: 1000px) { .def-cols { grid-template-columns: 1fr; } }
  .def-c { border-radius: 12px; padding: 12px 14px; border: 1px solid var(--line); position: relative; }
  .def-c.clickable { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
  .def-c.clickable:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.08); }
  .def-c p { margin: 6px 0 0; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
  .def-t { display:flex; align-items:center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
  .def-t svg { width: 14px; height: 14px; }
  .def-c.ok { background: var(--ok-soft); border-color: var(--ok-line); } .def-c.ok .def-t { color: var(--ok); }
  .def-c.bad { background: var(--bad-soft); border-color: var(--bad-line); } .def-c.bad .def-t { color: var(--bad); }
  .def-c.na { background: var(--panel-2); } .def-c.na .def-t { color: var(--muted); }
  .def-rules { display:grid; gap: 6px; margin-top: 14px; font-size: 12.5px; color: var(--ink-2); }
  .def-rules .rtag { margin-left: 0; margin-right: 4px; }

  /* Definition Edit Modal styling */
  .q-dialog.def-modal-dialog {
    width: min(880px, 96vw);
    max-width: 880px;
    padding: 24px 28px;
    border-radius: 20px;
  }
  .def-modal-h {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
  }
  .def-modal-h h2 { margin: 0; font-size: 19px; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
  .def-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 16px 0;
  }
  @media (max-width: 768px) {
    .def-modal-grid { grid-template-columns: 1fr; }
  }
  .def-rule-box {
    border-radius: 14px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .def-rule-box.pass-box { background: var(--ok-soft); border-color: var(--ok-line); }
  .def-rule-box.fail-box { background: var(--bad-soft); border-color: var(--bad-line); }
  .def-rule-box .rule-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
  }
  .def-rule-box.pass-box .rule-head { color: var(--ok); }
  .def-rule-box.fail-box .rule-head { color: var(--bad); }
  .def-rule-box .rule-hint { font-size: 12px; color: var(--ink-2); opacity: .85; line-height: 1.4; margin-bottom: 2px; }
  .def-rule-box textarea {
    width: 100%;
    min-height: 155px;
    padding: 12px;
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.55;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--ink);
    box-sizing: border-box;
    font-family: inherit;
    resize: vertical;
  }
  .def-rule-box.pass-box textarea:focus { border-color: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); outline: none; }
  .def-rule-box.fail-box textarea:focus { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); outline: none; }

  .rs.failed { color: var(--bad); background: var(--bad-soft); border-color: var(--bad-line); }
  .proc-log td { vertical-align: top; }
  .msg-cell { max-width: 460px; min-width: 260px; overflow-wrap: anywhere; word-break: break-word; }
  .err-detail { margin: 8px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font-size: 11.5px; white-space: pre-wrap; max-height: 260px; overflow: auto; color: var(--ink-2); }

  /* Modal, skeletons */
  .q-modal { position: fixed; inset: 0; background: rgba(5,8,15,.55); display:grid; place-items:center; z-index: 70; padding: 20px; }
  .q-dialog { width: min(520px, 100%); background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; padding: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
  .q-dialog h2 { margin: 0 0 4px; font-size: 18px; letter-spacing: -.01em; }
  .q-dialog p { margin: 0 0 16px; color: var(--muted); }
  .q-dialog .row2 { display:flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
  .checks { display:grid; gap: 6px; max-height: 260px; overflow: auto; }
  .checks label { display:flex; align-items:center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); font-size: 13px; cursor: pointer; }
  .checks label:hover { background: var(--hover); }
  .sk { border-radius: 10px; background: linear-gradient(90deg, var(--panel-2) 25%, var(--hover) 50%, var(--panel-2) 75%); background-size: 200% 100%; animation: qsk 1.2s ease-in-out infinite; }
  @keyframes qsk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
  @media (prefers-reduced-motion: reduce) { .sk { animation: none; } .tx { scroll-behavior: auto; } }
  .q-empty { padding: 44px 20px; text-align: center; color: var(--muted); }
  .q-empty svg { width: 30px; height: 30px; color: var(--faint); margin-bottom: 8px; }

  /* ================= Modern SaaS Charts & Drill-down ================= */
  .donut-container { display: flex; align-items: center; justify-content: center; gap: 28px; padding: 12px 6px; }
  .donut-chart-svg { width: 160px; height: 160px; flex-shrink: 0; transform: rotate(-90deg); }
  .donut-legend { display: flex; flex-direction: column; gap: 9px; flex: 1; min-width: 0; }
  .donut-legend-item { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-2); }
  .donut-legend-item .dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
  .donut-legend-item .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .donut-legend-item .count { margin-left: auto; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
  .donut-legend-item .pct { color: var(--muted); font-size: 12px; min-width: 44px; text-align: right; }

  .bar-chart-card { display: flex; flex-direction: column; height: 100%; }
  .bar-chart-svg-wrap { flex: 1; width: 100%; min-height: 220px; position: relative; }
  .bar-chart-svg { width: 100%; height: 220px; overflow: visible; }
  .chart-col:hover rect { opacity: 0.85; filter: brightness(1.2); cursor: pointer; }

  .drill-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; margin-bottom: 20px; }
  @media (max-width: 960px) { .drill-grid { grid-template-columns: 1fr; } }
  .obj-item { display: flex; flex-direction: column; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .obj-item:last-child { border-bottom: 0; }
  .obj-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; color: var(--ink); }
  .obj-head .count { font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
  .obj-track { height: 7px; border-radius: 4px; background: var(--panel-2); overflow: hidden; width: 100%; margin-top: 4px; }
  .obj-bar { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #f97316, #ef4444); transition: width .4s ease; }

  .quality-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 7px; font-size: 12px; font-weight: 650; }
  .quality-badge.good { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-line); }
  .quality-badge.missed { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); }

  .stage-pills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
  @media (max-width: 700px) { .stage-pills { grid-template-columns: repeat(2, 1fr); } }
  .stage-box { padding: 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); text-align: center; }
  .stage-box .s-lbl { font-size: 11.5px; color: var(--muted); font-weight: 600; display: block; margin-bottom: 4px; }
  .stage-box .s-val { font-size: 17px; font-weight: 700; color: var(--ink); }
  .stage-box .s-pct { font-size: 11.5px; color: var(--accent-text); font-weight: 650; }

  /* ================= Lead Gen Portal ================= */
  .portal-hero { display: flex; align-items: center; gap: 20px; padding: 22px 26px; border-radius: 18px; background: linear-gradient(135deg, rgba(124,58,237,.2) 0%, rgba(13,11,30,.85) 100%); border: 1px solid var(--accent-line); margin-bottom: 22px; flex-wrap: wrap; box-shadow: 0 4px 20px -2px rgba(0,0,0,.5); }
  .portal-hero h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.02em; font-weight: 700; }
  .portal-hero p { margin: 0; color: var(--ink-2); font-size: 13.5px; }
  .portal-hero .portal-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }

  .portal-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
  .portal-tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 16px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; display: flex; align-items: center; gap: 8px; transition: color .15s, border-color .15s; }
  .portal-tab:hover { color: var(--ink); }
  .portal-tab.active { color: var(--accent-text); border-bottom-color: var(--accent); }
  .portal-tab .count { font-size: 11px; padding: 1px 7px; border-radius: 999px; }

  .portal-card { border-radius: 16px; border: 1px solid var(--line); background: var(--panel); padding: 20px 22px; margin-bottom: 16px; transition: border-color .2s, box-shadow .2s; box-shadow: var(--shadow); }
  .portal-card:hover { border-color: var(--line-2); box-shadow: 0 8px 30px rgba(0,0,0,.35); }
  .portal-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
  .portal-meta-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  .portal-meta-left .time { font-size: 14px; font-weight: 700; color: var(--ink); }
  .portal-meta-left .dur { font-size: 12.5px; color: var(--muted); }
  .portal-scores { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--panel-2); padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 14px; }
  .portal-score-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
  .portal-score-chip small { color: var(--muted); font-size: 11.5px; font-weight: 500; }

  .coach-quote { margin: 12px 0; padding: 12px 16px; border-radius: 12px; background: rgba(124,58,237,.09); border-left: 3px solid var(--accent); font-size: 13.5px; line-height: 1.5; color: var(--ink); }
  .coach-quote b { color: var(--accent-text); display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }

  .portal-action-list { display: grid; gap: 6px; margin: 10px 0 14px; }
  .portal-action-row { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--ink-2); background: var(--panel-2); padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-2); }
  .portal-action-row svg { width: 16px; height: 16px; color: var(--accent-text); flex-shrink: 0; margin-top: 2px; }

  .portal-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
  .portal-audio { flex: 1; max-width: 380px; min-width: 240px; height: 36px; border-radius: 8px; }

  /* ================= Settings Page Styles ================= */
  .settings-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; margin-bottom: 22px; }
  @media (max-width: 980px) { .settings-grid { grid-template-columns: 1fr; } }
  .setting-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .setting-row:last-child { border-bottom: 0; }
  .setting-lbl { display: flex; flex-direction: column; gap: 3px; max-width: 65%; }
  .setting-lbl b { font-size: 13.5px; color: var(--ink); }
  .setting-lbl span { font-size: 12px; color: var(--muted); line-height: 1.4; }
  .setting-val { font-size: 13px; font-weight: 600; color: var(--ink-2); text-align: right; }

  /* ================= Objection Funnel & Polish ================= */
  .objection-funnel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
  @media (max-width: 850px) { .objection-funnel { grid-template-columns: repeat(2, 1fr); } }
  .funnel-step { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 10px; text-align: center; position: relative; transition: border-color .15s, transform .15s; }
  .funnel-step:hover { border-color: var(--line-2); transform: translateY(-2px); }
  .funnel-step .f-stage { font-size: 11px; text-transform: uppercase; font-weight: 700; color: var(--muted); letter-spacing: .04em; margin-bottom: 6px; }
  .funnel-step .f-count { font-size: 20px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
  .funnel-step .f-pct { font-size: 11.5px; font-weight: 650; color: var(--accent-text); margin-top: 3px; }
  .rank-badge { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--panel-2); color: var(--muted); margin-right: 8px; border: 1px solid var(--line); }
  .rank-badge.top { background: rgba(249,115,22,.15); color: #f97316; border-color: rgba(249,115,22,.3); }

  /* Segmented Toggle */
  .seg-control { display: inline-flex; background: var(--panel-2); padding: 3px; border-radius: 10px; border: 1px solid var(--line); }
  .seg-btn { background: none; border: 0; padding: 5px 12px; font-size: 12px; font-weight: 600; color: var(--muted); border-radius: 7px; cursor: pointer; transition: all .15s; }
  .seg-btn:hover { color: var(--ink); }
  .seg-btn.active { background: var(--panel); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.25); }

  /* ================= Modern SaaS Analysis Section ================= */
  .analysis-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; padding-bottom: 2px; }
  .a-tab { background: none; border: 0; border-bottom: 2.5px solid transparent; padding: 10px 18px; font-size: 13.5px; font-weight: 650; color: var(--muted); cursor: pointer; display: flex; align-items: center; gap: 8px; transition: color .15s, border-color .15s; white-space: nowrap; border-radius: 6px 6px 0 0; }
  .a-tab:hover { color: var(--ink); background: var(--hover); }
  .a-tab.active { color: var(--accent-text); border-bottom-color: var(--accent); background: var(--accent-soft); }
  .a-tab svg { width: 16px; height: 16px; }

  .skill-meter { display: flex; align-items: center; gap: 8px; }
  .skill-track { flex: 1; height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; min-width: 50px; }
  .skill-fill { height: 100%; border-radius: 3px; }
  .skill-fill.conf { background: linear-gradient(90deg, #6366f1, #818cf8); }
  .skill-fill.warmth { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
  .skill-fill.rapport { background: linear-gradient(90deg, #14b8a6, #2dd4bf); }

  .pace-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; }
  .pace-pill.good { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-line); }
  .pace-pill.warn { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); }

  .mood-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; text-transform: capitalize; }
  .mood-tag.improved { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-line); }
  .mood-tag.steady { background: var(--info-soft); color: var(--info); border: 1px solid var(--info-line); }
  .mood-tag.worsened { background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad-line); }

  .mood-trans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 14px; }
  .mood-trans-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .mood-trans-flow { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink); }
  .mood-trans-flow .arrow { color: var(--muted); font-size: 12px; }

  /* ================= Modern Priority Review Queue ================= */
  .prio-kpi-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
  .prio-kpi-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; display: flex; align-items: center; gap: 14px; transition: all .15s ease; box-shadow: var(--shadow); }
  .prio-kpi-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
  .prio-kpi-icon { width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .prio-kpi-icon svg { width: 19px; height: 19px; }
  .prio-kpi-card.is-bad .prio-kpi-icon { background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad-line); }
  .prio-kpi-card.is-warn .prio-kpi-icon { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); }
  .prio-kpi-card.is-risk .prio-kpi-icon { background: rgba(239, 68, 68, 0.12); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.25); }
  .prio-kpi-card.is-cadence .prio-kpi-icon { background: var(--accent-soft); color: var(--accent-text); border: 1px solid var(--accent-line); }
  .prio-kpi-body { display: flex; flex-direction: column; min-width: 0; }
  .prio-kpi-val { font-size: 22px; font-weight: 750; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
  .prio-kpi-val small { font-size: 13px; font-weight: 500; color: var(--muted); }
  .prio-kpi-lbl { font-size: 12.5px; font-weight: 650; color: var(--ink-2); margin-top: 2px; }
  .prio-kpi-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .prio-filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
  .prio-tabs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; background: var(--panel); padding: 4px; border-radius: 11px; border: 1px solid var(--line); }
  .prio-tab { border: none; background: transparent; padding: 6px 12px; font-size: 12.5px; font-weight: 600; color: var(--muted); border-radius: 8px; cursor: pointer; transition: all .12s ease; display: inline-flex; align-items: center; gap: 7px; }
  .prio-tab:hover { color: var(--ink); background: var(--hover); }
  .prio-tab.active { color: var(--ink); background: var(--panel-2); box-shadow: 0 1px 3px rgba(0,0,0,.1); font-weight: 700; }
  .prio-tab .tab-cnt { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); }
  .prio-tab.active .tab-cnt { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
  .prio-tab .tab-cnt.badge-bad { background: var(--bad-soft); border-color: var(--bad-line); color: var(--bad); }
  .prio-tab .tab-cnt.badge-risk { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.25); color: #ef4444; }

  .prio-search-wrap { position: relative; min-width: 240px; }
  .prio-search-wrap svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--muted); pointer-events: none; }
  .prio-search-input { padding-left: 32px; height: 35px; font-size: 12.5px; border-radius: 9px; }

  .prio-queue-wrapper { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .prio-queue-header { display: grid; grid-template-columns: minmax(200px, 1.3fr) minmax(140px, 1fr) minmax(180px, 1.2fr) minmax(170px, 1.1fr) minmax(145px, 1fr) 125px; gap: 14px; align-items: center; padding: 10px 18px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); border-bottom: 1px solid var(--line-2); min-width: 940px; }
  .prio-queue-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; min-width: 940px; }

  .prio-row { display: grid; grid-template-columns: minmax(200px, 1.3fr) minmax(140px, 1fr) minmax(180px, 1.2fr) minmax(170px, 1.1fr) minmax(145px, 1fr) 125px; gap: 14px; align-items: center; padding: 14px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: all .15s ease; border-left: 3.5px solid var(--line-2); }
  .prio-row:hover { border-color: var(--line-2); background: var(--hover); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,.08); }
  .prio-row.tier-high { border-left-color: var(--bad); }
  .prio-row.tier-medium, .prio-row.tier-moderate { border-left-color: var(--warn); }
  .prio-row.tier-low { border-left-color: var(--ok); }

  .prio-cell-agent { display: flex; align-items: center; gap: 12px; min-width: 0; }
  .prio-rank { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 26px; border-radius: 6px; font-weight: 800; font-size: 12px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); flex-shrink: 0; font-variant-numeric: tabular-nums; }
  .prio-rank.rank-1 { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
  .prio-rank.rank-top { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
  .prio-agent-info { display: flex; flex-direction: column; min-width: 0; }
  .prio-name { font-size: 14.5px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .prio-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .prio-score-wrap { display: inline-flex; align-items: center; gap: 8px; }
  .prio-score-val { font-size: 13.5px; font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; display: block; }
  .prio-score-val small { font-size: 11px; font-weight: 500; color: var(--muted); }
  .prio-score-src { font-size: 11px; color: var(--muted); display: block; margin-top: 1px; }

  .prio-cell-risk { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
  .prio-trigger-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

  .prio-cell-cadence { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
  .prio-cadence-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

  .prio-cell-calls { display: flex; flex-direction: column; gap: 2px; }
  .prio-calls-pill { font-size: 12.5px; font-weight: 600; color: var(--ink); }
  .prio-calls-num { font-weight: 800; font-variant-numeric: tabular-nums; }
  .prio-calls-sub { font-size: 11px; font-weight: 550; }
  .prio-calls-sub.is-bad { color: var(--bad); }

  .prio-cell-action { text-align: right; }
  .prio-cell-action button { white-space: nowrap; }

  @media (max-width: 960px) {
    .prio-kpi-strip { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 580px) {
    .prio-kpi-strip { grid-template-columns: 1fr; }
  }

  /* Agent Review View */
  .rev-hero-content { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
  .last-fb-container { display: flex; flex-direction: column; gap: 16px; }
  .last-fb-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .last-fb-meta h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink); }
  .coaching-focus-box { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
  .coaching-focus-box h4 { margin: 0 0 12px; font-size: 13.5px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 7px; }
  .coaching-focus-box h4 svg { width: 15px; height: 15px; color: var(--accent-text); }
  .action-plan-list { display: flex; flex-direction: column; gap: 10px; }
  .coaching-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; }
  .coaching-txt { flex: 1; font-size: 13px; min-width: 0; }
  .coaching-note { color: var(--muted); font-size: 12px; margin-top: 2px; }
  .plan-step-item { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
  .plan-step-item span { width: 20px; height: 20px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }

  /* Timeline & Call Selection */
  .rev-select-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
  .rev-sel-badge { font-size: 12.5px; font-weight: 700; color: var(--accent-text); background: var(--accent-soft); padding: 4px 10px; border-radius: 8px; border: 1px solid var(--accent-line); }
  .timeline-milestone { display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin: 12px 0 16px; border-radius: 10px; background: var(--panel-2); border: 1px dashed var(--line-2); font-size: 13px; color: var(--muted); }
  .timeline-milestone i { width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-text); flex-shrink: 0; }
  .timeline-milestone i svg { width: 13px; height: 13px; }

  /* ================= Chronological Calls Ready for Review ================= */
  .timeline-table-wrapper { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: 14px; }
  .timeline-calls-header { display: grid; grid-template-columns: 36px 125px minmax(180px, 1fr) 140px 95px 95px 130px; gap: 12px; align-items: center; padding: 10px 18px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); border-bottom: 1px solid var(--line-2); min-width: 820px; }
  .timeline-calls-header .tch-r { text-align: right; }
  .timeline-calls-table { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; min-width: 820px; }
  .timeline-call-item { display: grid; grid-template-columns: 36px 125px minmax(180px, 1fr) 140px 95px 95px 130px; gap: 12px; align-items: center; padding: 12px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: all .15s ease; font-size: 13px; min-width: 820px; }
  .timeline-call-item:hover { border-color: var(--line-2); background: var(--hover); }
  .timeline-call-item.selected { background: var(--accent-soft); border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line); }
  .timeline-call-item.has-issues { border-left: 3.5px solid var(--bad); }
  .timeline-call-item.selected.has-issues { border-left: 3.5px solid var(--bad); }
  
  .tci-when b { display: block; font-size: 12.5px; font-weight: 650; color: var(--ink); white-space: nowrap; }
  .tci-when .tci-dur { display: block; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 2px; }
  
  .tci-outcome { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
  .tci-outcome .oc-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tci-lead { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  .tci-lead svg { width: 11px; height: 11px; flex-shrink: 0; opacity: .7; }
  
  .tci-result { display: flex; align-items: center; min-width: 0; }
  .tci-result .badge { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tci-score, .tci-conduct { display: flex; align-items: center; }
  .tci-action { text-align: right; }

  /* Transfer Outcome badges & pills */
  .to-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
  .to-pill.lead { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
  .to-pill.drop { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
  .to-pill.reject { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }
  .to-pill.pending { background: rgba(100, 116, 139, 0.15); color: #94a3b8; border: 1px dashed rgba(100, 116, 139, 0.3); }

  /* Transfer Review Card on Call Detail */
  .transfer-review-card { padding: 18px 22px; margin-bottom: 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
  .transfer-review-card.set-lead { border-color: rgba(16, 185, 129, 0.35); background: linear-gradient(180deg, rgba(16, 185, 129, 0.05) 0%, var(--panel) 100%); }
  .transfer-review-card.set-drop { border-color: rgba(245, 158, 11, 0.35); background: linear-gradient(180deg, rgba(245, 158, 11, 0.05) 0%, var(--panel) 100%); }
  .transfer-review-card.set-reject { border-color: rgba(239, 68, 68, 0.35); background: linear-gradient(180deg, rgba(239, 68, 68, 0.05) 0%, var(--panel) 100%); }
  .trc-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
  .trc-title { display: flex; align-items: center; gap: 12px; }
  .trc-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .trc-icon svg { width: 18px; height: 18px; }
  .trc-title h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
  .trc-actions-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid var(--line-2); }
  .trc-prompt { font-size: 12.5px; font-weight: 600; color: var(--muted); }
  .tr-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 9px; font-size: 13px; font-weight: 650; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); cursor: pointer; transition: all .15s ease; }
  .tr-btn svg { width: 14px; height: 14px; }
  .tr-btn:hover { background: var(--hover); border-color: var(--line-2); }
  .tr-btn.tr-lead.active, .tr-btn.tr-lead:hover { background: #10b981; color: #fff; border-color: #10b981; box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3); }
  .tr-btn.tr-drop.active, .tr-btn.tr-drop:hover { background: #f59e0b; color: #fff; border-color: #f59e0b; box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3); }
  .tr-btn.tr-reject.active, .tr-btn.tr-reject:hover { background: #ef4444; color: #fff; border-color: #ef4444; box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3); }
  .tr-btn.tr-clear { font-size: 12px; color: var(--muted); background: transparent; border-color: transparent; }
  .tr-btn.tr-clear:hover { color: var(--ink); background: var(--hover); }
  .trc-meta { margin-left: auto; font-size: 12px; color: var(--muted); }

  /* Net Leads KPI grid */
  .net-leads-kpis { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

  /* Modal styles */
  .modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 9999; padding: 20px; animation: fadeIn .15s ease; }
  .modal-dialog { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; width: 100%; box-shadow: 0 20px 40px rgba(0,0,0,0.4); animation: slideUp .2s ease; }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
  @keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

  .dock-archive-box { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }

  /* ================= Sessions Summary Table View ================= */
  .summary-filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; padding: 14px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
  .summary-filter-bar .filter-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .filter-date-inputs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
  .filter-date-inputs input[type="date"] { height: 36px; padding: 0 10px; font-size: 12.5px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); }

  .sess-summary-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
  .sess-summary-table th { padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; border-bottom: 1px solid var(--line-2); background: var(--panel); white-space: nowrap; }
  .sess-summary-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
  .sess-summary-table tr { transition: background .12s ease; cursor: pointer; }
  .sess-summary-table tr:hover td { background: var(--hover); }
  .sess-summary-table tr:last-child td { border-bottom: 0; }
  
  .reviewer-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
  .reviewer-badge.del { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok-line); }
  .reviewer-badge.draft { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); }
  .reviewer-badge svg { width: 13px; height: 13px; }

  .risk-between-box { padding: 10px 14px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line-2); font-size: 12.5px; color: var(--ink-2); line-height: 1.4; }

  /* 5-Day Trend History Strip */
  .history-strip { display: flex; flex-direction: column; gap: 4px; }
  .history-strip-days { display: flex; align-items: center; gap: 5px; }
  .history-day-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 30px; height: 38px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--line); transition: transform .1s ease; cursor: default; }
  .history-day-chip:hover { transform: scale(1.08); border-color: var(--line-2); }
  .history-day-chip .history-day-lbl { font-size: 9.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; margin-bottom: 2px; }
  .history-day-chip .history-day-dot { width: 8px; height: 8px; border-radius: 50%; display: block; }
  .history-day-chip.risk-high { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); }
  .history-day-chip.risk-high .history-day-dot { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.5); }
  .history-day-chip.risk-medium, .history-day-chip.risk-moderate { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.3); }
  .history-day-chip.risk-medium .history-day-dot, .history-day-chip.risk-moderate .history-day-dot { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.5); }
  .history-day-chip.risk-low { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.3); }
  .history-day-chip.risk-low .history-day-dot { background: #10b981; box-shadow: 0 0 6px rgba(16, 185, 129, 0.5); }
  .history-day-chip.risk-no_calls { opacity: 0.5; }
  .history-day-chip.risk-no_calls .history-day-dot { background: var(--muted); opacity: 0.4; }

  /* Living Definition Query Builder */
  .qb-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; margin-bottom: 20px; box-shadow: var(--shadow); }
  .qb-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .qb-title { margin: 0; font-size: 16px; font-weight: 750; color: var(--ink); display: flex; align-items: center; gap: 8px; }
  .qb-group { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; position: relative; }
  .qb-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
  .qb-group-title { font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
  .qb-cond-row { display: grid; grid-template-columns: minmax(280px, 2.2fr) minmax(180px, 1.1fr) minmax(120px, 0.7fr) 38px; gap: 12px; align-items: center; margin-bottom: 10px; }
  .qb-formula-box { background: var(--panel-3); border: 1px dashed var(--line-2); border-radius: 8px; padding: 10px 14px; font-family: 'JetBrains Mono', monospace, sans-serif; font-size: 12px; color: var(--accent-text); margin-top: 14px; line-height: 1.5; word-break: break-word; }
  .period-option-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; width: 100%; }
  .period-option-card { border: 1.5px solid var(--line); border-radius: 12px; padding: 16px; cursor: pointer; transition: all .15s ease; background: var(--panel-2); }
  .period-option-card:hover { border-color: var(--line-2); background: var(--hover); }
  .period-option-card.active { border-color: var(--accent); background: var(--accent-soft); }
  .period-option-card input[type="radio"] { margin-right: 8px; }
  .cond-val-wrap { display: flex; align-items: center; gap: 4px; }

  @media (max-width: 1024px) {
    .period-option-grid { grid-template-columns: 1fr; }
    .qb-cond-row { grid-template-columns: 1fr; }
  }

  /* ================= 5-Day Working Trend Chart & Risk Diagnostics ================= */
  .agent-trend-chart-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--rad);
    padding: 20px 22px;
    margin-bottom: 22px;
  }
  .trend-chart-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line-2);
  }
  .trend-chart-title-wrap {
    min-width: 0;
    flex: 1;
  }
  .trend-chart-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 750;
    color: var(--ink);
  }
  .trend-chart-title svg {
    width: 20px;
    height: 20px;
    color: var(--accent);
  }
  .trend-chart-sub {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 3px;
    line-height: 1.4;
  }
  .trend-chart-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 11.5px;
    color: var(--muted);
  }
  .t-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .t-leg-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
  }
  .t-leg-line {
    width: 16px;
    height: 0;
    display: inline-block;
  }
  .trend-chart-dual-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
  }
  @media (max-width: 900px) {
    .trend-chart-dual-grid {
      grid-template-columns: minmax(0, 1fr);
    }
  }
  .trend-chart-panel {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid var(--line-2);
    border-radius: 10px;
    padding: 14px 16px 12px;
    display: flex;
    flex-direction: column;
  }
  .trend-panel-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-2);
    margin-bottom: 10px;
    letter-spacing: -0.01em;
  }
  .trend-chart-svg {
    width: 100%;
    height: 160px;
    overflow: visible;
    display: block;
  }
  .trend-days-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
  }
  @media (max-width: 1100px) {
    .trend-days-grid {
      grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
  }
  .trend-day-card {
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    transition: border-color 0.15s, transform 0.15s;
  }
  .trend-day-card:hover {
    border-color: var(--line-focus);
  }
  .trend-day-card.tier-high {
    border-left: 3px solid #ef4444;
  }
  .trend-day-card.tier-medium, .trend-day-card.tier-moderate {
    border-left: 3px solid #f59e0b;
  }
  .trend-day-card.tier-low {
    border-left: 3px solid #10b981;
  }
  .trend-day-card.tier-no_calls {
    border-left: 3px solid var(--faint);
    opacity: 0.75;
  }
  .trend-day-card.is-today {
    box-shadow: 0 0 0 1.5px rgba(99, 102, 241, 0.45);
  }
  .trend-day-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    border-bottom: 1px solid var(--line-2);
    padding-bottom: 6px;
  }
  .trend-day-name {
    font-size: 12px;
    font-weight: 750;
    color: var(--ink);
  }
  .trend-day-date {
    font-size: 11px;
    color: var(--muted);
  }
  .trend-today-pill {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 1px 4px;
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    border-radius: 3px;
  }
  .trend-day-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .trend-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11.5px;
  }
  .trend-stat-row .stat-lbl {
    color: var(--muted);
  }
  .trend-stat-row .stat-val {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
  }
  .text-good { color: #10b981 !important; }
  .text-warn { color: #f59e0b !important; }
  .text-bad  { color: #ef4444 !important; }
  .trend-day-trigger {
    font-size: 10.5px;
    color: #ef4444;
    line-height: 1.25;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed var(--line-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .prio-trend-drawer {
    background: rgba(15, 23, 42, 0.65);
    border-bottom: 1px solid var(--line);
    padding: 18px 22px 22px;
    animation: fadeIn .15s ease;
  }
  .prio-trend-drawer.hidden {
    display: none !important;
  }
  .prio-trend-chart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line-2);
    color: var(--muted);
    cursor: pointer;
    margin-left: 6px;
    transition: all 0.15s;
  }
  .prio-trend-chart-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    color: var(--ink);
    border-color: rgba(99, 102, 241, 0.4);
  }
  .prio-trend-chart-btn svg {
    width: 13px;
    height: 13px;
  }


  /* Multi-session tabs in Agent Review */
  .session-history-tabs { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; border-bottom: 1px solid var(--line); padding-bottom: 10px; flex-wrap: wrap; }
  .sht-tab { padding: 6px 14px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 13px; font-weight: 650; cursor: pointer; transition: all .15s ease; }
  .sht-tab:hover { background: var(--hover); color: var(--ink); }
  .sht-tab.active { background: var(--panel-2); color: var(--accent-text); border-color: var(--line-2); box-shadow: var(--shadow); }

  /* Timeline filter tabs */
  .timeline-filter-tabs { display: flex; align-items: center; gap: 6px; }
  .tft-tab { padding: 5px 12px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s ease; }
  .tft-tab:hover { background: var(--hover); color: var(--ink); }
  .tft-tab.active { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-line); }

  /* Prominent timeline feedback milestone divider */
  .timeline-feedback-milestone { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin: 12px 0; border-radius: 12px; background: linear-gradient(90deg, rgba(59, 130, 246, 0.08) 0%, rgba(59, 130, 246, 0.02) 100%); border: 1.5px dashed rgba(59, 130, 246, 0.4); }
  .timeline-feedback-milestone .tfm-icon { width: 32px; height: 32px; border-radius: 8px; background: rgba(59, 130, 246, 0.15); color: #3b82f6; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .timeline-feedback-milestone .tfm-icon svg { width: 17px; height: 17px; }
  .timeline-feedback-milestone .tfm-content { min-width: 0; flex: 1; }
  .timeline-feedback-milestone .tfm-title { font-size: 13.5px; font-weight: 700; color: var(--ink); }
  .timeline-feedback-milestone .tfm-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

  /* Action plan editable list */
  .session-plan-list { display: flex; flex-direction: column; gap: 10px; }
  .dynamic-plan-row { display: flex; align-items: flex-start; gap: 10px; width: 100%; }
  .dynamic-plan-row .plan-num { width: 28px; height: 28px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 4px; }
  .dynamic-plan-row textarea.sPlan, .dynamic-plan-row textarea.fbPlan { flex: 1; min-height: 52px; padding: 8px 12px; font-size: 13.5px; line-height: 1.45; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); resize: vertical; }
  .dynamic-plan-row textarea.sPlan:focus, .dynamic-plan-row textarea.fbPlan:focus { border-color: var(--accent); background: var(--panel); outline: none; }
  .plan-del-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; margin-top: 4px; transition: all .15s ease; }
  .plan-del-btn:hover { background: rgba(239, 68, 68, 0.12); color: #ef4444; border-color: rgba(239, 68, 68, 0.25); }
  .plan-del-btn svg { width: 15px; height: 15px; }

  /* Call Detail Recent Coaching Card */
  .call-recent-coaching-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 22px; margin-bottom: 22px; }
  .crc-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
  .crc-title { display: flex; align-items: center; gap: 10px; }
  .crc-title h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
  .crc-tabs { display: flex; align-items: center; gap: 6px; }
  .crc-tab { padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-size: 11.5px; font-weight: 650; cursor: pointer; transition: all .15s ease; }
  .crc-tab.active { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent-line); }
