* { margin: 0; padding: 0; box-sizing: border-box; }
  body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f0f2f5; color: #1a1a2e; font-size: 14px; }

  /* Top bar */
  .topbar { background: #1a1a2e; color: #fff; display: flex; align-items: center; height: 48px; padding: 0 20px; position: relative; }
  .topbar .logo { font-weight: 700; font-size: 18px; letter-spacing: 1px; }
  .topbar .logo span { color: #4ecdc4; }
  .topbar .user-area { margin-left: auto; display: flex; align-items: center; gap: 14px; }
  .topbar .tenant { font-size: 12px; color: #aab; }
  .topbar .avatar { width: 30px; height: 30px; background: #4ecdc4; color: #1a1a2e; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; cursor: pointer; }

  /* Settings menu (dropdown from avatar) */
  .settings-menu { position: absolute; top: 48px; right: 16px; background: #fff; border: 1px solid #dde; border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,0.12); width: 240px; padding: 6px 0; z-index: 200; display: none; }
  .settings-menu.open { display: block; }
  .settings-menu .item { padding: 10px 16px; font-size: 13px; cursor: pointer; }
  .settings-menu .item:hover { background: #f0f2f5; }
  .settings-menu .item.muted { color: #888; font-size: 11px; padding: 6px 16px; cursor: default; }
  .settings-menu .item.muted:hover { background: transparent; }
  .settings-menu hr { border: none; border-top: 1px solid #eef; margin: 4px 0; }

  /* Notification bell + dropdown (M15) */
  .topbar .bell { position: relative; cursor: pointer; font-size: 17px; line-height: 1; display: flex; align-items: center; user-select: none; }
  .topbar .bell .bell-count { position: absolute; top: -6px; right: -8px; background: #e74c3c; color: #fff; font-size: 9px; font-weight: 700; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; display: flex; align-items: center; justify-content: center; box-sizing: border-box; }
  .notif-menu { position: absolute; top: 48px; right: 16px; width: 340px; max-height: 62vh; overflow-y: auto; background: #fff; border: 1px solid #dde; border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,0.12); z-index: 200; display: none; }
  .notif-menu.open { display: block; }
  .notif-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid #eef; font-weight: 600; font-size: 13px; color: #1a1a2e; position: sticky; top: 0; background: #fff; }
  .notif-head a { font-size: 12px; color: #4ecdc4; cursor: pointer; font-weight: 500; }
  .notif-head a:hover { text-decoration: underline; }
  .notif-list { padding: 2px 0; }
  .notif-empty { padding: 22px 14px; text-align: center; color: #999; font-size: 13px; }
  .notif-item { padding: 9px 14px; cursor: pointer; border-bottom: 1px solid #f4f4f8; }
  .notif-item:last-child { border-bottom: none; }
  .notif-item:hover { background: #f6f8fa; }
  .notif-item.unread { background: #f0fbfa; }
  .notif-item.unread:hover { background: #e6f7f5; }
  .notif-row1 { display: flex; align-items: center; gap: 7px; }
  .notif-item .notif-title { flex: 1; font-size: 13px; font-weight: 600; color: #1a1a2e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .notif-item .notif-when { font-size: 11px; color: #999; flex-shrink: 0; }
  .notif-item .notif-body { font-size: 12px; color: #666; margin-top: 3px; margin-left: 15px; line-height: 1.4; }

  /* Nav tabs */
  .nav { background: #fff; border-bottom: 1px solid #dde; display: flex; padding: 0 20px; }
  .nav button { background: none; border: none; padding: 12px 20px; font-size: 14px; cursor: pointer; color: #555; border-bottom: 3px solid transparent; transition: all 0.15s; position: relative; }
  .nav button:hover { color: #1a1a2e; }
  .nav button.active { color: #1a1a2e; font-weight: 600; border-bottom-color: #4ecdc4; }
  .nav button .badge { background: #e74c3c; color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 10px; margin-left: 6px; vertical-align: middle; }
  .nav button.admin-only { color: #888; }
  .nav button.admin-only::after { content: " (admin)"; font-size: 10px; color: #aaa; }

  /* Notification bar */
  .notif-bar { background: #fff3cd; border-bottom: 1px solid #ffc107; padding: 8px 20px; font-size: 13px; display: flex; align-items: center; gap: 20px; }
  .notif-bar .dot { width: 8px; height: 8px; background: #e74c3c; border-radius: 50%; display: inline-block; }
  .notif-bar .notif-item { display: flex; align-items: center; gap: 6px; }
  .notif-bar .notif-item a { color: #1a1a2e; text-decoration: underline; cursor: pointer; }
  .notif-bar .dismiss { margin-left: auto; color: #888; cursor: pointer; font-size: 12px; }

  /* Footer */
  .footer { background: #fff; color: #888; font-size: 11px; padding: 10px 20px; display: flex; align-items: center; justify-content: center; gap: 12px; border-top: 1px solid #dde; }

  /* Main content */
  .content { padding: 20px; min-height: calc(100vh - 48px - 36px - 36px - 40px); }
  .tab-content { display: none; }
  .tab-content.active { display: block; }

  /* Page header */
  .page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
  .page-title { font-size: 20px; font-weight: 700; }
  .page-subtitle { font-size: 12px; color: #888; margin-top: 2px; }

  /* Cards */
  .card { background: #fff; border-radius: 8px; border: 1px solid #dde; margin-bottom: 16px; overflow: hidden; }
  .card-header { padding: 14px 18px; border-bottom: 1px solid #eef; font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: space-between; }
  .card-body { padding: 18px; }

  /* Widgets (Home dashboard) */
  .widget-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
  .widget-row.row-2 { grid-template-columns: 2fr 1fr 1fr; }
  .widget { background: #fff; border-radius: 8px; border: 1px solid #dde; padding: 16px; }
  .widget-title { font-size: 12px; color: #888; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
  .widget-value { font-size: 28px; font-weight: 700; color: #1a1a2e; }
  .widget-delta { font-size: 12px; margin-top: 6px; }
  .widget-delta.up { color: #27ae60; }
  .widget-delta.down { color: #e74c3c; }
  .widget-delta.neutral { color: #888; }
  .widget-cta { margin-top: 10px; }

  /* Widget — Ingest */
  .ingest-widget .ingest-list { font-size: 13px; color: #555; margin-bottom: 10px; max-height: 90px; overflow-y: auto; }
  .ingest-widget .ingest-list .row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid #eef; }
  .ingest-widget .ingest-list .row:last-child { border-bottom: none; }
  .ingest-widget .ingest-list .row .doc-count { color: #888; font-size: 11px; }
  .ingest-status { font-size: 11px; color: #888; margin-top: 6px; font-style: italic; }

  /* Widget — Score changes */
  .change-widget .change-list { font-size: 12px; color: #555; margin-top: 8px; }
  .change-widget .change-list .row { display: flex; justify-content: space-between; padding: 3px 0; }
  .change-widget .delta-up { color: #27ae60; font-weight: 600; }
  .change-widget .delta-down { color: #e74c3c; font-weight: 600; }

  /* Buttons */
  .btn { padding: 7px 14px; border-radius: 6px; border: 1px solid #dde; background: #fff; cursor: pointer; font-size: 13px; transition: all 0.15s; }
  .btn:hover { background: #f0f2f5; }
  .btn-primary { background: #1a1a2e; color: #fff; border-color: #1a1a2e; }
  .btn-primary:hover { background: #2d2d4e; }
  .btn-accent { background: #4ecdc4; color: #1a1a2e; border-color: #4ecdc4; font-weight: 600; }
  .btn-accent:hover { background: #3db8b0; }
  .btn-danger { background: #fff; color: #e74c3c; border-color: #e74c3c; }
  .btn-sm { padding: 4px 10px; font-size: 12px; }
  .btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

  /* In-flight feedback (beta demo 2026-07): OPTIC.busy() marks the clicked
     control while its request runs; #net-activity is the global top sweep
     shown whenever any fetchJSON is in flight for >300ms. */
  .is-busy { opacity: 0.55; pointer-events: none; }
  .is-busy::after { content: ""; display: inline-block; width: 9px; height: 9px; margin-left: 6px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: optic-spin 0.6s linear infinite; vertical-align: -1px; }
  @keyframes optic-spin { to { transform: rotate(360deg); } }
  #net-activity { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 3000; display: none; background: linear-gradient(90deg, transparent, #4ecdc4, transparent); background-size: 40% 100%; background-repeat: no-repeat; animation: optic-net 1.1s ease-in-out infinite; pointer-events: none; }
  #net-activity.on { display: block; }
  @keyframes optic-net { 0% { background-position: 0% 0; } 100% { background-position: 100% 0; } }

  /* Filter chips bar (Assets list) */
  .filter-bar { background: #fff; border: 1px solid #dde; border-radius: 8px; padding: 12px 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  .filter-chip { padding: 5px 12px; border-radius: 14px; border: 1px solid #dde; background: #fff; cursor: pointer; font-size: 12px; }
  .filter-chip.active { background: #1a1a2e; color: #fff; border-color: #1a1a2e; }
  .filter-bar .search { flex: 1; min-width: 200px; }
  .filter-bar .search input { width: 100%; padding: 6px 10px; border: 1px solid #dde; border-radius: 6px; font-size: 13px; }
  .filter-bar .sep { width: 1px; height: 22px; background: #dde; }

  /* Bulk action toolbar */
  .bulk-toolbar { background: #1a1a2e; color: #fff; padding: 10px 16px; margin-bottom: 12px; border-radius: 8px; display: flex; align-items: center; gap: 12px; }
  .bulk-toolbar .selected-count { font-weight: 600; }
  .bulk-toolbar .actions { margin-left: auto; display: flex; gap: 8px; }
  .bulk-toolbar .actions button { background: rgba(255,255,255,0.1); color: #fff; border: 1px solid rgba(255,255,255,0.3); }
  .bulk-toolbar .actions button:hover { background: rgba(255,255,255,0.2); }

  /* Tables */
  table { width: 100%; border-collapse: collapse; font-size: 13px; }
  th { text-align: left; padding: 10px 12px; border-bottom: 2px solid #dde; color: #555; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; background: #f8f9fa; }
  td { padding: 10px 12px; border-bottom: 1px solid #eef; vertical-align: middle; }
  tr.row-asset { cursor: pointer; }
  tr.row-asset:hover td { background: #f8f9fa; }
  tr.review-trow:hover td { background: #f8f9fa; }
  tr.review-trow td { padding-top: 12px; padding-bottom: 12px; }
  tr.review-trow td .btn-sm { white-space: nowrap; }
  tr.review-group:hover td { background: #eef2f5; }
  .review-finding:hover { background: #f8f9fa !important; }
  tr.row-asset.locked { opacity: 0.55; cursor: wait; background: repeating-linear-gradient(45deg, #fafafa, #fafafa 6px, #f4f4f4 6px, #f4f4f4 12px); }
  tr.row-asset.archived td { color: #999; font-style: italic; }
  tr.row-asset.bookmarked .name-cell::before { content: "★ "; color: #f39c12; }
  th.col-check, td.col-check { width: 32px; text-align: center; }
  th.col-score, td.col-score { width: 80px; text-align: center; font-weight: 600; }
  th.col-badges, td.col-badges { width: 200px; }
  th.col-rank, td.col-rank { width: 40px; text-align: center; color: #888; font-variant-numeric: tabular-nums; }
  td.col-rank { font-weight: 600; color: #1a1a2e; }
  td.locked-rank { color: #ccc; font-weight: 400; }
  th.sortable-active { color: #1a1a2e; background: #f0f2f5; }

  /* Inline meta chips (indication / mechanism / stage on each row) */
  .meta-cell { font-size: 11px; }
  .meta-chip { display: inline-block; background: #f0f2f5; color: #555; padding: 2px 8px; border-radius: 10px; font-size: 11px; margin-right: 4px; margin-bottom: 2px; cursor: pointer; border: 1px solid transparent; }
  .meta-chip:hover { border-color: #4ecdc4; background: #e8f8f6; }

  /* Facet panel */
  .facet-panel { background: #fff; border: 1px solid #dde; border-radius: 8px; padding: 14px 16px; margin-bottom: 12px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
  .facet-col .facet-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: #888; margin-bottom: 8px; }
  .facet-list label { display: block; font-size: 12px; color: #555; cursor: pointer; padding: 2px 0; }
  .facet-list label input { margin-right: 6px; vertical-align: middle; }
  .facet-list .count { color: #aaa; font-size: 10px; margin-left: 4px; }
  .facet-list .facet-more { display: inline-block; font-size: 11px; color: #4ecdc4; cursor: pointer; text-decoration: underline; margin-top: 4px; }
  .facet-tags .facet-list label { font-style: italic; }

  /* Active facet chips bar (just under the facet panel / above the table) */
  .active-facets { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; padding: 0 4px; flex-wrap: wrap; }
  .active-chip { background: #1a1a2e; color: #fff; padding: 3px 10px; border-radius: 12px; font-size: 11px; display: inline-flex; align-items: center; gap: 6px; }
  .active-chip .x { cursor: pointer; opacity: 0.7; }
  .active-chip .x:hover { opacity: 1; }
  .sort-info { margin-left: auto; font-size: 11px; color: #888; }
  .score-high { color: #27ae60; }
  .score-mid { color: #f39c12; }
  .score-low { color: #e74c3c; }

  /* Multi-badge cluster */
  .badges { display: inline-flex; gap: 4px; flex-wrap: wrap; }
  .badge-pill { padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
  .badge-disclosure-ok { background: #d4edda; color: #155724; }
  .badge-disclosure-flagged { background: #f8d7da; color: #721c24; }
  .badge-score-critical { background: #f8d7da; color: #721c24; }
  .badge-score-warning { background: #fff3cd; color: #856404; }
  .badge-score-info { background: #cce5ff; color: #004085; }
  .badge-score-ok { background: #d4edda; color: #155724; }
  .badge-score-pending { background: #e2e3e5; color: #383d41; }
  .badge-filtered { background: #e2e3e5; color: #555; }
  .badge-processing { background: #cce5ff; color: #004085; }
  .badge-mover-up { background: #d4edda; color: #155724; }
  .badge-mover-down { background: #f8d7da; color: #721c24; }

  /* Star icon */
  .star { font-size: 16px; color: #ddd; cursor: pointer; }
  .star.active { color: #f39c12; }

  /* Asset detail */
  .breadcrumb { font-size: 12px; color: #888; margin-bottom: 10px; }
  .breadcrumb a { color: #1a1a2e; text-decoration: none; cursor: pointer; }
  .breadcrumb a:hover { text-decoration: underline; }
  /* Referrer-aware trail crumbs */
  .breadcrumb .crumb { color: #4ecdc4; cursor: pointer; }
  .breadcrumb .crumb:hover { text-decoration: underline; }
  .breadcrumb .crumb-sep { margin: 0 7px; color: #ccc; }
  .breadcrumb .crumb-current { color: #555; font-weight: 600; }

  .asset-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 12px; }
  .asset-header .title { font-size: 22px; font-weight: 700; }
  .asset-header .meta { font-size: 12px; color: #888; margin-top: 4px; }
  .asset-header .actions { margin-left: auto; display: flex; gap: 8px; }

  .fatal-banner { background: #f8d7da; border: 1px solid #e74c3c; border-left: 6px solid #e74c3c; color: #721c24; padding: 12px 18px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
  .fatal-banner strong { display: block; font-size: 14px; margin-bottom: 4px; }

  /* Sub-tabs (within Asset detail) */
  .sub-nav { display: flex; gap: 4px; border-bottom: 1px solid #dde; margin-bottom: 16px; }
  .sub-nav button { background: none; border: none; padding: 10px 16px; font-size: 13px; cursor: pointer; color: #666; border-bottom: 2px solid transparent; }
  .sub-nav button.active { color: #1a1a2e; font-weight: 600; border-bottom-color: #1a1a2e; }
  .sub-content { display: none; }
  .sub-content.active { display: block; }

  /* Filter preface (on Scores sub-tab) */
  .filter-preface { background: #f8f9fa; border-left: 4px solid #4ecdc4; padding: 10px 14px; border-radius: 4px; margin-bottom: 16px; font-size: 13px; }
  .filter-preface .label { font-weight: 600; margin-right: 6px; color: #155724; }
  .filter-preface.failed .label { color: #721c24; }
  .filter-preface .expand { color: #4ecdc4; cursor: pointer; text-decoration: underline; font-size: 12px; margin-left: 8px; }

  /* Strengths/risks cards (top of Scores sub-tab) */
  .summary-cards { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-bottom: 16px; }
  .summary-card { background: #fff; border: 1px solid #dde; border-radius: 8px; padding: 14px; }
  .summary-card .label { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 6px; }
  .summary-card .value { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
  .summary-card .desc { font-size: 12px; color: #555; line-height: 1.4; }
  .summary-card.strong { border-left: 4px solid #27ae60; }
  .summary-card.weak { border-left: 4px solid #f39c12; }
  .summary-card.risk { border-left: 4px solid #e74c3c; }

  /* Landscape summary tiles (U6) */
  .stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
  .stat-tile { background: #f8fafb; border: 1px solid #e6ebef; border-radius: 8px; padding: 14px; text-align: center; }
  .stat-tile .stat-value { font-size: 22px; font-weight: 700; color: #1a1a2e; }
  .stat-tile .stat-label { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.4px; margin-top: 4px; }
  .stat-tile .stat-hint { font-size: 10px; color: #aaa; margin-top: 3px; }

  /* Spider plot section */
  .spider-section { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; align-items: start; }
  .spider-container { background: #fff; border: 1px solid #dde; border-radius: 8px; padding: 20px; display: flex; justify-content: center; }
  .spider-legend { font-size: 12px; color: #555; margin-top: 12px; display: flex; gap: 16px; align-items: center; }
  .spider-legend .swatch { display: inline-block; width: 14px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
  .spider-legend .swatch.score { background: #1a1a2e; }
  .spider-legend .swatch.uncertainty { background: rgba(78,205,196,0.35); }

  /* Score table next to spider */
  .score-table { background: #fff; border: 1px solid #dde; border-radius: 8px; padding: 16px; }
  .score-table h4 { font-size: 14px; margin-bottom: 12px; }
  .score-table .domain-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid #eef; font-size: 14px; cursor: pointer; }
  .score-table .domain-row:hover { background: #f8f9fa; }
  .score-table .domain-row .score-val { font-weight: 600; }
  .score-table .domain-row .range { font-size: 12px; color: #888; margin-left: 6px; }

  /* Drawer (slides in from right when domain clicked) */
  .drawer { position: fixed; top: 0; right: 0; width: 640px; max-width: 94vw; min-width: 360px; height: 100vh; background: #fff; border-left: 1px solid #dde; box-shadow: -4px 0 20px rgba(0,0,0,0.08); transform: translateX(100%); transition: transform 0.2s; z-index: 150; display: flex; flex-direction: column; }
  .drawer.resizing { transition: none; }
  .drawer-resize { position: absolute; left: 0; top: 0; width: 7px; height: 100%; cursor: ew-resize; background: transparent; }
  .drawer-resize:hover { background: #eef; }
  .drawer.open { transform: translateX(0); }
  .drawer-header { padding: 16px 20px; border-bottom: 1px solid #eef; display: flex; align-items: center; justify-content: space-between; }
  .drawer-title { font-weight: 600; }
  .drawer-close { cursor: pointer; color: #888; font-size: 20px; line-height: 1; }
  .drawer-body { flex: 1; overflow-y: auto; padding: 20px; }
  .drawer .q-row { padding: 12px; border: 1px solid #eef; border-radius: 6px; margin-bottom: 10px; }
  .drawer .q-row .q-text { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
  .drawer .q-row .q-score { font-size: 12px; color: #555; }
  .drawer .q-row .q-just { font-size: 12px; color: #555; margin-top: 6px; line-height: 1.5; }
  .drawer .q-row.flagged { border-left: 4px solid #f39c12; }
  .drawer .q-row.unscored { opacity: 0.55; }   /* U7: de-emphasize questions the scorer left unscored */

  /* Weight panel popup */
  .weight-popup { position: fixed; top: 100px; right: 30px; width: 360px; background: #fff; border: 1px solid #dde; border-radius: 10px; box-shadow: 0 8px 32px rgba(0,0,0,0.12); padding: 16px 18px; display: none; z-index: 130; }
  .weight-popup.open { display: block; }
  .weight-popup .header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
  .weight-popup .header h4 { font-size: 14px; }
  .weight-popup .header .close { cursor: pointer; color: #888; font-size: 18px; }
  .slider-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 12px; }
  .slider-row label { flex: 1; }
  .slider-row input[type=range] { width: 120px; accent-color: #4ecdc4; }
  .slider-row .val { width: 28px; text-align: right; font-weight: 600; }
  .weight-popup .profile-pills { display: flex; gap: 4px; margin-bottom: 10px; }
  .weight-popup .profile-pills button { padding: 4px 10px; border-radius: 12px; border: 1px solid #dde; background: #fff; cursor: pointer; font-size: 11px; }
  .weight-popup .profile-pills button.active { background: #4ecdc4; color: #1a1a2e; border-color: #4ecdc4; }
  .weight-popup .actions { margin-top: 12px; display: flex; justify-content: space-between; align-items: center; }
  .weight-popup .save-default { font-size: 11px; color: #4ecdc4; cursor: pointer; text-decoration: underline; }

  /* Chat launcher (floating button) */
  .chat-launcher { position: fixed; bottom: 24px; right: 24px; width: 56px; height: 56px; background: #1a1a2e; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; cursor: pointer; box-shadow: 0 4px 16px rgba(0,0,0,0.18); z-index: 140; }
  .chat-launcher:hover { background: #2d2d4e; }
  .chat-launcher .indicator { position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; background: #4ecdc4; border-radius: 50%; border: 2px solid #1a1a2e; }

  /* Chat panel (slides in from right when launcher clicked) */
  .chat-panel { position: fixed; bottom: 24px; right: 24px; width: 380px; height: 540px; background: #fff; border: 1px solid #dde; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.16); display: none; flex-direction: column; z-index: 150; overflow: hidden; }
  .chat-panel.open { display: flex; }
  .chat-resize { position: absolute; top: 0; left: 0; width: 18px; height: 18px; cursor: nwse-resize; z-index: 160; touch-action: none; }
  .chat-resize::before { content: ""; position: absolute; top: 5px; left: 5px; width: 7px; height: 7px; border-top: 2px solid rgba(255,255,255,.55); border-left: 2px solid rgba(255,255,255,.55); border-radius: 2px 0 0 0; }
  .chat-resize:hover::before { border-color: #4ecdc4; }
  .chat-header { background: #1a1a2e; color: #fff; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; }
  .chat-header .title { font-weight: 600; font-size: 14px; }
  .chat-header .scope { font-size: 11px; color: #4ecdc4; margin-top: 2px; }
  .chat-header .close { cursor: pointer; font-size: 20px; line-height: 1; }
  .chat-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: #f8f9fa; }
  .chat-msg { max-width: 88%; padding: 8px 12px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
  .chat-msg.bot { background: #fff; align-self: flex-start; border: 1px solid #eef; }
  .chat-msg.user { background: #1a1a2e; color: #fff; align-self: flex-end; }
  .chat-input { padding: 10px; border-top: 1px solid #eef; display: flex; gap: 8px; background: #fff; }
  .chat-input input { flex: 1; border: 1px solid #dde; border-radius: 18px; padding: 7px 12px; font-size: 13px; outline: none; }
  .chat-input input:disabled { background: #f3f4f7; color: #99a; cursor: not-allowed; }
  .chat-input button { background: #1a1a2e; color: #fff; border: none; border-radius: 50%; width: 32px; height: 32px; cursor: pointer; }
  .chat-input button:disabled { opacity: .4; cursor: not-allowed; }
  /* Header controls + recent-chats history list */
  .chat-actions { display: flex; align-items: center; gap: 10px; }
  .chat-act { cursor: pointer; font-size: 16px; line-height: 1; opacity: .85; user-select: none; }
  .chat-act:hover { opacity: 1; }
  /* History takes the full chat surface (a distinct white list, not the
     gray thread). Toggled via inline style.display in chat.js because
     .chat-messages/.chat-input carry an explicit display that overrides
     the [hidden] attribute. */
  .chat-history { flex: 1; overflow-y: auto; background: #fff; }
  .chat-history .ch-head { position: sticky; top: 0; background: #fff; padding: 11px 14px; font-size: 11px; font-weight: 700; color: #8a8aa6; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid #eef; }
  .chat-history .ch-new { display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; color: #1a1a2e; font-size: 13px; font-weight: 600; border-bottom: 1px solid #f0f0f5; }
  .chat-history .ch-new:hover { background: #f5f6ff; }
  .chat-history .ch-row { display: flex; align-items: baseline; gap: 8px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid #f3f3f8; }
  .chat-history .ch-row:hover { background: #f5f6ff; }
  .chat-history .ch-row.active { background: #eef0ff; }
  .chat-history .ch-title { flex: 1; font-size: 13px; color: #1a1a2e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .chat-history .ch-when { font-size: 11px; color: #aab; flex-shrink: 0; }
  .chat-history .ch-badge { font-size: 10px; padding: 1px 6px; border-radius: 8px; background: #e7e9f5; color: #4a4a7a; flex-shrink: 0; text-transform: uppercase; }
  .chat-history .ch-empty { padding: 24px 16px; color: #99a; font-size: 13px; text-align: center; }
  /* Editable chat title in the header */
  .chat-header .title { cursor: text; }
  .chat-header .title-edit { font: inherit; font-weight: 600; font-size: 14px; background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.4); border-radius: 4px; padding: 1px 5px; outline: none; width: 190px; }

  /* Reviews list */
  .review-row { display: grid; grid-template-columns: 32px 1fr auto auto; gap: 12px; align-items: center; padding: 12px 14px; background: #fff; border: 1px solid #eef; border-radius: 6px; margin-bottom: 8px; }
  .review-row .severity-dot { width: 12px; height: 12px; border-radius: 50%; }
  .review-row .severity-dot.critical { background: #e74c3c; }
  .review-row .severity-dot.warning { background: #f39c12; }
  .review-row .severity-dot.info { background: #4ecdc4; }
  .review-row .desc .asset-name { font-weight: 600; }
  .review-row .desc .flag-text { font-size: 12px; color: #666; margin-top: 2px; }
  .review-row .meta { font-size: 11px; color: #888; }
  .review-row .row-actions { display: flex; gap: 6px; }

  /* Chunked chat (review claim) */
  .chunked-review { display: grid; grid-template-columns: 240px 1fr; gap: 16px; height: 520px; background: #fff; border: 1px solid #dde; border-radius: 10px; overflow: hidden; }
  .chunk-list { background: #f8f9fa; border-right: 1px solid #eef; padding: 12px; overflow-y: auto; }
  .chunk-list .chunk-item { padding: 10px 12px; border-radius: 6px; margin-bottom: 6px; cursor: pointer; font-size: 12px; display: flex; align-items: center; gap: 8px; }
  .chunk-list .chunk-item.active { background: #1a1a2e; color: #fff; }
  .chunk-list .chunk-item .check { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #ccc; display: flex; align-items: center; justify-content: center; font-size: 10px; flex-shrink: 0; }
  .chunk-list .chunk-item.done .check { background: #27ae60; border-color: #27ae60; color: #fff; }
  .chunk-list .chunk-item.active .check { border-color: #4ecdc4; }
  .chunk-detail { padding: 18px; display: flex; flex-direction: column; }
  .chunk-detail h3 { font-size: 15px; margin-bottom: 8px; }
  .chunk-detail .rec { background: #f8f9fa; border-left: 3px solid #4ecdc4; padding: 10px 12px; border-radius: 4px; margin: 10px 0; font-size: 13px; }
  .chunk-detail .actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
  .chunk-detail textarea { width: 100%; border: 1px solid #dde; border-radius: 6px; padding: 8px 10px; font-size: 13px; min-height: 80px; font-family: inherit; margin-top: 10px; }
  .chunk-detail .nav-row { margin-top: auto; display: flex; justify-content: space-between; padding-top: 12px; border-top: 1px solid #eef; }

  /* Generic placeholder */
  .placeholder { background: #fafafa; border: 2px dashed #ccd; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #888; font-size: 13px; text-align: center; padding: 20px; min-height: 180px; }

  /* Comingsoon */
  .coming-soon { padding: 60px; text-align: center; color: #888; }
  .coming-soon h2 { font-size: 20px; margin-bottom: 8px; color: #555; }
  .coming-soon p { font-size: 13px; max-width: 480px; margin: 0 auto; }

  /* Annotation labels (wireframe explanatory) */
  .annot { background: #fff8d6; border: 1px dashed #d4a013; padding: 6px 10px; font-size: 11px; color: #6b4d00; border-radius: 4px; margin: 8px 0; }

  /* Rendered markdown (CR2026-06-26 H1) — sanitizeMarkdown wraps its output in
     .md so headings/lists/paragraphs render tidily wherever LLM markdown lands
     (synopsis, justifications, disclosure bodies, chat replies). First/last
     child margins are collapsed so a single-line value reads like plain text. */
  .md > :first-child { margin-top: 0; }
  .md > :last-child { margin-bottom: 0; }
  .md p { margin: 0 0 8px; }
  .md h1, .md h2, .md h3, .md h4, .md h5, .md h6 { font-size: 14px; font-weight: 600; margin: 12px 0 6px; line-height: 1.3; }
  .md ul, .md ol { margin: 0 0 8px; padding-left: 20px; }
  .md li { margin: 2px 0; }
  .md code { background: rgba(0, 0, 0, 0.06); padding: 1px 4px; border-radius: 3px; font-size: 0.92em; }
  .md a { color: #4ecdc4; }
  /* Chat bubbles are tight; keep the markdown wrapper from adding its own box. */
  .chat-msg .md, .chat-msg .md p { margin: 0; }

/* ===== Home landing (js/views/home.js — wireframes/home_hero_v2.html) ===== */
.home-wrap { max-width: 1180px; margin: 0 auto; }
.home-wrap .greet { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.home-wrap .greet h1 { font-size: 21px; font-weight: 700; }
.home-wrap .greet h1 .sub { color: #888; font-weight: 400; font-size: 15px; }
.home-wrap .greet .meta { font-size: 12px; color: #888; }
.home-wrap .greet .meta b { color: #555; }
.home-wrap .cols { display: grid; grid-template-columns: 1fr 1.2fr; gap: 22px; align-items: start; }
@media (max-width: 980px) { .home-wrap .cols { grid-template-columns: 1fr; } }
.home-wrap .stack { display: flex; flex-direction: column; gap: 20px; }
.home-wrap .lane-head { font-size: 11px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: #999; margin: 0 0 12px 2px; display: flex; align-items: center; gap: 8px; }
.home-wrap .lane-head .dot { width: 7px; height: 7px; border-radius: 50%; }
.home-wrap .card-header .count { font-size: 12px; color: #888; font-weight: 400; }
.home-wrap .card-header .more { margin-left: auto; font-size: 12px; color: #4ecdc4; font-weight: 600; cursor: pointer; }
.home-wrap .card-header .more:hover { text-decoration: underline; }
.home-wrap .concept-tag { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: #b8860b; background: #fff8e1; border: 1px solid #f0d9a8; border-radius: 10px; padding: 1px 8px; }

/* my reviews */
.home-wrap .rev { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #f4f4f8; }
.home-wrap .rev:last-child { border-bottom: none; }
.home-wrap .rev .sev { width: 4px; align-self: stretch; border-radius: 3px; flex: none; }
.home-wrap .rev .sev.critical { background: #e74c3c; } .home-wrap .rev .sev.warning { background: #f39c12; } .home-wrap .rev .sev.info { background: #4ecdc4; }
.home-wrap .rev .body { flex: 1; min-width: 0; }
.home-wrap .rev .l1 { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.home-wrap .rev .asset { font-weight: 650; font-size: 13.5px; }
.home-wrap .rev .type { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: #667; background: #eef; border-radius: 9px; padding: 1px 7px; }
.home-wrap .rev .summary { font-size: 12.5px; color: #555; line-height: 1.45; }
.home-wrap .rev .go { flex: none; align-self: center; }
.home-wrap .empty { padding: 22px 16px; text-align: center; color: #999; font-size: 13px; }
.home-wrap .empty .link { color: #4ecdc4; font-weight: 600; cursor: pointer; }

/* heat map */
.home-wrap .heat { display: grid; grid-template-columns: 150px repeat(5, 1fr); gap: 4px; align-items: center; }
.home-wrap .heat .h-col { font-size: 10px; color: #999; text-align: center; font-variant-numeric: tabular-nums; }
.home-wrap .heat .h-corner { font-size: 10px; color: #aaa; }
.home-wrap .heat .h-row { font-size: 12px; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-wrap .heat .cell { height: 30px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.home-wrap .heat-legend { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 11px; color: #777; }
.home-wrap .heat-legend .ramp { display: flex; }
.home-wrap .heat-legend .ramp span { width: 20px; height: 10px; }
.home-wrap .heat-legend .spacer { flex: 1; }

/* top assets */
.home-wrap .topn { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.home-wrap .tn { border: 1px solid #eef; border-radius: 8px; padding: 10px 8px 8px; text-align: center; transition: border-color .15s, box-shadow .15s; }
.home-wrap .tn:hover { border-color: #4ecdc4; box-shadow: 0 4px 12px rgba(78,205,196,.16); }
.home-wrap .tn .tnm { font-size: 12px; font-weight: 650; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-wrap .tn .tw { font-size: 12px; margin-top: 1px; } .home-wrap .tn .tw b { font-size: 15px; } .home-wrap .tn .tw .of { color: #aaa; }

/* work queues (concept) */
.home-wrap .q-label { font-size: 11px; font-weight: 700; color: #888; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px; }
.home-wrap .qrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed #e6e6ee; }
.home-wrap .qrow:last-child { border-bottom: none; }
.home-wrap .qrow .qn { flex: 1; font-size: 12.5px; color: #888; }
.home-wrap .qrow .qb { width: 90px; height: 7px; border-radius: 4px; background: #eef; overflow: hidden; }
.home-wrap .qrow .qb span { display: block; height: 100%; background: #cfd3dc; }
.home-wrap .qmeta { font-size: 11px; color: #999; font-variant-numeric: tabular-nums; }
.home-wrap .q-note { margin-top: 12px; font-size: 11px; color: #b8860b; background: #fff8e1; border: 1px dashed #f0d9a8; border-radius: 6px; padding: 7px 10px; }
