#panel-view {
  --bg: #070809;
  --bg-soft: #0b0d0f;
  --panel: #0f1114;
  --panel-2: #121519;
  --panel-3: #16191d;
  --line: #25292f;
  --line-soft: #1a1d21;
  --text: #eef0f3;
  --muted: #9499a1;
  --muted-2: #686d75;
  --red: #e22a25;
  --red-bright: #ff3a31;
  --red-dark: #8f1614;
  --amber: #d69934;
  --green: #48b978;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-red: 0 0 0 1px rgba(226,42,37,.12), 0 0 28px rgba(226,42,37,.06);
}

#panel-view * { box-sizing: border-box; }
#panel-view { scroll-behavior: smooth; }
#panel-view {
  margin: 0;
  background:
    radial-gradient(circle at 85% -10%, rgba(196, 31, 27, .08), transparent 27%),
    linear-gradient(180deg, #070809 0%, #090a0c 100%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}
#panel-view button, #panel-view input, #panel-view textarea { font: inherit; }
#panel-view button { color: inherit; }
#panel-view a { color: inherit; text-decoration: none; }

#panel-view::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .15;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.014) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

#panel-view .app-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
#panel-view .sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  width: 220px;
  border-right: 1px solid #171a1e;
  background: rgba(7,8,9,.97);
  display: flex;
  flex-direction: column;
  padding: 18px 12px 14px;
}
#panel-view .brand-block { display: flex; align-items: center; gap: 9px; padding: 2px 7px 19px; border-bottom: 1px solid #181a1e; }
#panel-view .brand-emblem { width: 38px; height: 38px; object-fit: contain; filter: drop-shadow(0 0 8px rgba(226,42,37,.32)); }
#panel-view .brand-copy strong { display: block; font-family: "Arial Narrow", "Roboto Condensed", Inter, system-ui, sans-serif; letter-spacing: .05em; font-size: 23px; line-height: 1; }
#panel-view .brand-copy strong span { color: var(--red-bright); }
#panel-view .brand-copy small { display: block; margin-top: 4px; color: #8e939a; font-size: 9px; letter-spacing: .28em; }
#panel-view .nav-list { padding-top: 16px; }
#panel-view .nav-item {
  height: 42px;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  margin-bottom: 4px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #a7abb2;
  font-size: 13px;
  font-weight: 600;
  transition: .18s ease;
}
#panel-view .nav-item:hover { color: #f5f6f7; background: #101215; border-color: #1b1f24; }
#panel-view .nav-item.is-active {
  color: #fff;
  background: linear-gradient(90deg, rgba(226,42,37,.12), rgba(226,42,37,.025));
  border-color: rgba(226,42,37,.22);
  box-shadow: inset 2px 0 0 var(--red-bright);
}
#panel-view .nav-icon { color: var(--red-bright); text-align: center; font-size: 17px; }
#panel-view .nav-badge { color: #ff7771; font-size: 10px; min-width: 19px; text-align: center; padding: 2px 5px; border-radius: 999px; background: rgba(226,42,37,.12); border: 1px solid rgba(226,42,37,.22); }
#panel-view .live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red-bright); box-shadow: 0 0 10px rgba(255,58,49,.8); }
#panel-view .nav-divider { margin: 18px 10px 9px; color: #5e636b; font-size: 9px; letter-spacing: .18em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
#panel-view .nav-divider::after { content: ""; height: 1px; background: #1b1e22; flex: 1; }
#panel-view .sidebar-status { margin-top: auto; border: 1px solid #1b1f24; background: #0c0e10; border-radius: 8px; padding: 11px; }
#panel-view .sidebar-status > div { display: flex; gap: 8px; align-items: center; font-size: 11px; color: #d4d7dc; }
#panel-view .sidebar-status small { display: block; margin: 6px 0 0 16px; color: #636870; font-size: 9px; }

#panel-view .main-area { grid-column: 2; min-width: 0; }
#panel-view .topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 26px;
  border-bottom: 1px solid #181b1f;
  background: rgba(7,8,9,.88);
  backdrop-filter: blur(16px);
}
#panel-view .topbar-left { display: flex; align-items: center; gap: 13px; min-width: 0; }
#panel-view .eyebrow, #panel-view .section-kicker { color: var(--red-bright); letter-spacing: .14em; font-size: 9px; font-weight: 700; }
#panel-view .topbar h1 { margin: 2px 0 0; font-family: "Arial Narrow", "Roboto Condensed", Inter, system-ui, sans-serif; font-size: 20px; letter-spacing: .015em; }
#panel-view .topbar-actions { display: flex; align-items: center; gap: 8px; }
#panel-view .connection-pill { display: flex; align-items: center; gap: 7px; height: 31px; padding: 0 11px; border-radius: 999px; color: #e6e8ea; border: 1px solid #272b30; background: #101215; font-size: 10px; font-weight: 700; letter-spacing: .09em; }
#panel-view .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--red-bright); box-shadow: 0 0 0 0 rgba(255,58,49,.4); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 6px rgba(255,58,49,0); } }
#panel-view .icon-button, #panel-view .mobile-nav-button { width: 32px; height: 32px; border: 1px solid #272b30; border-radius: 7px; background: #101215; display: grid; place-items: center; cursor: pointer; }
#panel-view .mobile-nav-button { display: none; }
#panel-view .user-chip { min-width: 205px; height: 42px; display: flex; align-items: center; gap: 9px; border: 1px solid #24282d; background: #0f1114; border-radius: 8px; padding: 5px 9px 5px 6px; }
#panel-view .user-avatar { width: 29px; height: 29px; border-radius: 6px; display: grid; place-items: center; background: linear-gradient(135deg, #54100f, #c5221e); border: 1px solid #e23a34; font-family: "Arial Narrow", "Roboto Condensed", Inter, system-ui, sans-serif; font-weight: 700; }
#panel-view .user-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
#panel-view .user-meta strong { font-size: 11px; }
#panel-view .role-label { margin-top: 2px; color: #7f848c; font-size: 9px; }
#panel-view .chevron { color: #7f848c; }

#panel-view .section-block { padding: 24px 26px 0; scroll-margin-top: 86px; }
#panel-view .section-heading { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
#panel-view .compact-heading { margin-bottom: 12px; }
#panel-view .section-heading h2, #panel-view .panel-header h2 {
  margin: 3px 0 0;
  font-family: "Arial Narrow", "Roboto Condensed", Inter, system-ui, sans-serif;
  font-size: 21px;
  line-height: 1.05;
  letter-spacing: .02em;
}
#panel-view .timestamp, #panel-view .helper-copy { color: #727780; font-size: 10px; }
#panel-view .timestamp span { color: #b2b6bc; }

#panel-view .metric-strip { display: grid; grid-template-columns: repeat(6, minmax(125px, 1fr)); border: 1px solid #1d2024; border-radius: 9px; overflow: hidden; background: #0d0f11; box-shadow: var(--shadow-red); }
#panel-view .metric-card { min-height: 95px; padding: 16px 16px 14px; border-right: 1px solid #1c1f23; position: relative; }
#panel-view .metric-card:last-child { border-right: 0; }
#panel-view .metric-card::before { content: ""; position: absolute; top: 0; left: 16px; width: 34px; height: 1px; background: var(--red-bright); opacity: .8; }
#panel-view .metric-label { display: block; color: #8b9098; font-size: 10px; }
#panel-view .metric-value { display: block; margin-top: 7px; font-family: "Arial Narrow", "Roboto Condensed", Inter, system-ui, sans-serif; font-size: 28px; line-height: 1; letter-spacing: .01em; }
#panel-view .metric-card small { display: block; margin-top: 7px; color: #656a72; font-size: 9px; }
#panel-view .good { color: var(--green); font-weight: 600; }
#panel-view .warning { color: #d89a43; font-weight: 600; }

#panel-view .dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(330px, .8fr); gap: 16px; padding: 16px 26px 0; }
#panel-view .panel { border: 1px solid #202329; background: linear-gradient(180deg, rgba(16,18,21,.98), rgba(11,13,15,.98)); border-radius: 10px; box-shadow: var(--shadow-red); overflow: hidden; }
#panel-view .panel-header { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 16px 13px; border-bottom: 1px solid #1d2024; }
#panel-view .stream-state { display: flex; align-items: center; gap: 7px; font-size: 10px; color: #a7abb1; }
#panel-view .status-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
#panel-view .status-dot.online { background: #38ad6a; box-shadow: 0 0 0 3px rgba(56,173,106,.08); }
#panel-view .status-dot.delayed { background: var(--amber); box-shadow: 0 0 0 3px rgba(214,153,52,.08); }
#panel-view .status-dot.offline { background: #6d727a; }
#panel-view .filter-row, #panel-view .incident-toolbar { display: flex; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #1b1e22; background: #0b0d0f; }
#panel-view .search-field { height: 34px; min-width: 0; display: flex; align-items: center; gap: 7px; flex: 1; padding: 0 10px; border: 1px solid #24282d; border-radius: 7px; background: #101215; color: #5f646c; }
#panel-view .search-field input { width: 100%; border: 0; outline: 0; color: #dfe2e5; background: transparent; font-size: 11px; }
#panel-view .search-field input::placeholder { color: #60656d; }
#panel-view .filter-button, #panel-view .quiet-button, #panel-view .outline-button, #panel-view .danger-outline-button, #panel-view .primary-button { border-radius: 7px; cursor: pointer; transition: .18s ease; }
#panel-view .filter-button { min-width: 104px; height: 34px; padding: 0 11px; border: 1px solid #24282d; background: #101215; color: #aaafb6; font-size: 10px; display: inline-flex; align-items: center; justify-content: space-between; gap: 14px; }
#panel-view .quiet-button { border: 1px solid #24282d; background: #111317; color: #9da2aa; padding: 6px 9px; font-size: 9px; }
#panel-view .outline-button { border: 1px solid rgba(226,42,37,.28); background: rgba(226,42,37,.05); color: #d7d9dc; padding: 7px 11px; font-size: 10px; }
#panel-view .danger-outline-button { border: 1px solid rgba(226,42,37,.42); background: rgba(226,42,37,.08); color: #ff8a85; padding: 7px 11px; font-size: 10px; }
#panel-view .primary-button { border: 1px solid #f1453f; background: linear-gradient(180deg,#d92a26,#a61916); padding: 8px 13px; font-size: 10px; font-weight: 700; }

