    :root {
      color-scheme: dark;
      --bg-dark: #000000;
      --bg-panel: rgba(12, 14, 16, 0.18);
      --bg-panel-strong: rgba(12, 14, 16, 0.62);
      --surface: rgba(12, 14, 16, 0.18);
      --surface-2: rgba(18, 22, 27, 0.32);
      --surface-3: rgba(34, 40, 49, 0.4);
      --line: rgba(109, 172, 200, 0.2);
      --line-soft: rgba(164, 207, 217, 0.12);
      --text: #f8fafc;
      --muted: #94a3b8;
      --subtle: rgba(148, 163, 184, 0.72);
      --brand-blue: #6dacc8;
      --brand-blue-soft: #a4cfd9;
      --brand-orange: #fb9126;
      --brand-warm: #e5deb3;
      --green: #64d98a;
      --cyan: var(--brand-blue-soft);
      --amber: var(--brand-orange);
      --red: #f07070;
      --violet: #a88beb;
      --blue: var(--brand-blue);
      --shadow: rgba(0, 0, 0, 0.64);
      --glass-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
      --focus-ring: 0 0 0 3px rgba(109, 172, 200, 0.22);
      --forge-sidebar-width: 280px;
      --forge-resizer-width: 10px;
      --forge-overview-top-left: 62%;
      --forge-overview-bottom-left: 62%;
      --forge-ticket-left: 58%;
      --forge-code-left: 45%;
      --forge-data-mirror-left: 42%;
      --forge-diagnosis-top: 34%;
    }

    * {
      box-sizing: border-box;
      letter-spacing: 0;
    }

    html,
    body {
      margin: 0;
      height: 100%;
      min-height: 100vh;
      background: var(--bg-dark);
      color: var(--text);
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      font-size: 14px;
    }

    body {
      width: 100vw;
      overflow: hidden;
    }

    button,
    input,
    select,
    textarea {
      font: inherit;
    }

    button {
      min-height: 34px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: linear-gradient(180deg, rgba(18, 22, 27, 0.88), rgba(11, 14, 17, 0.86));
      color: var(--text);
      cursor: pointer;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    }

    button:hover,
    button:focus-visible {
      border-color: rgba(251, 145, 38, 0.52);
      box-shadow: 0 0 0 1px rgba(251, 145, 38, 0.12), 0 10px 28px rgba(0, 0, 0, 0.34);
      outline: none;
    }

    button.primary {
      background: linear-gradient(135deg, var(--brand-blue-soft), var(--brand-blue));
      color: #061014;
      border-color: rgba(164, 207, 217, 0.78);
      font-weight: 700;
    }

    button.ghost {
      background: transparent;
    }

    input,
    select,
    textarea {
      width: 100%;
      min-height: 34px;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: rgba(0, 0, 0, 0.34);
      color: var(--text);
      padding: 8px 10px;
    }

    input:focus,
    select:focus,
    textarea:focus {
      border-color: rgba(109, 172, 200, 0.58);
      box-shadow: var(--focus-ring);
      outline: none;
    }

    input[type="checkbox"] {
      width: 18px;
      height: 18px;
      min-height: 18px;
      flex: 0 0 18px;
      padding: 0;
      accent-color: var(--cyan);
    }

    textarea {
      min-height: 92px;
      resize: vertical;
    }

    #app {
      position: fixed;
      inset: 0;
      z-index: 0;
      pointer-events: none;
      overflow: hidden;
      background-image:
        radial-gradient(at 0% 45%, rgba(251, 145, 38, 0.08) 0, transparent 48%),
        radial-gradient(at 100% 55%, rgba(109, 172, 200, 0.08) 0, transparent 48%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.03) 0, transparent 55%);
    }

    .layout {
      position: relative;
      z-index: 1;
      height: 100vh;
      width: 100vw;
      min-height: 0;
      display: flex;
      gap: 0;
      overflow: hidden;
      background: rgba(0, 0, 0, 0.06);
    }

    .sidebar {
      flex: 0 0 var(--forge-sidebar-width);
      width: var(--forge-sidebar-width);
      min-width: 220px;
      max-width: 440px;
      border-right: 1px solid var(--line);
      background: linear-gradient(180deg, rgba(12, 14, 16, 0.28), rgba(8, 10, 12, 0.18));
      padding: 18px 14px;
      position: relative;
      height: 100vh;
      overflow-y: auto;
      backdrop-filter: blur(2px);
      box-shadow: 12px 0 28px rgba(0, 0, 0, 0.12);
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 4px 6px 18px;
      border-bottom: 1px solid var(--line-soft);
      margin-bottom: 14px;
      min-width: 0;
    }

    .brand-logo {
      width: 38px;
      height: 38px;
      object-fit: contain;
      flex: 0 0 38px;
      filter: drop-shadow(0 0 16px rgba(109, 172, 200, 0.26));
    }

    .brand-copy {
      display: grid;
      gap: 4px;
      min-width: 0;
    }

    .brand-title {
      font-size: 1.15rem;
      font-weight: 800;
    }

    .brand-subtitle {
      color: var(--muted);
      font-size: 0.82rem;
    }

    .nav {
      display: grid;
      gap: 6px;
    }

    .nav button {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      text-align: left;
      background: transparent;
      border-color: transparent;
      color: var(--muted);
      padding: 8px 10px;
      box-shadow: none;
    }

    .nav button[aria-selected="true"] {
      background: linear-gradient(135deg, rgba(109, 172, 200, 0.14), rgba(251, 145, 38, 0.06));
      border-color: var(--line);
      color: var(--text);
    }

    .nav-count {
      min-width: 24px;
      text-align: center;
      color: var(--text);
      background: rgba(34, 40, 49, 0.34);
      border-radius: 8px;
      padding: 2px 6px;
      font-size: 0.78rem;
    }

    .side-panel {
      margin-top: 16px;
      border: 1px solid var(--line-soft);
      border-radius: 8px;
      padding: 12px;
      background: rgba(12, 14, 16, 0.12);
      box-shadow: 0 8px 22px rgba(0, 0, 0, 0.1);
    }

    .side-title {
      font-size: 0.78rem;
      color: var(--subtle);
      text-transform: uppercase;
      margin-bottom: 10px;
    }

    .side-list {
      display: grid;
      gap: 8px;
    }

    .side-row {
      display: grid;
      grid-template-columns: 10px minmax(0, 1fr);
      gap: 8px;
      align-items: center;
      color: var(--muted);
      min-width: 0;
    }

    .dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--subtle);
    }

    .dot.ok {
      background: var(--green);
    }

    .dot.warn {
      background: var(--amber);
    }

    .dot.fail {
      background: var(--red);
    }

    .main {
      flex: 1 1 auto;
      min-width: 0;
      min-height: 0;
      height: 100vh;
      display: grid;
      grid-template-rows: auto minmax(0, 1fr);
    }

    .layout-resizer {
      position: relative;
      flex: 0 0 var(--forge-resizer-width);
      width: var(--forge-resizer-width);
      min-width: var(--forge-resizer-width);
      align-self: stretch;
      cursor: col-resize;
      z-index: 30;
      touch-action: none;
      outline: none;
      border-radius: 999px;
    }

    .layout-resizer::before {
      content: "";
      position: absolute;
      left: 50%;
      top: 24px;
      bottom: 24px;
      width: 3px;
      transform: translateX(-50%);
      border-radius: 999px;
      background: linear-gradient(
        180deg,
        rgba(109, 172, 200, 0.12),
        rgba(164, 207, 217, 0.58),
        rgba(251, 145, 38, 0.5),
        rgba(164, 207, 217, 0.58),
        rgba(109, 172, 200, 0.12)
      );
      box-shadow: 0 0 0 1px rgba(109, 172, 200, 0.18), 0 0 16px rgba(109, 172, 200, 0.14);
      opacity: 0.96;
      transition: background 140ms ease, box-shadow 140ms ease, opacity 140ms ease, width 140ms ease;
    }

    .layout-resizer::after {
      content: "";
      position: absolute;
      inset: 24px 2px;
      border-radius: 999px;
      background: rgba(109, 172, 200, 0.035);
      opacity: 0.7;
      transition: opacity 140ms ease, background 140ms ease;
    }

    .layout-resizer:hover::before,
    .layout-resizer:focus-visible::before,
    .layout-resizer.is-active::before {
      background: linear-gradient(
        180deg,
        rgba(109, 172, 200, 0.12),
        rgba(109, 172, 200, 0.5),
        rgba(251, 145, 38, 0.42),
        rgba(109, 172, 200, 0.5),
        rgba(109, 172, 200, 0.12)
      );
      box-shadow: 0 0 0 1px rgba(109, 172, 200, 0.22), 0 0 18px rgba(109, 172, 200, 0.2);
      width: 4px;
      opacity: 1;
    }

    .layout-resizer:hover::after,
    .layout-resizer:focus-visible::after,
    .layout-resizer.is-active::after {
      background: rgba(109, 172, 200, 0.08);
      opacity: 1;
    }

    body.resizing-layout {
      user-select: none;
    }

    body.resizing-layout-x,
    body.resizing-layout-x * {
      cursor: col-resize !important;
      user-select: none !important;
    }

    body.resizing-layout-y,
    body.resizing-layout-y * {
      cursor: row-resize !important;
      user-select: none !important;
    }

    .topbar {
      min-height: 72px;
      border-bottom: 1px solid var(--line);
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 16px;
      align-items: center;
      padding: 14px clamp(16px, 3vw, 28px);
      background: rgba(0, 0, 0, 0.18);
      position: sticky;
      top: 0;
      z-index: 20;
      backdrop-filter: blur(4px);
    }

    .page-title {
      display: grid;
      gap: 3px;
      min-width: 0;
    }

    .page-title h1 {
      margin: 0;
      font-size: 1.22rem;
      line-height: 1.2;
    }

    .page-title span {
      color: var(--muted);
      font-size: 0.84rem;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .top-actions {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .target-profile-control {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
      color: var(--muted);
      font-size: 0.78rem;
    }

    .target-profile-control select {
      width: auto;
      min-width: 150px;
      max-width: 220px;
      min-height: 30px;
      padding: 5px 9px;
    }

    .badge {
      display: inline-flex;
      align-items: center;
      min-height: 24px;
      padding: 3px 8px;
      border-radius: 8px;
      border: 1px solid var(--line);
      background: rgba(12, 14, 16, 0.18);
      color: var(--muted);
      font-size: 0.78rem;
      white-space: nowrap;
    }

    .badge.ok {
      color: #dfffe8;
      border-color: rgba(100, 217, 138, 0.42);
      background: rgba(100, 217, 138, 0.12);
    }

    .badge.warn {
      color: #ffe8ad;
      border-color: rgba(230, 184, 92, 0.42);
      background: rgba(230, 184, 92, 0.12);
    }

    .badge.fail {
      color: #ffd0d0;
      border-color: rgba(240, 112, 112, 0.45);
      background: rgba(240, 112, 112, 0.12);
    }

    .badge.info {
      color: #dcf7ff;
      border-color: rgba(88, 199, 216, 0.42);
      background: rgba(88, 199, 216, 0.12);
    }

    .content {
      padding: 18px clamp(16px, 3vw, 28px) 28px;
      display: grid;
      gap: 16px;
      min-width: 0;
      min-height: 0;
      overflow: auto;
      scrollbar-gutter: stable;
    }

    .metrics {
      display: grid;
      grid-template-columns: repeat(5, minmax(140px, 1fr));
      gap: 12px;
    }

    .metric {
      border: 1px solid var(--line);
      background: linear-gradient(180deg, rgba(12, 14, 16, 0.16), rgba(8, 10, 12, 0.08));
      border-radius: 8px;
      min-height: 96px;
      padding: 14px;
      display: grid;
      align-content: space-between;
      box-shadow: var(--glass-shadow);
      backdrop-filter: none;
    }

    .metric-label {
      color: var(--muted);
      font-size: 0.78rem;
      text-transform: uppercase;
    }

    .metric-value {
      font-size: 2rem;
      line-height: 1;
      font-weight: 800;
    }

    .metric-note {
      color: var(--subtle);
      font-size: 0.78rem;
    }

    .view {
      display: none;
      gap: 16px;
      min-width: 0;
    }

    .view.active {
      display: grid;
    }

    .grid-2 {
      display: grid;
      grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
      gap: 16px;
      min-width: 0;
    }

    .split-row {
      display: flex;
      align-items: stretch;
      gap: 0;
      min-width: 0;
      min-height: 0;
    }

    .split-column {
      display: flex;
      flex-direction: column;
      gap: 0;
      min-width: 0;
      min-height: 0;
      height: 100%;
    }

    .split-pane {
      min-width: 0;
      min-height: 0;
      flex: 1 1 auto;
    }

    .split-pane[data-split-pane="primary"] {
      flex: 0 0 var(--forge-overview-top-left);
    }

    .split-row[data-split="overview-bottom"] > .split-pane[data-split-pane="primary"] {
      flex-basis: var(--forge-overview-bottom-left);
    }

    .split-row[data-split="tickets"] > .split-pane[data-split-pane="primary"] {
      flex-basis: var(--forge-ticket-left);
    }

    .split-row[data-split="code-agent"] > .split-pane[data-split-pane="primary"] {
      flex-basis: var(--forge-code-left);
    }

    .split-row[data-split="data-mirror"] > .split-pane[data-split-pane="primary"] {
      flex-basis: var(--forge-data-mirror-left);
    }

    .split-column[data-split="diagnosis"] > .split-pane[data-split-pane="primary"] {
      flex-basis: var(--forge-diagnosis-top);
    }

    .pane-resizer {
      margin: 0 3px;
    }

    .horizontal-resizer {
      flex: 0 0 14px;
      width: 100%;
      min-width: 0;
      height: 14px;
      min-height: 14px;
      align-self: stretch;
      cursor: row-resize;
      border-radius: 0;
    }

    .horizontal-resizer::before {
      left: 12px;
      right: 12px;
      top: 50%;
      bottom: auto;
      width: auto;
      height: 1px;
      transform: translateY(-50%);
      background: rgba(156, 163, 175, 0.48);
      box-shadow: none;
      opacity: 0.78;
      transition: background 140ms ease, opacity 140ms ease, height 140ms ease;
    }

    .horizontal-resizer::after {
      inset: 3px 12px;
      background: transparent;
      opacity: 0;
    }

    .horizontal-resizer:hover::before,
    .horizontal-resizer:focus-visible::before,
    .horizontal-resizer.is-active::before {
      height: 2px;
      width: auto;
      background: rgba(190, 198, 210, 0.64);
      box-shadow: none;
      opacity: 1;
    }

    .horizontal-resizer:hover::after,
    .horizontal-resizer:focus-visible::after,
    .horizontal-resizer.is-active::after {
      background: rgba(156, 163, 175, 0.05);
      opacity: 1;
    }

    #view-diagnosis.active {
      height: 100%;
      min-height: 0;
    }

    .grid-3 {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 16px;
      min-width: 0;
    }

    .panel {
      min-width: 0;
      border: 1px solid var(--line);
      background: linear-gradient(180deg, rgba(12, 14, 16, 0.16), rgba(8, 10, 12, 0.08));
      border-radius: 8px;
      overflow: hidden;
      box-shadow: var(--glass-shadow);
      backdrop-filter: none;
    }

    .panel-head {
      min-height: 52px;
      padding: 12px 14px;
      border-bottom: 1px solid var(--line-soft);
      background: rgba(0, 0, 0, 0.08);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }

    .panel-title {
      margin: 0;
      font-size: 0.96rem;
      font-weight: 800;
    }

    .panel-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: nowrap;
      white-space: nowrap;
    }

    .panel-actions select {
      width: auto;
      min-width: 128px;
      flex: 0 0 auto;
    }

    .panel-actions .badge,
    .panel-actions button {
      flex: 0 0 auto;
    }

    .panel-body {
      padding: 12px 14px 14px;
      min-width: 0;
    }

    .toolbar {
      display: grid;
      grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
      gap: 8px;
      margin-bottom: 12px;
      align-items: end;
    }

    .mirror-command {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 14px;
      align-items: center;
      padding: 2px 0 14px 12px;
      border-left: 3px solid rgba(109, 172, 200, 0.58);
      border-bottom: 1px solid var(--line-soft);
    }

    .mirror-command-copy {
      display: grid;
      gap: 4px;
      min-width: 0;
    }

    .mirror-kicker {
      color: var(--muted);
      font-size: 0.72rem;
      font-weight: 800;
      text-transform: uppercase;
    }

    .mirror-command h3,
    .mirror-section-head h3 {
      margin: 0;
      font-size: 0.95rem;
      font-weight: 800;
    }

    .mirror-command p {
      margin: 0;
      color: var(--muted);
      line-height: 1.42;
    }

    .mirror-command button:disabled {
      cursor: not-allowed;
      opacity: 0.55;
    }

    .mirror-actions {
      display: grid;
      grid-template-columns: repeat(3, minmax(110px, 1fr));
      gap: 8px;
    }

    .mirror-section {
      display: grid;
      gap: 8px;
      padding-top: 4px;
    }

    .mirror-section-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
    }

    .mirror-facts,
    .mirror-summary {
      display: grid;
      gap: 0;
      min-width: 0;
      border-top: 1px solid var(--line-soft);
      border-bottom: 1px solid var(--line-soft);
    }

    .mirror-fact-row {
      display: grid;
      grid-template-columns: minmax(120px, 0.65fr) minmax(0, 1fr) auto;
      gap: 10px;
      align-items: center;
      min-width: 0;
      padding: 9px 0;
      border-bottom: 1px solid var(--line-soft);
    }

    .mirror-fact-row:last-child {
      border-bottom: 0;
    }

    .mirror-fact-label {
      color: var(--muted);
      font-size: 0.74rem;
      font-weight: 800;
      text-transform: uppercase;
    }

    .mirror-fact-value,
    .mirror-fact-note {
      min-width: 0;
      overflow-wrap: anywhere;
    }

    .mirror-fact-value {
      color: var(--text);
      font-weight: 700;
    }

    .mirror-fact-note {
      color: var(--muted);
      font-size: 0.8rem;
      text-align: right;
    }

    .mirror-empty {
      padding: 12px 0;
      color: var(--muted);
    }

    .mirror-raw {
      border-top: 1px solid var(--line-soft);
      padding-top: 8px;
    }

    .mirror-raw summary {
      color: var(--muted);
      cursor: pointer;
      font-size: 0.78rem;
      font-weight: 800;
      text-transform: uppercase;
    }

    .mirror-raw .json-box {
      margin-top: 8px;
      max-height: 340px;
    }

    .field {
      display: grid;
      gap: 5px;
    }

    .field.wide {
      grid-column: span 2;
    }

    .approval-toolbar {
      grid-template-columns: minmax(130px, 0.8fr) minmax(130px, 0.8fr) minmax(240px, 1.5fr) minmax(130px, 0.8fr) auto;
      align-items: end;
    }

    .approval-toolbar textarea {
      min-height: 38px;
      max-height: 96px;
      resize: vertical;
    }

    .field label {
      color: var(--muted);
      font-size: 0.76rem;
      text-transform: uppercase;
    }

    .table-wrap {
      overflow: auto;
      max-height: 470px;
      border: 1px solid var(--line-soft);
      border-radius: 8px;
      background: rgba(0, 0, 0, 0.06);
    }

    table {
      width: 100%;
      min-width: 720px;
      border-collapse: collapse;
      font-size: 0.86rem;
    }

    th,
    td {
      padding: 9px 10px;
      border-bottom: 1px solid var(--line-soft);
      vertical-align: top;
      text-align: left;
    }

    th {
      color: var(--muted);
      font-weight: 700;
      background: rgba(8, 10, 12, 0.34);
      position: sticky;
      top: 0;
      z-index: 1;
    }

    td {
      color: #dce2e8;
    }

    tr:last-child td {
      border-bottom: 0;
    }

    .selectable-row {
      cursor: pointer;
    }

    .selectable-row:hover td {
      background: rgba(109, 172, 200, 0.08);
    }

    .clickable-record {
      cursor: pointer;
      border-radius: 8px;
      transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
    }

    .clickable-record:hover,
    .clickable-record:focus-visible {
      background: rgba(109, 172, 200, 0.08);
      box-shadow: inset 0 0 0 1px rgba(109, 172, 200, 0.18);
      outline: none;
    }

    .record-time {
      color: var(--subtle);
      font-size: 0.74rem;
      line-height: 1.35;
    }

    .record-time[title] {
      cursor: help;
    }

    .record-copy {
      display: grid;
      gap: 3px;
      min-width: 0;
    }

    .mono {
      font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
      font-size: 0.82rem;
    }

    .muted {
      color: var(--muted);
    }

    .empty {
      min-height: 120px;
      display: grid;
      place-items: center;
      color: var(--muted);
      border: 1px dashed var(--line);
      border-radius: 8px;
    }

    .rail {
      display: grid;
      gap: 10px;
    }

    .rail-row {
      display: grid;
      grid-template-columns: 18px minmax(0, 1fr);
      gap: 10px;
      min-width: 0;
    }

    .rail-node {
      width: 12px;
      height: 12px;
      border-radius: 50%;
      margin-top: 3px;
      background: var(--cyan);
      box-shadow: 0 0 0 4px rgba(88, 199, 216, 0.12);
    }

    .rail-copy {
      display: grid;
      gap: 3px;
      min-width: 0;
    }

    .rail-copy strong,
    .row-title {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .split-detail {
      display: flex;
      align-items: stretch;
      gap: 0;
      min-width: 0;
      min-height: 0;
    }

    .json-box {
      min-height: 160px;
      max-height: 460px;
      overflow: auto;
      background: rgba(0, 0, 0, 0.1);
      border: 1px solid var(--line-soft);
      border-radius: 8px;
      padding: 12px;
      color: #d8e1ea;
      white-space: pre-wrap;
      word-break: break-word;
    }

    .stack {
      display: grid;
      gap: 10px;
    }

    .row {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
      min-width: 0;
    }

    .auth-cover {
      position: fixed;
      inset: 0;
      display: none;
      place-items: center;
      background: rgba(0, 0, 0, 0.72);
      z-index: 50;
      padding: 20px;
      backdrop-filter: blur(12px);
    }

    .auth-cover.active {
      display: grid;
    }

    .auth-box {
      width: min(680px, 100%);
      border: 1px solid var(--line);
      background: var(--bg-panel-strong);
      border-radius: 8px;
      box-shadow: 0 20px 64px rgba(0, 0, 0, 0.48);
      overflow: hidden;
    }

    .auth-head {
      padding: 16px;
      border-bottom: 1px solid var(--line-soft);
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: center;
    }

    .auth-head .brand {
      padding: 0;
      margin: 0;
      border-bottom: 0;
    }

    .auth-frame {
      width: 100%;
      height: 390px;
      border: 0;
      background: #0f1114;
      display: block;
    }

    .sidebar,
    .content,
    .table-wrap,
    .json-box,
    .operator-chat-thread,
    .auth-box {
      scrollbar-width: thin;
      scrollbar-color: rgba(109, 172, 200, 0.24) transparent;
    }

    ::-webkit-scrollbar {
      width: 10px;
      height: 10px;
    }

    ::-webkit-scrollbar-track {
      background: transparent;
    }

    ::-webkit-scrollbar-thumb {
      background: rgba(109, 172, 200, 0.2);
      border: 2px solid transparent;
      border-radius: 999px;
      background-clip: padding-box;
    }

    ::-webkit-scrollbar-thumb:hover {
      background: rgba(251, 145, 38, 0.34);
      background-clip: padding-box;
    }

    .auth-status {
      padding: 12px 16px;
      color: var(--muted);
      border-top: 1px solid var(--line-soft);
      min-height: 44px;
    }

    .record-modal {
      position: fixed;
      inset: 0;
      z-index: 70;
      display: grid;
      place-items: center;
      padding: 24px;
    }

    .record-modal-backdrop {
      position: absolute;
      inset: 0;
      width: 100%;
      min-height: 100%;
      border: 0;
      border-radius: 0;
      background: rgba(0, 0, 0, 0.64);
      box-shadow: none;
      cursor: default;
    }

    .record-modal-panel {
      position: relative;
      z-index: 1;
      width: min(980px, 100%);
      max-height: min(820px, calc(100vh - 48px));
      border: 1px solid rgba(109, 172, 200, 0.32);
      border-radius: 8px;
      background: rgba(5, 8, 10, 0.88);
      box-shadow: 0 26px 78px rgba(0, 0, 0, 0.72);
      display: grid;
      grid-template-rows: auto minmax(0, 1fr);
      overflow: hidden;
      backdrop-filter: blur(14px);
    }

    .record-modal-head {
      min-height: 72px;
      border-bottom: 1px solid var(--line-soft);
      padding: 16px;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 14px;
      align-items: start;
    }

    .record-modal-title-block {
      display: grid;
      gap: 6px;
      min-width: 0;
    }

    .record-modal-title-row {
      display: flex;
      align-items: center;
      gap: 8px;
      min-width: 0;
      flex-wrap: wrap;
    }

    .record-modal-title-row h2 {
      margin: 0;
      font-size: 1.1rem;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .record-modal-subtitle {
      color: var(--muted);
      font-size: 0.86rem;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: normal;
      line-height: 1.35;
    }

    .record-modal-close {
      min-width: 38px;
      width: 38px;
      padding: 0;
      display: grid;
      place-items: center;
      font-size: 1.2rem;
    }

    .record-modal-body {
      min-height: 0;
      overflow: auto;
      display: grid;
      gap: 14px;
      padding: 16px;
    }

    .record-detail-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(120px, 1fr));
      gap: 10px;
    }

    .record-detail-cell {
      min-width: 0;
      border: 1px solid var(--line-soft);
      border-radius: 8px;
      padding: 10px;
      background: rgba(0, 0, 0, 0.18);
      display: grid;
      gap: 4px;
    }

    .record-detail-cell.wide {
      grid-column: 1 / -1;
    }

    .record-detail-cell.missing .record-detail-value {
      color: var(--muted);
      font-style: italic;
    }

    .record-detail-label {
      color: var(--subtle);
      font-size: 0.72rem;
      text-transform: uppercase;
    }

    .record-detail-value {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .record-detail-value.wrap {
      overflow: visible;
      text-overflow: clip;
      white-space: normal;
      line-height: 1.42;
    }

    .record-detail-value.pre-line {
      white-space: pre-line;
    }

    .operator-chat-panel {
      border: 1px solid var(--line-soft);
      border-radius: 8px;
      background: rgba(0, 0, 0, 0.12);
      display: grid;
      gap: 10px;
      padding: 12px;
      min-width: 0;
    }

    .operator-chat-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      min-width: 0;
    }

    .operator-chat-head h3 {
      margin: 0;
      font-size: 0.95rem;
    }

    .operator-chat-thread {
      min-height: 76px;
      max-height: 220px;
      overflow: auto;
      display: grid;
      align-content: start;
      gap: 8px;
      color: var(--muted);
      border: 1px dashed rgba(109, 172, 200, 0.18);
      border-radius: 8px;
      padding: 10px;
      background: rgba(0, 0, 0, 0.08);
    }

    .operator-chat-message {
      display: grid;
      gap: 4px;
      color: #d8e1ea;
    }

    .operator-chat-message strong {
      color: #f7f8fa;
      font-size: 0.8rem;
    }

    .operator-chat-compose {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      align-items: stretch;
      min-width: 0;
    }

    .operator-chat-compose textarea {
      min-height: 72px;
      resize: vertical;
    }

    .record-modal-json {
      min-height: min(520px, 50vh);
      max-height: min(760px, 72vh);
    }

    .hidden {
      display: none !important;
    }

    @media (max-width: 1180px) {
      .metrics {
        grid-template-columns: repeat(3, minmax(140px, 1fr));
      }

      .grid-3 {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 900px) {
      body {
        width: auto;
        overflow: auto;
      }

      .layout {
        display: block;
        width: auto;
        height: auto;
        min-height: 100vh;
        overflow: visible;
      }

      .layout-resizer {
        display: none;
      }

      .sidebar {
        position: static;
        height: auto;
        width: auto;
        max-width: none;
        border-right: 0;
        border-bottom: 1px solid var(--line);
      }

      .main {
        display: block;
        height: auto;
      }

      .content {
        overflow: visible;
      }

      .split-row,
      .split-column,
      .split-detail {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
        height: auto;
      }

      .split-pane,
      .split-pane[data-split-pane="primary"] {
        flex: auto;
      }

      .topbar {
        grid-template-columns: 1fr;
      }

      .top-actions {
        justify-content: flex-start;
      }

      .metrics,
      .toolbar,
      .mirror-command,
      .mirror-actions,
      .record-detail-grid {
        grid-template-columns: 1fr;
      }

      .mirror-fact-row {
        grid-template-columns: 1fr;
        gap: 4px;
      }

      .mirror-fact-note {
        text-align: left;
      }

      .record-modal {
        padding: 12px;
      }

      .record-modal-panel {
        max-height: calc(100vh - 24px);
      }
    }