#panel-view .live-table { width: 100%; }
#panel-view .live-row { min-height: 45px; display: grid; grid-template-columns: 1.05fr .72fr 1fr 54px 68px 78px 112px; align-items: center; gap: 10px; padding: 0 13px; border-bottom: 1px solid #191c20; font-size: 10px; color: #b7bbc1; position: relative; }
#panel-view .live-row:last-child { border-bottom: 0; }
#panel-view .live-row.table-head { min-height: 31px; color: #60656d; background: #0a0c0e; font-size: 8px; text-transform: uppercase; letter-spacing: .09em; }
#panel-view .live-row:not(.table-head):hover { background: #121519; }
#panel-view .live-row.priority-high::before { content: ""; position: absolute; left: 0; width: 2px; top: 8px; bottom: 8px; background: var(--red-bright); box-shadow: 0 0 8px rgba(255,58,49,.45); }
#panel-view .player-cell { display: flex; align-items: center; gap: 7px; color: #edf0f2; font-weight: 600; }
#panel-view .player-cell i { width: 6px; height: 6px; border: 1px solid #ff4b44; transform: rotate(45deg); }
#panel-view .vl-chip { justify-self: start; min-width: 29px; text-align: center; padding: 3px 5px; border-radius: 5px; background: #171a1e; border: 1px solid #292d33; color: #adb2b9; font-size: 9px; }
#panel-view .vl-chip.medium { color: #efb86b; border-color: rgba(214,153,52,.28); background: rgba(214,153,52,.06); }
#panel-view .vl-chip.high { color: #ff746e; border-color: rgba(226,42,37,.32); background: rgba(226,42,37,.08); }
#panel-view .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
#panel-view .panel-footer { min-height: 38px; padding: 0 13px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #1b1e22; color: #666b72; font-size: 9px; }
#panel-view .panel-footer a { color: #c74743; }

#panel-view .health-summary { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid #1b1e22; }
#panel-view .health-summary div { padding: 13px 11px; border-right: 1px solid #1b1e22; }
#panel-view .health-summary div:last-child { border-right: 0; }
#panel-view .health-summary strong { display: block; font-family: "Arial Narrow", "Roboto Condensed", Inter, system-ui, sans-serif; font-size: 21px; }
#panel-view .health-summary span { color: #737881; font-size: 9px; }
#panel-view .health-list { padding: 5px 12px 11px; }
#panel-view .health-row { min-height: 57px; display: grid; grid-template-columns: 1.4fr .7fr .55fr; align-items: center; gap: 8px; border-bottom: 1px solid #1b1e22; }
#panel-view .health-row:last-child { border-bottom: 0; }
#panel-view .health-main { display: flex; gap: 9px; align-items: center; }
#panel-view .health-main strong { display: block; font-size: 10px; }
#panel-view .health-main small, #panel-view .health-stat small { display: block; margin-top: 4px; color: #666b73; font-size: 8px; }
#panel-view .health-stat strong { font-family: "Arial Narrow", "Roboto Condensed", Inter, system-ui, sans-serif; font-size: 16px; }
#panel-view .preview-locked-notice { margin: 0 12px 12px; border: 1px solid #25292f; border-radius: 7px; padding: 10px; color: #777c84; font-size: 9px; }

#panel-view .incidents-section { padding-top: 28px; }
#panel-view .incident-toolbar { padding: 0 0 10px; border: 0; background: transparent; }
#panel-view .search-field.wide { max-width: 500px; }
#panel-view .incident-layout { display: grid; grid-template-columns: minmax(260px, .72fr) minmax(0, 2fr); gap: 22px; }
#panel-view .incident-list, #panel-view .incident-detail { border: 1px solid #202329; border-radius: 10px; background: #0d0f11; box-shadow: var(--shadow-red); overflow: hidden; }
#panel-view .incident-list { align-self: start; }
#panel-view .incident-item { width: 100%; min-height: 69px; display: grid; grid-template-columns: 34px 1fr auto; gap: 9px; align-items: center; padding: 10px 12px; border: 0; border-bottom: 1px solid #1c1f23; background: transparent; text-align: left; cursor: pointer; }
#panel-view .incident-item:last-child { border-bottom: 0; }
#panel-view .incident-item:hover { background: #121519; }
#panel-view .incident-item.is-selected { background: linear-gradient(90deg, rgba(226,42,37,.10), rgba(226,42,37,.015)); box-shadow: inset 2px 0 0 var(--red-bright); }
#panel-view .priority-marker { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; font-size: 8px; font-weight: 700; letter-spacing: .04em; border: 1px solid #333840; color: #aeb3ba; }
#panel-view .priority-marker.p1 { color: #ff6c66; border-color: rgba(226,42,37,.42); background: rgba(226,42,37,.09); }
#panel-view .priority-marker.p2 { color: #e5aa57; border-color: rgba(214,153,52,.33); background: rgba(214,153,52,.06); }
#panel-view .incident-item-main strong, #panel-view .incident-item-main small, #panel-view .incident-item-metrics b, #panel-view .incident-item-metrics small { display: block; }
#panel-view .incident-item-main strong { font-size: 11px; }
#panel-view .incident-item-main small { margin-top: 5px; color: #747982; font-size: 8px; }
#panel-view .incident-item-metrics { text-align: right; }
#panel-view .incident-item-metrics b { color: #aeb3ba; font-size: 9px; }
#panel-view .incident-item-metrics small { margin-top: 5px; color: #5f646c; font-size: 8px; }
#panel-view .incident-detail { padding: 17px; }
#panel-view .incident-detail-header { display: flex; justify-content: space-between; gap: 18px; align-items: start; padding-bottom: 14px; border-bottom: 1px solid #1f2226; }
#panel-view .detail-title-row { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
#panel-view .detail-title-row h3 { margin: 0; font-family: "Arial Narrow", "Roboto Condensed", Inter, system-ui, sans-serif; font-size: 19px; }
#panel-view .incident-detail-header p { margin: 7px 0 0 38px; color: #737880; font-size: 9px; }
#panel-view .state-chip { display: inline-flex; align-items: center; height: 23px; padding: 0 8px; border-radius: 999px; font-size: 8px; border: 1px solid #30343a; color: #aeb3b9; }
#panel-view .state-chip.investigating { color: #f1b461; border-color: rgba(214,153,52,.28); background: rgba(214,153,52,.06); }
#panel-view .detail-score { width: 70px; text-align: right; }
#panel-view .detail-score span { display: block; color: #6e737b; font-size: 8px; text-transform: uppercase; letter-spacing: .09em; }
#panel-view .detail-score strong { display: block; margin-top: 2px; color: #ff5f58; font-family: "Arial Narrow", "Roboto Condensed", Inter, system-ui, sans-serif; font-size: 30px; }
#panel-view .incident-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; margin: 14px 0; background: #1d2024; border: 1px solid #1d2024; border-radius: 8px; overflow: hidden; }
#panel-view .incident-stats div { background: #0f1114; padding: 10px 11px; }
#panel-view .incident-stats span { display: block; color: #696e76; font-size: 8px; }
#panel-view .incident-stats strong { display: block; margin-top: 4px; font-family: "Arial Narrow", "Roboto Condensed", Inter, system-ui, sans-serif; font-size: 15px; }
#panel-view .incident-content-grid, #panel-view .incident-lower-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#panel-view .incident-lower-grid { margin-top: 12px; }
#panel-view .detail-card { border: 1px solid #20242a; border-radius: 8px; background: #0b0d0f; padding: 13px; }
#panel-view .subhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
#panel-view .subhead h4 { margin: 0; font-family: "Arial Narrow", "Roboto Condensed", Inter, system-ui, sans-serif; font-size: 13px; letter-spacing: .02em; }
#panel-view .subhead span { color: #666b73; font-size: 8px; }
#panel-view .distribution-row { display: grid; grid-template-columns: 78px 1fr 20px; align-items: center; gap: 9px; min-height: 29px; font-size: 9px; color: #a9aeb5; }
#panel-view .bar { height: 5px; background: #1a1d21; border-radius: 999px; overflow: hidden; }
#panel-view .bar i { display: block; height: 100%; background: linear-gradient(90deg,#8d1815,#ef332d); box-shadow: 0 0 8px rgba(239,51,45,.25); }
#panel-view .distribution-row b { text-align: right; font-size: 9px; }
#panel-view .timeline { position: relative; }
#panel-view .timeline::before { content: ""; position: absolute; left: 3px; top: 7px; bottom: 7px; width: 1px; background: #292d33; }
#panel-view .timeline > div { min-height: 27px; display: grid; grid-template-columns: 8px 59px 1fr 43px; align-items: center; gap: 8px; color: #9da2a9; font-size: 8px; }
#panel-view .timeline i { position: relative; z-index: 1; width: 7px; height: 7px; border-radius: 50%; background: #ba2622; border: 1px solid #ff4c45; box-shadow: 0 0 7px rgba(226,42,37,.32); }
#panel-view .timeline time { color: #696e76; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
#panel-view .timeline b { color: #d9dcdf; text-align: right; }
#panel-view .compact-record { min-height: 33px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; border-top: 1px solid #1b1e22; font-size: 8px; color: #848992; }
#panel-view .compact-record:first-of-type { border-top: 0; }
#panel-view .compact-record strong { color: #d7dade; font-size: 9px; }
#panel-view .compact-record button { border: 0; background: transparent; color: #e05a55; padding: 0; cursor: pointer; font-size: 8px; }
#panel-view .review-controls { margin-top: 12px; border: 1px solid #282c32; border-radius: 8px; background: linear-gradient(180deg,#0d0f11,#0a0c0e); padding: 13px; }
#panel-view .decision-row { display: flex; flex-wrap: wrap; gap: 7px; }
#panel-view .decision-button { border: 1px solid #292d33; border-radius: 6px; background: #111418; color: #8f949c; padding: 7px 9px; font-size: 8px; cursor: pointer; }
#panel-view .decision-button.is-active { color: #f1b461; border-color: rgba(214,153,52,.32); background: rgba(214,153,52,.06); }
#panel-view .note-editor { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 9px; }
#panel-view .note-editor textarea { min-height: 60px; resize: vertical; border: 1px solid #25292e; border-radius: 7px; background: #0e1012; color: #dfe2e5; padding: 9px; outline: 0; font-size: 9px; }
#panel-view .note-editor textarea::placeholder { color: #5e636b; }
#panel-view .note-editor .primary-button { align-self: end; }

#panel-view .replay-panel, #panel-view .sessions-panel { padding: 12px; }
#panel-view .replay-filters { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; margin-bottom: 10px; }
#panel-view .data-table { width: 100%; border: 1px solid #1d2024; border-radius: 8px; overflow: hidden; }
#panel-view .data-row { min-height: 46px; display: grid; align-items: center; gap: 10px; padding: 0 11px; border-bottom: 1px solid #1b1e22; color: #aeb3ba; font-size: 9px; }
#panel-view .data-row:last-child { border-bottom: 0; }
#panel-view .data-row.data-head { min-height: 32px; background: #0a0c0e; color: #5f646c; font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
#panel-view .replay-table .data-row { grid-template-columns: 85px 1fr .7fr 1.7fr 65px 65px 72px; }
#panel-view .session-table .data-row { grid-template-columns: 80px 1fr 1fr 1.3fr 80px 46px; }
#panel-view .data-row button { justify-self: end; border: 1px solid #292d33; background: #121519; border-radius: 6px; color: #aeb3ba; padding: 5px 7px; font-size: 8px; cursor: pointer; }
#panel-view .tag { display: inline-block; margin-right: 5px; padding: 3px 5px; border-radius: 4px; color: #ce6b67; background: rgba(226,42,37,.06); border: 1px solid rgba(226,42,37,.16); font-size: 8px; font-weight: 500; }
#panel-view .role-badge { display: inline-block; min-width: 58px; text-align: center; padding: 4px 6px; border-radius: 999px; font-size: 8px; }
#panel-view .role-badge.admin { color: #ff7872; background: rgba(226,42,37,.08); border: 1px solid rgba(226,42,37,.23); }
#panel-view .role-badge.customer { color: #e7b468; background: rgba(214,153,52,.07); border: 1px solid rgba(214,153,52,.21); }
#panel-view .role-badge.preview { color: #9ba1a9; background: #171a1e; border: 1px solid #2c3036; }
#panel-view .row-menu { letter-spacing: .1em; }

#panel-view .access-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
#panel-view .access-card { min-height: 92px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px; }
#panel-view .access-card > div { display: flex; align-items: center; gap: 12px; }
#panel-view .status-icon { width: 39px; height: 39px; border-radius: 8px; display: grid; place-items: center; border: 1px solid rgba(226,42,37,.28); background: rgba(226,42,37,.06); color: #ff5d56; font-family: "Arial Narrow", "Roboto Condensed", Inter, system-ui, sans-serif; font-weight: 700; }
#panel-view .access-card h3 { margin: 0; font-family: "Arial Narrow", "Roboto Condensed", Inter, system-ui, sans-serif; font-size: 15px; }
#panel-view .access-card p { margin: 5px 0 0; color: #747981; font-size: 9px; }
#panel-view .access-card code { color: #d66a65; }
#panel-view .switch { position: relative; width: 39px; height: 22px; flex: 0 0 auto; }
#panel-view .switch input { position: absolute; opacity: 0; pointer-events: none; }
#panel-view .switch span { position: absolute; inset: 0; border-radius: 999px; background: #25292e; border: 1px solid #343940; cursor: pointer; }
#panel-view .switch span::after { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; border-radius: 50%; background: #767c85; transition: .18s ease; }
#panel-view .switch input:checked + span { background: rgba(226,42,37,.22); border-color: rgba(226,42,37,.52); }
#panel-view .switch input:checked + span::after { left: 20px; background: #ff4a42; box-shadow: 0 0 9px rgba(255,74,66,.4); }

#panel-view .footer { margin: 36px 26px 0; min-height: 70px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #1c1f23; color: #50555d; font-size: 8px; letter-spacing: .14em; }

/* Role display hooks */
#panel-view .role-preview-only, #panel-view .role-label-preview { display: none; }
#panel-view .role-label-customer { display: none; }
#panel-view .role-preview .role-admin-only,
#panel-view .role-preview .role-hide-preview,
#panel-view .role-preview .role-reviewer-only,
#panel-view .role-preview .role-authorized-ip { display: none !important; }
#panel-view .role-preview .role-preview-only,
#panel-view .role-preview .role-label-preview { display: block; }
#panel-view .role-preview .role-label-admin { display: none; }
#panel-view .role-preview .metric-strip { grid-template-columns: repeat(5, minmax(125px,1fr)); }
#panel-view .role-preview .live-row { grid-template-columns: 1.1fr .78fr 1fr 54px 68px 78px; }
#panel-view .role-preview .panel-health .health-list { display: none; }
#panel-view .preview-health-note {
  margin: 0;
  padding: 17px 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

#panel-view .role-customer .role-admin-only,
#panel-view .role-customer .role-label-admin { display: none !important; }
#panel-view .role-customer .role-label-customer { display: block; }
#panel-view .role-customer .metric-strip { grid-template-columns: repeat(5, minmax(125px,1fr)); }

#panel-view .nav-toggle { position: fixed; opacity: 0; pointer-events: none; }
#panel-view .nav-scrim { display: none; }

@media (max-width: 1260px) {
  #panel-view .metric-strip { grid-template-columns: repeat(3, 1fr); }
  #panel-view .metric-card:nth-child(3n) { border-right: 0; }
  #panel-view .metric-card:nth-child(-n+3) { border-bottom: 1px solid #1c1f23; }
  #panel-view .role-preview .metric-strip, #panel-view .role-customer .metric-strip { grid-template-columns: repeat(3, 1fr); }
  #panel-view .dashboard-grid { grid-template-columns: 1fr; }
  #panel-view .panel-health { order: 2; }
  #panel-view .live-row { grid-template-columns: 1fr .65fr .9fr 50px 60px 72px 96px; }
}

@media (max-width: 980px) {
  #panel-view .app-shell { grid-template-columns: 1fr; }
  #panel-view .main-area { grid-column: 1; }
  #panel-view .sidebar { transform: translateX(-101%); transition: .22s ease; box-shadow: 18px 0 45px rgba(0,0,0,.45); }
  #panel-view .nav-toggle:checked ~ .app-shell .sidebar { transform: translateX(0); }
  #panel-view .nav-scrim { position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.58); backdrop-filter: blur(2px); }
  #panel-view .nav-toggle:checked ~ .app-shell .nav-scrim { display: block; }
  #panel-view .mobile-nav-button { display: grid; }
  #panel-view .incident-layout { grid-template-columns: 1fr; gap: 14px; }
  #panel-view .incident-list { display: grid; grid-template-columns: repeat(2,1fr); }
  #panel-view .incident-item:nth-child(odd) { border-right: 1px solid #1c1f23; }
  #panel-view .incident-content-grid, #panel-view .incident-lower-grid { grid-template-columns: 1fr; }
  #panel-view .replay-table, #panel-view .session-table { overflow-x: auto; }
  #panel-view .replay-table .data-row { min-width: 800px; }
  #panel-view .session-table .data-row { min-width: 760px; }
}

@media (max-width: 720px) {
  #panel-view .topbar { height: 62px; padding: 0 14px; }
  #panel-view .topbar h1 { font-size: 18px; }
  #panel-view .eyebrow { display: none; }
  #panel-view .connection-pill { display: none; }
  #panel-view .user-chip { min-width: 0; width: 38px; padding: 4px; justify-content: center; }
  #panel-view .user-meta, #panel-view .user-chip .chevron { display: none; }
  #panel-view .section-block, #panel-view .dashboard-grid { padding-left: 14px; padding-right: 14px; }
  #panel-view .metric-strip, #panel-view .role-preview .metric-strip, #panel-view .role-customer .metric-strip { grid-template-columns: repeat(2, 1fr); }
  #panel-view .metric-card, #panel-view .metric-card:nth-child(3n) { border-right: 1px solid #1c1f23; border-bottom: 1px solid #1c1f23; }
  #panel-view .metric-card:nth-child(even) { border-right: 0; }
  #panel-view .metric-card:nth-last-child(-n+2) { border-bottom: 0; }
  #panel-view .live-table { overflow-x: auto; }
  #panel-view .live-row { min-width: 720px; }
  #panel-view .role-preview .live-row { min-width: 620px; }
  #panel-view .filter-row, #panel-view .incident-toolbar { flex-wrap: wrap; }
  #panel-view .search-field.wide { max-width: none; flex-basis: 100%; }
  #panel-view .incident-list { display: block; }
  #panel-view .incident-item:nth-child(odd) { border-right: 0; }
  #panel-view .incident-stats { grid-template-columns: repeat(2,1fr); }
  #panel-view .incident-stats div:last-child { grid-column: 1 / -1; }
  #panel-view .incident-detail { padding: 13px; }
  #panel-view .incident-detail-header { align-items: center; }
  #panel-view .incident-detail-header p { margin-left: 0; }
  #panel-view .detail-score { width: auto; }
  #panel-view .detail-score strong { font-size: 24px; }
  #panel-view .replay-filters { grid-template-columns: 1fr 1fr; }
  #panel-view .access-grid { grid-template-columns: 1fr; }
  #panel-view .footer { margin-left: 14px; margin-right: 14px; }
}

@media (max-width: 480px) {
  #panel-view .metric-strip, #panel-view .role-preview .metric-strip, #panel-view .role-customer .metric-strip { grid-template-columns: 1fr; }
  #panel-view .metric-card, #panel-view .metric-card:nth-child(even), #panel-view .metric-card:nth-child(3n) { border-right: 0; border-bottom: 1px solid #1c1f23; }
  #panel-view .metric-card:last-child { border-bottom: 0; }
  #panel-view .panel-header { align-items: flex-start; }
  #panel-view .health-summary div { padding: 11px 9px; }
  #panel-view .health-row { grid-template-columns: 1.2fr .65fr .55fr; }
  #panel-view .section-heading { align-items: flex-start; }
  #panel-view .helper-copy { text-align: right; max-width: 150px; }
  #panel-view .incident-detail-header { display: grid; grid-template-columns: 1fr auto; }
  #panel-view .detail-title-row { gap: 7px; }
  #panel-view .detail-title-row h3 { font-size: 17px; }
  #panel-view .decision-row { display: grid; grid-template-columns: 1fr 1fr; }
  #panel-view .note-editor { grid-template-columns: 1fr; }
  #panel-view .note-editor .primary-button { justify-self: end; }
  #panel-view .replay-filters { grid-template-columns: 1fr; }
  #panel-view .access-card { align-items: flex-start; }
  #panel-view .footer { display: grid; gap: 7px; padding: 15px 0; justify-content: start; }
}

/* =========================================================
   NexusAC Operations — horizontal workspace navigation v2
   Visual/UI layer only. API wiring remains intentionally absent.
   ========================================================= */

#panel-view {
  font-size: 14px;
  overflow-x: hidden;
}

/* Moving micro-noise / telemetry dust in the background */
#panel-view::after {
  content: "";
  position: fixed;
  z-index: 0;
  inset: -220px 0 0;
  pointer-events: none;
  opacity: .34;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.22) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(226,42,37,.38) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255,255,255,.12) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(226,42,37,.18) 0 1px, transparent 1.4px);
  background-size: 97px 137px, 173px 211px, 131px 181px, 223px 263px;
  background-position: 11px 0, 71px 44px, 39px 83px, 127px 123px;
  animation: nexusTelemetryDust 14s linear infinite;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 8%, #000 86%, transparent 100%);
}

@keyframes nexusTelemetryDust {
  from { transform: translate3d(0, -180px, 0); }
  to { transform: translate3d(0, 180px, 0); }
}

@media (prefers-reduced-motion: reduce) {
  #panel-view::after, #panel-view .pulse { animation: none !important; }
  #panel-view .category-button { transition: none !important; }
}

#panel-view .app-shell {
  position: relative;
  z-index: 1;
  display: block;
  min-height: 100vh;
}

#panel-view .main-area {
  grid-column: auto;
  min-width: 0;
}

/* Header */
#panel-view .topbar {
  height: 78px;
  padding: 0 32px;
  background: rgba(6, 7, 9, .91);
  border-bottom: 1px solid rgba(255,255,255,.055);
  box-shadow: 0 10px 35px rgba(0,0,0,.20);
}

#panel-view .topbar-left { gap: 17px; }
#panel-view .topbar-separator {
  width: 1px;
  height: 38px;
  background: linear-gradient(180deg, transparent, #34383e, transparent);
}

#panel-view .top-brand {
  min-width: max-content;
  padding: 0;
  border: 0;
  gap: 10px;
}
#panel-view .top-brand .brand-emblem { width: 43px; height: 43px; }
#panel-view .top-brand .brand-copy strong { font-size: 25px; }
#panel-view .top-brand .brand-copy small { font-size: 10px; letter-spacing: .25em; }

#panel-view .eyebrow, #panel-view .section-kicker {
  font-size: 11px;
  letter-spacing: .15em;
}
#panel-view .topbar h1 {
  margin-top: 4px;
  font-size: 24px;
  letter-spacing: .025em;
}

#panel-view .connection-pill { height: 34px; font-size: 11px; padding: 0 13px; }
#panel-view .icon-button { width: 35px; height: 35px; font-size: 17px; }
#panel-view .user-chip { min-width: 220px; height: 46px; }
#panel-view .user-avatar { width: 32px; height: 32px; font-size: 14px; }
#panel-view .user-meta strong { font-size: 12px; }
#panel-view .role-label { font-size: 10px; }

/* Horizontal category navigation */
#panel-view .category-nav {
  position: sticky;
  top: 78px;
  z-index: 24;
  padding: 10px 30px 11px;
  border-bottom: 1px solid #1a1d21;
  background:
    linear-gradient(180deg, rgba(12,14,16,.96), rgba(8,9,11,.94));
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 28px rgba(0,0,0,.16);
}
#panel-view .category-nav-inner {
  max-width: 1640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: #4a1716 transparent;
  padding: 2px 1px;
}
#panel-view .category-button {
  position: relative;
  flex: 0 0 auto;
  min-height: 43px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid #25292e;
  border-radius: 8px;
  color: #aeb3ba;
  background: linear-gradient(180deg, #121519, #0d0f12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.015);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .015em;
  transform-origin: center;
  transition: transform .18s cubic-bezier(.2,.75,.25,1), border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}
#panel-view .category-button::after {
  content: "";
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: -1px;
  height: 1px;
  background: transparent;
  box-shadow: none;
  transition: .18s ease;
}
#panel-view .category-button:hover {
  color: #fff;
  border-color: rgba(226,42,37,.38);
  background: linear-gradient(180deg, rgba(36,20,21,.98), #111316);
  box-shadow: 0 9px 24px rgba(0,0,0,.26), 0 0 20px rgba(226,42,37,.08);
  transform: translateY(-1px) scale(1.045);
}
#panel-view .category-button:active { transform: translateY(0) scale(1.015); }
#panel-view .category-button.is-active {
  color: #fff;
  border-color: rgba(255,63,55,.48);
  background: linear-gradient(180deg, rgba(87,21,20,.60), rgba(31,15,16,.88));
  box-shadow: inset 0 0 0 1px rgba(255,58,49,.08), 0 0 24px rgba(226,42,37,.09);
}
#panel-view .category-button.is-active::after {
  background: #ff4038;
  box-shadow: 0 0 12px rgba(255,64,56,.65);
}
#panel-view .category-icon { color: #f33b34; font-size: 16px; line-height: 1; }
#panel-view .category-badge {
  min-width: 21px;
  padding: 2px 6px;
  border: 1px solid rgba(255,72,65,.24);
  border-radius: 999px;
  background: rgba(226,42,37,.12);
  color: #ff817c;
  font-size: 10px;
  text-align: center;
}
#panel-view .category-button .live-dot { margin-left: 1px; }

/* View switching */
#panel-view .workspace { min-height: calc(100vh - 150px); }
#panel-view .view-pane { display: none; animation: viewEnter .22s ease both; }
#panel-view .view-pane.is-active { display: block; }
@keyframes viewEnter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Larger, more readable data typography */
#panel-view .section-block { padding: 28px 32px 0; scroll-margin-top: 150px; }
#panel-view .dashboard-grid { padding: 18px 32px 0; gap: 18px; }
#panel-view .section-heading { margin-bottom: 16px; }
#panel-view .section-heading h2, #panel-view .panel-header h2 { font-size: 24px; }
#panel-view .timestamp, #panel-view .helper-copy { font-size: 12px; }

#panel-view .metric-card { min-height: 108px; padding: 18px 18px 16px; }
#panel-view .metric-label { font-size: 12px; }
#panel-view .metric-value { margin-top: 8px; font-size: 31px; }
#panel-view .metric-card small { margin-top: 8px; font-size: 11px; }

#panel-view .panel-header { min-height: 75px; padding: 17px 18px 15px; }
#panel-view .stream-state { font-size: 12px; }
#panel-view .search-field { height: 38px; }
#panel-view .search-field input { font-size: 13px; }
#panel-view .filter-button { height: 38px; font-size: 12px; min-width: 118px; }
#panel-view .quiet-button { font-size: 11px; padding: 7px 10px; }
#panel-view .outline-button, #panel-view .danger-outline-button, #panel-view .primary-button { font-size: 12px; }

#panel-view .live-row {
  min-height: 50px;
  padding: 0 15px;
  gap: 12px;
  font-size: 12px;
}
#panel-view .live-row.table-head { min-height: 35px; font-size: 10px; }
#panel-view .vl-chip { font-size: 11px; min-width: 31px; }
#panel-view .panel-footer { min-height: 43px; padding: 0 15px; font-size: 11px; }

#panel-view .health-summary strong { font-size: 24px; }
#panel-view .health-summary span { font-size: 11px; }
#panel-view .health-row { min-height: 64px; }
#panel-view .health-main strong { font-size: 12px; }
#panel-view .health-main small, #panel-view .health-stat small { font-size: 10px; }
#panel-view .health-stat strong { font-size: 18px; }
#panel-view .preview-locked-notice { font-size: 11px; }

#panel-view .incidents-section { padding-top: 30px; }
#panel-view .incident-layout { gap: 28px; }
#panel-view .incident-item { min-height: 78px; padding: 12px 14px; }
#panel-view .incident-item-main strong { font-size: 13px; }
#panel-view .incident-item-main small { font-size: 10px; }
#panel-view .incident-item-metrics b { font-size: 11px; }
#panel-view .incident-item-metrics small { font-size: 10px; }
#panel-view .priority-marker { font-size: 10px; width: 31px; height: 31px; }
#panel-view .incident-detail { padding: 21px; }
#panel-view .incident-detail-header p { font-size: 11px; }
#panel-view .incident-stats span { font-size: 10px; }
#panel-view .incident-stats strong { font-size: 17px; }
#panel-view .subhead h4 { font-size: 15px; }
#panel-view .subhead span { font-size: 10px; }
#panel-view .distribution-row { min-height: 33px; font-size: 11px; grid-template-columns: 92px 1fr 24px; }
#panel-view .distribution-row b { font-size: 11px; }
#panel-view .timeline > div { min-height: 31px; font-size: 10px; grid-template-columns: 8px 70px 1fr 48px; }
#panel-view .compact-record { min-height: 39px; font-size: 10px; }
#panel-view .compact-record strong { font-size: 11px; }
#panel-view .compact-record button { font-size: 10px; }
#panel-view .decision-button { font-size: 11px; padding: 8px 11px; }
#panel-view .note-editor textarea { font-size: 12px; padding: 11px; }

#panel-view .replay-panel, #panel-view .sessions-panel { padding: 15px; }
#panel-view .data-row { min-height: 52px; padding: 0 13px; font-size: 11px; }
#panel-view .data-row.data-head { min-height: 36px; font-size: 9px; }
#panel-view .data-row button { font-size: 10px; padding: 6px 8px; }
#panel-view .tag { font-size: 10px; padding: 4px 6px; }
#panel-view .role-badge { font-size: 10px; }
#panel-view .access-card { min-height: 108px; padding: 19px; }
#panel-view .access-card h3 { font-size: 17px; }
#panel-view .access-card p { font-size: 11px; line-height: 1.55; }
#panel-view .footer { font-size: 10px; }

#panel-view .dedicated-section { max-width: 1640px; margin: 0 auto; }
#panel-view .dedicated-section > .panel-full { width: 100%; }
#panel-view .dedicated-section .panel-live .live-row {
  grid-template-columns: 1.2fr .75fr 1.1fr 70px 90px 105px 150px;
}
#panel-view .dedicated-section .panel-health .health-list { padding-bottom: 16px; }
#panel-view .dedicated-section .panel-health .health-row {
  grid-template-columns: minmax(240px, 1.8fr) .75fr .7fr;
}

/* Keep role styling consistent with horizontal navigation */
#panel-view .role-preview .category-button.role-hide-preview,
#panel-view .role-preview .category-button.role-admin-only,
#panel-view .role-customer .category-button.role-admin-only { display: none !important; }

@media (max-width: 1100px) {
  #panel-view .topbar { padding: 0 22px; }
  #panel-view .category-nav { padding-left: 20px; padding-right: 20px; }
  #panel-view .section-block, #panel-view .dashboard-grid { padding-left: 22px; padding-right: 22px; }
  #panel-view .topbar-separator, #panel-view .eyebrow { display: none; }
  #panel-view .topbar h1 { font-size: 21px; }
  #panel-view .incident-layout { gap: 20px; }
}

@media (max-width: 760px) {
  #panel-view .topbar { height: 68px; padding: 0 14px; }
  #panel-view .top-brand .brand-emblem { width: 38px; height: 38px; }
  #panel-view .top-brand .brand-copy strong { font-size: 21px; }
  #panel-view .top-brand .brand-copy small { font-size: 8px; }
  #panel-view .topbar-left > div:last-child { display: none; }
  #panel-view .connection-pill { display: none; }
  #panel-view .user-chip { min-width: 0; width: 42px; height: 42px; padding: 4px; justify-content: center; }
  #panel-view .user-meta, #panel-view .user-chip .chevron { display: none; }
  #panel-view .category-nav { top: 68px; padding: 8px 11px 9px; }
  #panel-view .category-nav-inner { gap: 7px; }
  #panel-view .category-button { min-height: 40px; padding: 0 12px; font-size: 12px; }
  #panel-view .category-button:hover { transform: translateY(-1px) scale(1.025); }
  #panel-view .section-block, #panel-view .dashboard-grid { padding-left: 14px; padding-right: 14px; }
  #panel-view .section-heading h2, #panel-view .panel-header h2 { font-size: 21px; }
  #panel-view .metric-card { min-height: 102px; }
  #panel-view .metric-label { font-size: 11px; }
  #panel-view .metric-value { font-size: 28px; }
  #panel-view .live-row { font-size: 11px; }
  #panel-view .footer { margin-left: 14px; margin-right: 14px; }
}

@media (max-width: 520px) {
  #panel-view .category-label { max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
  #panel-view .category-button { padding: 0 10px; }
  #panel-view .section-kicker { font-size: 10px; }
  #panel-view .section-heading h2, #panel-view .panel-header h2 { font-size: 20px; }
  #panel-view .timestamp, #panel-view .helper-copy { font-size: 10px; }
}


/* =========================================================
   NexusAC Operations — layout refinements v3
   ========================================================= */

/* Keep the workspace category group visually centered on wide screens. */
#panel-view .category-nav-inner {
  justify-content: center;
}

/* Brand is decorative UI: prevent text selection and image dragging. */
#panel-view .top-brand {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none;
}
#panel-view .top-brand .brand-emblem {
  -webkit-user-drag: none;
  user-select: none;
}

/* Replays and Sessions use the same centered operation-canvas width as
   the dedicated Live Flags and Server Health views. */
#panel-view .view-pane[data-pane="replays"] .dedicated-section,
#panel-view .view-pane[data-pane="sessions"] .dedicated-section {
  width: 100%;
}

/* Give standalone operation panels a little breathing room below the nav. */
#panel-view .view-pane[data-pane="live-flags"] .dedicated-section,
#panel-view .view-pane[data-pane="server-health"] .dedicated-section,
#panel-view .view-pane[data-pane="replays"] .dedicated-section,
#panel-view .view-pane[data-pane="sessions"] .dedicated-section {
  padding-top: 30px;
}

/* On narrower screens horizontal navigation should remain fully reachable
   instead of centering overflowing items off-canvas. */
@media (max-width: 1180px) {
  #panel-view .category-nav-inner {
    justify-content: flex-start;
  }
}

/* =========================================================
   NexusAC Operations — personalization & notifications v4
   UI-only layer. Event hooks are exposed through window.NexusPanelUI.
   ========================================================= */

#panel-view {
  --field-bg: #101215;
  --noise-primary: rgba(255,255,255,.19);
  --noise-accent: rgba(226,42,37,.34);
  --ui-text-scale: 1.08;
  --ui-text-weight: 650;
}

#panel-view {
  background:
    radial-gradient(circle at 85% -10%, color-mix(in srgb, var(--red) 10%, transparent), transparent 27%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  color: var(--text);
  font-family: Inter, "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 500;
  transition: background-color .22s ease, color .22s ease;
}

#panel-view::before {
  background-image:
    linear-gradient(color-mix(in srgb, var(--text) 3.2%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--text) 2.5%, transparent) 1px, transparent 1px);
}

#panel-view::after {
  background-image:
    radial-gradient(circle, var(--noise-primary) 0 1px, transparent 1.5px),
    radial-gradient(circle, var(--noise-accent) 0 1px, transparent 1.5px),
    radial-gradient(circle, color-mix(in srgb, var(--noise-primary) 68%, transparent) 0 1px, transparent 1.4px),
    radial-gradient(circle, color-mix(in srgb, var(--noise-accent) 58%, transparent) 0 1px, transparent 1.4px);
}

/* Dynamic theme surfaces */
#panel-view .topbar,
#panel-view .category-nav { background: color-mix(in srgb, var(--bg) 92%, transparent); border-color: var(--line-soft); }
#panel-view .category-nav { background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 96%, transparent), color-mix(in srgb, var(--bg-soft) 95%, transparent)); }
#panel-view .panel,
#panel-view .metric-strip,
#panel-view .incident-detail,
#panel-view .access-card { background: linear-gradient(180deg, var(--panel), var(--bg-soft)); border-color: var(--line); }
#panel-view .metric-card,
#panel-view .filter-row,
#panel-view .detail-card,
#panel-view .review-controls,
#panel-view .incident-stats div,
#panel-view .data-row.data-head { background: var(--bg-soft); border-color: var(--line-soft); }
#panel-view .search-field,
#panel-view .filter-button,
#panel-view .quiet-button,
#panel-view .icon-button,
#panel-view .category-button,
#panel-view .user-chip,
#panel-view .decision-button,
#panel-view .note-editor textarea,
#panel-view .data-row button,
#panel-view .settings-secondary-button,
#panel-view .sound-test,
#panel-view .sound-select,
#panel-view .select-setting select,
#panel-view .hex-input { background: var(--field-bg); border-color: var(--line); color: var(--text); }
#panel-view .data-row,
#panel-view .live-row,
#panel-view .health-row,
#panel-view .panel-header,
#panel-view .panel-footer,
#panel-view .incident-detail-header,
#panel-view .incident-item,
#panel-view .compact-record { border-color: var(--line-soft); }

/* Improve readability: less condensed typography and higher default weights. */
#panel-view .brand-copy strong,
#panel-view .topbar h1,
#panel-view .section-heading h2,
#panel-view .panel-header h2,
#panel-view .metric-value,
#panel-view .detail-title-row h3,
#panel-view .detail-score strong,
#panel-view .incident-stats strong,
#panel-view .subhead h4,
#panel-view .health-summary strong,
#panel-view .health-stat strong,
#panel-view .access-card h3,
#panel-view .status-icon {
  font-family: Inter, "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  font-weight: 760;
  letter-spacing: .01em;
}

#panel-view,
#panel-view button,
#panel-view input,
#panel-view textarea,
#panel-view select { font-weight: 520; }

#panel-view .category-button { font-size: calc(13px * var(--ui-text-scale)); font-weight: var(--ui-text-weight); }
#panel-view .topbar h1 { font-size: calc(24px * var(--ui-text-scale)); }
#panel-view .eyebrow, #panel-view .section-kicker { font-size: calc(11px * var(--ui-text-scale)); font-weight: 780; }
#panel-view .section-heading h2, #panel-view .panel-header h2 { font-size: calc(24px * var(--ui-text-scale)); }
#panel-view .timestamp, #panel-view .helper-copy { font-size: calc(12px * var(--ui-text-scale)); font-weight: 540; }
#panel-view .metric-label { font-size: calc(12px * var(--ui-text-scale)); font-weight: 620; }
#panel-view .metric-value { font-size: calc(31px * var(--ui-text-scale)); }
#panel-view .metric-card small { font-size: calc(11px * var(--ui-text-scale)); font-weight: 540; }
#panel-view .stream-state { font-size: calc(12px * var(--ui-text-scale)); font-weight: 570; }
#panel-view .search-field input { font-size: calc(13px * var(--ui-text-scale)); font-weight: 520; }
#panel-view .filter-button { font-size: calc(12px * var(--ui-text-scale)); font-weight: 600; }
#panel-view .quiet-button { font-size: calc(11px * var(--ui-text-scale)); font-weight: 620; }
#panel-view .outline-button, #panel-view .danger-outline-button, #panel-view .primary-button { font-size: calc(12px * var(--ui-text-scale)); font-weight: 650; }
#panel-view .live-row { font-size: calc(12px * var(--ui-text-scale)); font-weight: 570; }
#panel-view .live-row.table-head { font-size: calc(10px * var(--ui-text-scale)); font-weight: 740; }
#panel-view .vl-chip { font-size: calc(11px * var(--ui-text-scale)); font-weight: 750; }
#panel-view .panel-footer { font-size: calc(11px * var(--ui-text-scale)); font-weight: 570; }
#panel-view .health-summary span { font-size: calc(11px * var(--ui-text-scale)); font-weight: 580; }
#panel-view .health-main strong { font-size: calc(12px * var(--ui-text-scale)); font-weight: 690; }
#panel-view .health-main small, #panel-view .health-stat small { font-size: calc(10px * var(--ui-text-scale)); font-weight: 540; }
#panel-view .health-stat strong { font-size: calc(18px * var(--ui-text-scale)); }
#panel-view .preview-locked-notice { font-size: calc(11px * var(--ui-text-scale)); font-weight: 560; }
#panel-view .incident-item-main strong { font-size: calc(13px * var(--ui-text-scale)); font-weight: 720; }
#panel-view .incident-item-main small { font-size: calc(10px * var(--ui-text-scale)); font-weight: 560; }
#panel-view .incident-item-metrics b { font-size: calc(11px * var(--ui-text-scale)); font-weight: 720; }
#panel-view .incident-item-metrics small { font-size: calc(10px * var(--ui-text-scale)); font-weight: 560; }
#panel-view .priority-marker { font-size: calc(10px * var(--ui-text-scale)); font-weight: 800; }
#panel-view .incident-detail-header p { font-size: calc(11px * var(--ui-text-scale)); font-weight: 540; }
#panel-view .state-chip { font-size: calc(10px * var(--ui-text-scale)); font-weight: 650; }
#panel-view .detail-score span { font-size: calc(10px * var(--ui-text-scale)); font-weight: 680; }
#panel-view .incident-stats span { font-size: calc(10px * var(--ui-text-scale)); font-weight: 580; }
#panel-view .incident-stats strong { font-size: calc(17px * var(--ui-text-scale)); }
#panel-view .subhead h4 { font-size: calc(15px * var(--ui-text-scale)); }
#panel-view .subhead span { font-size: calc(10px * var(--ui-text-scale)); font-weight: 560; }
#panel-view .distribution-row, #panel-view .distribution-row b { font-size: calc(11px * var(--ui-text-scale)); font-weight: 570; }
#panel-view .timeline > div { font-size: calc(10px * var(--ui-text-scale)); font-weight: 550; }
#panel-view .compact-record { font-size: calc(10px * var(--ui-text-scale)); font-weight: 550; }
#panel-view .compact-record strong { font-size: calc(11px * var(--ui-text-scale)); font-weight: 680; }
#panel-view .compact-record button { font-size: calc(10px * var(--ui-text-scale)); font-weight: 650; }
#panel-view .decision-button { font-size: calc(11px * var(--ui-text-scale)); font-weight: 620; }
#panel-view .note-editor textarea { font-size: calc(12px * var(--ui-text-scale)); font-weight: 520; }
#panel-view .data-row { font-size: calc(11px * var(--ui-text-scale)); font-weight: 560; }
#panel-view .data-row.data-head { font-size: calc(10px * var(--ui-text-scale)); font-weight: 760; }
#panel-view .data-row button, #panel-view .tag, #panel-view .role-badge { font-size: calc(10px * var(--ui-text-scale)); font-weight: 650; }
#panel-view .access-card p { font-size: calc(11px * var(--ui-text-scale)); font-weight: 540; }
#panel-view .footer { font-size: calc(10px * var(--ui-text-scale)); font-weight: 620; }
#panel-view .user-meta strong { font-size: calc(12px * var(--ui-text-scale)); font-weight: 690; }
#panel-view .role-label { font-size: calc(10px * var(--ui-text-scale)); font-weight: 560; }
#panel-view .connection-pill { font-size: calc(11px * var(--ui-text-scale)); font-weight: 760; }

/* Dynamic muted colors for light/dark user-selected backgrounds. */
#panel-view .metric-label,
#panel-view .timestamp,
#panel-view .helper-copy,
#panel-view .health-main small,
#panel-view .health-stat small,
#panel-view .incident-item-main small,
#panel-view .incident-item-metrics small,
#panel-view .incident-detail-header p,
#panel-view .incident-stats span,
#panel-view .subhead span,
#panel-view .timeline time,
#panel-view .compact-record,
#panel-view .access-card p,
#panel-view .role-label,
#panel-view .footer,
#panel-view .stream-state { color: var(--muted); }
#panel-view .data-row,
#panel-view .live-row,
#panel-view .health-main strong,
#panel-view .search-field input,
#panel-view .filter-button,
#panel-view .category-button,
#panel-view .quiet-button { color: color-mix(in srgb, var(--text) 82%, var(--muted)); }
#panel-view .data-row.data-head,
#panel-view .live-row.table-head { color: var(--muted-2); }
#panel-view .search-field input::placeholder,
#panel-view .note-editor textarea::placeholder { color: var(--muted-2); opacity: 1; }

/* Settings entry next to LIVE */
#panel-view .settings-toggle {
  position: relative;
  font-size: 17px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease;
}
#panel-view .settings-toggle:hover,
#panel-view .settings-toggle[aria-expanded="true"] {
  transform: rotate(16deg) scale(1.06);
  color: var(--red-bright);
  border-color: color-mix(in srgb, var(--red) 50%, var(--line));
  box-shadow: 0 0 18px color-mix(in srgb, var(--red) 16%, transparent);
}

#panel-view .settings-panel {
  position: fixed;
  z-index: 90;
  top: 74px;
  right: 18px;
  width: min(510px, calc(100vw - 28px));
  max-height: calc(100vh - 92px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--red) 24%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 97%, transparent);
  box-shadow: 0 24px 80px rgba(0,0,0,.48), 0 0 42px color-mix(in srgb, var(--red) 8%, transparent);
  backdrop-filter: blur(22px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(.985);
  transform-origin: top right;
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
#panel-view .settings-panel.is-open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
#panel-view .settings-scrim {
  position: fixed;
  z-index: 89;
  inset: 0;
  background: rgba(0,0,0,.24);
  opacity: 0;
  visibility: hidden;
  transition: .18s ease;
}
#panel-view .settings-scrim.is-open { opacity: 1; visibility: visible; }
#panel-view .settings-panel-header {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 17px;
  border-bottom: 1px solid var(--line-soft);
}
#panel-view .settings-panel-header h2 { margin: 3px 0 0; font-size: calc(22px * var(--ui-text-scale)); font-weight: 780; }
#panel-view .settings-close {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field-bg);
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}
#panel-view .settings-scroll { overflow-y: auto; padding: 14px; }
#panel-view .settings-group {
  padding: 15px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: color-mix(in srgb, var(--bg-soft) 92%, transparent);
}
#panel-view .settings-group + .settings-group { margin-top: 12px; }
#panel-view .settings-group-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
#panel-view .settings-group-title h3 { margin: 0; font-size: calc(15px * var(--ui-text-scale)); font-weight: 760; }
#panel-view .settings-group-title span { color: var(--muted); font-size: calc(10px * var(--ui-text-scale)); font-weight: 570; }
#panel-view .setting-grid { display: grid; gap: 10px; }
#panel-view .setting-grid.two-col { grid-template-columns: 1fr 1fr; }
#panel-view .compact-settings { margin-top: 10px; }
#panel-view .color-setting > span,
#panel-view .select-setting > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: calc(10px * var(--ui-text-scale));
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .07em;
}
#panel-view .color-setting > div { display: grid; grid-template-columns: 42px 1fr; gap: 7px; }
#panel-view .color-setting input[type="color"] {
  width: 42px;
  height: 38px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field-bg);
  cursor: pointer;
}
#panel-view .hex-input,
#panel-view .select-setting select,
#panel-view .sound-select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 9px;
  outline: none;
  font-size: calc(11px * var(--ui-text-scale));
  font-weight: 600;
}
#panel-view .contrast-status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding: 10px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-2) 68%, transparent);
}
#panel-view .contrast-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 12%, transparent); }
#panel-view .contrast-status strong,
#panel-view .notification-master strong,
#panel-view .desktop-notification-row strong { display: block; font-size: calc(11px * var(--ui-text-scale)); font-weight: 720; }
#panel-view .contrast-status small,
#panel-view .notification-master small,
#panel-view .desktop-notification-row small { display: block; margin-top: 2px; color: var(--muted); font-size: calc(10px * var(--ui-text-scale)); font-weight: 540; line-height: 1.4; }
#panel-view .settings-secondary-button {
  min-height: 34px;
  margin-top: 10px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  font-size: calc(10px * var(--ui-text-scale));
  font-weight: 650;
}
#panel-view .settings-secondary-button:hover,
#panel-view .sound-test:hover { border-color: color-mix(in srgb, var(--red) 44%, var(--line)); color: var(--text); }
#panel-view .notification-master,
#panel-view .desktop-notification-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}
#panel-view .desktop-notification-row .settings-secondary-button { margin-top: 0; flex: 0 0 auto; }
#panel-view .notification-event-list { margin-top: 10px; }
#panel-view .notification-event {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto 112px 48px;
  align-items: center;
  gap: 8px;
  min-height: 55px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
}
#panel-view .notification-event:last-child { border-bottom: 0; }
#panel-view .notification-event-copy { display: flex; align-items: center; min-width: 0; gap: 9px; }
#panel-view .notification-event-copy strong { display: block; font-size: calc(11px * var(--ui-text-scale)); font-weight: 720; }
#panel-view .notification-event-copy small { display: block; margin-top: 2px; color: var(--muted); font-size: calc(10px * var(--ui-text-scale)); font-weight: 560; }
#panel-view .event-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--red) 30%, var(--line));
  border-radius: 7px;
  color: var(--red-bright);
  background: color-mix(in srgb, var(--red) 8%, transparent);
  font-weight: 800;
}
#panel-view .compact-switch { width: 36px; height: 20px; }
#panel-view .compact-switch span::after { width: 12px; height: 12px; }
#panel-view .compact-switch input:checked + span::after { left: 18px; }
#panel-view .sound-select { height: 34px; font-size: calc(10px * var(--ui-text-scale)); }
#panel-view .sound-test {
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  font-size: calc(10px * var(--ui-text-scale));
  font-weight: 680;
}
#panel-view .settings-note { margin: 10px 0 0; color: var(--muted-2); font-size: calc(9px * var(--ui-text-scale)); line-height: 1.5; font-weight: 540; }

/* Animated per-category notification marker. */
#panel-view .category-button.has-notification::before {
  content: "!";
  position: absolute;
  z-index: 3;
  top: -10px;
  right: -5px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--red-bright) 75%, #fff);
  border-radius: 999px;
  background: var(--red-bright);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 0 16px color-mix(in srgb, var(--red) 55%, transparent);
  animation: nexusCategoryAlert .82s ease-in-out infinite alternate;
}
@keyframes nexusCategoryAlert {
  from { transform: translateY(0) scale(.96); }
  to { transform: translateY(-6px) scale(1.04); }
}

/* Toast notifications */
#panel-view .toast-region {
  position: fixed;
  z-index: 100;
  top: 88px;
  right: 20px;
  width: min(390px, calc(100vw - 28px));
  display: grid;
  gap: 9px;
  pointer-events: none;
}
#panel-view .nexus-toast {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 10px 10px 10px 12px;
  border: 1px solid color-mix(in srgb, var(--red) 30%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: 0 16px 50px rgba(0,0,0,.36), 0 0 24px color-mix(in srgb, var(--red) 8%, transparent);
  backdrop-filter: blur(18px);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(18px) scale(.98);
  transition: .22s ease;
}
#panel-view .nexus-toast.is-visible { opacity: 1; transform: translateX(0) scale(1); }
#panel-view .toast-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red-bright); border: 1px solid color-mix(in srgb, var(--red) 30%, var(--line)); font-weight: 900; }
#panel-view .nexus-toast strong { display: block; font-size: calc(12px * var(--ui-text-scale)); font-weight: 760; }
#panel-view .nexus-toast small { display: block; margin-top: 3px; color: var(--muted); font-size: calc(10px * var(--ui-text-scale)); font-weight: 550; line-height: 1.35; }
#panel-view .nexus-toast button { width: 29px; height: 29px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 19px; }

/* Light backgrounds need softer shadows rather than black-heavy contrast. */
#panel-view.theme-light .panel,
#panel-view.theme-light .metric-strip,
#panel-view.theme-light .settings-panel,
#panel-view.theme-light .nexus-toast { box-shadow: 0 14px 34px rgba(0,0,0,.12), 0 0 0 1px color-mix(in srgb, var(--red) 5%, transparent); }
#panel-view.theme-light .category-button:hover { color: var(--text); }
#panel-view.theme-light .category-button.has-notification::before { color: #fff; }

@media (max-width: 760px) {
  #panel-view .settings-panel { top: 66px; right: 8px; width: calc(100vw - 16px); max-height: calc(100vh - 74px); }
  #panel-view .setting-grid.two-col { grid-template-columns: 1fr; }
  #panel-view .notification-event { grid-template-columns: minmax(0,1fr) auto; }
  #panel-view .notification-event .sound-select { grid-column: 1; }
  #panel-view .notification-event .sound-test { grid-column: 2; grid-row: 2; }
  #panel-view .toast-region { top: 76px; right: 8px; width: calc(100vw - 16px); }
}

@media (max-width: 520px) {
  #panel-view .settings-panel-header { padding: 13px 14px; }
  #panel-view .settings-scroll { padding: 10px; }
  #panel-view .settings-group { padding: 12px; }
  #panel-view .settings-group-title { align-items: flex-start; flex-direction: column; gap: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  #panel-view .settings-panel,
  #panel-view .settings-scrim,
  #panel-view .nexus-toast,
  #panel-view .category-button.has-notification::before,
  #panel-view .settings-toggle { animation: none !important; transition: none !important; }
}

/* Weight setting affects ordinary copy as well as navigation. */
#panel-view { --ui-copy-weight: 580; --ui-label-weight: 690; }
#panel-view .workspace,
#panel-view .topbar,
#panel-view .category-nav,
#panel-view .settings-panel { font-weight: var(--ui-copy-weight); }
#panel-view .metric-label,
#panel-view .health-main strong,
#panel-view .incident-item-main strong,
#panel-view .incident-item-metrics b,
#panel-view .compact-record strong,
#panel-view .notification-event-copy strong,
#panel-view .contrast-status strong,
#panel-view .notification-master strong,
#panel-view .desktop-notification-row strong,
#panel-view .user-meta strong { font-weight: var(--ui-label-weight); }
#panel-view .live-row,
#panel-view .data-row,
#panel-view .health-main small,
#panel-view .health-stat small,
#panel-view .incident-item-main small,
#panel-view .incident-item-metrics small,
#panel-view .incident-detail-header p,
#panel-view .timeline > div,
#panel-view .compact-record,
#panel-view .access-card p,
#panel-view .role-label,
#panel-view .stream-state,
#panel-view .timestamp,
#panel-view .helper-copy { font-weight: var(--ui-copy-weight); }

/* Complete adaptive-surface pass for custom light or dark backgrounds. */
#panel-view .connection-pill,
#panel-view .incident-list,
#panel-view .incident-detail,
#panel-view .live-row.table-head,
#panel-view .vl-chip,
#panel-view .role-badge.preview { background: var(--bg-soft); border-color: var(--line); color: var(--text); }
#panel-view .live-row:not(.table-head):hover,
#panel-view .incident-item:hover { background: var(--panel-2); }
#panel-view .incident-stats { background: var(--line-soft); border-color: var(--line-soft); }
#panel-view .bar { background: var(--line-soft); }
#panel-view .timeline::before { background: var(--line); }
#panel-view .switch span { background: var(--panel-3); border-color: var(--line); }
#panel-view .switch span::after { background: var(--muted-2); }
#panel-view .note-editor textarea { color: var(--text); }
#panel-view .connection-pill { color: var(--text); }
#panel-view.theme-light .category-button {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: color-mix(in srgb, var(--text) 86%, var(--muted));
}
#panel-view.theme-light .category-button:hover {
  background: linear-gradient(180deg, color-mix(in srgb, var(--red) 9%, var(--panel-2)), var(--panel));
}
#panel-view.theme-light .category-button.is-active {
  background: linear-gradient(180deg, color-mix(in srgb, var(--red) 14%, var(--panel-2)), color-mix(in srgb, var(--red) 6%, var(--panel)));
}

/* ===== Control polish: precise settings controls + health metrics ===== */
#panel-view .settings-toggle {
  display: inline-grid;
  place-items: center;
  padding: 0;
  line-height: 0;
}
#panel-view .settings-gear {
  width: 18px;
  height: 18px;
  display: block;
  pointer-events: none;
  transform: translateY(0);
}
#panel-view .settings-toggle:hover .settings-gear,
#panel-view .settings-toggle[aria-expanded="true"] .settings-gear { transform: none; }

#panel-view .setting-control { min-width: 0; }
#panel-view .setting-label-row {
  min-height: 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
#panel-view .setting-label-row > span,
#panel-view .setting-label-row > label {
  color: var(--muted);
  font-size: calc(10px * var(--ui-text-scale));
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .07em;
}
#panel-view .color-setting > span,
#panel-view .select-setting > span { margin-bottom: 0; }
#panel-view .color-control-row { display: grid; grid-template-columns: 42px 1fr; gap: 7px; }
#panel-view .setting-reset {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--field-bg) 92%, transparent);
  color: var(--muted);
  font: 700 15px/1 system-ui, sans-serif;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, color .16s ease, background .16s ease, box-shadow .16s ease;
}
#panel-view .setting-reset:hover {
  color: var(--red-bright);
  border-color: color-mix(in srgb, var(--red) 46%, var(--line));
  background: color-mix(in srgb, var(--red) 8%, var(--field-bg));
  box-shadow: 0 0 14px color-mix(in srgb, var(--red) 10%, transparent);
  transform: rotate(-24deg) scale(1.06);
}
#panel-view .setting-reset:active { transform: rotate(-42deg) scale(.94); }
#panel-view .setting-action-cluster { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
#panel-view .desktop-notification-row .setting-action-cluster .settings-secondary-button { margin: 0; }
#panel-view .notification-event {
  grid-template-columns: minmax(0,1fr) auto 112px 48px 28px;
}
#panel-view .notification-event .event-reset { justify-self: end; }

/* Server health rows now read as a purposeful entity + compact metric group. */
#panel-view .health-row {
  grid-template-columns: minmax(210px, 1fr) auto !important;
  gap: 18px !important;
  min-height: 70px !important;
  padding: 8px 0;
}
#panel-view .health-main { min-width: 0; }
#panel-view .health-metrics {
  width: min(360px, 42vw);
  display: grid;
  grid-template-columns: repeat(2, minmax(132px, 1fr));
  gap: 8px;
  align-items: stretch;
}
#panel-view .health-stat {
  min-height: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 3px;
  padding: 7px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-2) 56%, transparent);
  text-align: left !important;
}
#panel-view .health-stat small {
  order: 0;
  margin: 0;
  color: var(--muted-2);
  font-size: calc(9px * var(--ui-text-scale)) !important;
  font-weight: 680 !important;
  letter-spacing: .055em;
  text-transform: uppercase;
}
#panel-view .health-stat strong {
  order: 1;
  margin: 0;
  color: var(--text);
  font-size: calc(18px * var(--ui-text-scale)) !important;
  font-weight: 780 !important;
  line-height: 1;
}
#panel-view .dedicated-section .panel-health .health-list { padding-left: 16px; padding-right: 16px; }
#panel-view .dedicated-section .panel-health .health-row { padding-left: 0; padding-right: 0; }

@media (max-width: 720px) {
  #panel-view .notification-event { grid-template-columns: minmax(0,1fr) auto 28px; }
  #panel-view .notification-event .sound-select { grid-column: 1; }
  #panel-view .notification-event .sound-test { grid-column: 2; grid-row: 2; }
  #panel-view .notification-event .event-reset { grid-column: 3; grid-row: 2; }
  #panel-view .health-row { grid-template-columns: 1fr !important; gap: 9px !important; padding: 11px 0; }
  #panel-view .health-metrics { width: 100%; grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  #panel-view .setting-reset { transition: none !important; }
  #panel-view .setting-reset:hover, #panel-view .setting-reset:active { transform: none !important; }
}

/* ===== Palette selector + notification/reset alignment fixes ===== */
/* Keep animated notification markers completely inside category buttons. */
#panel-view .category-button.has-notification::before {
  top: 3px;
  right: 4px;
  width: 17px;
  height: 17px;
  font-size: 10px;
  line-height: 1;
  animation: nexusCategoryAlertInside .72s ease-in-out infinite alternate;
}
@keyframes nexusCategoryAlertInside {
  from { transform: translateY(0) scale(.96); }
  to { transform: translateY(4px) scale(1.04); }
}

/* Reset controls are anchored to the right edge of their own setting. */
#panel-view .setting-label-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 27px;
  align-items: center;
  justify-content: initial;
  gap: 9px;
}
#panel-view .setting-label-row > span { min-width: 0; }
#panel-view .setting-label-row .setting-reset { justify-self: end; }
#panel-view .select-setting { min-width: 0; }
#panel-view .select-setting .setting-label-row { width: 100%; }

#panel-view .palette-setting { margin-bottom: 11px; }
#panel-view .palette-label-row { margin-bottom: 8px; }
#panel-view .palette-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
#panel-view .palette-option {
  min-width: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--field-bg) 94%, transparent);
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  font-size: calc(10px * var(--ui-text-scale));
  font-weight: 680;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease, box-shadow .16s ease;
}
#panel-view .palette-option:hover {
  transform: translateY(-1px);
  color: var(--text);
  border-color: color-mix(in srgb, var(--red) 34%, var(--line));
  background: color-mix(in srgb, var(--panel-2) 88%, transparent);
}
#panel-view .palette-option.is-selected {
  color: var(--text);
  border-color: color-mix(in srgb, var(--red) 62%, var(--line));
  background: color-mix(in srgb, var(--red) 8%, var(--panel-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 12%, transparent), 0 0 14px color-mix(in srgb, var(--red) 7%, transparent);
}
#panel-view .palette-option[data-palette="nexus"] { --swatch-bg: #070809; --swatch-accent: #e22a25; }
#panel-view .palette-option[data-palette="carbon-rose"] { --swatch-bg: #0b0a0c; --swatch-accent: #ff4b5c; }
#panel-view .palette-option[data-palette="midnight-violet"] { --swatch-bg: #090a12; --swatch-accent: #8b5cf6; }
#panel-view .palette-option[data-palette="cobalt-night"] { --swatch-bg: #071018; --swatch-accent: #38bdf8; }
#panel-view .palette-option[data-palette="emerald-ops"] { --swatch-bg: #07110d; --swatch-accent: #22c55e; }
#panel-view .palette-option[data-palette="amber-terminal"] { --swatch-bg: #100d07; --swatch-accent: #f59e0b; }
#panel-view .palette-option[data-palette="crimson-graphite"] { --swatch-bg: #0d0b0b; --swatch-accent: #ef4444; }
#panel-view .palette-option[data-palette="plum-signal"] { --swatch-bg: #100a13; --swatch-accent: #d946ef; }
#panel-view .palette-option[data-palette="slate-mint"] { --swatch-bg: #0a0f0f; --swatch-accent: #2dd4bf; }
#panel-view .palette-option[data-palette="frost-signal"] { --swatch-bg: #eef2f5; --swatch-accent: #d8272d; }
#panel-view .palette-swatches {
  flex: 0 0 auto;
  width: 32px;
  height: 22px;
  position: relative;
  display: block;
}
#panel-view .palette-swatches i {
  position: absolute;
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--swatch-bg);
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: 0 1px 5px rgba(0,0,0,.28);
}
#panel-view .palette-swatches i:first-child { left: 0; z-index: 1; }
#panel-view .palette-swatches i:last-child { right: 0; z-index: 2; background: var(--swatch-accent); }
#panel-view .palette-option.is-selected .palette-swatches i:last-child { box-shadow: 0 0 0 2px color-mix(in srgb, var(--red) 20%, transparent), 0 0 9px color-mix(in srgb, var(--red) 28%, transparent); }

@media (max-width: 520px) {
  #panel-view .palette-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  #panel-view .category-button.has-notification::before,
  #panel-view .palette-option { animation: none !important; transition: none !important; }
  #panel-view .category-button.has-notification::before { transform: none !important; }
}

/* =========================================================
   NexusAC Operations — overview expansion + fixed workspace v7
   Standalone Live Flags / Servers categories were folded into Overview.
   The browser page itself is fixed; active views and expanded datasets
   own their scrolling surfaces.
   ========================================================= */
#panel-view, #panel-view {
  width: 100%;
  height: 100%;
  overflow: hidden !important;
  overscroll-behavior: none;
}

#panel-view .app-shell,
#panel-view .main-area {
  width: 100%;
  height: 100vh;
  min-height: 0 !important;
  overflow: hidden;
}

#panel-view .main-area {
  display: flex;
  flex-direction: column;
}

#panel-view .topbar {
  position: relative;
  top: auto;
  flex: 0 0 78px;
}

#panel-view .category-nav {
  position: relative;
  top: auto;
  flex: 0 0 auto;
}

#panel-view .workspace {
  flex: 1 1 auto;
  min-height: 0 !important;
  overflow: hidden;
}

#panel-view .view-pane {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#panel-view .view-pane.is-active {
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--red) 42%, var(--line)) transparent;
}

#panel-view .view-pane.is-active::-webkit-scrollbar,
#panel-view .panel-scroll-surface::-webkit-scrollbar,
#panel-view .panel-live.is-expanded .live-table::-webkit-scrollbar,
#panel-view .panel-health.is-expanded .health-list::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
#panel-view .view-pane.is-active::-webkit-scrollbar-thumb,
#panel-view .panel-scroll-surface::-webkit-scrollbar-thumb,
#panel-view .panel-live.is-expanded .live-table::-webkit-scrollbar-thumb,
#panel-view .panel-health.is-expanded .health-list::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: color-mix(in srgb, var(--red) 38%, var(--line));
  border: 2px solid transparent;
  background-clip: padding-box;
}
#panel-view .view-pane.is-active::-webkit-scrollbar-track,
#panel-view .panel-live.is-expanded .live-table::-webkit-scrollbar-track,
#panel-view .panel-health.is-expanded .health-list::-webkit-scrollbar-track { background: transparent; }

/* Footer is intentionally removed from the fixed-height operation canvas. */
#panel-view .footer { display: none !important; }

/* Overview panels stay compact until explicitly expanded. */
#panel-view .extended-entry { display: none !important; }
#panel-view .panel.is-expanded .extended-entry { display: grid !important; }

#panel-view .panel-expand-button {
  border: 0;
  background: transparent;
  color: color-mix(in srgb, var(--red-bright) 78%, var(--text));
  padding: 5px 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: calc(10px * var(--ui-text-scale));
  font-weight: 720;
  cursor: pointer;
  transition: color .16s ease, transform .16s ease, opacity .16s ease;
}
#panel-view .panel-expand-button:hover { color: var(--red-bright); transform: translateY(-1px); }
#panel-view .panel-expand-button span { font-size: 12px; transition: transform .18s ease; }
#panel-view .panel-expand-button[aria-expanded="true"] span { transform: translateY(-1px); }

/* Quiet header button keeps its original framed treatment while using the same toggle logic. */
#panel-view .quiet-button.panel-expand-button {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-2) 84%, transparent);
  color: var(--text);
  padding: 7px 10px;
}
#panel-view .quiet-button.panel-expand-button:hover {
  border-color: color-mix(in srgb, var(--red) 45%, var(--line));
  background: color-mix(in srgb, var(--red) 7%, var(--panel-2));
}

/* Expand in place, then let the data body own vertical scrolling. */
#panel-view .panel-live.is-expanded,
#panel-view .panel-health.is-expanded {
  min-height: 0;
}

#panel-view .panel-live.is-expanded .live-table {
  max-height: min(54vh, 610px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

#panel-view .panel-health.is-expanded .health-list {
  max-height: min(54vh, 610px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

/* Panels expand vertically in their existing columns; the neighboring panel keeps its compact height. */
#panel-view .dashboard-grid { align-items: start; }

/* Keep the Overview category notification target useful after removing the two standalone tabs. */
#panel-view .category-button[data-view="overview"].has-notification::before { right: 4px; }

@media (max-width: 760px) {
  #panel-view .topbar { flex-basis: 68px; }
  #panel-view .panel-live.is-expanded .live-table,
  #panel-view .panel-health.is-expanded .health-list { max-height: 48vh; }
}

@media (prefers-reduced-motion: reduce) {
  #panel-view .panel-expand-button,
  #panel-view .panel-expand-button span { transition: none !important; }
}

/* The supplied visual shell is scoped to the operational view; login and admin access stay unchanged. */
body.panel-active > .shell > .topbar { display: none; }
#panel-view {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  --ui-text-scale: 1.08;
  --ui-text-weight: 650;
  --ui-copy-weight: 580;
  --ui-label-weight: 700;
}
#panel-view .operations-topbar .topbar-actions { flex-wrap: nowrap; }
#panel-view .operations-topbar .settings-toggle { flex: none; color: var(--muted); }
#panel-view .operations-topbar .role-pill { white-space: nowrap; }
#panel-view .operations-topbar .button { min-height: 34px; padding: 0 11px; font-size: 11px; }
#panel-view .operations-topbar .status-pill { border-radius: 999px; }
#panel-view .connection-pill .status-dot { margin: 0; background: var(--amber); }
#panel-view .connection-pill.status-up .status-dot { background: var(--green); }
#panel-view .connection-pill.status-down .status-dot { background: var(--red); }
#panel-view .stream-state .status-dot { margin: 0; background: var(--amber); }
#panel-view .stream-state.feed-live .status-dot { background: var(--green); }
#panel-view .stream-state.feed-down .status-dot { background: var(--red); }
#panel-view .stream-description { margin: 0; padding: 8px 16px; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 10px; }
#panel-view .filter-select { flex: none; min-width: 120px; }
#panel-view .filter-select select {
  width: 100%; height: 34px; padding: 0 28px 0 10px;
  border: 1px solid var(--line); border-radius: 7px;
  color: var(--text); background: var(--panel-2);
  font: inherit; font-size: 11px; cursor: pointer;
}
#panel-view .live-table-shell, #panel-view .replay-table-shell { min-width: 0; overflow-x: auto; }
#panel-view .preview-replay-notice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  max-width: 620px;
  margin-top: 20px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  color: var(--text);
}
#panel-view .preview-replay-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--red-bright);
  background: var(--panel-2);
}
#panel-view .preview-replay-notice h3 { margin: 0; font-size: 17px; }
#panel-view .preview-replay-notice p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* The light preset needs explicit contrast for older hard-coded shell colors. */
#panel-view.theme-light .topbar,
#panel-view.theme-light .category-nav { background: var(--panel); border-color: var(--line); }
#panel-view.theme-light .topbar h1,
#panel-view.theme-light .brand-copy strong,
#panel-view.theme-light .section-heading h2,
#panel-view.theme-light .panel-header h2,
#panel-view.theme-light .settings-panel h2,
#panel-view.theme-light .settings-panel h3,
#panel-view.theme-light .settings-panel strong,
#panel-view.theme-light .settings-panel .setting-label-row,
#panel-view.theme-light .settings-panel .notification-event-copy strong { color: var(--text); }
#panel-view.theme-light .settings-panel .palette-option,
#panel-view.theme-light .settings-panel .setting-reset,
#panel-view.theme-light .settings-panel .settings-close,
#panel-view.theme-light .settings-panel .sound-select,
#panel-view.theme-light .settings-panel .settings-secondary-button { color: var(--text); background: var(--panel-2); border-color: var(--line); }
#panel-view.theme-light .settings-panel .palette-option.is-selected { background: color-mix(in srgb, var(--red) 9%, var(--panel-2)); }
#panel-view .live-table { max-height: 270px; overflow-y: auto; }
#panel-view .panel-live.is-expanded .live-table { max-height: min(54vh, 610px); }
#panel-view .live-row { min-width: 680px; }
#panel-view .flag-row.live-row {
  background: var(--panel-2);
  color: var(--text);
  border-bottom-color: var(--line-soft);
}
#panel-view .flag-row.live-row:hover { background: var(--panel-3); }
#panel-view .live-row > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#panel-view .live-row .player-cell { color: var(--text); }
#panel-view .live-row .player-cell::before {
  content: ""; width: 6px; height: 6px; margin-right: 7px;
  display: inline-block; flex: none; border: 1px solid var(--red-bright); transform: rotate(45deg);
}
#panel-view .role-preview .live-row { min-width: 590px; }
#panel-view .role-preview .live-row { grid-template-columns: 1.1fr .78fr 1fr 74px 68px 78px; }
#panel-view .live-row { grid-template-columns: 1.05fr .72fr 1fr 74px 68px 78px 112px; }
#panel-view .live-row.priority-high::before { display: none; }
#panel-view .flag-row-new { animation: viewEnter .22s ease-out; }
#panel-view .health-list { max-height: 260px; overflow-y: auto; }
#panel-view .panel-health.is-expanded .health-list { max-height: min(54vh, 610px); }
#panel-view .health-row { grid-template-columns: minmax(0, 1fr) auto; }
#panel-view .health-main { min-width: 0; }
#panel-view .health-main > div { min-width: 0; }
#panel-view .health-main strong, #panel-view .health-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#panel-view .health-metrics { display: flex; gap: 6px; }
#panel-view .health-stat { min-width: 70px; }
#panel-view .health-row .status-dot.disabled { background: #6d727a; }
#panel-view .panel-header-actions { display: flex; align-items: center; gap: 7px; }
#panel-view .incident-overview { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 12px; color: var(--muted); font-size: 11px; }
#panel-view .incident-overview strong { color: var(--text); font-size: 12px; }
#panel-view .incident-list-wrap { min-width: 0; }
#panel-view .incident-list { max-height: calc(100vh - 245px); overflow-y: auto; }
#panel-view .incident-detail { min-height: 450px; }
#panel-view .incident-detail-content { padding: 0; }
#panel-view .incident-detail-empty { min-height: 440px; }
#panel-view .incident-detail-header p { overflow-wrap: anywhere; }
#panel-view .incident-stats div { min-width: 0; }
#panel-view .incident-stats strong { overflow-wrap: anywhere; }
#panel-view .distribution-row { grid-template-columns: minmax(70px, 1fr) 1.3fr 25px; }
#panel-view .distribution-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#panel-view .timeline { max-height: 280px; overflow-y: auto; }
#panel-view .timeline > div { grid-template-columns: 8px 64px minmax(0, 1fr) auto; }
#panel-view .timeline > div > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#panel-view .history-record { width: 100%; padding: 0 4px; background: none; border-right: 0; border-bottom: 0; border-left: 0; text-align: left; cursor: pointer; }
#panel-view .history-record:hover { color: var(--text); background: var(--panel-2); }
#panel-view .history-record span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#panel-view .compact-record .compact-download { min-height: 26px; padding: 3px 6px; border: 0; background: none; color: var(--red-bright); font-size: 10px; }
#panel-view .review-controls .decision-button { font-size: 10px; }
#panel-view .review-controls .decision-button.is-active { color: var(--red-bright); border-color: var(--red-dark); }
#panel-view .review-controls .note-editor textarea { font-size: 11px; }
#panel-view .review-badge { white-space: nowrap; }
#panel-view .replay-filters { grid-template-columns: minmax(0, 1fr) auto; }
#panel-view .replay-table-shell .data-row { min-width: 760px; grid-template-columns: 125px 1fr .8fr 1.5fr 70px 75px 86px; }
#panel-view .replay-library { display: block; border: 0; }
#panel-view .replay-data-row > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#panel-view .replay-checks { display: flex; gap: 4px; min-width: 0; overflow: hidden; }
#panel-view .replay-checks .tag { flex: none; }
#panel-view .replay-data-row .replay-download { justify-self: end; min-height: 27px; padding: 3px 7px; font-size: 10px; }
#panel-view .connection-footer { margin: 22px 26px; }
#panel-view .connection-footer .connection-meta { flex-wrap: wrap; }
#panel-view .empty-state { padding: 22px 15px; }

@media (max-width: 980px) {
  #panel-view .operations-heading h1 { font-size: 18px; }
  #panel-view .operations-topbar .top-brand { min-width: 0; }
  #panel-view .operations-topbar .topbar-separator { display: none; }
}
@media (max-width: 760px) {
  #panel-view .operations-topbar { gap: 8px; padding: 0 14px; }
  #panel-view .topbar-left > div.operations-heading:last-child { display: block; min-width: 0; }
  #panel-view .operations-heading .eyebrow { display: none; }
  #panel-view .operations-heading h1 { font-size: 15px; }
  #panel-view .operations-topbar .brand-copy { display: none; }
  #panel-view .operations-topbar .brand-emblem { width: 30px; height: 30px; }
  #panel-view .operations-topbar .role-pill { display: none; }
  #panel-view .operations-topbar .button { padding: 0 7px; font-size: 10px; }
  #panel-view .health-row { grid-template-columns: minmax(0, 1fr) auto; }
  #panel-view .health-stat { min-width: 60px; }
  #panel-view .incident-list { max-height: 230px; }
  #panel-view .incident-detail { min-height: 300px; }
  #panel-view .incident-detail-empty { min-height: 300px; }
  #panel-view .incident-content-grid, #panel-view .incident-lower-grid { grid-template-columns: 1fr; }
  #panel-view .connection-footer { margin: 20px 14px; }
}
@media (max-width: 520px) {
  #panel-view .metric-strip, #panel-view .role-preview .metric-strip, #panel-view .role-customer .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #panel-view .role-preview .metric-card:nth-child(5), #panel-view .role-customer .metric-card:nth-child(5) { grid-column: span 2; }
  #panel-view .role-preview .metric-card:last-child, #panel-view .role-customer .metric-card:last-child { grid-column: span 2; }
  #panel-view .metric-card:nth-child(odd) { border-right: 1px solid var(--line-soft); }
  #panel-view .metric-card:nth-child(even) { border-right: 0; }
  #panel-view .metric-card:last-child { border-right: 0; }
  #panel-view .panel-header-actions { flex-wrap: wrap; justify-content: end; }
  #panel-view .health-metrics .health-stat:last-child { display: none; }
}
