:root {
  --canvas: #eef5ff;
  --canvas-2: #f7fbff;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-2: rgba(244, 249, 255, 0.9);
  --surface-dark: rgba(10, 30, 58, 0.78);
  --surface-dark-2: rgba(15, 42, 78, 0.88);
  --ink: #0f1f34;
  --muted: #5b6b83;
  --line: rgba(88, 127, 177, 0.18);
  --line-strong: rgba(88, 127, 177, 0.32);
  --primary: #1d7dff;
  --primary-strong: #0e5dd7;
  --primary-soft: rgba(29, 125, 255, 0.14);
  --cyan: #7fd9ff;
  --good: #18a970;
  --warn: #f1a33a;
  --danger: #e5484d;
  --shadow: 0 24px 70px rgba(17, 47, 91, 0.14);
  --scrollbar-size: 8px;
  --scrollbar-track: rgba(213, 227, 245, 0.72);
  --scrollbar-thumb-solid: rgba(86, 142, 214, 0.72);
  --scrollbar-thumb: linear-gradient(180deg, rgba(104, 167, 239, 0.82), rgba(52, 121, 215, 0.64));
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
  --primary-blue: #3b82f6;
  --primary-blue-hover: #2563eb;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --bg-selected: rgba(59, 130, 246, 0.08);
  --border-color: rgba(0, 0, 0, 0.06);
  --button-c-bg: rgba(219, 234, 254, 0.9);
  --button-c-bg-hover: rgba(191, 219, 254, 0.98);
  --button-c-border: rgba(191, 219, 254, 0.98);
  --button-c-text: #1d4ed8;
  --button-c-strong: #60a5fa;
  --button-c-strong-hover: #3b82f6;
  --sidebar-width: 276px;
  --header-height: 72px;
  --success: #16a34a;
  --warning: #d97706;
  --danger-strong: #dc2626;
  --neutral-strong: #64748b;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 25%, #1d4ed8 75%, #1e3a8a 100%);
  font-family: "Geist", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.overflow-x-hidden {
  overflow-x: hidden;
}

.w-full {
  width: 100%;
}

.max-w-full {
  max-width: 100%;
}

.sidebar,
.sidebar-nav-groups,
.nav-list,
.cockpit-list,
.table,
.device-ledger,
.ledger-modal,
.modal-body,
.task-rule-directory-scroll,
.task-definition-children,
.live-pane-scroll,
.nine-grid-device-pool,
.nine-grid-stage {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb-solid) var(--scrollbar-track);
  scrollbar-gutter: stable;
}

.sidebar::-webkit-scrollbar,
.sidebar-nav-groups::-webkit-scrollbar,
.nav-list::-webkit-scrollbar,
.cockpit-list::-webkit-scrollbar,
.table::-webkit-scrollbar,
.device-ledger::-webkit-scrollbar,
.ledger-modal::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.task-rule-directory-scroll::-webkit-scrollbar,
.task-definition-children::-webkit-scrollbar,
.live-pane-scroll::-webkit-scrollbar,
.nine-grid-device-pool::-webkit-scrollbar,
.nine-grid-stage::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

.sidebar::-webkit-scrollbar-thumb,
.sidebar-nav-groups::-webkit-scrollbar-thumb,
.nav-list::-webkit-scrollbar-thumb,
.cockpit-list::-webkit-scrollbar-thumb,
.table::-webkit-scrollbar-thumb,
.device-ledger::-webkit-scrollbar-thumb,
.ledger-modal::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
.task-rule-directory-scroll::-webkit-scrollbar-thumb,
.task-definition-children::-webkit-scrollbar-thumb,
.live-pane-scroll::-webkit-scrollbar-thumb,
.nine-grid-device-pool::-webkit-scrollbar-thumb,
.nine-grid-stage::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 2px solid transparent;
  background: var(--scrollbar-thumb);
  background-clip: padding-box;
}

.sidebar::-webkit-scrollbar-track,
.sidebar-nav-groups::-webkit-scrollbar-track,
.nav-list::-webkit-scrollbar-track,
.cockpit-list::-webkit-scrollbar-track,
.table::-webkit-scrollbar-track,
.device-ledger::-webkit-scrollbar-track,
.ledger-modal::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
.task-rule-directory-scroll::-webkit-scrollbar-track,
.task-definition-children::-webkit-scrollbar-track,
.live-pane-scroll::-webkit-scrollbar-track,
.nine-grid-device-pool::-webkit-scrollbar-track,
.nine-grid-stage::-webkit-scrollbar-track {
  border-radius: 999px;
  background: var(--scrollbar-track);
}

.app-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  padding: 0;
  transition: none;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: none;
}

.app-shell.cockpit-layout {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  background: transparent;
}

.app-container-formal {
  display: flex;
  width: 98%;
  max-width: 98%;
  height: 96%;
  max-height: 96%;
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  overflow: hidden;
}

.app-container-formal.is-collapsed .sidebar {
  width: 92px;
}

.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  min-height: 0;
  padding: 20px 16px;
  color: var(--text-primary);
  border-right: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.4);
  overflow: hidden;
}

.sidebar.collapsed {
  width: 92px;
  padding-inline: 12px;
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  min-width: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 0 8px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  flex-shrink: 0;
}

.logo-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.prototype-sidebar-toggle {
  margin-left: auto;
}

.brand {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: #0c2c52;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(147, 210, 255, 0.84));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 14px 28px rgba(41, 98, 177, 0.18);
}

.brand-copy {
  display: grid;
  gap: 4px;
}

.brand h1,
.topbar h2,
.panel-header h3,
.section-copy h3,
.action-copy h3,
.document-preview h4 {
  margin: 0;
}

.brand h1 {
  color: #0f2b4d;
  font-size: 20px;
  line-height: 1.08;
}

.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  color: #1b5fb4;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(222, 239, 255, 0.74));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 10px 24px rgba(39, 99, 177, 0.14);
  backdrop-filter: blur(18px);
}

.sidebar-toggle:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 14px 28px rgba(39, 99, 177, 0.2);
}

.brand p,
.tenant-card p,
.panel-header p,
.topbar-copy p,
.section-copy p,
.action-copy p {
  margin: 0;
  color: #5c7190;
  font-size: 13px;
  line-height: 1.55;
}

.sidebar-nav-groups {
  display: grid;
  align-content: start;
  flex: 1 1 auto;
  gap: 14px;
  overflow: auto;
  min-height: 0;
  padding: 4px 2px 4px 0;
}

.nav-section {
  display: grid;
  gap: 10px;
}

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

.nav-section-label {
  color: #6a7f9a;
  font-size: 12px;
  font-weight: 600;
}

.nav-section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  color: #5b7aa2;
  border: 1px solid rgba(164, 204, 241, 0.56);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.54);
  font-size: 11px;
  font-style: normal;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  color: #36577e;
  border: 1px solid rgba(164, 204, 241, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.34);
  backdrop-filter: blur(14px);
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.nav-item:hover,
.nav-item.active {
  color: #0f4f9f;
  border-color: rgba(90, 153, 232, 0.32);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(222, 239, 255, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84), 0 10px 22px rgba(45, 104, 184, 0.12);
  transform: translateY(-1px);
}

.nav-item svg {
  flex: 0 0 auto;
}

.tenant-card {
  margin-top: auto;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(228, 242, 255, 0.74));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82), 0 14px 30px rgba(45, 104, 184, 0.12);
  backdrop-filter: blur(18px);
}

.tenant-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #1158ac;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(204, 230, 255, 0.86));
  font-size: 16px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.tenant-copy {
  min-width: 0;
}

.tenant-card span {
  color: #6783a9;
  font-size: 12px;
}

.tenant-card strong {
  display: block;
  margin: 6px 0 4px;
  color: #0f2b4d;
  font-size: 16px;
  line-height: 1.3;
}

.tenant-logout {
  grid-column: 1 / -1;
  width: 100%;
}

.app-shell.sidebar-collapsed .sidebar-brand-row {
  flex-direction: column;
}

.app-shell.sidebar-collapsed .brand {
  grid-template-columns: 1fr;
  justify-items: center;
}

.app-shell.sidebar-collapsed .brand-copy,
.app-shell.sidebar-collapsed .nav-section-head,
.app-shell.sidebar-collapsed .tenant-copy,
.app-shell.sidebar-collapsed .tenant-logout span {
  display: none;
}

.app-shell.sidebar-collapsed .sidebar-nav-groups {
  padding-right: 0;
}

.app-shell.sidebar-collapsed .nav-item {
  justify-content: center;
  padding-inline: 0;
}

.app-shell.sidebar-collapsed .nav-item span {
  display: none;
}

.app-shell.sidebar-collapsed .tenant-card {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 12px 10px;
}

.app-shell.sidebar-collapsed .tenant-logout {
  width: 46px;
  min-width: 46px;
  padding-inline: 0;
}

.main-panel {
  padding: 0;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.cockpit-panel {
  display: grid;
  place-items: center;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  padding: clamp(12px, 1.3vw, 22px);
}

.cockpit-layout .topbar {
  display: none;
}

.top-header {
  height: var(--header-height);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 28px;
  gap: 16px;
  background: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.project-selector {
  display: flex;
  align-items: center;
  padding: 0;
  background: transparent;
  border: 0;
  font-weight: 800;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: -0.2px;
  min-width: auto;
}

#pageTitle {
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
}

.page-body {
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 12px 20px 12px;
}

.cockpit-content-grid {
  align-items: center;
  gap: 0;
  min-height: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-bottom: 20px;
}

.topbar-copy {
  display: grid;
  gap: 6px;
  width: 100%;
  text-align: center;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
}

.topbar h2 {
  font-size: 30px;
  line-height: 1.08;
}

.ledger-topbar {
  margin-bottom: 16px;
}

.ledger-topbar .topbar-copy {
  justify-items: center;
}

.topbar-copy p,
.panel-header p,
.section-copy p,
.action-copy p,
.document-preview p {
  color: var(--muted);
}

.top-actions,
.hero-actions,
.button-row,
.footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-pill,
.badge,
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 12px;
  font-style: normal;
}

.live-pill {
  color: #eef7ff;
  background: rgba(15, 42, 78, 0.92);
  box-shadow: 0 12px 24px rgba(15, 42, 78, 0.18);
}

.live-pill i,
.record-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--danger);
}

.badge {
  color: #36506d;
  background: rgba(70, 114, 171, 0.12);
}

.status-good,
.level-low {
  color: #0c7a4f;
  background: rgba(24, 169, 112, 0.14);
}

.status-warn,
.level-mid {
  color: #8a5609;
  background: rgba(241, 163, 58, 0.16);
}

.status-danger,
.level-high {
  color: #c02f34;
  background: rgba(229, 72, 77, 0.14);
}

.status-neutral {
  color: #46617d;
  background: rgba(70, 114, 171, 0.1);
}

.btn-new,
.btn-ghost,
.small-button,
.primary-cta,
.secondary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 0;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  max-width: 100%;
  min-width: 0;
  line-height: 1.25;
  text-align: center;
  word-break: break-word;
  flex-shrink: 0;
}

.btn-ghost,
.small-button {
  color: var(--button-c-text);
  background: var(--button-c-bg);
  backdrop-filter: none;
  border: 1px solid var(--button-c-border);
}

.btn-new,
.primary-cta,
.small-button.strong {
  color: #fff;
  border-color: transparent;
  background: var(--button-c-strong);
  box-shadow: 0 3px 10px rgba(96, 165, 250, 0.34);
}

.secondary-cta {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
}

.small-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
}

.content-grid {
  display: grid;
  gap: 16px;
  width: 100%;
  height: 100%;
  min-height: 0;
  align-content: stretch;
  overflow: hidden;
}

.content-grid > * {
  min-height: 0;
}

#pageMount,
.pageMount,
.content-grid-formal {
  min-width: 0;
  min-height: 100%;
  height: 100%;
  align-content: stretch;
}

.panel,
.dashboard-shell {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel {
  min-height: 0;
  padding: 18px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-header h3 {
  font-size: 22px;
}

.ledger-subsection-head {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  text-align: center;
}

.ledger-subsection-head h3 {
  font-size: 22px;
}

.dashboard-shell {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(7, 24, 45, 0.96), rgba(10, 31, 58, 0.96)),
    #0a1f3a;
}

.experience-shell {
  color: #edf7ff;
}

.cockpit-21x9 {
  width: 100%;
  max-width: 1920px;
  aspect-ratio: 16 / 9;
  min-height: 0;
  margin: 0 auto;
  border-color: rgba(127, 217, 255, 0.18);
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 8%, rgba(63, 168, 255, 0.28), transparent 28%),
    radial-gradient(circle at 16% 72%, rgba(64, 210, 255, 0.16), transparent 30%),
    linear-gradient(135deg, #06172d 0%, #09264a 48%, #061529 100%);
  box-shadow: 0 30px 90px rgba(6, 23, 45, 0.26);
}

.cockpit-layout .cockpit-21x9 {
  width: min(calc(100vw - 44px), calc((100vh - 44px) * 16 / 9));
  max-width: none;
  max-height: calc(100vh - 44px);
  min-height: 0;
}

.cockpit-screen {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 14px;
  width: 100%;
  height: 100%;
  min-height: inherit;
  padding: 20px;
  overflow: hidden;
}

.cockpit-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent 90%);
}

.cockpit-header,
.cockpit-kpis,
.cockpit-main,
.cockpit-flow {
  position: relative;
  z-index: 1;
}

.cockpit-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-height: 78px;
  padding: 16px 18px;
  border: 1px solid rgba(127, 217, 255, 0.16);
  border-radius: 22px;
  background: rgba(5, 23, 46, 0.64);
  backdrop-filter: blur(18px);
}

.cockpit-header span,
.cockpit-card header span,
.cockpit-kpi span {
  color: rgba(222, 242, 255, 0.66);
  font-size: 12px;
}

.cockpit-header h1 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 6px;
  color: #f4fbff;
  font-size: clamp(30px, 2.7vw, 52px);
  line-height: 1;
}

.cockpit-header .inline-typo-image {
  width: clamp(78px, 6vw, 118px);
  height: clamp(26px, 2vw, 36px);
  margin: 0;
}

.cockpit-header p,
.cockpit-header em {
  margin: 0;
  color: rgba(222, 242, 255, 0.72);
  font-style: normal;
}

.cockpit-header aside {
  display: grid;
  justify-items: end;
  gap: 6px;
  white-space: nowrap;
}

.cockpit-header aside b {
  color: #fff;
  font-size: 20px;
}

.cockpit-kpis.dense-bento {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 10px;
}

.cockpit-kpi {
  display: grid;
  gap: 4px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid rgba(127, 217, 255, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035)),
    rgba(10, 38, 73, 0.66);
  backdrop-filter: blur(16px);
}

.cockpit-kpi strong {
  color: #fff;
  font-size: clamp(24px, 2.4vw, 40px);
  line-height: 1;
}

.cockpit-kpi small {
  overflow: hidden;
  color: rgba(222, 242, 255, 0.58);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cockpit-main.interest-stage {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.7fr) minmax(260px, 0.85fr);
  gap: 14px;
  min-height: 0;
  padding: 0;
  background: none;
}

.cockpit-column {
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 0.86fr);
  gap: 14px;
  min-height: 0;
}

.cockpit-card,
.cockpit-map-panel,
.cockpit-video-panel {
  overflow: hidden;
  border: 1px solid rgba(127, 217, 255, 0.14);
  border-radius: 20px;
  background: rgba(8, 31, 60, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
}

.cockpit-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  padding: 14px;
}

.cockpit-card header,
.cockpit-map-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.cockpit-card header b,
.cockpit-map-title strong {
  color: #f4fbff;
  font-size: 16px;
}

.cockpit-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  margin-top: 12px;
  overflow: auto;
  padding-right: 2px;
}

.cockpit-list.compact {
  gap: 7px;
}

.cockpit-list-row {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 0 10px;
  color: #eaf7ff;
  border: 1px solid rgba(127, 217, 255, 0.1);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
}

.cockpit-list-row strong,
.cockpit-list-row span,
.cockpit-list-row em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cockpit-list-row span {
  color: rgba(222, 242, 255, 0.64);
  font-size: 12px;
}

.cockpit-list-row em {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-style: normal;
  font-size: 11px;
}

.danger-row {
  border-color: rgba(229, 72, 77, 0.2);
  background: rgba(229, 72, 77, 0.08);
}

.cockpit-center.desire-stage {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.22fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  min-height: 0;
  padding: 0;
  color: inherit;
  background: none;
}

.cockpit-map-panel,
.cockpit-video-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  padding: 16px;
}

.cockpit-map-grid {
  position: relative;
  min-height: 0;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(circle at 28% 42%, rgba(127, 217, 255, 0.34), transparent 20%),
    radial-gradient(circle at 62% 54%, rgba(29, 125, 255, 0.32), transparent 22%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(145deg, rgba(20, 77, 139, 0.9), rgba(6, 25, 50, 0.94));
  background-size: auto, auto, 52px 52px, 52px 52px, auto;
}

.cockpit-map-grid::after {
  content: "3号楼北侧材料转运点 / 加工棚西侧 / 配电室入口";
  position: absolute;
  left: 18px;
  bottom: 16px;
  color: rgba(222, 242, 255, 0.58);
  font-size: 12px;
}

.cockpit-heat {
  min-width: 142px;
}

.cockpit-heat small {
  line-height: 1.35;
}

.cockpit-video-wall.command-live-wall {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
  margin-top: 12px;
  height: 100%;
}

.cockpit-video.command-tile,
.cockpit-video-wall.command-live-wall .command-tile:first-child {
  grid-row: span 1;
}

.cockpit-flow.action-stage {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
  padding: 0;
  color: inherit;
  background: none;
}

.cockpit-flow-node.horizontal-accordion {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 64px;
  padding: 10px 12px;
  color: #dff4ff;
  border: 1px solid rgba(127, 217, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  text-align: left;
}

.cockpit-flow-node.active {
  border-color: rgba(127, 217, 255, 0.38);
  background: linear-gradient(135deg, rgba(29, 125, 255, 0.42), rgba(127, 217, 255, 0.16));
}

.cockpit-flow-node span {
  color: rgba(222, 242, 255, 0.64);
  font-size: 12px;
}

.cockpit-flow-node strong {
  color: #fff;
  font-size: 15px;
}

.cockpit-hidden-motion {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.cockpit-ice.dashboard-shell {
  color: #0b2138;
  border-color: rgba(57, 137, 220, 0.24);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(238, 248, 255, 0.74)),
    radial-gradient(circle at 12% 0%, rgba(60, 199, 255, 0.24), transparent 30%),
    radial-gradient(circle at 88% 10%, rgba(29, 125, 255, 0.18), transparent 31%),
    linear-gradient(135deg, #f9fdff 0%, #eef8ff 52%, #e5f3ff 100%);
  box-shadow: 0 34px 100px rgba(38, 102, 171, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.cockpit-ice .cockpit-screen {
  grid-template-rows: clamp(58px, 6.8%, 72px) clamp(32px, 4%, 42px) minmax(0, 1fr);
  gap: clamp(8px, 1vw, 14px);
  padding: clamp(14px, 1.3vw, 22px);
}

.cockpit-ice .cockpit-screen::before {
  background:
    linear-gradient(90deg, rgba(42, 120, 205, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(42, 120, 205, 0.06) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.65), transparent 92%);
}

.cockpit-ice .cockpit-header,
.cockpit-ice .cockpit-kpi,
.cockpit-ice .cockpit-card,
.cockpit-ice .cockpit-map-panel,
.cockpit-ice .cockpit-flow-node.horizontal-accordion {
  border-color: rgba(52, 144, 232, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(240, 249, 255, 0.58)),
    rgba(255, 255, 255, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 18px 42px rgba(57, 137, 220, 0.12);
  backdrop-filter: blur(24px) saturate(1.16);
}

.cockpit-ice .cockpit-header {
  align-items: center;
  min-height: 0;
  padding: 8px clamp(16px, 1.3vw, 24px);
}

.cockpit-title-block {
  display: flex;
  align-items: center;
  min-height: 100%;
}

.cockpit-ice .cockpit-header span,
.cockpit-ice .cockpit-card header span,
.cockpit-ice .cockpit-kpi span,
.cockpit-ice .cockpit-flow-node span {
  color: #58728f;
  font-weight: 800;
}

.cockpit-ice .cockpit-header h1 {
  margin: 1px 0 0;
  color: #08213d;
  font-size: clamp(26px, 2.05vw, 38px);
}

.cockpit-ice .cockpit-header p,
.cockpit-ice .cockpit-header em,
.cockpit-ice .cockpit-kpi small,
.cockpit-ice .cockpit-list-row span {
  color: #4f6e8b;
  font-weight: 650;
}

.cockpit-ice .cockpit-header aside b,
.cockpit-ice .cockpit-kpi strong,
.cockpit-ice .cockpit-card header b,
.cockpit-ice .cockpit-map-title strong,
.cockpit-ice .cockpit-list-row strong,
.cockpit-ice .cockpit-flow-node strong {
  color: #08213d;
}

.cockpit-ice .cockpit-header aside {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  height: 100%;
}

.cockpit-ice .cockpit-header aside b {
  display: flex;
  align-items: center;
  height: 100%;
  font-size: clamp(15px, 1vw, 18px);
}

.cockpit-return-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 16px;
  color: #fff;
  border: 1px solid rgba(15, 124, 255, 0.36);
  border-radius: 999px;
  background: linear-gradient(135deg, #0f7cff, #34c5ff);
  font-size: 13px;
  font-weight: 950;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 12px 26px rgba(15, 124, 255, 0.22);
}

.cockpit-return-button:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.48),
    0 16px 32px rgba(15, 124, 255, 0.28);
}

.cockpit-ice .cockpit-header .inline-typo-image {
  display: none;
}

.cockpit-ice .cockpit-kpis.dense-bento {
  grid-auto-rows: clamp(32px, 4vh, 42px);
  gap: clamp(8px, 0.85vw, 12px);
}

.cockpit-ice .cockpit-kpi {
  display: flex;
  gap: 8px;
  align-items: center;
  align-content: center;
  justify-content: center;
  justify-items: center;
  width: 100%;
  min-height: 0;
  height: 100%;
  padding: 5px 10px;
  border: 1px solid rgba(52, 144, 232, 0.22);
  border-radius: 14px;
  text-align: center;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.cockpit-ice .cockpit-kpi:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 124, 255, 0.36);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 18px 44px rgba(15, 124, 255, 0.16);
}

.cockpit-ice .cockpit-kpi strong {
  font-size: clamp(18px, 1.38vw, 26px);
  letter-spacing: 0;
}

.cockpit-ice .cockpit-kpi span {
  font-size: 11px;
}

.cockpit-ice .cockpit-main.interest-stage {
  grid-template-columns: minmax(248px, 0.76fr) minmax(0, 2.42fr) minmax(286px, 0.9fr);
  gap: clamp(10px, 1vw, 16px);
}

.cockpit-ice .cockpit-column {
  gap: clamp(10px, 1vw, 14px);
}

.cockpit-ice .cockpit-card,
.cockpit-ice .cockpit-map-panel {
  padding: clamp(10px, 1vw, 16px);
  border-radius: 22px;
}

.cockpit-ice .cockpit-card header,
.cockpit-ice .cockpit-map-title {
  min-height: 32px;
}

.cockpit-card-tall {
  grid-row: 1 / -1;
}

.cockpit-section-title {
  position: relative;
  align-items: center;
  padding: 0 0 8px 0;
}

.cockpit-section-title::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(15, 124, 255, 0.55), rgba(91, 197, 255, 0.16), transparent);
}

.cockpit-ice .cockpit-card .cockpit-section-title span,
.cockpit-ice .cockpit-map-title.cockpit-section-title span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #062446;
  font-size: clamp(17px, 1.08vw, 21px);
  font-weight: 950;
  letter-spacing: 0;
}

.cockpit-ice .cockpit-card .cockpit-section-title span::before,
.cockpit-ice .cockpit-map-title.cockpit-section-title span::before {
  content: "";
  width: 9px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, #087cff, #6bddff);
  box-shadow: 0 6px 18px rgba(15, 124, 255, 0.24);
}

.dashboard-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  color: #075cbf;
  border: 1px solid rgba(15, 124, 255, 0.2);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(227, 244, 255, 0.78)),
    rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 8px 18px rgba(15, 124, 255, 0.1);
}

.cockpit-ice .cockpit-map-dominant {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.cockpit-ice .cockpit-list {
  gap: 8px;
  margin-top: 10px;
}

.cockpit-ice .cockpit-list-row {
  min-height: clamp(44px, 5.2vh, 58px);
  padding: 7px 10px;
  color: #08213d;
  border-color: rgba(57, 137, 220, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(235, 247, 255, 0.7)),
    rgba(237, 248, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.cockpit-ice .cockpit-list-row em {
  color: #0f7cff;
  background: rgba(15, 124, 255, 0.1);
  font-weight: 900;
}

.cockpit-ice .cockpit-list-row em.status-good,
.cockpit-ice .cockpit-list-row em.level-low {
  color: #0c7a4f;
  background: rgba(24, 169, 112, 0.16);
}

.cockpit-ice .cockpit-list-row em.status-warn,
.cockpit-ice .cockpit-list-row em.level-mid {
  color: #875200;
  background: rgba(241, 163, 58, 0.22);
}

.cockpit-ice .cockpit-list-row em.status-danger,
.cockpit-ice .cockpit-list-row em.level-high {
  color: #bc252b;
  background: rgba(229, 72, 77, 0.16);
}

.cockpit-ice .cockpit-list-row em.status-neutral {
  color: #315577;
  background: rgba(70, 114, 171, 0.13);
}

.risk-badge {
  min-width: 42px;
  text-align: center;
}

.cockpit-ice .cockpit-list-row .risk-badge {
  color: #fff;
}

.cockpit-ice .cockpit-list-row .risk-badge.risk-high {
  background: linear-gradient(135deg, #e5484d, #ff7a85);
  box-shadow: 0 8px 18px rgba(229, 72, 77, 0.22);
}

.cockpit-ice .cockpit-list-row .risk-badge.risk-mid {
  color: #3d2700 !important;
  background: linear-gradient(135deg, #ffd45a, #ffb23e);
  box-shadow: 0 8px 18px rgba(241, 163, 58, 0.2);
}

.cockpit-ice .cockpit-list-row .risk-badge.risk-low {
  background: linear-gradient(135deg, #0f7cff, #65c7ff);
  box-shadow: 0 8px 18px rgba(15, 124, 255, 0.18);
}

.cockpit-ice .cockpit-list-row .risk-badge.risk-ok {
  background: linear-gradient(135deg, #18a970, #65dca6);
  box-shadow: 0 8px 18px rgba(24, 169, 112, 0.18);
}

.cockpit-ice .danger-row {
  border-color: rgba(229, 72, 77, 0.24);
  background: rgba(229, 72, 77, 0.08);
}

.cockpit-real-map {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid rgba(52, 144, 232, 0.24);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(225, 243, 255, 0.52)),
    #e9f5ff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    inset 0 -24px 58px rgba(15, 124, 255, 0.08);
}

.dashboard-leaflet-map {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.dashboard-leaflet-map.leaflet-container {
  background: #e8f4ff;
  font-family: "Geist", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

.dashboard-leaflet-map .leaflet-tile {
  filter: saturate(0.88) contrast(1.02) brightness(1.03);
}

.dashboard-map-marker {
  display: grid;
  place-items: center;
  min-width: 74px;
  min-height: 40px;
  padding: 5px 9px;
  color: #08213d;
  border: 1px solid rgba(15, 124, 255, 0.3);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(223, 242, 255, 0.78)),
    rgba(255, 255, 255, 0.74);
  box-shadow: 0 12px 24px rgba(15, 124, 255, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px) saturate(1.18);
}

.dashboard-map-marker strong,
.dashboard-map-marker span {
  display: block;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.dashboard-map-marker strong {
  font-size: 18px;
  font-weight: 950;
}

.dashboard-map-marker span {
  margin-top: 4px;
  color: #35617f;
  font-size: 11px;
  font-weight: 900;
}

.dashboard-map-marker.province {
  min-width: 92px;
  min-height: 54px;
  border-color: rgba(15, 124, 255, 0.48);
  background: linear-gradient(135deg, rgba(14, 113, 255, 0.94), rgba(91, 197, 255, 0.9));
  color: #fff;
  box-shadow: 0 18px 36px rgba(15, 124, 255, 0.28);
}

.dashboard-map-marker.province span,
.dashboard-map-marker.device span {
  color: rgba(255, 255, 255, 0.9);
}

.dashboard-map-marker.city.alert {
  border-color: rgba(229, 72, 77, 0.42);
  box-shadow: 0 14px 30px rgba(229, 72, 77, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.dashboard-map-marker.device {
  min-width: 92px;
  min-height: 42px;
  color: #fff;
  border-color: rgba(15, 124, 255, 0.5);
  background: linear-gradient(135deg, #0f7cff, #35c2ff);
}

.dashboard-map-marker.device.locked {
  border-color: rgba(229, 72, 77, 0.52);
  background: linear-gradient(135deg, #e5484d, #ff8a6b);
}

.cockpit-ice .cockpit-flow.action-stage {
  gap: 7px;
}

.cockpit-ice .cockpit-flow-node.horizontal-accordion {
  min-height: 42px;
  padding: 7px 10px;
  border-radius: 15px;
}

.cockpit-ice .cockpit-flow-node.active {
  color: #fff;
  border-color: rgba(14, 113, 255, 0.5);
  background: linear-gradient(135deg, #0f7cff, #34c5ff);
  box-shadow: 0 16px 38px rgba(15, 124, 255, 0.2);
}

.cockpit-ice .cockpit-flow-node.active span,
.cockpit-ice .cockpit-flow-node.active strong {
  color: #fff;
}

.cockpit-china-map {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid rgba(52, 144, 232, 0.24);
  border-radius: 20px;
  background:
    radial-gradient(circle at 70% 18%, rgba(15, 124, 255, 0.2), transparent 30%),
    radial-gradient(circle at 26% 76%, rgba(60, 199, 255, 0.18), transparent 32%),
    linear-gradient(90deg, rgba(42, 120, 205, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(42, 120, 205, 0.08) 1px, transparent 1px),
    linear-gradient(145deg, #f5fbff, #dcefff);
  background-size: auto, auto, 48px 48px, 48px 48px, auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), inset 0 -28px 70px rgba(15, 124, 255, 0.08);
}

.cockpit-map-loading {
  display: grid;
  height: 100%;
  min-height: 220px;
  place-items: center;
  color: #4f6e8b;
  font-weight: 800;
}

.dashboard-map-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.dashboard-map-svg.is-dragging {
  cursor: grabbing;
}

.dashboard-china-shape {
  fill: rgba(102, 177, 255, 0.38);
  stroke: rgba(35, 113, 202, 0.26);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.dashboard-china-outline {
  fill: none;
  stroke: rgba(16, 103, 196, 0.76);
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}

.dashboard-city-label {
  fill: rgba(8, 33, 61, 0.72);
  font-size: 10px;
  font-weight: 800;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.94);
  stroke-width: 3px;
  stroke-linejoin: round;
  pointer-events: none;
}

.dashboard-device-point {
  cursor: pointer;
  transform-box: fill-box;
  transform-origin: center;
}

.dashboard-device-point circle:first-child {
  fill: rgba(15, 124, 255, 0.28);
}

.dashboard-device-point.locked circle:first-child {
  fill: rgba(229, 72, 77, 0.28);
}

.dashboard-device-point .camera-body {
  fill: #fff;
  stroke: #0f7cff;
  stroke-width: 1.4;
  filter: drop-shadow(0 6px 12px rgba(15, 124, 255, 0.18));
}

.dashboard-device-point .camera-lens {
  fill: #0f7cff;
}

.dashboard-device-point.locked .camera-lens {
  fill: #e5484d;
}

.dashboard-device-point text {
  fill: #062446;
  font-size: 15px;
  font-weight: 900;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.dashboard-map-label {
  position: absolute;
  left: 18px;
  bottom: 16px;
  display: grid;
  gap: 4px;
  padding: 11px 14px;
  color: #4f6e8b;
  border: 1px solid rgba(57, 137, 220, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(18px);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-map-label strong {
  color: #08213d;
  font-size: 14px;
}

.dashboard-status-modal {
  min-width: 0;
}

.dashboard-status-modal div {
  min-height: 56px;
}

.dashboard-camera-popover {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 4;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(430px, 42%);
  min-height: 258px;
  overflow: hidden;
  border: 1px solid rgba(15, 124, 255, 0.26);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 28px 70px rgba(16, 92, 168, 0.22);
  backdrop-filter: blur(22px);
}

.dashboard-camera-popover[hidden] {
  display: none;
}

.dashboard-camera-popover header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 13px 10px;
}

.dashboard-camera-popover header strong,
.dashboard-camera-popover header span {
  display: block;
}

.dashboard-camera-popover header strong {
  color: #08213d;
  font-size: 18px;
}

.dashboard-camera-popover header span {
  margin-top: 3px;
  color: #526f8c;
  font-size: 12px;
  font-weight: 800;
}

.dashboard-camera-popover button {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  color: #0b315e;
  border: 1px solid rgba(15, 124, 255, 0.18);
  border-radius: 999px;
  background: rgba(236, 248, 255, 0.9);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.dashboard-camera-popover .camera-video {
  position: relative;
  min-height: 190px;
  margin: 0 12px 12px;
  overflow: hidden;
  border-radius: 17px;
  background: #d7ecff;
}

.dashboard-camera-popover video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dashboard-camera-popover .camera-video::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(5, 24, 46, 0.48));
}

.dashboard-camera-popover .camera-meta {
  position: absolute;
  z-index: 1;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #fff;
  font-weight: 900;
  text-shadow: 0 2px 10px rgba(4, 24, 50, 0.48);
}

.dashboard-camera-popover .camera-meta em {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 124, 255, 0.78);
  font-style: normal;
  font-size: 12px;
}

.experience-nav {
  position: sticky;
  top: 14px;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 18px;
  align-items: center;
  width: calc(100% - 40px);
  min-height: 58px;
  margin: 18px auto 0;
  padding: 0 14px 0 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(11, 31, 57, 0.62);
  backdrop-filter: blur(20px);
}

.experience-nav strong {
  font-size: 14px;
}

.experience-nav div {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: rgba(237, 247, 255, 0.68);
  font-size: 13px;
}

.hero-stage {
  position: relative;
  display: grid;
  gap: 24px;
  min-height: 0;
  padding: 52px 36px 58px;
  overflow: hidden;
}

.hero-wash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 52% 18%, rgba(127, 217, 255, 0.24), transparent 22%),
    radial-gradient(circle at 14% 74%, rgba(29, 125, 255, 0.24), transparent 26%),
    linear-gradient(rgba(6, 18, 37, 0.38), rgba(6, 18, 37, 0.76)),
    url("https://picsum.photos/seed/power-command-center/1920/1080");
  background-size: cover;
  background-position: center;
  filter: contrast(1.08) saturate(0.76);
}

.hero-grid,
.command-live-wall,
.dense-bento {
  position: relative;
  z-index: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 24px;
  align-items: stretch;
}

.hero-copy {
  display: grid;
  align-content: start;
  gap: 16px;
  max-width: min(780px, 84vw);
}

.hero-copy h1 {
  max-width: min(780px, 84vw);
  margin: 0;
  font-size: clamp(36px, 4vw, 60px);
  font-weight: 900;
  line-height: 1.02;
}

.hero-copy p {
  max-width: 700px;
  font-size: 17px;
  line-height: 1.68;
  color: rgba(237, 247, 255, 0.78);
}

.inline-typo-image {
  display: inline-block;
  width: clamp(88px, 9vw, 142px);
  height: clamp(34px, 3.8vw, 54px);
  margin: 0 10px;
  vertical-align: middle;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background:
    linear-gradient(rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.22)),
    url("https://picsum.photos/seed/helmet-recorder/420/180");
  background-size: cover;
  background-position: center;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.hero-metric-card {
  min-height: 116px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.hero-metric-card span,
.bento-card span,
.horizontal-accordion strong,
.feedback-strip span {
  color: rgba(237, 247, 255, 0.66);
  font-size: 12px;
}

.hero-metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 32px;
}

.hero-metric-card p {
  margin-top: 8px;
  color: rgba(237, 247, 255, 0.74);
}

.command-ops-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(300px, 0.68fr);
  gap: 16px;
  align-items: stretch;
}

.command-live-wall {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 152px;
  gap: 14px;
}

.command-tile,
.video-tile {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.06);
}

.command-tile video,
.video-scene video,
.evidence-preview video,
.evidence-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.command-tile {
  min-height: 0;
}

.command-live-wall .command-tile:first-child {
  grid-row: span 2;
}

.command-overlay,
.video-scene strong,
.video-scene p,
.video-scene small,
.record-dot {
  position: absolute;
  z-index: 2;
}

.command-overlay {
  inset: auto 14px 14px 14px;
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(6, 18, 37, 0.12), rgba(6, 18, 37, 0.62));
  backdrop-filter: blur(14px);
}

.command-overlay strong {
  font-size: 22px;
}

.command-overlay p,
.command-overlay small {
  margin: 0;
  color: rgba(237, 247, 255, 0.8);
}

.record-label {
  justify-self: start;
  padding: 4px 8px;
  color: #fff;
  border-radius: 999px;
  background: rgba(10, 28, 54, 0.7);
  font-size: 11px;
}

.command-side-stack {
  display: grid;
  gap: 14px;
}

.command-side-card {
  display: grid;
  gap: 14px;
  min-height: 0;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.command-side-head {
  display: grid;
  gap: 6px;
}

.command-side-head span {
  color: rgba(237, 247, 255, 0.66);
  font-size: 12px;
}

.command-side-head strong {
  font-size: 24px;
  line-height: 1.15;
}

.mini-heatmap {
  position: relative;
  min-height: 176px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(145deg, rgba(27, 75, 141, 0.92), rgba(18, 49, 92, 0.9));
  background-size: 13% 100%, 100% 25%, auto;
}

.mini-heat-point {
  position: absolute;
  display: grid;
  gap: 4px;
  min-width: 92px;
  padding: 8px 10px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(10, 31, 58, 0.46);
  backdrop-filter: blur(16px);
  text-align: left;
}

.mini-heat-point b,
.mini-heat-point small {
  display: block;
  white-space: nowrap;
}

.mini-heat-point small {
  color: rgba(237, 247, 255, 0.74);
  font-size: 11px;
}

.command-queue {
  display: grid;
  gap: 10px;
}

.command-queue div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(8, 28, 53, 0.34);
}

.command-queue b,
.command-queue span,
.command-queue em {
  min-width: 0;
}

.command-queue b {
  grid-column: 1 / -1;
  font-size: 14px;
}

.command-queue span {
  color: rgba(237, 247, 255, 0.76);
  font-size: 13px;
}

.command-queue em {
  color: rgba(237, 247, 255, 0.54);
  font-style: normal;
  font-size: 12px;
}

.command-tile.offline,
.video-tile.offline {
  filter: grayscale(1);
}

.interest-stage,
.desire-stage,
.accordion-stage,
.action-stage {
  padding: 108px 36px;
}

.dense-bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: 164px;
  grid-auto-flow: dense;
  gap: 16px;
}

.bento-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)),
    rgba(13, 39, 72, 0.86);
}

.bento-card strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
  line-height: 1.1;
}

.bento-plan,
.bento-alert,
.bento-progress {
  grid-column: span 4;
}

.bento-device,
.bento-ai {
  grid-column: span 6;
}

.heatmap {
  position: absolute;
  inset: 116px 20px 20px;
  border-radius: 20px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(135deg, rgba(29, 125, 255, 0.22), rgba(127, 217, 255, 0.12));
  background-size: 42px 42px, 42px 42px, cover;
}

.heat-point {
  position: absolute;
  display: grid;
  min-width: 92px;
  padding: 9px 12px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(4, 20, 39, 0.56);
  backdrop-filter: blur(12px);
}

.heat-point i {
  position: absolute;
  inset: -12px;
  border-radius: inherit;
  background: rgba(127, 217, 255, 0.44);
}

.heat-point b,
.heat-point small {
  position: relative;
  z-index: 1;
}

.heat-point small {
  color: rgba(237, 247, 255, 0.68);
  font-size: 11px;
}

.mini-ledger {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.mini-ledger div,
.dashboard-progress-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
}

.mini-ledger b,
.mini-ledger span,
.mini-ledger em,
.dashboard-progress-list b,
.dashboard-progress-list em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-ledger em,
.dashboard-progress-list em {
  color: rgba(237, 247, 255, 0.78);
  font-style: normal;
}

.dashboard-progress-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.dashboard-progress-list i {
  position: relative;
  width: 120px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.dashboard-progress-list i span {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--cyan), var(--primary));
}

.desire-stage {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.18fr);
  gap: 34px;
  align-items: start;
  color: #edf7ff;
  background: linear-gradient(180deg, rgba(8, 23, 43, 0.98), rgba(10, 31, 58, 0.98));
}

.section-copy {
  position: sticky;
  top: 112px;
}

.section-copy h3,
.action-copy h3 {
  font-size: 46px;
  line-height: 1.04;
}

.stack-story {
  display: grid;
  gap: 18px;
  padding-bottom: 82px;
}

.stack-card {
  min-height: 190px;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(29, 125, 255, 0.18), rgba(127, 217, 255, 0.1)),
    rgba(14, 39, 71, 0.9);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.26);
}

.stack-card strong {
  display: block;
  margin-top: 16px;
  font-size: 32px;
  line-height: 1.08;
}

.accordion-stage {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  background: linear-gradient(180deg, #edf5ff 0%, #f6fbff 100%);
}

.horizontal-accordion {
  display: grid;
  align-content: start;
  gap: 18px;
  min-height: 330px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.horizontal-accordion.featured {
  background: linear-gradient(180deg, rgba(223, 242, 255, 0.92), rgba(255, 255, 255, 0.9));
}

.horizontal-accordion:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 34px rgba(29, 125, 255, 0.12);
}

.horizontal-accordion strong {
  color: var(--ink);
  font-size: 26px;
}

.horizontal-accordion p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.action-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 28px;
  align-items: center;
  color: #edf7ff;
  background:
    linear-gradient(rgba(7, 24, 45, 0.76), rgba(7, 24, 45, 0.9)),
    url("https://picsum.photos/seed/safety-command-room/1600/900");
  background-size: cover;
  background-position: center;
}

.feedback-strip {
  display: grid;
  gap: 10px;
}

.feedback-strip article {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
}

.feedback-strip strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.ledger-shell,
.live-command-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
}

.ledger-shell-fixed {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.ledger-panel-fixed {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.ledger-panel-fixed > .query-toolbar,
.ledger-panel-fixed > .import-rule-panel,
.ledger-panel-fixed > .workplan-pagination,
.ledger-panel-fixed > .ledger-pagination {
  flex: 0 0 auto;
}

.ledger-panel-fixed > .table,
.ledger-panel-fixed > .task-definition-ledger {
  flex: 1 1 auto;
  min-height: 0;
}

.detail-panel {
  display: none;
}

.query-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  min-width: 0;
  overflow: hidden;
}

.workplan-filter-toolbar {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.query-field,
.query-actions {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.query-field {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  row-gap: 0;
}

.query-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
  flex-shrink: 0;
  max-width: 100%;
}

.query-field > span {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  padding-left: 0;
  white-space: nowrap;
}

.query-field-date-range {
  min-width: 0;
}

.query-field-wide {
  min-width: 0;
}

.query-input,
.query-select,
.query-native-select,
.query-native-input {
  display: grid;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
  box-sizing: border-box;
  box-shadow: none;
  min-width: 0;
}

.query-native-select,
.query-native-input {
  width: 100%;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  outline: none;
  appearance: none;
}

.query-native-input:focus,
.query-native-select:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: rgba(255, 255, 255, 0.9);
}

.query-input-dual {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.query-input-dual i {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  white-space: nowrap;
}

.query-input span {
  color: var(--muted);
  font-size: 12px;
}

.query-input input {
  width: 100%;
  padding: 0;
  color: var(--ink);
  border: 0;
  background: transparent;
  font-size: 14px;
  line-height: 1.5;
  outline: none;
}

.query-input input::placeholder {
  color: rgba(15, 31, 52, 0.88);
  opacity: 1;
}

.query-select {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  text-align: left;
}

.query-select strong {
  font-size: 14px;
}

.query-select em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.query-select strong,
.query-select em {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.query-pills,
.chip-row,
.button-row,
.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.query-pills span,
.chip-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.table {
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.34);
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}

.table-head,
.table-row {
  display: grid;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  min-width: 0;
  padding: 0 14px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.table-head {
  color: var(--text-tertiary);
  background: rgba(255, 255, 255, 0.42);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

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

.table-head span,
.table-row span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  text-align: center;
}

.table-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.app-shell {
  zoom: 0.9;
}

.ledger-checkbox-cell {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100%;
  min-width: 0;
}

.ledger-checkbox {
  position: relative;
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
}

.ledger-checkbox input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.ledger-checkbox i {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(97, 144, 201, 0.42);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.ledger-checkbox input:checked + i,
.ledger-checkbox.is-partial i {
  border-color: rgba(26, 106, 215, 0.72);
  background: linear-gradient(180deg, rgba(93, 166, 245, 0.96), rgba(37, 110, 222, 0.92));
  box-shadow: 0 6px 16px rgba(42, 113, 216, 0.18);
}

.ledger-checkbox input:checked + i::after,
.ledger-checkbox.is-partial i::after {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  margin: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.96);
}

.ledger-checkbox.is-partial i::after {
  width: 8px;
  height: 2px;
  margin: 7px 4px;
  border-radius: 999px;
}

.ledger-batch-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}

.ledger-batch-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.table-empty {
  min-width: var(--table-min, 100%);
  padding: 22px 14px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.table-button-row {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
}

.table-button-row.selected {
  background: rgba(29, 125, 255, 0.08);
}

.import-rule-panel {
  display: grid;
  gap: 12px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(52, 144, 232, 0.22);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(237, 248, 255, 0.66)),
    rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.import-rule-head,
.import-columns {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.import-rule-head div {
  display: grid;
  gap: 4px;
}

.import-rule-head strong {
  color: #08213d;
  font-size: 18px;
}

.import-rule-head span,
.import-columns span {
  color: #4f6e8b;
  font-size: 12px;
  font-weight: 800;
}

.import-columns {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.import-columns span {
  min-height: 28px;
  padding: 6px 10px;
  border: 1px solid rgba(52, 144, 232, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.import-flow,
.import-result {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.import-result {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.import-result-wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
}

.import-flow article,
.import-result article {
  display: grid;
  gap: 4px;
  min-height: 70px;
  padding: 12px;
  border: 1px solid rgba(52, 144, 232, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
}

.import-flow span,
.import-result span {
  color: #55718d;
  font-size: 12px;
  font-weight: 800;
}

.import-flow strong,
.import-result strong {
  color: #08213d;
  font-size: 26px;
  line-height: 1;
}

.import-filter-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.import-filter-note {
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(52, 144, 232, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: #55718d;
  font-size: 13px;
  line-height: 1.5;
}

.import-filter-summary article {
  display: grid;
  gap: 6px;
  min-height: 70px;
  padding: 12px;
  border: 1px solid rgba(52, 144, 232, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
}

.import-filter-summary span {
  color: #55718d;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.import-filter-summary strong {
  color: #08213d;
  font-size: 24px;
  line-height: 1;
}

.task-rule-import-resolution-summary {
  grid-template-columns: minmax(180px, 0.82fr) minmax(280px, 1.18fr);
  align-items: stretch;
}

.task-rule-import-resolution-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.task-rule-import-resolution-actions .btn-ghost,
.task-rule-import-resolution-actions .btn-new {
  min-width: 132px;
}

.task-rule-import-resolution-actions .btn-ghost.active {
  color: #0d60c6;
  border-color: rgba(29, 125, 255, 0.22);
  background: rgba(225, 238, 255, 0.92);
}

.workplan-import-error {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(52, 144, 232, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 36px rgba(87, 122, 190, 0.1);
}

.workplan-import-error strong {
  color: #08213d;
  font-size: 15px;
}

.workplan-import-error p {
  margin: 0;
  color: #4f6e8b;
  line-height: 1.6;
}

.status-link {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.workplan-table .table-head,
.workplan-table .table-row {
  --table-min: 100%;
  grid-template-columns:
    44px
    44px
    minmax(140px, 0.9fr)
    minmax(240px, 1.64fr)
    minmax(140px, 0.9fr)
    minmax(98px, 0.56fr)
    minmax(98px, 0.58fr)
    minmax(98px, 0.58fr)
    minmax(140px, 0.9fr)
    minmax(98px, 0.58fr)
    minmax(98px, 0.58fr);
}

.workplan-table .table-row span:nth-child(4),
.workplan-table .table-row span:nth-child(5),
.workplan-table .table-row span:nth-child(8),
.workplan-table .table-row span:nth-child(9) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workplan-table .table-head span,
.workplan-table .table-row span {
  width: 100%;
}

.page-workplans .workplan-table > .table-head,
.page-workplans .workplan-table > .table-head > span,
.page-workplans .workplan-table > .table-head > label,
.page-workplans .workplan-table > .table-head strong,
.page-workplans .workplan-table > .table-head b {
  font-weight: 700;
}

.page-workplans .workplan-table > .table-row,
.page-workplans .workplan-table > .table-row > span,
.page-workplans .workplan-table > .table-row > label,
.page-workplans .workplan-table > .table-row strong,
.page-workplans .workplan-table > .table-row b {
  font-weight: 400;
}

.workplan-table .table-row span:nth-child(4) {
  white-space: normal;
  align-items: center;
}

.workplan-content-cell,
.task-execution-content-cell,
.task-generation-content-cell {
  display: -webkit-box !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  white-space: normal !important;
  text-overflow: ellipsis;
  line-height: 1.45;
  max-height: calc(1.45em * 2);
  word-break: break-all;
  width: 100%;
}

.workplan-table .table-row,
.task-generation-row,
.task-execution-ledger-row {
  min-height: 56px;
}

.workplan-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.ledger-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.workplan-pagination-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.ledger-pagination-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.workplan-pagination-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.ledger-pagination-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.page-jump-field {
  display: inline-grid;
  grid-template-columns: auto minmax(52px, 64px) auto;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  color: var(--text-primary);
  border: 1px solid var(--button-c-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.66);
  backdrop-filter: none;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.page-jump-field input {
  width: 56px;
  min-width: 56px;
  height: 24px;
  padding: 0 6px;
  color: var(--text-primary);
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: center;
  outline: none;
  appearance: textfield;
  -moz-appearance: textfield;
}

.page-jump-field input::-webkit-outer-spin-button,
.page-jump-field input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.page-jump-field em {
  color: var(--muted);
  font-style: normal;
}

.page-size-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  color: var(--text-primary);
  border: 1px solid var(--button-c-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.66);
  backdrop-filter: none;
  font-size: 13px;
  font-weight: 700;
}

.page-size-select select {
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  outline: none;
}

.import-preview-table .table-head,
.import-preview-table .table-row {
  --table-min: 1180px;
  grid-template-columns: 0.7fr 0.55fr 0.82fr 0.82fr 0.82fr 0.75fr 0.75fr 1.5fr;
}

.workplan-import-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.workplan-import-strip article {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(52, 144, 232, 0.18);
  border-radius: 16px;
  background: rgba(244, 249, 255, 0.9);
}

.workplan-import-strip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.workplan-import-strip strong {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
}

.workplan-import-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  align-content: center;
  gap: 14px;
  border: 1px dashed rgba(29, 125, 255, 0.28);
  border-radius: 20px;
  background: rgba(244, 249, 255, 0.78);
}

.workplan-import-empty strong {
  color: var(--ink);
  font-size: 24px;
}

.workplan-import-empty span {
  color: var(--muted);
  font-weight: 750;
}

.import-preview-group {
  display: grid;
  gap: 10px;
}

.import-preview-group header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #08213d;
  font-size: 16px;
  font-weight: 900;
}

.import-preview-group header span {
  display: inline-grid;
  min-width: 34px;
  height: 28px;
  place-items: center;
  color: #0b63ce;
  border: 1px solid rgba(29, 125, 255, 0.2);
  border-radius: 999px;
  background: rgba(224, 241, 255, 0.82);
  font-size: 13px;
}

.workplan-import-preview .table-head,
.workplan-import-preview .table-row {
  --table-min: 1180px;
  grid-template-columns: 0.72fr 2.2fr 0.72fr 0.88fr 0.9fr 0.78fr 0.78fr;
}

.workplan-import-exception .table-head,
.workplan-import-exception .table-row {
  --table-min: 960px;
  grid-template-columns: 0.82fr 1.9fr 1.45fr 0.9fr;
}

.user-import-preview .table-head,
.user-import-preview .table-row {
  --table-min: 1080px;
  grid-template-columns: 0.92fr 0.86fr 0.98fr 0.88fr 1fr 0.72fr 0.72fr;
}

.import-resolution-select {
  width: 100%;
  min-height: 32px;
}

.import-row-note {
  color: #55718d;
  font-size: 12px;
  font-weight: 850;
}

.taskrule-table .table-head,
.taskrule-table .table-row {
  --table-min: 1460px;
  grid-template-columns:
    72px
    minmax(138px, 0.88fr)
    minmax(152px, 0.96fr)
    minmax(198px, 1.18fr)
    minmax(236px, 1.28fr)
    minmax(164px, 0.98fr)
    minmax(96px, 0.62fr)
    minmax(104px, 0.66fr)
    minmax(248px, 1.26fr);
}

.taskrule-table .table-head span,
.taskrule-table .table-row span {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.taskrule-table .table-row span:nth-child(2),
.taskrule-table .table-row span:nth-child(3),
.taskrule-table .table-row span:nth-child(4),
.taskrule-table .table-row span:nth-child(5),
.taskrule-table .table-row span:nth-child(9) {
  white-space: normal;
  line-height: 1.5;
}

.taskrule-table .table-actions {
  justify-content: center;
}

.taskrule-tree-table .table-head,
.taskrule-tree-table .table-row {
  --table-min: 100%;
  grid-template-columns:
    72px
    minmax(420px, 1.82fr)
    minmax(142px, 0.8fr)
    92px
    92px
    minmax(292px, 1.2fr)
    96px
    minmax(226px, 1.04fr);
}

.taskrule-tree-table .table-head span,
.taskrule-tree-table .table-row span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  text-align: center;
}

.taskrule-tree-table .table-head span:nth-child(2),
.taskrule-tree-table .table-row span:nth-child(2) {
  justify-content: center;
  text-align: center;
}

.task-rule-tree-row {
  min-height: 88px;
}

.task-rule-tree-row.level-1 {
  background:
    linear-gradient(90deg, rgba(214, 232, 255, 0.56), rgba(246, 250, 255, 0.92) 22%, rgba(246, 250, 255, 0.92)),
    rgba(246, 250, 255, 0.92);
  box-shadow: inset 5px 0 0 rgba(34, 110, 214, 0.24);
}

.task-rule-tree-row.level-2 {
  background:
    linear-gradient(90deg, rgba(228, 240, 255, 0.46), rgba(250, 253, 255, 0.9) 22%, rgba(250, 253, 255, 0.9)),
    rgba(250, 253, 255, 0.9);
  box-shadow: inset 5px 0 0 rgba(34, 110, 214, 0.16);
}

.task-rule-tree-row.level-3 {
  background:
    linear-gradient(90deg, rgba(235, 244, 255, 0.34), rgba(255, 255, 255, 0.88) 22%, rgba(255, 255, 255, 0.88)),
    rgba(255, 255, 255, 0.88);
  box-shadow: inset 5px 0 0 rgba(34, 110, 214, 0.1);
}

.task-rule-toggle,
.task-rule-toggle-placeholder {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.task-rule-toggle {
  position: relative;
  z-index: 1;
  color: var(--primary-strong);
  border: 0;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(222, 239, 255, 0.92)),
    rgba(29, 125, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 8px 20px rgba(39, 105, 188, 0.14);
}

.task-rule-toggle svg {
  transition: transform 180ms ease;
}

.task-rule-toggle.expanded svg {
  transform: rotate(90deg);
}

.task-rule-branch-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.task-rule-branch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(100%, 520px);
}

.task-rule-branch-link {
  display: inline-flex;
  width: 18px;
  height: 2px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(73, 128, 207, 0.12), rgba(73, 128, 207, 0.42));
}

.task-rule-node-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  max-width: 100%;
  padding: 0 14px;
  border: 1px solid rgba(88, 127, 177, 0.16);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(239, 247, 255, 0.88)),
    rgba(255, 255, 255, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 10px 24px rgba(33, 91, 160, 0.08);
}

.task-rule-node-tag.level-1 {
  border-color: rgba(42, 113, 204, 0.16);
  background:
    linear-gradient(180deg, rgba(240, 247, 255, 0.98), rgba(225, 238, 255, 0.92)),
    rgba(236, 244, 255, 0.84);
}

.task-rule-node-tag.level-2 {
  border-color: rgba(54, 132, 217, 0.16);
  background:
    linear-gradient(180deg, rgba(247, 251, 255, 0.96), rgba(234, 244, 255, 0.9)),
    rgba(243, 248, 255, 0.82);
}

.task-rule-node-tag.current {
  border-color: rgba(29, 125, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(231, 242, 255, 0.98), rgba(214, 233, 255, 0.92)),
    rgba(225, 239, 255, 0.88);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 14px 32px rgba(33, 94, 170, 0.12);
}

.task-rule-node-tag em {
  color: #4f6f99;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.task-rule-node-tag strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 700;
}

.taskrule-tree-table .table-actions {
  justify-content: center;
  flex-wrap: wrap;
}

.task-rule-action-hint {
  color: #6d84a0;
  font-size: 12px;
  font-weight: 700;
}

.task-rule-risk-summary {
  display: grid;
  gap: 10px;
  width: 100%;
}

.task-rule-risk-total {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
}

.task-rule-risk-total strong {
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.task-rule-risk-total span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task-rule-risk-meter {
  display: grid;
  gap: 7px;
}

.task-rule-risk-line {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.task-rule-risk-line label {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task-rule-risk-line label i {
  display: inline-flex;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
}

.task-rule-risk-line strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.task-rule-risk-track {
  display: flex;
  align-items: center;
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(207, 225, 244, 0.72);
}

.task-rule-risk-track b {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.task-rule-risk-line.risk-high {
  color: #e5484d;
}

.task-rule-risk-line.risk-high .task-rule-risk-track b {
  background: linear-gradient(90deg, #f26c72, #e5484d);
}

.task-rule-risk-line.risk-mid {
  color: #de8f18;
}

.task-rule-risk-line.risk-mid .task-rule-risk-track b {
  background: linear-gradient(90deg, #f7c45d, #f1a33a);
}

.task-rule-risk-line.risk-low {
  color: #1d7dff;
}

.task-rule-risk-line.risk-low .task-rule-risk-track b {
  background: linear-gradient(90deg, #5da8ff, #1d7dff);
}

.task-rule-risk-line.risk-ok {
  color: #18a970;
}

.task-rule-risk-line.risk-ok .task-rule-risk-track b {
  background: linear-gradient(90deg, #69d5a2, #18a970);
}

.task-rule-risk-shell {
  display: block;
  min-height: 0;
  padding: 0;
  background: rgba(248, 252, 255, 0.76);
}

.task-rule-risk-shell > span {
  display: block;
  padding: 0;
  overflow: visible;
  white-space: normal;
}

.task-rule-split-layout {
  display: grid;
  grid-template-columns: minmax(0, 25fr) minmax(0, 75fr);
  gap: 18px;
  align-items: stretch;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
}

.task-rule-page-shell {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.task-rule-page-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.task-rule-directory-panel,
.task-rule-ledger-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(241, 248, 255, 0.9)),
    rgba(255, 255, 255, 0.84);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 18px 48px rgba(26, 78, 145, 0.08);
}

.task-rule-panel-head,
.task-rule-ledger-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 16px 12px;
}

.task-rule-panel-head strong,
.task-rule-ledger-head strong {
  color: var(--ink);
  font-size: 26px;
  font-weight: 800;
  min-width: 0;
}

.task-rule-panel-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.task-rule-panel-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.task-rule-panel-actions .btn-ghost.compact,
.task-rule-panel-actions .task-rule-add-button {
  min-width: 0;
}

.task-rule-directory-scroll {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 12px 14px;
  overflow-x: hidden;
  overflow-y: auto;
  gap: 8px;
}

.task-rule-directory-group,
.task-rule-directory-branch {
  display: grid;
  gap: 6px;
  align-content: start;
  min-width: 0;
}

.task-rule-directory-children,
.task-rule-directory-leaves {
  display: grid;
  gap: 6px;
}

.task-rule-directory-children {
  padding-left: 18px;
}

.task-rule-directory-leaves {
  padding-left: 30px;
}

.task-rule-directory-leaves.level-4 {
  padding-left: 24px;
}

.task-rule-directory-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 38px;
  padding: 0 4px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.task-rule-directory-header.level-1 {
  min-height: 40px;
  align-items: center;
}

.task-rule-directory-header.level-2 {
  min-height: 36px;
}

.task-rule-directory-header.level-3 {
  min-height: 34px;
}

.task-rule-directory-main {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  min-width: 0;
  min-height: 100%;
  padding: 0 8px 0 6px;
  color: var(--ink);
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
}

.task-rule-directory-main:hover {
  background: rgba(29, 125, 255, 0.06);
}

.task-rule-directory-header.level-1 .task-rule-directory-main,
.task-rule-directory-header.level-1 .task-rule-directory-title {
  align-items: center;
}

.task-rule-directory-title {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.task-rule-directory-title strong {
  min-width: 0;
  white-space: normal;
  font-size: 18px;
  line-height: 1.42;
  font-weight: 700;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.task-rule-directory-level-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  color: #6b86a8;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.task-rule-directory-level-text.level-1 {
  color: #456b97;
  font-weight: 800;
}

.task-rule-directory-level-text.level-2 {
  color: #5a7ca4;
  font-weight: 700;
}

.task-rule-directory-level-text.level-3 {
  color: #7890ad;
  font-weight: 600;
}

.task-rule-directory-level-text.level-4 {
  color: #8a9bb5;
  font-weight: 600;
}

.task-rule-directory-header.level-1 .task-rule-directory-title strong {
  font-weight: 800;
}

.task-rule-directory-header.level-2 .task-rule-directory-title strong {
  font-weight: 700;
}

.task-rule-directory-header.level-3 .task-rule-directory-title strong,
.task-rule-directory-leaves.level-4 .task-rule-directory-title strong {
  font-weight: 700;
}

.task-rule-directory-header.level-3 .task-rule-directory-title strong {
  font-weight: 650;
}

.task-rule-directory-toggle {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  color: var(--primary-strong);
}

.task-rule-directory-toggle svg {
  width: 12px;
  height: 12px;
  transition: transform 180ms ease;
}

.task-rule-directory-toggle.expanded svg {
  transform: rotate(90deg);
}

.task-rule-directory-header em {
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.task-rule-directory-leaf {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 0 10px 0 8px;
  color: var(--ink);
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
}

.task-rule-directory-leaf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.task-rule-directory-leaf-row.selected {
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(229, 241, 255, 0.96), rgba(214, 233, 255, 0.92)),
    rgba(224, 238, 255, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 18px rgba(32, 99, 181, 0.1);
}

.task-rule-directory-dot {
  display: inline-flex;
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(68, 109, 160, 0.56);
  margin-top: 0;
}

.task-rule-directory-dot.status-good {
  background: #18a970;
}

.task-rule-directory-dot.status-danger {
  background: #e5484d;
}

.task-rule-directory-leaf strong {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 18px;
  line-height: 1.42;
  font-weight: 650;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.task-rule-directory-leaf-row .table-actions {
  flex: 0 0 auto;
  min-width: 96px;
  justify-content: flex-end;
  align-self: center;
  padding-top: 0;
}

.task-rule-add-button {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  color: #2a6fd5;
  border: 1px solid rgba(42, 111, 213, 0.16);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(232, 243, 255, 0.9)),
    rgba(240, 247, 255, 0.92);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.task-rule-tree-action {
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  flex: 0 0 30px;
  color: #2a6fd5;
  border: 1px solid rgba(42, 111, 213, 0.14);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(236, 245, 255, 0.9)),
    rgba(244, 249, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.task-rule-tree-action svg {
  width: 14px;
  height: 14px;
}

.task-rule-directory-header .table-actions {
  flex: 0 0 auto;
  min-width: 96px;
  justify-content: flex-end;
  gap: 6px;
  align-self: center;
  position: sticky;
  top: 0;
  padding-left: 6px;
  background: transparent;
}

.task-rule-tree-action:hover,
.task-rule-add-button:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 8px 18px rgba(34, 102, 186, 0.12);
}

.task-rule-tree-action.danger {
  color: #c64963;
  border-color: rgba(198, 73, 99, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 241, 244, 0.92)),
    rgba(255, 246, 248, 0.9);
}

.task-rule-ledger-shell {
  display: grid;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.task-rule-ledger-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  height: 100%;
  padding-bottom: 14px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.task-rule-ledger-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding-bottom: 2px;
  min-width: 0;
}

@media (max-width: 1500px) {
  .task-rule-ledger-head {
    grid-template-columns: 1fr;
  }

  .task-rule-ledger-head .table-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

.task-rule-ledger-title {
  min-width: 0;
  flex: 1 1 auto;
}

.task-rule-path-summary.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.task-rule-path-summary.compact article {
  padding: 12px 14px;
  border-radius: 18px;
}

.task-rule-ledger-summary,
.task-rule-ledger-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 0 18px;
}

.task-rule-ledger-overview {
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.9fr);
}

.task-rule-ledger-overview.slim {
  grid-template-columns: 1fr;
}

.task-rule-ledger-summary article,
.task-rule-overview-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(88, 127, 177, 0.16);
  border-radius: 18px;
  background: rgba(248, 252, 255, 0.84);
}

.task-rule-ledger-summary span,
.task-rule-overview-card > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task-rule-overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.task-rule-overview-head > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task-rule-overview-title {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
}

.task-rule-overview-card > .task-rule-overview-title {
  color: #223552;
  font-size: 16px;
  font-weight: 800;
}

.task-rule-auto-risk-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.task-rule-auto-risk-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 6px;
  border: 1px solid rgba(88, 127, 177, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  color: #6f829b;
  font-size: 16px;
  font-weight: 700;
  cursor: default;
}

.task-rule-auto-risk-option.active {
  color: #0c7a4f;
  border-color: rgba(24, 169, 112, 0.18);
  background: rgba(24, 169, 112, 0.1);
}

.task-rule-ledger-summary strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 18px;
}

.task-rule-risk-count-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.task-rule-risk-count-card {
  min-width: 0;
  padding: 12px 10px;
  border-radius: 16px;
  text-align: center;
}

.task-rule-risk-count-card span {
  display: block;
  font-size: 12px;
  font-weight: 700;
}

.task-rule-risk-count-card strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
  line-height: 1;
}

.task-rule-risk-count-card.risk-high {
  color: #c02f34;
  background: rgba(229, 72, 77, 0.12);
}

.task-rule-risk-count-card.risk-mid {
  color: #8a5609;
  background: rgba(241, 163, 58, 0.14);
}

.task-rule-risk-count-card.risk-low {
  color: #1463c2;
  background: rgba(29, 125, 255, 0.12);
}

.task-rule-risk-count-card.risk-ok {
  color: #0c7a4f;
  background: rgba(24, 169, 112, 0.12);
}

.task-rule-risk-table-wrap {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  box-sizing: border-box;
  overflow: hidden;
}

.task-rule-ledger-head .table-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
  max-width: 100%;
  width: min(100%, 420px);
}

.task-rule-ledger-head .small-button {
  min-width: 0;
  max-width: 100%;
  flex: 0 1 auto;
  padding-left: 10px;
  padding-right: 10px;
}

.task-rule-risk-table {
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  border-radius: 16px;
  box-sizing: border-box;
  overflow-x: auto;
  overflow-y: auto;
}

.task-rule-risk-table-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.task-rule-risk-table-head strong {
  color: var(--ink);
  font-size: 24px;
  text-align: center;
}

.task-rule-risk-table .table-head,
.task-rule-risk-table .table-row {
  --table-min: 100%;
  box-sizing: border-box;
  grid-template-columns:
    44px
    44px
    minmax(84px, 0.5fr)
    84px
    72px
    minmax(84px, 0.5fr)
    minmax(200px, 1.1fr)
    minmax(84px, 0.5fr)
    minmax(84px, 0.5fr);
}

.task-rule-risk-table .table-row {
  min-height: 66px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.task-rule-risk-table .table-head span,
.task-rule-risk-table .table-row span {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.task-rule-risk-table .table-head span {
  color: var(--ink);
  font-weight: 800;
  font-size: 18px;
}

.task-rule-risk-table .table-row span:nth-child(9) {
  justify-content: center;
}

.task-rule-risk-table .table-row span:nth-child(7) {
  white-space: normal;
  line-height: 1.4;
  overflow: hidden;
}

.task-rule-risk-table .table-row span:nth-child(8) {
  white-space: normal;
  line-height: 1.5;
  align-items: center;
}

.task-rule-measure-cell {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  white-space: normal !important;
  line-height: 1.4;
  overflow: hidden !important;
}

.task-rule-measure-cell b {
  display: -webkit-box !important;
  width: 100%;
  max-height: calc(1.4em * 2);
  overflow: hidden !important;
  color: var(--ink);
  font-weight: 400;
  line-height: 1.4;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.task-rule-evidence-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.task-rule-evidence-badge.photo {
  color: #165bb3;
  background: rgba(222, 237, 255, 0.9);
}

.task-rule-evidence-badge.video {
  color: #0b6f80;
  background: rgba(214, 244, 249, 0.92);
}

.task-rule-evidence-badge.hybrid {
  color: #8f4f00;
  background: rgba(255, 238, 202, 0.92);
}

.task-rule-import-preview .table-head,
.task-rule-import-preview .table-row {
  --table-min: 100%;
  grid-template-columns:
    minmax(118px, 0.78fr)
    minmax(122px, 0.8fr)
    minmax(148px, 0.92fr)
    minmax(168px, 1fr)
    minmax(168px, 1fr)
    96px
    88px
    minmax(260px, 1.28fr)
    104px;
}

.task-rule-import-preview .table-row span:nth-child(4),
.task-rule-import-preview .table-row span:nth-child(5),
.task-rule-import-preview .table-row span:nth-child(8) {
  justify-content: flex-start;
  text-align: left;
}

.task-rule-import-preview .table-row span:nth-child(8) {
  white-space: normal;
  line-height: 1.5;
}

.task-rule-import-issue-preview .table-head,
.task-rule-import-issue-preview .table-row {
  grid-template-columns:
    88px
    minmax(220px, 1fr)
    minmax(220px, 0.96fr)
    minmax(420px, 1.7fr);
}

.task-rule-import-issue-preview .table-row span:nth-child(2),
.task-rule-import-issue-preview .table-row span:nth-child(3),
.task-rule-import-issue-preview .table-row span:nth-child(4) {
  justify-content: flex-start;
  text-align: left;
}

.task-rule-import-issue-preview .table-row span:nth-child(4) {
  white-space: normal;
  line-height: 1.5;
}

.task-rule-path-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.task-rule-path-summary article {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(88, 127, 177, 0.16);
  border-radius: 16px;
  background: rgba(247, 251, 255, 0.88);
}

.task-rule-path-summary article:last-child:nth-child(3) {
  grid-column: 1 / -1;
}

.task-rule-path-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.task-rule-path-summary strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
}

.task-rule-import-empty span {
  max-width: 480px;
  text-align: center;
  line-height: 1.6;
}

.task-rule-node-form-grid,
.task-risk-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.task-rule-filter-toolbar,
.task-execution-filter-toolbar {
  margin-bottom: 14px;
}

.task-generation-filter-toolbar {
  grid-template-columns: minmax(280px, 1.4fr) repeat(6, minmax(0, 180px)) auto;
  align-items: end;
  margin-bottom: 14px;
}

.task-rule-filter-toolbar {
  grid-template-columns: repeat(4, minmax(0, 220px)) auto;
  align-items: end;
}

.task-generation-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.task-generation-summary-strip article {
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid rgba(89, 139, 201, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 248, 255, 0.88)),
    rgba(255, 255, 255, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 12px 28px rgba(31, 96, 172, 0.08);
}

.task-generation-summary-strip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.task-generation-summary-strip strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 26px;
  font-weight: 900;
}

.task-generation-batch-bar {
  margin-bottom: 14px;
}

.task-generation-batch-modal {
  display: grid;
  gap: 14px;
}

.task-generation-batch-toolbar {
  grid-template-columns: minmax(220px, 320px);
  justify-content: start;
}

.task-generation-batch-reason-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.task-generation-batch-reason-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid rgba(89, 139, 201, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 248, 255, 0.88)),
    rgba(255, 255, 255, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 12px 28px rgba(31, 96, 172, 0.08);
}

.task-generation-batch-reason-card.is-active {
  border-color: rgba(31, 118, 227, 0.36);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 18px 34px rgba(31, 96, 172, 0.14);
}

.task-generation-batch-reason-card strong,
.task-generation-batch-reason-card span,
.task-generation-batch-reason-card em {
  display: block;
}

.task-generation-batch-reason-card strong {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}

.task-generation-batch-reason-card span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.task-generation-batch-reason-card em {
  flex: 0 0 auto;
  color: var(--primary-strong);
  font-size: 20px;
  font-style: normal;
  font-weight: 900;
}

.task-generation-batch-action-hint {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.task-execution-date-range {
  min-width: 280px;
}

.task-execution-filter-toolbar {
  grid-template-columns:
    minmax(260px, 1.2fr)
    repeat(2, minmax(0, 170px))
    minmax(250px, 1fr)
    minmax(250px, 1fr)
    auto;
  align-items: end;
}

.task-execution-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.task-execution-summary-card {
  display: grid;
  gap: 8px;
  min-height: 84px;
  padding: 14px 16px;
  border: 1px solid rgba(160, 196, 235, 0.55);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(239, 247, 255, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 14px 28px rgba(36, 91, 168, 0.08);
  align-content: center;
  text-align: center;
}

.task-execution-summary-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.task-execution-summary-card strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.task-execution-summary-card strong.status-bad {
  color: var(--danger);
}

.task-execution-summary-card strong.status-good {
  color: var(--good);
}

.task-execution-summary-card strong.status-info {
  color: #1d6dff;
}

.task-execution-summary-card strong.status-neutral {
  color: #5f7b97;
}

.task-generation-table {
  min-height: 0;
  overflow: auto;
}

.task-generation-table .table-head,
.task-generation-table .table-row {
  --table-min: 1450px;
}

.task-generation-head,
.task-generation-row {
  grid-template-columns:
    44px
    44px
    minmax(166px, 0.72fr)
    minmax(218px, 0.98fr)
    minmax(300px, 1.3fr)
    minmax(166px, 0.98fr)
    minmax(84px, 0.56fr)
    minmax(84px, 0.8fr)
    minmax(112px, 0.7fr)
    minmax(112px, 0.74fr)
    minmax(84px, 0.8fr)
    minmax(148px, 1fr);
}

.task-generation-row span:nth-child(5),
.task-generation-row span:nth-child(6),
.task-generation-row span:nth-child(12) {
  white-space: normal;
  line-height: 1.5;
}

.task-generation-head span,
.task-generation-row span {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.task-generation-batch-head,
.task-generation-batch-row {
  --table-min: 1120px;
  grid-template-columns:
    72px
    minmax(112px, 0.84fr)
    minmax(238px, 1.44fr)
    minmax(186px, 1.12fr)
    minmax(126px, 0.8fr)
    minmax(180px, 1fr)
    minmax(240px, 1.24fr);
}

.task-generation-batch-head span,
.task-generation-batch-row span {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.task-generation-batch-row span:nth-child(3),
.task-generation-batch-row span:nth-child(4),
.task-generation-batch-row span:nth-child(7) {
  white-space: normal;
  line-height: 1.5;
}

.task-generation-actions {
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.task-definition-head,
.task-definition-row {
  grid-template-columns:
    44px
    72px
    minmax(168px, 0.92fr)
    minmax(220px, 1.18fr)
    minmax(132px, 0.76fr)
    minmax(144px, 0.82fr)
    minmax(136px, 0.78fr)
    minmax(126px, 0.72fr)
    minmax(96px, 0.6fr)
    minmax(252px, 1.2fr)
    minmax(104px, 0.68fr)
    minmax(180px, 0.92fr);
}

.task-definition-block {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(241, 248, 255, 0.88)),
    rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.task-definition-block .table-row:last-child {
  border-bottom: 1px solid var(--line);
}

.task-definition-row {
  min-width: 1730px;
}

.task-definition-row span:nth-child(4),
.task-definition-row span:nth-child(10),
.task-definition-row span:nth-child(12) {
  white-space: normal;
  line-height: 1.5;
}

.task-definition-children {
  overflow: hidden;
  background: rgba(244, 249, 255, 0.68);
}

.task-execution-ledger-table {
  flex: 1 1 auto;
  min-height: 0;
}

.task-definition-head,
.task-definition-row,
.task-execution-row,
.task-execution-ledger-head,
.task-execution-ledger-row {
  --table-min: 100%;
  grid-template-columns:
    44px
    44px
    minmax(130px, 0.9fr)
    minmax(240px, 1.64fr)
    minmax(98px, 0.56fr)
    minmax(98px, 0.56fr)
    minmax(98px, 0.58fr)
    minmax(98px, 0.58fr)
    minmax(98px, 0.58fr)
    minmax(98px, 0.58fr)
    minmax(98px, 0.58fr)
    minmax(98px, 0.58fr)
    minmax(148px, 1fr);
}

.task-definition-head,
.task-execution-ledger-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(247, 251, 255, 0.98);
}

.task-definition-head span,
.task-execution-ledger-head span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.task-definition-row,
.task-execution-row,
.task-execution-ledger-row {
  min-height: 62px;
}

.task-execution-left {
  justify-content: center !important;
  text-align: center !important;
}

.task-execution-content-cell {
  display: -webkit-box !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal !important;
  line-height: 1.45;
  align-items: flex-start !important;
}

.task-execution-plan-range {
  flex-direction: column;
  gap: 2px;
  line-height: 1.3;
  white-space: normal !important;
}

.task-rule-detail-stack,
.task-rule-preview-stack,
.task-package-stack {
  display: grid;
  gap: 14px;
}

.task-rule-summary-grid,
.task-rule-preview-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.task-rule-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.task-rule-risk-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.task-rule-form-grid textarea,
.task-rule-form-grid input,
.task-rule-form-grid select {
  width: 100%;
}

.task-rule-summary-grid article,
.task-rule-preview-cards article {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(246, 250, 255, 0.9);
}

.task-rule-summary-grid span,
.task-rule-preview-cards span,
.task-rule-preview-group header span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.task-rule-summary-grid strong,
.task-rule-preview-cards strong,
.task-rule-preview-group header strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.3;
}

.task-rule-preview-group {
  display: grid;
  gap: 10px;
}

.task-rule-preview-group header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.task-rule-checkpoint-list {
  display: grid;
  gap: 10px;
}

.task-rule-checkpoint-list article {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid rgba(88, 127, 177, 0.16);
  border-radius: 16px;
  background: rgba(248, 252, 255, 0.86);
}

.task-rule-checkpoint-list strong {
  color: var(--ink);
  font-size: 14px;
}

.task-rule-checkpoint-list span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.task-preview-table .table-head,
.task-preview-table .table-row {
  --table-min: 960px;
  grid-template-columns: minmax(148px, 0.92fr) minmax(280px, 1.32fr) minmax(98px, 0.58fr) minmax(320px, 1.42fr);
}

.task-package-stack .description-box {
  margin-top: 0;
}

.task-package-stack .description-box {
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(252, 253, 255, 0.98), rgba(240, 247, 255, 0.94)),
    rgba(255, 255, 255, 0.86);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 12px 32px rgba(27, 93, 170, 0.06);
}

.task-evidence-list article em {
  color: var(--primary-strong);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.device-ledger {
  --table-min: 1608px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  overflow: auto;
}

.device-ledger .table-head,
.device-ledger .table-row {
  min-width: var(--table-min, 100%);
  grid-template-columns:
    44px
    44px
    minmax(124px, 0.9fr)
    minmax(124px, 0.9fr)
    minmax(60px, 0.5fr)
    minmax(60px, 0.5fr)
    minmax(60px, 0.5fr)
    minmax(128px, 0.88fr)
    minmax(128px, 0.88fr)
    minmax(128px, 0.88fr)
    minmax(128px, 0.88fr)
    minmax(60px, 0.5fr)
    minmax(128px, 0.88fr);
}

.device-ledger .table-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(247, 251, 255, 0.98);
}

.device-ledger .table-head span,
.device-ledger .table-row span {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.device-ledger .device-ledger-actions-cell,
.device-ledger .device-ledger-actions,
.device-ledger .device-ledger-actions-main {
  display: flex;
}

.device-ledger-id strong,
.device-ledger-model strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
}

.device-ledger-model {
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  line-height: 1.35;
}

.device-ledger-model small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.page-devices .device-ledger .device-ledger-model {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
  height: calc(1.35em * 2) !important;
  min-height: calc(1.35em * 2) !important;
  max-height: calc(1.35em * 2) !important;
  overflow: hidden !important;
}

.page-devices .device-ledger .device-ledger-sn-text,
.page-devices .device-ledger .device-ledger-model-text {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.35;
  text-align: center;
}

.device-ledger-actions-cell {
  justify-content: flex-end !important;
  align-items: center !important;
  overflow: visible !important;
  min-width: 132px;
}

.device-ledger-actions {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  overflow: visible;
}

.device-ledger-actions-main {
  justify-content: flex-end;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 116px;
  overflow: visible;
}

.device-ledger-actions-cell,
.device-ledger-actions,
.device-ledger-actions-main,
.device-more-menu {
  white-space: nowrap;
}

.device-ledger-actions .small-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.device-more-menu {
  position: relative;
  display: inline-flex;
  overflow: visible;
}

.row-action-menu {
  position: relative;
  display: inline-flex;
  flex: 0 0 30px;
  overflow: visible;
}

.device-more-menu summary {
  list-style: none;
}

.device-more-menu summary::-webkit-details-marker {
  display: none;
}

.device-more-menu[open] > .small-button,
.row-action-menu[open] > .row-action-trigger {
  border-color: rgba(29, 125, 255, 0.28);
}

.device-more-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 12;
  display: grid;
  gap: 8px;
  min-width: 100%;
  padding: 10px;
  border: 1px solid rgba(88, 127, 177, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 36px rgba(20, 61, 116, 0.12);
  backdrop-filter: blur(18px);
}

.row-action-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 12;
  display: grid;
  gap: 8px;
  min-width: 148px;
  padding: 10px;
  border: 1px solid rgba(88, 127, 177, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 36px rgba(20, 61, 116, 0.12);
  backdrop-filter: blur(18px);
}

.device-ledger .table-row span,
.device-ledger .table-head span {
  min-width: 0;
}

.device-ledger .table-row span {
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-ledger > .table-empty {
  min-width: var(--table-min, 100%);
  min-height: 100%;
}

.device-more-dropdown .btn-ghost {
  width: 100%;
  min-height: 32px;
  justify-content: center;
}

.device-more-option {
  width: 100%;
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  justify-content: center;
}

.row-action-dropdown .small-button,
.row-action-dropdown .btn-ghost {
  width: 100%;
  min-height: 30px;
  justify-content: center;
}

.device-table-empty {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status.status-good {
  color: #0f7a51;
  border-color: rgba(24, 169, 112, 0.2);
  background: rgba(230, 249, 240, 0.92);
}

.status.status-warn {
  color: #a56705;
  border-color: rgba(222, 143, 24, 0.24);
  background: rgba(255, 245, 220, 0.92);
}

.status.status-danger {
  color: #b33a41;
  border-color: rgba(229, 72, 77, 0.22);
  background: rgba(255, 236, 238, 0.94);
}

.status.status-neutral {
  color: #37618b;
  border-color: rgba(96, 144, 205, 0.18);
  background: rgba(237, 245, 255, 0.9);
}

.confirm-stack {
  display: grid;
  gap: 16px;
}

.confirm-card {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid rgba(88, 127, 177, 0.18);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(252, 253, 255, 0.98), rgba(241, 247, 255, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.confirm-card strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
}

.confirm-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.device-qr-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(88, 127, 177, 0.18);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(250, 252, 255, 0.98), rgba(238, 246, 255, 0.94));
}

.device-qr-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 164px;
  height: 164px;
  padding: 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(88, 127, 177, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.device-qr-box svg {
  display: block;
  width: 100%;
  height: 100%;
}

.device-qr-fallback {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.device-qr-meta {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.device-qr-meta strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
  word-break: break-all;
}

.device-qr-meta span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  word-break: break-all;
}

.device-qr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-provider-table .table-head,
.ai-provider-table .table-row {
  grid-template-columns: 0.8fr 1fr 0.92fr 0.56fr 0.56fr 0.56fr 0.66fr;
}

.ai-rule-table .table-head,
.ai-rule-table .table-row {
  grid-template-columns: 1.15fr 0.95fr 0.95fr 0.52fr 0.88fr 0.5fr;
}

.event-table .table-head,
.event-table .table-row {
  grid-template-columns: 44px 0.95fr 0.85fr 0.82fr 0.8fr 0.88fr 1fr 0.52fr 0.55fr 0.7fr 0.8fr 0.8fr 0.76fr;
}

.audit-table .table-head,
.audit-table .table-row {
  grid-template-columns: 0.92fr 0.9fr 0.7fr 0.7fr 0.7fr 0.6fr 0.65fr 1.2fr;
}

.rectification-table .table-head,
.rectification-table .table-row {
  --table-min: 1180px;
  grid-template-columns: 0.92fr 0.86fr 0.92fr 0.75fr 0.75fr 0.7fr 0.65fr 0.68fr 0.62fr;
}

.media-table .table-head,
.media-table .table-row {
  --table-min: 1240px;
  grid-template-columns: 0.8fr 0.8fr 1.15fr 0.62fr 0.7fr 0.66fr 0.8fr 0.8fr 0.75fr 0.55fr;
}

.document-table .table-head,
.document-table .table-row {
  --table-min: 1060px;
  grid-template-columns: 0.72fr 0.9fr 0.9fr 0.82fr 1.68fr 0.55fr;
}

.user-table .table-head,
.user-table .table-row {
  grid-template-columns: 0.72fr 0.9fr 0.9fr 1.18fr 0.72fr 0.6fr;
}

.user-management-table .table-head,
.user-management-table .table-row {
  --table-min: 1320px;
  grid-template-columns: 44px 0.5fr 0.72fr 0.82fr 0.88fr 0.9fr 1fr 1.08fr 0.9fr 0.88fr 0.62fr 0.9fr;
}

.role-table .table-head,
.role-table .table-row {
  --table-min: 1240px;
  grid-template-columns: 44px 0.5fr 0.96fr 1fr 0.84fr 1fr 1.28fr 0.72fr 0.64fr 0.92fr;
}

.log-table .table-head,
.log-table .table-row {
  --table-min: 1080px;
  grid-template-columns: 44px 0.58fr 0.6fr 0.86fr 0.68fr 0.8fr 0.56fr 1.92fr 0.52fr 0.62fr;
}

.settings-table .table-head,
.settings-table .table-row {
  --table-min: 1320px;
  grid-template-columns: 44px 0.46fr 1.24fr 1.04fr 0.82fr 1.12fr 0.5fr 0.56fr 0.56fr 0.66fr 0.82fr 0.86fr;
}

.contract-table .table-head,
.contract-table .table-row {
  --table-min: 1160px;
  grid-template-columns: 0.62fr 0.86fr 1.3fr 1.55fr 0.86fr;
}

.architecture-shell {
  gap: 18px;
}

.architecture-hero {
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 0%, rgba(127, 217, 255, 0.18), transparent 28%),
    radial-gradient(circle at 90% 8%, rgba(29, 125, 255, 0.12), transparent 28%),
    rgba(255, 255, 255, 0.88);
}

.architecture-stack {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.architecture-stack article,
.build-order-list article,
.module-grid article,
.sync-flow-grid article,
.rule-ledger article {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(248, 252, 255, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.architecture-stack article {
  min-height: 170px;
  align-content: start;
  padding: 16px;
  border-radius: 18px;
}

.architecture-stack span,
.module-grid span,
.sync-flow-grid span,
.rule-ledger span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.architecture-stack strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
}

.architecture-stack p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.build-order-list,
.sync-flow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.build-order-list article,
.sync-flow-grid article {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  min-height: 112px;
  padding: 14px;
  border-radius: 17px;
}

.build-order-list b,
.sync-flow-grid b {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  font-size: 13px;
}

.build-order-list strong,
.sync-flow-grid strong {
  color: var(--ink);
  font-size: 16px;
}

.build-order-list span,
.sync-flow-grid span,
.sync-flow-grid em {
  grid-column: 2;
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
  line-height: 1.45;
}

.sync-flow-grid em {
  color: var(--primary-strong);
  font-weight: 800;
}

.module-grid,
.rule-ledger {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.module-grid article,
.rule-ledger article {
  min-height: 96px;
  padding: 14px;
  border-radius: 16px;
}

.module-grid strong,
.rule-ledger strong {
  color: var(--ink);
  font-size: 16px;
}

.rule-ledger {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.table-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  min-width: 116px;
  min-height: 34px;
}

.role-filter-toolbar {
  margin-bottom: 14px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-grid div,
.description-box,
.document-preview,
.evidence-preview {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(244, 249, 255, 0.88);
}

.detail-grid span,
.description-box span,
.evidence-preview-meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-grid strong {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.description-box {
  margin-top: 12px;
}

.description-box p,
.document-preview p {
  margin-top: 8px;
  color: var(--ink);
  line-height: 1.6;
}

.permission-section {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.permission-group-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(91, 141, 209, 0.2);
  border-radius: 18px;
  background: rgba(247, 251, 255, 0.88);
}

.permission-group-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.permission-group-card header strong {
  color: var(--ink);
  font-size: 15px;
}

.permission-group-card header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

button:disabled,
.small-button:disabled,
.btn-ghost:disabled,
.btn-new:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
}

.workflow-mini {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0 14px;
}

.workflow-mini span,
.flow-rail span {
  display: grid;
  min-height: 30px;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  font-size: 12px;
}

.workflow-mini span.active,
.flow-rail span.active {
  color: #fff;
  border-color: rgba(29, 125, 255, 0.22);
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.flow-rail {
  display: grid;
  gap: 8px;
  margin: 12px 0 14px;
}

.video-wall {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.video-tile {
  border-radius: 20px;
  background: rgba(4, 20, 39, 0.64);
}

.video-scene {
  position: relative;
  min-height: 260px;
  padding: 16px;
}

.video-scene::after,
.command-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 17, 34, 0.1), rgba(5, 17, 34, 0.72));
}

.video-scene strong {
  left: 16px;
  bottom: 62px;
  color: #fff;
  font-size: 28px;
}

.video-scene p,
.video-scene small {
  left: 16px;
  right: 16px;
  margin: 0;
  color: rgba(237, 247, 255, 0.82);
}

.video-scene p {
  bottom: 38px;
}

.video-scene small {
  bottom: 16px;
  font-size: 12px;
}

.record-dot {
  top: 16px;
  right: 16px;
  background: var(--danger);
}

.video-tile footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
}

.video-tile footer em {
  font-style: normal;
}

.live-shell {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  align-content: stretch;
  grid-template-rows: auto minmax(0, 1fr);
}

.nine-grid-shell {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.live-module-topbar,
.live-summary-strip,
.live-command-layout,
.nine-grid-summary-strip,
.nine-grid-info-card {
  display: grid;
  gap: 16px;
}

.live-module-topbar {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 16px 18px;
}

.live-module-title,
.live-module-mode,
.live-segmented,
.live-chip-row,
.live-viewer-controls,
.live-viewer-center-actions,
.nine-grid-focus-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.live-quality-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 8px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  font-weight: 700;
}

.live-quality-control input,
.live-quality-control select {
  width: 68px;
  min-height: 26px;
  padding: 0 4px;
  color: var(--ink);
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 800;
}

.live-quality-control select {
  width: 58px;
}

.live-quality-control em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.live-quality-note {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.live-module-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.live-segmented button,
.nine-grid-focus-tab {
  min-height: 36px;
  padding: 0 14px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  font-weight: 700;
}

.live-segmented button.active,
.nine-grid-focus-tab.active {
  color: #fff;
  border-color: rgba(29, 125, 255, 0.22);
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.live-module-mode {
  justify-content: flex-end;
}

.live-module-title strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.live-module-title span,
.live-pane-header span,
.live-summary-card em,
.live-device-card-body p,
.live-device-meta span,
.live-empty-state p,
.live-viewer-center-copy p,
.live-location-grid span,
.live-timeline-head span,
.live-timeline-copy p,
.nine-grid-device-copy span,
.nine-grid-placeholder span {
  color: var(--muted);
}

.live-summary-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.live-summary-card {
  display: grid;
  gap: 8px;
  min-height: 110px;
  padding: 16px 18px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.live-summary-card span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.live-summary-card strong {
  color: var(--ink);
  font-size: 30px;
  line-height: 1;
}

.live-summary-card em {
  font-style: normal;
  font-size: 12px;
}

.live-command-layout {
  grid-template-columns: minmax(280px, 2fr) minmax(0, 5fr) minmax(300px, 2fr);
  grid-template-areas: "devices viewer detail";
  align-items: stretch;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.live-device-pane,
.live-viewer-pane,
.live-detail-pane,
.nine-grid-toolbar-panel,
.nine-grid-stage-panel,
.nine-grid-info-strip {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.live-device-pane {
  grid-area: devices;
}

.live-viewer-pane {
  grid-area: viewer;
}

.live-detail-pane {
  grid-area: detail;
}

.live-device-pane,
.live-viewer-pane,
.live-detail-pane {
  height: 100%;
  min-height: 0;
}

.live-viewer-pane.expanded {
  box-shadow: 0 26px 80px rgba(16, 72, 140, 0.2);
}

.live-pane-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 14px;
}

.live-pane-header strong,
.live-empty-state strong,
.live-viewer-center-copy strong,
.live-detail-section header strong,
.nine-grid-placeholder strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

.live-pane-header span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
}

.live-device-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 0 18px 16px;
}

.live-device-toolbar .live-filter-field:first-child {
  grid-column: 1 / -1;
}

.live-filter-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.live-filter-field.live-filter-inline {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.live-filter-field span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.live-filter-field.live-filter-inline .query-native-input,
.live-filter-field.live-filter-inline .query-native-select {
  min-width: 0;
  width: 100%;
}

.live-device-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.live-pane-scroll {
  min-height: 0;
  overflow: auto;
}

.live-device-scroll,
.live-detail-scroll {
  padding: 0 18px 18px;
}

.live-device-group {
  display: grid;
  gap: 12px;
}

.live-device-group + .live-device-group {
  margin-top: 18px;
}

.live-device-group > header {
  display: contents;
}

.live-device-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  font-weight: 800;
  text-align: left;
}

.live-device-group-toggle strong,
.live-detail-section header strong {
  font-size: 18px;
}

.live-device-group-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.live-device-group-right span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.live-device-group-icon {
  color: var(--primary-strong);
  font-size: 18px;
  font-style: normal;
  line-height: 1;
}

.live-device-list {
  display: grid;
  gap: 12px;
}

.live-device-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  width: 100%;
  padding: 10px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(250, 253, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.live-device-card.selected {
  border-color: rgba(29, 125, 255, 0.42);
  box-shadow: 0 14px 40px rgba(18, 88, 164, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.live-device-preview,
.live-video-frame,
.nine-grid-video-frame {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #d7ecff;
}

.live-device-preview {
  min-height: 92px;
}

.live-device-preview img,
.live-video-frame img,
.nine-grid-video-frame img,
.nine-grid-video-frame video,
.live-video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live-stream-info {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  width: min(320px, calc(100% - 24px));
  overflow: hidden;
  color: #f8fbff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(9, 23, 37, 0.9);
  box-shadow: 0 8px 24px rgba(3, 14, 25, 0.2);
}

.live-stream-info header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 32px;
  padding-left: 10px;
}

.live-stream-info header span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 800;
}

.live-stream-info header button {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  color: #fff;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.live-stream-info header button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: transform 160ms ease;
}

.live-stream-info.is-expanded header button svg {
  transform: rotate(90deg);
}

.live-stream-info-body {
  display: grid;
  gap: 4px;
  padding: 0 10px 10px;
}

.live-stream-info-body strong {
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.live-stream-info-body span {
  color: rgba(238, 247, 255, 0.78);
  font-size: 11px;
  line-height: 1.35;
}

.live-stream-info.is-collapsed {
  width: 36px;
}

.live-stream-info.is-collapsed header {
  padding-left: 0;
}

.live-stream-info.is-collapsed header span,
.live-stream-info.is-collapsed .live-stream-info-body {
  display: none;
}

.live-preview-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 1;
  padding: 4px 8px;
  color: #fff;
  border-radius: 999px;
  background: rgba(8, 31, 58, 0.74);
  font-size: 11px;
  font-weight: 800;
}

.live-device-card-body,
.live-viewer-stage,
.live-empty-state,
.live-viewer-center-copy,
.live-detail-section,
.live-location-card,
.live-timeline,
.live-timeline-item,
.nine-grid-device-card,
.nine-grid-device-copy,
.nine-grid-placeholder {
  display: grid;
  gap: 10px;
}

.live-device-card-body {
  align-content: center;
  min-width: 0;
}

.live-device-card-body p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.live-device-title-row,
.live-device-meta,
.live-timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.live-device-title-row strong,
.live-video-overlay strong,
.live-location-card strong,
.nine-grid-device-copy strong,
.nine-grid-tile-overlay strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.live-device-title-row span,
.live-device-meta span,
.live-timeline-head span {
  font-size: 12px;
  font-weight: 700;
}

.live-device-meta-holder span:first-child {
  color: var(--ink);
}

.live-device-meta {
  align-items: flex-start;
}

.live-device-meta span {
  color: var(--muted);
  line-height: 1.45;
}

.live-chip-row {
  gap: 8px;
}

.live-risk-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.live-risk-high {
  color: #b82d35;
  border-color: rgba(229, 72, 77, 0.2);
  background: rgba(229, 72, 77, 0.12);
}

.live-risk-mid {
  color: #9a5d08;
  border-color: rgba(241, 163, 58, 0.22);
  background: rgba(241, 163, 58, 0.14);
}

.live-risk-low {
  color: #0e5dd7;
  border-color: rgba(29, 125, 255, 0.22);
  background: rgba(29, 125, 255, 0.12);
}

.live-risk-ok {
  color: #0f7a51;
  border-color: rgba(24, 169, 112, 0.22);
  background: rgba(24, 169, 112, 0.12);
}

.live-risk-neutral {
  color: #5c7086;
  border-color: rgba(122, 142, 168, 0.22);
  background: rgba(122, 142, 168, 0.12);
}

.live-viewer-stage {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 18px;
}

.live-video-frame {
  min-height: 300px;
  height: 100%;
}

.live-video-frame::after,
.nine-grid-video-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(5, 24, 46, 0.62));
}

.live-video-overlay,
.nine-grid-tile-overlay {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  display: grid;
  gap: 8px;
}

.live-video-overlay strong,
.nine-grid-tile-overlay strong {
  color: #fff;
}

.live-video-overlay span,
.nine-grid-tile-overlay span {
  color: rgba(237, 247, 255, 0.82);
  font-size: 13px;
}

.live-viewer-center-copy {
  position: absolute;
  inset: 0;
  z-index: 2;
  align-content: center;
  justify-items: center;
  padding: 24px;
  text-align: center;
}

.live-viewer-center-copy strong {
  color: #fff;
  font-size: 24px;
}

.live-viewer-center-copy p {
  max-width: 560px;
  color: rgba(237, 247, 255, 0.82);
  line-height: 1.65;
}

.live-empty-state {
  min-height: 320px;
  place-items: center;
  align-content: center;
  padding: 24px;
  text-align: center;
}

.live-empty-side {
  min-height: 240px;
}

.live-empty-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  color: var(--primary-strong);
  border: 1px solid rgba(29, 125, 255, 0.18);
  border-radius: 18px;
  background: rgba(29, 125, 255, 0.1);
}

.live-empty-icon svg {
  width: 22px;
  height: 22px;
}

.live-diagnostics-panel,
.live-detail-meta-grid,
.live-chain-panel,
.live-location-grid,
.nine-grid-info-card {
  display: grid;
  gap: 12px;
}

.live-diagnostics-panel {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 14px 18px 0;
}

.live-diagnostics-panel article,
.live-detail-meta-grid article,
.nine-grid-info-card article {
  display: grid;
  gap: 6px;
  min-height: 78px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(248, 251, 255, 0.88);
}

.live-diagnostics-panel span,
.live-detail-meta-grid span,
.nine-grid-info-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.live-diagnostics-panel strong,
.live-detail-meta-grid strong,
.live-chain-panel strong,
.nine-grid-info-card strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
}

.live-chain-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 640px;
}

.live-chain-strip article,
.live-chain-panel article {
  display: grid;
  gap: 6px;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(7, 24, 45, 0.34);
  backdrop-filter: blur(12px);
}

.live-chain-strip span,
.live-chain-panel span {
  color: rgba(237, 247, 255, 0.74);
  font-size: 12px;
  font-weight: 700;
}

.live-chain-strip strong {
  color: #fff;
  font-size: 15px;
  line-height: 1.35;
}

.live-chain-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.live-chain-log {
  display: grid;
  gap: 10px;
}

.live-chain-log-item {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(248, 251, 255, 0.88);
}

.live-chain-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.live-chain-log-head strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.live-chain-log-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.live-chain-log-item p {
  margin: 0;
  color: var(--ink);
  line-height: 1.6;
}

.live-video-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 18px 18px;
}

.live-video-toolbar .small-button.danger {
  color: #b4232d;
  border-color: rgba(180, 35, 45, 0.28);
  background: rgba(180, 35, 45, 0.07);
}

.live-video-toolbar.hidden {
  display: none;
}

.live-detail-scroll {
  display: grid;
  gap: 14px;
}

.live-detail-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(250, 253, 255, 0.9);
}

.live-detail-section header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.live-detail-meta-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.live-detail-strip,
.live-detail-long-copy {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(248, 251, 255, 0.88);
}

.live-detail-strip span,
.live-detail-long-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.live-detail-strip strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-detail-long-copy p {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
}

.live-progress-rail {
  display: grid;
  gap: 8px;
}

.live-progress-rail span {
  display: grid;
  min-height: 34px;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  font-weight: 700;
}

.live-progress-rail span.active {
  color: #fff;
  border-color: rgba(29, 125, 255, 0.22);
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
}

.live-location-card {
  padding: 14px;
  border: 1px solid rgba(29, 125, 255, 0.16);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(29, 125, 255, 0.08), rgba(127, 217, 255, 0.08));
}

.live-location-grid {
  grid-template-columns: 1fr;
}

.live-timeline {
  position: relative;
  padding-left: 10px;
}

.live-timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: rgba(88, 127, 177, 0.28);
}

.live-timeline-item {
  position: relative;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.live-timeline-dot {
  width: 12px;
  height: 12px;
  margin-top: 6px;
  border: 2px solid rgba(29, 125, 255, 0.18);
  border-radius: 999px;
  background: rgba(29, 125, 255, 0.92);
  box-shadow: 0 0 0 5px rgba(29, 125, 255, 0.08);
}

.live-timeline-copy {
  gap: 8px;
  padding-bottom: 14px;
}

.live-timeline-copy p {
  margin: 0;
  line-height: 1.6;
}

.live-empty-inline {
  padding: 14px;
  color: var(--muted);
  border: 1px dashed rgba(88, 127, 177, 0.28);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  text-align: center;
  font-size: 13px;
}

.nine-grid-shell {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.nine-grid-toolbar-panel,
.nine-grid-info-strip {
  padding-bottom: 18px;
}

.nine-grid-summary-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0 18px 18px;
}

.nine-grid-device-pool {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 220px);
  gap: 12px;
  padding: 0 18px 18px;
  overflow-x: auto;
}

.nine-grid-device-card {
  grid-template-rows: 112px auto auto;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(250, 253, 255, 0.9);
}

.nine-grid-device-card.selected {
  border-color: rgba(29, 125, 255, 0.42);
}

.nine-grid-device-card img {
  width: 100%;
  height: 112px;
  object-fit: cover;
  border-radius: 14px;
}

.nine-grid-device-copy strong,
.nine-grid-device-copy span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nine-grid-stage-panel {
  min-height: 520px;
  padding: 18px;
}

.nine-grid-stage {
  display: grid;
  flex: 1 1 auto;
  min-height: 0;
  gap: 14px;
}

.nine-grid-stage.mode-1 {
  grid-template-columns: minmax(0, 1fr);
}

.nine-grid-stage.mode-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.nine-grid-stage.mode-9 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.nine-grid-tile,
.nine-grid-placeholder {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(248, 251, 255, 0.86);
}

.nine-grid-tile.focused {
  border-color: rgba(29, 125, 255, 0.42);
  box-shadow: 0 18px 48px rgba(18, 88, 164, 0.16);
}

.nine-grid-tile.offline .nine-grid-video-frame::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(5, 24, 46, 0.78));
}

.nine-grid-focus-layer {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

.nine-grid-video-frame {
  width: 100%;
  height: 100%;
}

.nine-grid-remove-button {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  min-height: 32px;
  padding: 0 12px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(8, 31, 58, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.nine-grid-placeholder {
  place-items: center;
  align-content: center;
  padding: 18px;
  text-align: center;
}

.nine-grid-info-strip {
  gap: 12px;
}

.nine-grid-focus-tabs {
  padding: 0 18px;
}

.nine-grid-info-card {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0 18px;
}

.nine-grid-info-card .span-2 {
  grid-column: span 2;
}

.evidence-preview {
  overflow: hidden;
}

.evidence-preview {
  position: relative;
  min-height: 220px;
  padding: 0;
}

.evidence-preview-meta {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  display: grid;
  gap: 6px;
  padding: 12px;
  color: #fff;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(10, 31, 58, 0.18), rgba(10, 31, 58, 0.76));
}

.task-stage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.task-stage-grid article,
.task-record-card,
.task-evidence-list article,
.task-doc-list article,
.violation-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(244, 249, 255, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.task-stage-grid article {
  display: grid;
  gap: 6px;
  min-height: 102px;
  padding: 14px;
}

.task-stage-grid span,
.task-record-meta span,
.violation-shot-overlay span,
.violation-context-grid span,
.task-evidence-list span {
  color: var(--muted);
  font-size: 12px;
}

.task-stage-grid strong {
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
}

.task-stage-grid small {
  color: var(--muted);
  line-height: 1.45;
}

.task-record-stream {
  display: grid;
  gap: 10px;
}

.task-record-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
  padding: 12px;
}

.task-record-thumb {
  position: relative;
  min-height: 126px;
  overflow: hidden;
  border-radius: 14px;
  background: #dfeeff;
}

.task-record-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.task-record-copy {
  display: grid;
  align-content: center;
  gap: 6px;
  min-width: 0;
}

.task-record-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.task-record-meta em,
.violation-shot-overlay em {
  color: var(--primary-strong);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.task-record-copy strong,
.violation-copy strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
}

.task-record-copy p,
.violation-copy p,
.task-doc-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.task-execution-ledger {
  grid-template-columns: minmax(0, 1fr);
}

.task-execution-chain-view {
  display: grid;
  gap: 18px;
}

.task-execution-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.task-execution-flow-node {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 16px 12px 14px;
  border-radius: 20px;
  border: 1px solid rgba(177, 205, 235, 0.58);
  background: rgba(245, 250, 255, 0.9);
  color: var(--ink);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.task-execution-flow-node strong,
.task-execution-node-detail header strong,
.task-execution-history-box header strong,
.task-execution-scene-box header strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}

.task-execution-flow-node em {
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

.task-execution-flow-dot {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(214, 227, 245, 0.9);
  color: var(--primary-strong);
  font-size: 15px;
  font-weight: 900;
}

.task-execution-flow-node.is-completed {
  border-color: rgba(74, 136, 232, 0.42);
  background: linear-gradient(180deg, rgba(233, 243, 255, 0.98), rgba(242, 247, 255, 0.95));
}

.task-execution-flow-node.is-completed .task-execution-flow-dot {
  background: linear-gradient(180deg, rgba(32, 111, 220, 0.96), rgba(83, 158, 241, 0.9));
  color: #fff;
  box-shadow: 0 10px 20px rgba(32, 111, 220, 0.18);
}

.task-execution-flow-node.is-current {
  border-color: rgba(32, 111, 220, 0.56);
  background: linear-gradient(180deg, rgba(234, 244, 255, 1), rgba(245, 250, 255, 0.98));
  box-shadow: 0 14px 28px rgba(32, 111, 220, 0.12);
  transform: translateY(-2px);
}

.task-execution-flow-node.is-current .task-execution-flow-dot {
  background: linear-gradient(180deg, rgba(32, 111, 220, 0.96), rgba(83, 158, 241, 0.9));
  color: #fff;
  box-shadow: 0 12px 24px rgba(32, 111, 220, 0.24);
}

.task-execution-flow-node.is-pending {
  opacity: 0.72;
}

.task-execution-node-detail,
.task-execution-history-box,
.task-execution-scene-box {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid rgba(177, 205, 235, 0.58);
  background: rgba(245, 250, 255, 0.92);
}

.task-execution-node-detail header,
.task-execution-history-box header,
.task-execution-scene-box header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.task-execution-node-detail header span,
.task-execution-history-box header span,
.task-execution-scene-box header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.task-execution-scene-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.task-execution-scene-grid article,
.task-execution-history-list article {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(177, 205, 235, 0.52);
  background: rgba(255, 255, 255, 0.72);
}

.task-execution-scene-grid article span,
.task-execution-scene-item span,
.task-execution-history-list article span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task-execution-scene-grid article strong,
.task-execution-scene-item b,
.task-execution-history-list article strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.task-execution-scene-list,
.task-execution-history-list {
  display: grid;
  gap: 10px;
}

.task-execution-scene-item {
  display: grid;
  gap: 4px;
}

@media (max-width: 1200px) {
  .task-execution-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .task-execution-scene-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .task-execution-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.task-output-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(320px, 0.86fr);
  gap: 14px;
}

.task-output-side,
.task-evidence-list,
.task-doc-list {
  display: grid;
  gap: 10px;
}

.task-evidence-list article,
.task-doc-list article {
  display: grid;
  gap: 6px;
  padding: 14px;
}

.task-evidence-list em {
  color: var(--primary-strong);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.task-doc-list strong {
  color: var(--ink);
  font-size: 16px;
}

.violation-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.violation-source-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.violation-source-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(244, 249, 255, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.violation-source-pill span {
  color: var(--muted);
  font-size: 13px;
}

.violation-source-pill strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.violation-source-pill.active {
  border-color: rgba(29, 125, 255, 0.3);
  background: linear-gradient(180deg, rgba(232, 243, 255, 0.98), rgba(244, 249, 255, 0.9));
  box-shadow: 0 14px 28px rgba(29, 125, 255, 0.1);
}

.violation-card.selected {
  border-color: rgba(29, 125, 255, 0.34);
  box-shadow: 0 14px 30px rgba(29, 125, 255, 0.12);
}

.violation-card-main {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  width: 100%;
  padding: 14px;
  border: 0;
  background: transparent;
  text-align: left;
}

.violation-shot,
.violation-focus-media {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #dfeeff;
}

.violation-shot {
  min-height: 248px;
}

.violation-shot img,
.violation-focus-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.violation-shot-overlay,
.violation-focus-caption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  color: #fff;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(10, 31, 58, 0.2), rgba(10, 31, 58, 0.78));
}

.violation-copy {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.violation-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.violation-context-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.violation-context-grid div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.66);
}

.violation-context-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 14px;
}

.violation-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 14px;
}

.violation-focus-shell {
  grid-template-columns: minmax(0, 1fr);
}

.violation-focus-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 16px;
  align-items: stretch;
}

.violation-focus-media {
  min-height: 480px;
}

.violation-focus-copy {
  display: grid;
  align-content: start;
  gap: 12px;
}

.violation-focus-topline {
  display: grid;
  gap: 10px;
}

.violation-focus-topline strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1.15;
}

.violation-context-grid-wide {
  gap: 12px;
}

.permission-matrix {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.permission-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(91, 141, 209, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
}

.permission-chip input {
  width: 16px;
  height: 16px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at top, rgba(152, 207, 255, 0.45), transparent 32%),
    linear-gradient(180deg, #f7fbff 0%, #edf6ff 100%);
}

.login-panel {
  width: min(520px, 100%);
  display: grid;
  gap: 24px;
  padding: 32px;
  border: 1px solid rgba(145, 187, 237, 0.42);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 248, 255, 0.92));
  box-shadow: 0 30px 80px rgba(21, 68, 130, 0.16);
  backdrop-filter: blur(18px);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.login-brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  flex: 0 0 auto;
  color: #0c2c52;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(147, 210, 255, 0.84));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 14px 28px rgba(41, 98, 177, 0.18);
}

.login-brand-copy {
  display: grid;
  gap: 4px;
}

.login-brand-copy h1 {
  margin: 0;
  font-size: 30px;
  color: var(--ink);
}

.login-brand-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-mode-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 4px; border-radius: 12px; background: rgba(220, 235, 252, .7); }
.login-mode-tabs button, .login-link-button { border: 0; background: transparent; color: var(--muted); min-height: 36px; border-radius: 9px; cursor: pointer; font: inherit; }
.login-mode-tabs button.active { background: #fff; color: var(--primary-strong); box-shadow: 0 3px 10px rgba(30, 90, 150, .12); font-weight: 600; }
.login-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.login-code-row input { min-width: 0; min-height: 44px; padding: 0 14px; border: 1px solid rgba(96, 144, 205, .24); border-radius: 14px; background: rgba(255,255,255,.92); font: inherit; }
.login-code-row button { min-width: 106px; border: 1px solid rgba(96,144,205,.28); border-radius: 12px; background: #eef6ff; color: var(--primary-strong); cursor: pointer; font: inherit; }
.login-code-row button:disabled { opacity: .55; cursor: wait; }
.login-link-button { min-height: 30px; color: var(--primary-strong); font-size: 13px; }

.login-field,
.form-field {
  display: grid;
  gap: 8px;
}

.login-field span,
.form-field span {
  font-size: 13px;
  color: var(--muted);
}

.login-field input,
.form-field input,
.form-field select,
.form-field textarea,
.query-native-input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(96, 144, 205, 0.24);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font: inherit;
}


.form-field textarea {
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
}

.login-submit,
.login-submit-button {
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  box-shadow: 0 16px 28px rgba(29, 125, 255, 0.22);
  font-size: 15px;
  font-weight: 600;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.login-submit-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(29, 125, 255, 0.26);
}

.login-submit-button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
  box-shadow: none;
}

.login-error {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(229, 72, 77, 0.1);
  color: var(--danger);
  font-size: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-field-span {
  grid-column: 1 / -1;
}

.form-field-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(96, 144, 205, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
}

.form-field-check input {
  width: 16px;
  height: 16px;
}

.tenant-logout {
  margin-top: 12px;
  width: 100%;
  justify-content: center;
}

.permission-head,
.permission-row {
  display: grid;
  grid-template-columns: 130px repeat(9, 92px);
  align-items: center;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
}

.permission-head {
  color: var(--muted);
  background: rgba(52, 91, 146, 0.05);
  font-size: 12px;
}

.permission-head span,
.permission-row strong,
.permission-row span {
  padding: 0 10px;
  text-align: center;
}

.permission-row strong {
  text-align: left;
}

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

.allow {
  color: var(--good);
  font-weight: 900;
}

.deny {
  color: var(--danger);
  font-weight: 900;
}

.document-preview h4 {
  font-size: 18px;
}

.empty-state-inline {
  padding: 14px;
  color: var(--muted);
  font-size: 14px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  max-width: 420px;
  padding: 14px 18px;
  color: #fff;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  box-shadow: 0 20px 36px rgba(29, 125, 255, 0.24);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(7, 20, 38, 0.42);
  backdrop-filter: blur(10px);
}

.ledger-modal {
  width: min(860px, 96vw);
  max-height: min(760px, 92vh);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(237, 247, 255, 0.92)),
    var(--surface);
  box-shadow: 0 32px 90px rgba(9, 31, 62, 0.28);
}

.workplan-ledger-modal {
  width: min(1180px, 96vw);
  max-height: min(860px, 94vh);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3,
.modal-head p {
  margin: 0;
}

.modal-head h3 {
  font-size: 26px;
  line-height: 1.15;
}

.modal-head p {
  margin-top: 6px;
  color: var(--muted);
}

.modal-close-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  font-size: 22px;
  line-height: 1;
}

.modal-body {
  display: grid;
  gap: 14px;
  max-height: 520px;
  overflow: auto;
  padding: 18px 24px;
}

.workplan-ledger-modal .modal-body {
  max-height: 650px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 22px;
  border-top: 1px solid var(--line);
  position: relative;
  z-index: 1;
}

.modal-detail-grid {
  margin: 0;
}

.workplan-ledger-modal .modal-detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workplan-ledger-modal .detail-grid strong {
  overflow: visible;
  text-overflow: initial;
  white-space: normal;
  line-height: 1.5;
}

.workplan-modal-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.workplan-modal-summary article {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(52, 144, 232, 0.18);
  border-radius: 16px;
  background: rgba(244, 249, 255, 0.9);
}

.workplan-modal-summary span,
.workplan-long-text span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.workplan-modal-summary strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
}

.workplan-modal-summary em {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-style: normal;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.35;
}

.workplan-long-text p {
  white-space: normal;
  word-break: break-word;
}

.modal-evidence {
  min-height: 280px;
}

@media (max-width: 1280px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .command-ops-grid {
    grid-template-columns: 1fr;
  }

  .command-live-wall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dense-bento {
    grid-auto-rows: 154px;
  }

  .query-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .workplan-filter-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-rule-filter-toolbar,
  .task-execution-filter-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .query-field-date-range {
    grid-column: span 2;
  }

  .task-execution-date-range {
    min-width: 0;
  }

  .task-rule-summary-grid,
  .task-rule-preview-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-rule-risk-group {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-rule-node-form-grid,
  .task-risk-form-grid {
    grid-template-columns: 1fr;
  }

  .task-execution-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .live-command-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "viewer viewer"
      "devices detail";
    height: auto;
    overflow: visible;
  }

  .live-device-pane,
  .live-detail-pane,
  .live-viewer-pane {
    height: auto;
    min-height: 0;
  }

  .live-viewer-pane {
    min-height: 420px;
  }
}

@media (max-width: 900px) {
  .login-shell {
    padding: 18px;
  }

  .login-panel {
    padding: 24px 18px;
  }

  .app-shell {
    display: block;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar-nav-groups {
    gap: 10px;
    overflow: visible;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
  }

  .nav-item {
    flex: 0 0 auto;
  }

  .main-panel {
    padding: 14px;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .content-grid {
    height: auto;
    overflow: visible;
  }

  .topbar,
  .panel-header,
  .top-actions,
  .hero-actions,
  .button-row,
  .footer-actions,
  .action-stage,
  .desire-stage {
    flex-direction: column;
    align-items: stretch;
  }

  .experience-nav {
    grid-template-columns: 1fr;
    width: calc(100% - 28px);
    border-radius: 22px;
    padding: 14px;
  }

  .hero-stage {
    padding: 42px 18px 54px;
  }

  .hero-copy h1 {
    font-size: clamp(36px, 11vw, 56px);
  }

  .hero-metrics,
  .command-ops-grid,
  .command-live-wall,
  .dense-bento,
  .accordion-stage,
  .ledger-shell,
  .task-execution-ledger,
  .task-output-grid,
  .violation-focus-shell,
  .live-command-grid,
  .live-summary-strip,
  .live-command-layout,
  .live-detail-meta-grid,
  .nine-grid-summary-strip,
  .nine-grid-info-card,
  .video-wall,
  .query-toolbar,
  .detail-grid,
  .task-stage-grid,
  .violation-source-row,
  .violation-focus-layout,
  .violation-gallery,
  .violation-context-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .live-shell {
    height: auto;
    overflow: visible;
    grid-template-rows: auto auto;
  }

  .nine-grid-shell {
    grid-template-rows: auto auto auto auto;
  }

  .live-command-layout {
    grid-template-areas:
      "devices"
      "viewer"
      "detail";
    height: auto;
    overflow: visible;
  }

  .task-record-card,
  .violation-card-main {
    grid-template-columns: 1fr;
  }

  .live-module-topbar {
    grid-template-columns: 1fr;
  }

  .live-pane-header,
  .live-module-mode {
    flex-direction: column;
    align-items: stretch;
  }

  .live-device-toolbar {
    grid-template-columns: 1fr;
  }

  .live-device-toolbar .live-filter-field:first-child {
    grid-column: auto;
  }

  .live-device-toolbar-actions {
    justify-content: flex-start;
  }

  .live-device-pane,
  .live-viewer-pane,
  .live-detail-pane {
    height: auto;
    min-height: 0;
  }

  .live-video-frame {
    min-height: 320px;
  }

  .live-diagnostics-panel,
  .live-chain-strip,
  .live-chain-panel,
  .nine-grid-stage.mode-4,
  .nine-grid-stage.mode-9 {
    grid-template-columns: 1fr;
  }

  .nine-grid-device-pool {
    grid-auto-columns: minmax(220px, 82vw);
  }

  .bento-plan,
  .bento-alert,
  .bento-progress,
  .bento-device,
  .bento-ai {
    grid-column: span 1;
    grid-row: span 1;
  }

  .command-live-wall .command-tile:first-child {
    grid-row: span 1;
  }

  .section-copy {
    position: static;
  }

  .table {
    overflow-x: auto;
  }

  .table-head,
  .table-row {
    min-width: 980px;
  }

  .task-execution-ledger-head,
  .task-execution-ledger-row {
    min-width: 1420px;
  }

  .workplan-filter-toolbar,
  .task-rule-filter-toolbar,
  .task-execution-filter-toolbar,
  .workplan-pagination,
  .ledger-pagination {
    grid-template-columns: 1fr;
  }

  .query-field-date-range {
    grid-column: auto;
  }

  .query-actions,
  .workplan-pagination-actions,
  .ledger-pagination-actions {
    justify-content: stretch;
  }

  .query-actions > button,
  .workplan-pagination-actions > button,
  .ledger-pagination-actions > button,
  .page-size-select,
  .page-jump-field {
    width: 100%;
  }

  .page-jump-field {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .page-jump-field input {
    min-width: 0;
  }

  .task-rule-summary-grid,
  .task-rule-preview-cards {
    grid-template-columns: 1fr;
  }

  .task-rule-split-layout,
  .task-rule-ledger-summary,
  .task-rule-ledger-overview,
  .task-rule-path-summary.compact {
    grid-template-columns: 1fr;
  }

  .task-rule-risk-group {
    grid-template-columns: 1fr;
  }

  .taskrule-tree-table .table-head,
  .taskrule-tree-table .table-row,
  .task-rule-risk-table .table-head,
  .task-rule-risk-table .table-row {
    min-width: 1180px;
  }

  .detail-panel {
    position: static;
  }

  .cockpit-21x9 {
    aspect-ratio: auto;
    min-height: 980px;
  }

  .cockpit-ice .cockpit-screen {
    grid-template-rows: auto auto minmax(520px, 1fr) auto;
  }

  .cockpit-ice .cockpit-main.interest-stage {
    grid-template-columns: 1fr;
  }

  .cockpit-ice .cockpit-map-dominant {
    min-height: 520px;
  }

  .cockpit-real-map,
  .cockpit-china-map {
    min-height: 430px;
  }
}

#pageMount,
.pageMount,
.content-grid-formal {
  min-width: 0;
  min-height: 100%;
  height: 100%;
}

.metric-card,
.summary-card,
.live-card {
  min-width: 0;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.metric-card em,
.summary-card em {
  color: var(--text-secondary);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.metric-card-button {
  width: 100%;
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.dashboard-list-row,
.dashboard-alert-row {
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.page-live {
  grid-template-rows: auto minmax(0, 1fr);
}

.live-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 340px;
  gap: 18px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.live-sidebar,
.live-main,
.live-card {
  min-width: 0;
  min-height: 0;
}

.prototype-modal-backdrop {
  background: rgba(7, 20, 38, 0.42);
  backdrop-filter: blur(10px);
}

.prototype-modal {
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(237, 247, 255, 0.92)),
    var(--surface);
  box-shadow: 0 32px 90px rgba(9, 31, 62, 0.28);
}

.prototype-modal-head {
  border-bottom: 1px solid var(--line);
}

.prototype-modal-title h3 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
}

.prototype-modal-title p {
  margin: 6px 0 0;
  color: var(--muted);
}

.prototype-modal-body {
  max-height: 520px;
  overflow: auto;
}

.workplan-ledger-modal .prototype-modal-body {
  max-height: 650px;
}

.prototype-modal-actions {
  border-top: 1px solid var(--line);
}

.dashboard-body {
  display: grid;
  grid-template-columns: 0.95fr 1.6fr 0.95fr;
  gap: 18px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.task-rule-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.3fr) minmax(0, 0.7fr);
  gap: 20px;
  min-height: 0;
  height: 100%;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.page-live {
  height: 100%;
}

/* Prototype-faithful shell override */
.app-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  padding: 0;
  background: transparent;
}

.app-container-formal {
  display: flex;
  width: 98%;
  max-width: 98%;
  height: 96%;
  max-height: 96%;
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  overflow: hidden;
}

.sidebar,
.app-container-formal .sidebar {
  width: var(--sidebar-width);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  background: rgba(255, 255, 255, 0.4);
  min-height: 0;
  overflow: hidden;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  margin-bottom: 28px;
  width: 100%;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  flex-shrink: 0;
}

.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-menu,
.app-container-formal .nav-menu {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  position: relative;
  border: 0;
  background: transparent;
  text-align: left;
  width: 100%;
}

.nav-item:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--bg-selected);
  color: var(--primary-blue);
  font-weight: 600;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--primary-blue);
  border-radius: 0 3px 3px 0;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--glass-border);
  margin-top: 16px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #dbe8ff;
  color: var(--primary-blue);
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

.user-plan {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
  line-height: 1.35;
}

.user-profile-logout {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--button-c-border);
  background: var(--button-c-bg);
  color: var(--button-c-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.top-header {
  height: var(--header-height);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 28px;
  gap: 16px;
  background: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.project-selector {
  display: flex;
  align-items: center;
  padding: 0;
  background: transparent;
  border: 0;
  font-weight: 800;
  font-size: 20px;
  line-height: 1.1;
  min-width: auto;
}

.page-body {
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 12px 20px 12px;
}

#pageMount,
.content-grid,
.content-grid-formal {
  min-width: 0;
  min-height: 100%;
  height: 100%;
}

.view-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
  align-content: stretch;
  align-items: stretch;
  grid-auto-rows: minmax(0, 1fr);
}

.panel,
.tree-panel,
.file-panel,
.metric-card,
.summary-card,
.gallery-card,
.detail-grid article,
.description-box {
  min-width: 0;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.panel {
  padding: 16px 16px 14px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  min-width: 0;
}

.panel-header h3,
.tree-toolbar-left strong,
.file-toolbar-title strong {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin: 0;
}

.btn-new,
.btn-ghost {
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: 0;
  max-width: 100%;
  min-width: 0;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  flex-shrink: 0;
}

.btn-new {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 18px;
  background: var(--button-c-strong);
  color: #fff;
  box-shadow: 0 3px 10px rgba(96, 165, 250, 0.34);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--button-c-border);
  background: var(--button-c-bg);
  color: var(--button-c-text);
}

.btn-new:hover {
  background: var(--button-c-strong-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.btn-ghost:hover {
  background: var(--button-c-bg-hover);
}

.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--button-c-border);
  background: var(--button-c-bg);
  color: var(--button-c-text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.1;
  text-align: center;
}

.small-button.strong {
  background: var(--button-c-strong);
  border-color: transparent;
  color: #fff;
}

.btn-ghost.compact,
.btn-new.compact {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.btn-ghost.is-active,
.btn-ghost.active {
  background: var(--bg-selected);
  color: var(--primary-blue);
  border-color: var(--button-c-border);
}

.btn-new.is-active,
.btn-new.active {
  background: var(--button-c-strong-hover);
}

.btn-new:hover {
  background: var(--button-c-strong-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.btn-ghost:hover {
  background: var(--button-c-bg-hover);
}

.query-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
  align-items: end;
  min-width: 0;
  overflow: hidden;
}

.query-toolbar.compact-two-rows {
  grid-template-areas:
    "f1 f2 f3 f4"
    "f5 f6 actions actions";
}

.query-toolbar.compact-two-rows > .query-field:nth-of-type(1) { grid-area: f1; }
.query-toolbar.compact-two-rows > .query-field:nth-of-type(2) { grid-area: f2; }
.query-toolbar.compact-two-rows > .query-field:nth-of-type(3) { grid-area: f3; }
.query-toolbar.compact-two-rows > .query-field:nth-of-type(4) { grid-area: f4; }
.query-toolbar.compact-two-rows > .query-field:nth-of-type(5) { grid-area: f5; }
.query-toolbar.compact-two-rows > .query-field:nth-of-type(6) { grid-area: f6; }
.query-toolbar.compact-two-rows > .query-actions { grid-area: actions; }
.query-toolbar.compact-two-rows.collapsed > .query-field:nth-of-type(n + 7) { display: none; }
.query-toolbar.compact-two-rows.expanded > .query-field:nth-of-type(n + 5) { display: grid; }

.page-workplans .workplan-toolbar {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.page-workplans .workplan-toolbar.query-toolbar {
  align-items: end;
}

.query-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.query-field span {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  line-height: 1.3;
  white-space: nowrap;
}

.query-native-input,
.query-native-select,
.query-input {
  width: 100%;
  min-height: 36px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.66);
  color: var(--text-primary);
  font-size: 13px;
  padding: 0 12px;
  outline: none;
}

.query-input {
  display: flex;
  align-items: center;
}

.query-input-dual {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
}

.query-input-dual input {
  width: 100%;
  border: 0;
  background: transparent;
  min-width: 0;
  outline: none;
  color: var(--text-primary);
  font-size: 14px;
}

.query-actions,
.panel-actions,
.table-actions,
.inline-actions,
.ledger-actions,
.tree-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.query-actions {
  justify-content: flex-end;
  grid-column: 1 / -1;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}

.query-actions > .btn-ghost,
.query-actions > .btn-new,
.query-actions > .btn-new,
.query-actions > .btn-ghost,
.query-actions > .ledger-batch-actions,
.panel-actions > .btn-ghost,
.panel-actions > .btn-new,
.panel-actions > .btn-new,
.panel-actions > .btn-ghost,
.ledger-actions > .btn-ghost,
.ledger-actions > .btn-new,
.ledger-actions > .btn-new,
.ledger-actions > .btn-ghost,
.tree-toolbar-right > .btn-ghost,
.tree-toolbar-right > .btn-new,
.tree-toolbar-right > .btn-new,
.tree-toolbar-right > .btn-ghost,
.inline-actions > .btn-ghost,
.inline-actions > .btn-new,
.inline-actions > .btn-new,
.inline-actions > .btn-ghost {
  white-space: nowrap;
  flex-shrink: 0;
}

.workplan-actions-row,
.task-rule-action-row,
.workplan-pagination-actions,
.ledger-pagination-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.workplan-actions-row,
.task-rule-action-row,
.workplan-pagination-actions,
.ledger-pagination-actions,
.ledger-batch-actions {
  justify-content: flex-end;
}

.ledger-batch-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
  max-width: 100%;
  margin-left: 0;
  overflow: hidden;
  min-height: 36px;
  flex: 0 0 auto;
}

.query-actions > .ledger-batch-actions {
  padding-left: 2px;
}

.query-actions > .ledger-batch-actions {
  margin-left: 0;
}

.query-actions > .btn-ghost,
.query-actions > .btn-new,
.query-actions > .ledger-batch-actions,
.query-actions > .ledger-batch-actions > .btn-ghost,
.query-actions > .ledger-batch-actions > .btn-new,
.query-actions > .ledger-batch-actions > .ledger-batch-meta {
  flex: 0 0 auto;
}

.ledger-batch-actions .ledger-batch-meta {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.ledger-batch-actions > .btn-ghost,
.ledger-batch-actions > .btn-new {
  min-height: 40px;
  padding: 0 14px;
  font-size: 14px;
}

.workplan-actions-row > .btn-ghost,
.workplan-actions-row > .btn-new,
.task-rule-action-row > .btn-ghost,
.task-rule-action-row > .btn-new,
.workplan-pagination-actions > .btn-ghost,
.workplan-pagination-actions > .btn-new,
.ledger-pagination-actions > .btn-ghost,
.ledger-pagination-actions > .btn-new,
.ledger-batch-actions > .btn-ghost,
.ledger-batch-actions > .btn-new {
  white-space: nowrap;
  flex-shrink: 0;
}

.workplan-pagination-actions > .btn-ghost,
.workplan-pagination-actions > .btn-new,
.ledger-pagination-actions > .btn-ghost,
.ledger-pagination-actions > .btn-new {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.task-rule-action-row > .btn-ghost,
.task-rule-action-row > .btn-new {
  min-height: 40px;
  padding: 0 14px;
  font-size: 13px;
  justify-content: center;
}

.table-actions > .small-button,
.table-actions > .btn-ghost,
.table-actions > .btn-new {
  flex-shrink: 0;
}

.page-workplans .workplan-toolbar + .workplan-actions-row {
  margin-top: 16px;
  margin-bottom: 10px;
  padding-top: 0;
}

.page-workplans .workplan-toolbar > .workplan-actions-row {
  margin: 0;
  padding: 0;
}

.workplan-actions-row > .btn-ghost,
.workplan-actions-row > .btn-new {
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
}

.task-rule-query-toolbar {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.25fr) auto auto;
  align-items: end;
  row-gap: 10px;
  overflow: visible;
  flex: 0 0 auto;
}

.task-rule-query-toolbar > .query-actions {
  overflow: visible;
}

.task-rule-query-toolbar > .task-rule-action-row:first-of-type {
  grid-column: 3 / 5;
  justify-content: flex-start;
}

.task-rule-query-toolbar > .task-rule-directory-controls {
  grid-column: 1 / -1;
  justify-content: flex-start;
  padding-bottom: 8px;
}

.task-rule-titlebar {
  min-height: 56px;
  margin-bottom: 12px;
  padding: 16px 16px 12px;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.task-rule-titlebar .tree-toolbar-left {
  display: flex;
  align-items: center;
  min-height: 28px;
}

.task-rule-titlebar .tree-toolbar-left strong {
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
}

.task-rule-directory-scroll {
  padding-top: 6px;
}

.table-actions {
  justify-content: center;
  white-space: nowrap;
  overflow: visible;
}

.table-actions .small-button,
.table-actions .btn-ghost,
.table-actions .btn-new,
.table-actions .task-rule-tree-action,
.table-actions .row-action-menu {
  min-width: 0;
  flex-shrink: 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  flex-shrink: 0;
}

.metric-card,
.summary-card {
  padding: 14px;
  display: grid;
  gap: 8px;
}

.metric-card span,
.summary-card span {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 700;
}

.metric-card strong,
.summary-card strong {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.table-wrap {
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.34);
  width: 100%;
  max-width: 100%;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.table-head,
.table-row {
  display: grid;
  align-items: center;
  gap: 10px;
  width: max(100%, var(--table-min-width, 0px));
  min-width: 0;
  padding: 0 14px;
  flex-shrink: 0;
}

.table-head {
  min-height: 42px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.42);
}

.table-row {
  min-height: 42px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.14);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  width: fit-content;
  white-space: nowrap;
}

.status-primary { background: rgba(59, 130, 246, 0.12); color: var(--primary-blue); }
.status-success { background: rgba(22, 163, 74, 0.12); color: var(--success); }
.status-warning { background: rgba(245, 158, 11, 0.14); color: var(--warning); }
.status-danger { background: rgba(239, 68, 68, 0.12); color: #dc2626; }
.status-neutral { background: rgba(148, 163, 184, 0.16); color: var(--neutral-strong); }

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.page-dashboard {
  grid-template-rows: 88px minmax(0, 1fr);
}

.dashboard-body {
  display: grid;
  grid-template-columns: 0.95fr 1.6fr 0.95fr;
  gap: 18px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.dashboard-side-panel,
.dashboard-map-card,
.dashboard-stack-card {
  min-width: 0;
  min-height: 0;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  padding: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dashboard-side-stack {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 18px;
  min-height: 0;
  overflow: hidden;
}

.dashboard-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.dashboard-section-title strong {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

.dashboard-section-button {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--button-c-border);
  background: var(--button-c-bg);
  color: var(--button-c-text);
  font-size: 12px;
  font-weight: 700;
}

.dashboard-list {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: auto;
}

.dashboard-list-row,
.dashboard-alert-row {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

/* Dashboard hierarchy: compact status strip, dominant map, lightweight side summaries. */
.page-dashboard > .metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  height: 88px;
  min-height: 0;
}

.dashboard-metric-card {
  --dashboard-kpi-accent: #0ea5e9;
  --dashboard-kpi-glow: rgba(14, 165, 233, 0.2);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  justify-items: center;
  gap: 5px;
  height: 88px;
  min-height: 0;
  padding: 10px 14px 8px;
  box-sizing: border-box;
  overflow: hidden;
  color: var(--text-primary);
  border-color: rgba(106, 159, 208, 0.22);
  background: rgba(255, 255, 255, 0.46);
  box-shadow: none;
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.dashboard-metric-card[data-tone="serious"] {
  --dashboard-kpi-accent: #e5484d;
  --dashboard-kpi-glow: rgba(229, 72, 77, 0.2);
}

.dashboard-metric-card[data-tone="warning"] {
  --dashboard-kpi-accent: #f59e0b;
  --dashboard-kpi-glow: rgba(245, 158, 11, 0.2);
}

.dashboard-metric-card[data-tone="general"] {
  --dashboard-kpi-accent: #0ea5e9;
  --dashboard-kpi-glow: rgba(14, 165, 233, 0.2);
}

.dashboard-metric-card:hover {
  border-color: color-mix(in srgb, var(--dashboard-kpi-accent) 34%, rgba(106, 159, 208, 0.22));
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 20px var(--dashboard-kpi-glow), 0 8px 18px rgba(30, 82, 145, 0.1);
}

.dashboard-metric-card:focus-visible {
  outline: 2px solid var(--dashboard-kpi-accent);
  outline-offset: 2px;
}

.dashboard-metric-card > span {
  min-width: 0;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}

.dashboard-metric-card > strong {
  color: var(--text-primary);
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.dashboard-body {
  grid-template-columns: minmax(190px, 0.66fr) minmax(0, 2.68fr) minmax(190px, 0.66fr);
  gap: 12px;
}

.dashboard-side-panel,
.dashboard-stack-card {
  padding: 12px;
  border-radius: 12px;
}

.dashboard-map-card {
  padding: 16px;
}

.dashboard-side-stack {
  gap: 14px;
}

.dashboard-section-title {
  margin-bottom: 10px;
}

.dashboard-section-title strong {
  font-size: 17px;
  font-weight: 700;
}

.dashboard-list {
  gap: 8px;
}

.dashboard-list-row,
.dashboard-alert-row {
  gap: 5px;
  padding: 10px;
}

.dashboard-map-card .dashboard-map-board {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  margin-top: 0;
}

@media (max-width: 1200px) {
  .page-dashboard {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .page-dashboard > .metric-grid {
    height: auto;
    min-height: 0;
  }

  .dashboard-metric-card {
    height: 88px;
  }

  .page-dashboard > .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .page-dashboard > .metric-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-metric-card {
    transition: none;
  }
}

/* AI control center operations surface */
.ai-control-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); flex: 1 1 auto; min-height: 0; overflow: auto; }
.ai-control-grid > .ai-config-section + .ai-config-section { border-left: 1px solid rgba(106, 147, 180, 0.22); }
.ai-status-pair, .ai-model-meta, .ai-hotword-actions, .ai-prompt-actions, .ai-log-paging { display: flex; align-items: center; gap: 10px; }
.ai-status-pair { flex-wrap: wrap; justify-content: flex-end; }
.ai-safe-badge, .ai-key-safe { color: #176e86; background: #e8f5f6; border: 1px solid #b5dfe2; border-radius: 999px; padding: 5px 10px; font-size: 12px; font-style: normal; white-space: nowrap; }
.ai-detection-row, .ai-route-editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; align-items: end; margin-top: 16px; }
.ai-last-check { color: #607682; font-size: 12px; align-self: end; padding-bottom: 10px; }
.ai-model-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ai-model-card { border: 1px solid #d6e2e6; border-radius: 7px; padding: 14px; display: grid; gap: 10px; min-width: 0; }
.ai-model-card > strong { color: #183b4a; font-size: 14px; }
.ai-model-card > span { color: #607682; font-size: 12px; }
.ai-model-connectivity { display: flex; align-items: center; gap: 10px; padding-top: 2px; border-top: 1px solid #e6edef; }
.ai-model-connectivity .btn-ghost { flex: 0 0 auto; }
.ai-model-connectivity .ai-config-test-status { min-width: 0; overflow-wrap: anywhere; }
.ai-model-meta { justify-content: space-between; color: #607682; font-size: 12px; }
.ai-reasoning-preset { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #607682; font-size: 12px; }
.ai-reasoning-preset span { min-width: 0; overflow-wrap: anywhere; }
.ai-chat-test-banner { display: grid; gap: 6px; padding: 14px 16px; margin-bottom: 16px; border: 1px solid #d6e2e6; border-radius: 7px; }
.ai-chat-test-banner strong { font-size: 15px; }
.ai-chat-test-banner span { color: #526b77; line-height: 1.6; overflow-wrap: anywhere; }
.ai-chat-test-banner.success { border-color: #9fd4bf; background: #f0faf5; color: #14764e; }
.ai-chat-test-banner.failed { border-color: #e5b5b1; background: #fff5f4; color: #a53333; }
.ai-config-check { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; color: #3f5966; font-size: 12px; font-weight: 700; }
.ai-config-check input { accent-color: #1689a7; }
.ai-hotword-actions, .ai-prompt-actions { justify-content: flex-end; margin: 12px 0; }
.ai-hotword-manual { display: grid; grid-template-columns: minmax(0, 1fr) 82px auto; gap: 8px; align-items: center; margin: 12px 0; }
.ai-hotword-manual input { min-width: 0; height: 34px; box-sizing: border-box; border: 1px solid #b9cbd3; border-radius: 5px; padding: 0 9px; color: #244755; background: #fff; }
.ai-hotword-list { display: flex; flex-wrap: wrap; gap: 8px; min-height: 70px; align-content: flex-start; }
.ai-hotword-list span { display: inline-flex; gap: 6px; align-items: center; border: 1px solid #d6e2e6; border-radius: 5px; padding: 6px 8px; color: #294b5b; font-size: 12px; background: #fbfdfd; }
.ai-hotword-list small { color: #7a8d94; font-size: 10px; }
.ai-release-list { display: grid; gap: 8px; margin-top: 14px; }
.ai-release-list > div { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; border-top: 1px solid #e6edef; padding-top: 8px; font-size: 12px; }
.ai-release-list span { color: #607682; }
.ai-hotword-version { color: #176e86; font-size: 12px; }
.ai-prompt-editor { width: 100%; min-height: 190px; box-sizing: border-box; border: 1px solid #b9cbd3; border-radius: 6px; padding: 10px 11px; line-height: 1.6; resize: vertical; font: inherit; color: #244755; }
.ai-config-field-wide { grid-column: 1 / -1; }
.ai-config-field textarea { width: 100%; box-sizing: border-box; border: 1px solid #b9cbd3; border-radius: 6px; padding: 8px 10px; font: inherit; color: #244755; resize: vertical; }
.ai-prompt-history { display: grid; gap: 6px; color: #607682; font-size: 12px; border-top: 1px solid #e6edef; padding-top: 10px; }
.ai-legacy-note { flex: 0 0 auto; padding: 12px 18px; border-bottom: 1px solid #e6edef; color: #607682; font-size: 12px; }
.ai-call-log-table .table-head, .ai-call-log-table .table-row { grid-template-columns: 1.1fr 1.25fr .65fr 1.2fr .65fr .65fr 1.25fr 1.25fr .6fr; }
.ai-log-paging { justify-content: flex-end; flex: 0 0 auto; padding: 10px 18px 0; color: #607682; font-size: 12px; }
.ai-empty-log { padding: 36px; color: #607682; text-align: center; }
.ai-qa-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: #607682; font-size: 12px; }
@media (max-width: 1180px) {
  .ai-control-grid, .ai-model-columns { grid-template-columns: minmax(0, 1fr); }
  .ai-control-grid > .ai-config-section + .ai-config-section { border-left: 0; border-top: 1px solid rgba(106, 147, 180, 0.22); }
}
@media (max-width: 720px) {
  .ai-detection-row, .ai-route-editor { grid-template-columns: minmax(0, 1fr); }
  .ai-hotword-manual { grid-template-columns: minmax(0, 1fr) 72px; }
  .ai-hotword-manual button { grid-column: 1 / -1; justify-self: end; }
  .ai-config-section { padding: 16px 14px; }
}

/* Local nine-grid interaction prototype. The formal live page keeps its existing layout. */
.nine-grid-prototype-shell {
  gap: 12px;
  padding-bottom: 12px;
}

.nine-grid-prototype-header {
  padding: 14px 18px;
}

.nine-grid-prototype-header-actions,
.nine-grid-prototype-overview-title,
.nine-grid-prototype-detail-status,
.nine-grid-prototype-status,
.nine-grid-prototype-topline,
.nine-grid-prototype-meta,
.nine-grid-prototype-device-line {
  display: flex;
  align-items: center;
}

.nine-grid-prototype-header-actions {
  justify-content: flex-end;
  gap: 12px;
}

.nine-grid-prototype-demo-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  color: #315579;
  border: 1px solid rgba(70, 123, 177, 0.2);
  border-radius: 999px;
  background: rgba(235, 244, 252, 0.9);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.nine-grid-prototype-overview {
  display: grid;
  gap: 14px;
  padding: 14px 18px;
}

.nine-grid-prototype-overview-title {
  justify-content: space-between;
  gap: 16px;
}

.nine-grid-prototype-overview-title > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.nine-grid-prototype-overview-title strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
}

.nine-grid-prototype-overview-title span,
.nine-grid-prototype-focus-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.nine-grid-prototype-focus-label {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.84);
}

.nine-grid-prototype-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 0.7fr)) minmax(170px, 1.3fr);
  gap: 10px;
}

.nine-grid-prototype-metrics article {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(250, 253, 255, 0.86);
  font-size: 12px;
  font-weight: 700;
}

.nine-grid-prototype-metrics article i,
.nine-grid-prototype-detail-status i,
.nine-grid-prototype-status i {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #a6b5c4;
}

.nine-grid-prototype-metrics article i.is-online,
.nine-grid-prototype-detail-status.is-online i,
.nine-grid-prototype-status.is-online i {
  background: #17a673;
  box-shadow: 0 0 0 3px rgba(23, 166, 115, 0.12);
}

.nine-grid-prototype-metrics article i.is-offline,
.nine-grid-prototype-detail-status.is-offline i,
.nine-grid-prototype-status.is-offline i {
  background: #d06464;
  box-shadow: 0 0 0 3px rgba(208, 100, 100, 0.12);
}

.nine-grid-prototype-metrics article i.is-empty {
  border: 1px solid #9fb2c5;
  background: transparent;
}

.nine-grid-prototype-metrics article strong {
  margin-left: auto;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

.nine-grid-prototype-metrics .nine-grid-prototype-policy {
  justify-content: space-between;
}

.nine-grid-prototype-policy strong {
  color: #2c6d9c;
  font-size: 12px;
}

.nine-grid-prototype-stage-panel {
  min-height: 0;
  padding: 14px;
}

.nine-grid-prototype-stage {
  min-height: clamp(420px, 54vh, 720px);
  gap: 10px;
}

.nine-grid-prototype-tile,
.nine-grid-prototype-empty {
  min-height: 0;
  border-radius: 12px;
  border-color: rgba(112, 143, 174, 0.26);
  background: #102538;
  box-shadow: 0 10px 24px rgba(21, 54, 82, 0.08);
  animation: nine-grid-tile-in 320ms ease both;
  animation-delay: calc(var(--tile-order, 0) * 28ms);
}

.nine-grid-prototype-tile.is-offline {
  background: #263545;
}

.nine-grid-prototype-tile.is-offline .nine-grid-video-frame {
  background: #3d5264;
}

.nine-grid-prototype-tile.is-offline .nine-grid-video-frame img {
  display: none;
}

.nine-grid-prototype-tile.is-offline .nine-grid-prototype-shade {
  background: linear-gradient(180deg, rgba(22, 43, 61, 0.58), rgba(15, 31, 46, 0.9));
}

.nine-grid-prototype-tile.focused {
  border-color: rgba(63, 156, 255, 0.9);
  box-shadow: 0 0 0 2px rgba(63, 156, 255, 0.2), 0 14px 30px rgba(21, 80, 132, 0.2);
}

.nine-grid-prototype-focus {
  display: block;
  cursor: pointer;
}

.nine-grid-prototype-focus:hover .nine-grid-prototype-shade {
  background: linear-gradient(180deg, rgba(2, 15, 27, 0.12), rgba(2, 15, 27, 0.84));
}

.nine-grid-prototype-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(3, 18, 32, 0.16), rgba(3, 18, 32, 0.82));
  transition: background 180ms ease;
}

.nine-grid-prototype-topline {
  position: absolute;
  top: 10px;
  left: 11px;
  right: 11px;
  z-index: 2;
  justify-content: space-between;
  gap: 8px;
  color: rgba(244, 249, 255, 0.78);
  font-size: 10px;
  font-weight: 700;
}

.nine-grid-prototype-status {
  gap: 6px;
  min-height: 22px;
  padding: 0 8px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 999px;
  background: rgba(8, 31, 51, 0.58);
  white-space: nowrap;
}

.nine-grid-prototype-status.is-online i {
  background: #43db9b;
  box-shadow: none;
}

.nine-grid-prototype-status.is-offline i {
  background: #ff9d9d;
  box-shadow: none;
}

.nine-grid-prototype-offline-copy {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  gap: 5px;
  color: rgba(245, 249, 255, 0.9);
  text-align: center;
}

.nine-grid-prototype-offline-copy strong {
  font-size: 15px;
}

.nine-grid-prototype-offline-copy span {
  color: rgba(223, 234, 245, 0.66);
  font-size: 11px;
}

.nine-grid-prototype-overlay {
  z-index: 2;
  display: grid;
  gap: 4px;
  padding: 12px;
}

.nine-grid-prototype-device-line {
  justify-content: space-between;
  gap: 8px;
}

.nine-grid-prototype-device-line strong {
  min-width: 0;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nine-grid-prototype-device-line span,
.nine-grid-prototype-overlay > span {
  overflow: hidden;
  color: rgba(222, 235, 247, 0.74);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nine-grid-prototype-meta {
  justify-content: space-between;
  gap: 8px;
  color: rgba(241, 247, 252, 0.8);
  font-size: 10px;
}

.nine-grid-prototype-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nine-grid-prototype-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  color: #7e9bb5;
  border: 1px dashed rgba(109, 143, 174, 0.45);
  background: repeating-linear-gradient(135deg, rgba(242, 247, 252, 0.86), rgba(242, 247, 252, 0.86) 10px, rgba(234, 242, 249, 0.86) 10px, rgba(234, 242, 249, 0.86) 20px);
  text-align: center;
}

.nine-grid-prototype-empty-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #6b8daa;
  border: 1px solid rgba(107, 141, 170, 0.42);
  border-radius: 50%;
}

.nine-grid-prototype-empty-icon svg {
  width: 15px;
  height: 15px;
}

.nine-grid-prototype-empty strong {
  color: #52708d;
  font-size: 13px;
}

.nine-grid-prototype-empty span {
  color: #89a0b5;
  font-size: 11px;
}

.nine-grid-prototype-info-strip {
  gap: 12px;
  padding-bottom: 14px;
}

.nine-grid-prototype-info-strip .live-pane-header {
  padding: 0 18px;
}

.nine-grid-prototype-detail-status {
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.nine-grid-prototype-detail-status.is-online {
  color: #187a58;
}

.nine-grid-prototype-detail-status.is-offline {
  color: #b04f4f;
}

.nine-grid-prototype-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0 18px;
}

.nine-grid-prototype-detail-grid article {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(250, 253, 255, 0.76);
}

.nine-grid-prototype-detail-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.nine-grid-prototype-detail-grid strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nine-grid-prototype-info-empty {
  padding: 0 18px;
  color: var(--muted);
  font-size: 12px;
}

@keyframes nine-grid-tile-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .nine-grid-prototype-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .nine-grid-prototype-policy {
    grid-column: 1 / -1;
  }

  .nine-grid-prototype-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .nine-grid-prototype-shell {
    height: auto;
    min-height: 0;
    max-height: calc(100vh - 170px);
    overflow-x: hidden;
    overflow-y: auto;
    align-content: start;
    grid-template-rows: max-content max-content max-content max-content;
  }

  .nine-grid-prototype-stage-panel {
    overflow: visible;
    flex: none;
  }

  .nine-grid-prototype-stage {
    flex: none;
    height: auto;
    min-height: 0;
  }

  .nine-grid-prototype-header,
  .nine-grid-prototype-overview-title {
    align-items: flex-start;
  }

  .nine-grid-prototype-header-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .nine-grid-prototype-overview-title {
    flex-direction: column;
  }

  .nine-grid-prototype-focus-label {
    align-self: stretch;
  }

  .nine-grid-prototype-stage {
    min-height: 460px;
  }

  .nine-grid-prototype-stage.mode-4,
  .nine-grid-prototype-stage.mode-9 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nine-grid-prototype-stage.mode-4 {
    grid-auto-rows: minmax(180px, 1fr);
  }

  .nine-grid-prototype-stage.mode-9 {
    grid-auto-rows: minmax(128px, 1fr);
  }
}

@media (max-width: 460px) {
  .nine-grid-prototype-metrics,
  .nine-grid-prototype-detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .nine-grid-prototype-header-actions .live-segmented {
    width: 100%;
  }

  .nine-grid-prototype-header-actions .live-segmented button {
    flex: 1 1 0;
    padding: 0 8px;
  }

  .nine-grid-prototype-stage {
    min-height: 520px;
  }

  .nine-grid-prototype-overlay {
    padding: 8px;
    gap: 3px;
  }

  .nine-grid-prototype-device-line {
    align-items: flex-start;
    flex-direction: column;
    gap: 1px;
  }

  .nine-grid-prototype-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 1px;
  }

  .nine-grid-prototype-meta span {
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nine-grid-prototype-tile,
  .nine-grid-prototype-empty {
    animation: none;
  }
}

/* Integrated remote-inspection layout preview. Formal single-stream styles stay above. */
.page-live-clean.live-preview-shell {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.page-live-clean.live-preview-shell .live-command-layout {
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
}

.page-live-clean.live-preview-shell.layout-1 .live-command-layout {
  grid-template-columns: minmax(224px, 0.92fr) minmax(0, 2.35fr) minmax(224px, 0.92fr);
  grid-template-areas: "devices viewer detail";
}

.page-live-clean.live-preview-shell.layout-4 .live-command-layout {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "viewer";
}

.page-live-clean.live-preview-shell.layout-4.has-live-grid-device-drawer .live-command-layout {
  grid-template-columns: minmax(224px, 250px) minmax(0, 1fr);
  grid-template-areas: "devices viewer";
}

.page-live-clean.live-preview-shell.layout-9 .live-command-layout {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "viewer";
}

.page-live-clean.live-preview-shell.layout-4 .live-detail-pane,
.page-live-clean.live-preview-shell.layout-9 .live-device-pane,
.page-live-clean.live-preview-shell.layout-9 .live-detail-pane {
  display: none;
}

.page-live-clean.live-preview-shell .live-device-pane {
  grid-area: devices;
}

.page-live-clean.live-preview-shell .live-viewer-pane {
  grid-area: viewer;
  min-width: 0;
}

.page-live-clean.live-preview-shell .live-detail-pane {
  grid-area: detail;
}

.live-preview-viewer-header {
  min-height: 62px !important;
  height: auto !important;
  padding: 10px 12px 10px 14px !important;
  gap: 12px;
}

.live-preview-title {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.live-preview-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-preview-title strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

.live-preview-layout-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.live-grid-drawer-toggle {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  color: #45647d;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.86);
}

.live-grid-drawer-toggle.is-open {
  color: #1d6fbd;
  border-color: rgba(29, 111, 189, 0.3);
  background: rgba(230, 243, 255, 0.96);
}

.live-grid-drawer-toggle svg {
  width: 15px;
  height: 15px;
}

.live-preview-segmented {
  width: 180px;
  min-width: 180px;
  height: 34px;
}

.live-preview-segmented button {
  min-width: 0;
  padding: 0 8px;
  font-size: 12px;
}

.live-preview-pagination {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 136px;
  min-width: 136px;
  height: 34px;
  padding: 0 3px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(248, 251, 255, 0.86);
  font-size: 11px;
  font-weight: 800;
}

.live-preview-pagination span {
  width: 72px;
  text-align: center;
  white-space: nowrap;
}

.live-preview-pagination .icon-button {
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  border: 0;
  background: transparent;
}

.live-preview-pagination .icon-button svg {
  width: 14px;
  height: 14px;
}

.live-preview-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  color: #346082;
  border: 1px solid rgba(67, 122, 170, 0.2);
  border-radius: 999px;
  background: rgba(237, 246, 253, 0.86);
  font-size: 11px;
  font-weight: 850;
}

.live-preview-sidebar-surface {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  color: #2f5979;
  border: 1px solid rgba(104, 143, 176, 0.18);
  background: #fff;
  text-align: center;
}

.live-preview-sidebar-surface.is-offline {
  color: #718092;
  background: #e9edf1;
}

.live-preview-sidebar-surface span {
  font-size: 12px;
  font-weight: 850;
}

.live-preview-sidebar-surface small {
  color: currentColor;
  font-size: 10px;
  opacity: 0.75;
}

.page-live-clean.live-preview-shell .live-viewer-stage {
  min-height: 0;
}

.live-preview-single-stage {
  min-height: 0;
  overflow: hidden;
}

.live-preview-single-stage .live-grid-tile {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}

.live-preview-single-stage .live-grid-media video,
.live-preview-single-stage .live-grid-media img {
  object-fit: cover;
}

.live-grid-scroll {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  padding: 12px;
  overflow: auto;
}

.live-grid-stage {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.live-grid-stage.mode-4 {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  min-width: 520px;
}

.live-grid-stage.mode-9 {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  min-width: 700px;
}

.live-grid-tile,
.live-grid-empty {
  position: relative;
  min-width: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(88, 127, 177, 0.22);
  border-radius: 10px;
  background: #fff;
}

.live-grid-tile.is-focused {
  border-color: rgba(29, 125, 255, 0.78);
  box-shadow: 0 0 0 2px rgba(29, 125, 255, 0.16);
}

.live-grid-tile-hit {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.live-grid-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #fff;
}

.live-grid-media.is-online {
  background: #fff;
}

.live-grid-media.is-offline,
.live-grid-media.is-disconnected {
  background: #dfe4e9;
}

.live-grid-media video,
.live-grid-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.live-grid-media-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.live-grid-live-mark,
.live-grid-offline-mark {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #5d7489;
  font-size: 12px;
  font-weight: 800;
}

.live-grid-live-mark i,
.live-grid-status i {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #18a970;
}

.live-grid-offline-mark {
  color: #687786;
}

.live-grid-tile-overlay {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: grid;
  gap: 4px;
  padding: 9px 10px 8px;
  color: #29445c;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.95) 35%);
  pointer-events: none;
}

.live-grid-tile-topline,
.live-grid-device-line,
.live-grid-meta,
.live-grid-stream-line {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.live-grid-tile-topline,
.live-grid-meta,
.live-grid-stream-line {
  color: #6b7d8e;
  font-size: 10px;
  font-weight: 700;
}

.live-grid-tile-topline > span:last-child,
.live-grid-meta > span,
.live-grid-stream-line > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-grid-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #267a59;
  white-space: nowrap;
}

.live-grid-status.is-offline {
  color: #7d6d6d;
}

.live-grid-status.is-offline i {
  background: #a2aab2;
}

.live-grid-device-line strong {
  min-width: 0;
  overflow: hidden;
  color: #17324c;
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-grid-device-line span {
  max-width: 52%;
  overflow: hidden;
  color: #6d7f90;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-grid-expand-button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  color: #45647d;
  border: 1px solid rgba(89, 121, 148, 0.24);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.88);
}

.live-grid-expand-button svg {
  width: 14px;
  height: 14px;
}

.live-grid-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  color: #80909e;
  border-style: dashed;
  background: #f6f8fa;
  text-align: center;
}

.live-grid-empty-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #8ea1b0;
  border: 1px solid rgba(111, 135, 153, 0.34);
  border-radius: 50%;
}

.live-grid-empty-icon svg {
  width: 14px;
  height: 14px;
}

.live-grid-empty strong {
  color: #60778b;
  font-size: 12px;
}

.live-grid-empty span {
  color: #93a1ad;
  font-size: 10px;
}

.live-preview-toolbar {
  flex-wrap: wrap;
  gap: 8px;
}

.live-preview-toolbar .small-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.live-preview-toolbar .small-button svg {
  width: 14px;
  height: 14px;
}

.live-preview-task-note {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(248, 251, 255, 0.72);
}

.live-preview-task-note span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.live-preview-task-note strong {
  color: var(--ink);
  font-size: 12px;
}

.page-live-clean.live-preview-shell {
  position: relative;
}

.page-live-clean.live-preview-shell.has-live-fullscreen {
  isolation: isolate;
}

.page-live-clean.live-preview-shell.has-live-fullscreen > .live-command-layout {
  visibility: hidden;
}

.live-fullscreen-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  border: 1px solid rgba(102, 133, 157, 0.24);
  border-radius: 12px;
  background: #dbe6ee;
}

.live-fullscreen-surface {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  color: #20384d;
  background: #f3f7fa;
}

.live-fullscreen-surface:fullscreen {
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
  background: #f3f7fa;
}

.live-fullscreen-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #e8f0f5;
}

.live-fullscreen-canvas {
  position: absolute;
  inset: 72px 20px 86px;
  display: flex;
  min-width: 0;
  min-height: 0;
  align-items: center;
  justify-content: center;
}

.live-fullscreen-media-frame {
  position: relative;
  width: min(100%, calc((100dvh - 190px) * 1.7778));
  max-height: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(188, 207, 221, 0.24);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(45, 78, 107, 0.12);
}

.live-fullscreen-media-surface {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #5d7182;
  background: #fff;
}

.live-fullscreen-live-mark {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #617789;
  font-size: 12px;
}

.live-fullscreen-live-mark i,
.live-fullscreen-status i {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #21b67d;
  box-shadow: 0 0 0 4px rgba(33, 182, 125, 0.12);
}

.live-fullscreen-live-mark strong {
  color: #40576b;
  font-size: 12px;
}

.live-fullscreen-hud {
  position: absolute;
  top: 14px;
  right: 14px;
  left: 14px;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(160px, 1fr);
  align-items: start;
  gap: 12px;
  pointer-events: none;
}

.live-fullscreen-device-heading,
.live-fullscreen-mode-switcher,
.live-fullscreen-hud-actions,
.live-fullscreen-stream-summary,
.live-fullscreen-action-dock {
  border: 1px solid rgba(102, 133, 157, 0.22);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 6px 18px rgba(45, 78, 107, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.live-fullscreen-device-heading {
  display: grid;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  gap: 3px;
  padding: 9px 11px;
  border-radius: 8px;
  pointer-events: auto;
}

.live-fullscreen-device-heading strong,
.live-fullscreen-device-heading > span:last-child,
.live-fullscreen-hud-actions > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-fullscreen-device-heading strong {
  color: #17324c;
  font-size: 14px;
}

.live-fullscreen-device-heading > span:last-child {
  color: #64798b;
  font-size: 10px;
}

.live-fullscreen-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #247a5a;
  font-size: 10px;
  font-weight: 800;
}

.live-fullscreen-mode-switcher {
  display: flex;
  align-items: center;
  justify-self: center;
  gap: 3px;
  padding: 4px;
  border-radius: 8px;
  pointer-events: auto;
}

.live-fullscreen-mode-switcher button {
  display: inline-flex;
  min-width: 98px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  color: #5e7487;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-size: 11px;
  font-weight: 750;
}

.live-fullscreen-mode-switcher button:hover {
  color: #214b6d;
  background: #f0f6fa;
}

.live-fullscreen-mode-switcher button.active {
  color: #174f7b;
  border-color: #9fc4e5;
  background: #dcecf9;
}

.live-fullscreen-mode-switcher svg,
.live-fullscreen-action-dock svg,
.live-fullscreen-icon-button svg {
  width: 15px;
  height: 15px;
}

.live-fullscreen-hud-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-self: end;
  gap: 8px;
  padding: 4px;
  border-radius: 8px;
  pointer-events: auto;
}

.live-fullscreen-hud-actions > span {
  max-width: 150px;
  padding-left: 7px;
  color: #5d7588;
  font-size: 10px;
  font-weight: 700;
}

.live-fullscreen-icon-button {
  display: inline-flex;
  width: 34px;
  height: 34px;
  min-width: 34px;
  align-items: center;
  justify-content: center;
  color: #35566c;
  border: 1px solid rgba(102, 133, 157, 0.2);
  border-radius: 6px;
  background: rgba(246, 250, 253, 0.9);
}

.live-fullscreen-icon-button:hover {
  color: #173f5f;
  border-color: #9fbfd5;
  background: #eaf3f8;
}

.live-fullscreen-stream-summary {
  position: absolute;
  bottom: 20px;
  left: 18px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0;
  max-width: calc(50% - 170px);
  min-height: 38px;
  padding: 0 10px;
  border-radius: 8px;
}

.live-fullscreen-stream-summary span {
  overflow: hidden;
  color: #506c81;
  font-size: 10px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-fullscreen-stream-summary span + span::before {
  content: "·";
  padding: 0 7px;
  color: #9cafbc;
}

.live-fullscreen-action-dock {
  position: absolute;
  bottom: 16px;
  left: 50%;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 8px;
  transform: translateX(-50%);
}

.live-fullscreen-feedback {
  position: absolute;
  top: 78px;
  right: 18px;
  z-index: 6;
  max-width: min(320px, calc(100% - 36px));
  padding: 8px 10px;
  color: #20527d;
  border: 1px solid #9fc4e5;
  border-radius: 7px;
  background: #eaf3ff;
  box-shadow: 0 6px 16px rgba(45, 78, 107, 0.12);
  font-size: 11px;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.live-fullscreen-feedback.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.live-fullscreen-action-dock button {
  display: inline-flex;
  min-width: 82px;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  color: #385d77;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

.live-fullscreen-action-dock button:hover {
  color: #173f5f;
  border-color: #bfd3e1;
  background: #eef5fa;
}

.live-fullscreen-action-dock button.is-recording {
  color: #a94343;
  border-color: #e5b2b2;
  background: #fff1f1;
}

.live-fullscreen-action-dock button.is-danger {
  color: #a34747;
}

.live-fullscreen-action-dock button.is-danger:hover {
  border-color: #e4b0b0;
  background: #fff1f1;
}

.live-fullscreen-action-divider {
  width: 1px;
  height: 22px;
  margin: 0 2px;
  background: #d5e2ea;
}

.live-fullscreen-inspector {
  display: none;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: 18px;
  padding: 74px 18px 18px;
  overflow: auto;
  border-left: 1px solid #d5e2ea;
  background: #f8fbfd;
}

.mode-focus .live-fullscreen-surface {
  grid-template-columns: minmax(0, 1fr) 286px;
}

.mode-focus .live-fullscreen-inspector {
  display: flex;
}

.live-fullscreen-inspector > header {
  display: grid;
  gap: 5px;
  padding-bottom: 14px;
  border-bottom: 1px solid #d9e5ec;
}

.live-fullscreen-inspector > header span,
.live-fullscreen-progress > span {
  color: #6b8292;
  font-size: 10px;
  font-weight: 800;
}

.live-fullscreen-inspector > header strong {
  overflow: hidden;
  color: #17324c;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-fullscreen-inspector-rows {
  display: grid;
}

.live-fullscreen-inspector-rows > div {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid #e0e9ef;
}

.live-fullscreen-inspector-rows span {
  color: #6b8292;
  font-size: 10px;
}

.live-fullscreen-inspector-rows strong {
  overflow: hidden;
  color: #31536b;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-fullscreen-progress {
  display: grid;
  gap: 0;
}

.live-fullscreen-progress > span {
  margin-bottom: 8px;
}

.live-fullscreen-progress > div {
  position: relative;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 8px;
  min-height: 30px;
  align-items: start;
  color: #607789;
}

.live-fullscreen-progress > div::after {
  position: absolute;
  top: 12px;
  bottom: -3px;
  left: 4px;
  width: 1px;
  content: "";
  background: #cbdbe5;
}

.live-fullscreen-progress > div:last-child::after {
  display: none;
}

.live-fullscreen-progress i {
  position: relative;
  z-index: 1;
  width: 9px;
  height: 9px;
  margin-top: 2px;
  border: 2px solid #8aa2b3;
  border-radius: 50%;
  background: #f8fbfd;
}

.live-fullscreen-progress strong {
  font-size: 11px;
  font-weight: 700;
}

.live-fullscreen-progress .is-complete {
  color: #2b7356;
}

.live-fullscreen-progress .is-complete i {
  border-color: #4ba57b;
  background: #4ba57b;
}

@media (max-width: 1280px) and (min-width: 901px) {
  .page-live-clean.live-preview-shell.layout-1 .live-command-layout {
    grid-template-columns: minmax(210px, 0.86fr) minmax(0, 2fr) minmax(210px, 0.86fr);
  }
}

@media (max-width: 900px) {
  .page-live-clean.live-preview-shell {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .page-live-clean.live-preview-shell.layout-1 .live-command-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    grid-template-areas: "devices" "viewer" "detail";
    height: auto;
    overflow: visible;
  }

  .page-live-clean.live-preview-shell.layout-4 .live-command-layout,
  .page-live-clean.live-preview-shell.layout-4.has-live-grid-device-drawer .live-command-layout {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    grid-template-areas: "viewer";
    height: auto;
    overflow: visible;
  }

  .page-live-clean.live-preview-shell.layout-4 .live-detail-pane,
  .page-live-clean.live-preview-shell.layout-9 .live-device-pane,
  .page-live-clean.live-preview-shell.layout-9 .live-detail-pane {
    display: none;
  }

  .page-live-clean.live-preview-shell.layout-9 .live-command-layout {
    grid-template-rows: auto;
    grid-template-areas: "viewer";
  }

  .page-live-clean.live-preview-shell .live-device-pane,
  .page-live-clean.live-preview-shell .live-viewer-pane,
  .page-live-clean.live-preview-shell .live-detail-pane {
    height: auto;
    max-height: none;
  }

  .page-live-clean.live-preview-shell.layout-4 .live-device-pane {
    display: none;
  }

  .page-live-clean.live-preview-shell.layout-4.has-live-grid-device-drawer .live-device-pane {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 8;
    display: flex;
    width: min(300px, calc(100% - 24px));
    height: auto;
    max-height: none;
    box-shadow: 10px 12px 30px rgba(37, 72, 103, 0.16);
  }

  .page-live-clean.live-preview-shell .live-preview-viewer-pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .live-preview-viewer-header {
    align-items: stretch;
    flex-direction: column;
    flex: 0 0 auto;
    min-height: 0 !important;
  }

  .live-preview-layout-controls {
    justify-content: space-between;
    width: 100%;
  }

  .live-preview-single-stage {
    flex: 0 0 auto;
    height: auto;
    min-height: 320px !important;
  }

  .live-grid-scroll {
    min-height: 420px;
  }

  .live-grid-stage.mode-4 {
    min-width: 520px;
  }

  .live-grid-stage.mode-9 {
    min-width: 700px;
  }

  .live-fullscreen-overlay {
    position: fixed;
    border: 0;
    border-radius: 0;
  }

  .live-fullscreen-surface {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .mode-focus .live-fullscreen-surface {
    grid-template-columns: minmax(0, 1fr);
  }

  .mode-focus .live-fullscreen-inspector {
    position: absolute;
    right: 10px;
    bottom: 64px;
    left: 10px;
    z-index: 6;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    max-height: 142px;
    gap: 8px;
    padding: 10px 12px;
    overflow: hidden;
    border: 1px solid #c9dbe6;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 6px 18px rgba(45, 78, 107, 0.12);
  }

  .mode-focus .live-fullscreen-canvas {
    bottom: 224px;
  }

  .mode-focus .live-fullscreen-stream-summary {
    display: none;
  }

  .mode-focus .live-fullscreen-inspector > header {
    gap: 2px;
    padding-bottom: 7px;
  }

  .mode-focus .live-fullscreen-inspector-rows {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 12px;
  }

  .mode-focus .live-fullscreen-inspector-rows > div {
    gap: 2px;
    padding: 4px 0;
  }

  .mode-focus .live-fullscreen-inspector-rows > div:nth-child(n + 5),
  .mode-focus .live-fullscreen-progress {
    display: none;
  }

  .live-fullscreen-hud {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .live-fullscreen-device-heading {
    max-width: min(100%, 300px);
  }

  .live-fullscreen-mode-switcher {
    grid-column: 1 / -1;
    grid-row: 2;
    width: fit-content;
    max-width: 100%;
  }

  .live-fullscreen-mode-switcher button {
    min-width: 92px;
  }

  .live-fullscreen-hud-actions > span {
    display: none;
  }

  .live-fullscreen-canvas {
    inset: 124px 10px 92px;
  }

  .live-fullscreen-media-frame {
    width: min(100%, calc((100dvh - 240px) * 1.7778));
  }

  .live-fullscreen-stream-summary {
    bottom: 66px;
    left: 50%;
    max-width: calc(100% - 20px);
    min-height: 30px;
    transform: translateX(-50%);
  }

  .live-fullscreen-feedback {
    top: 154px;
    right: 10px;
    max-width: calc(100% - 20px);
  }

  .live-fullscreen-action-dock {
    bottom: 10px;
  }
}

@media (max-width: 460px) {
  .live-preview-layout-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .live-preview-segmented,
  .live-preview-pagination {
    width: 100%;
    min-width: 0;
  }

  .live-preview-pagination {
    align-self: flex-start;
  }

  .live-grid-stage.mode-4 {
    min-width: 500px;
  }

  .live-grid-stage.mode-9 {
    min-width: 680px;
  }

  .live-fullscreen-hud {
    top: 10px;
    right: 10px;
    left: 10px;
  }

  .live-fullscreen-device-heading {
    padding: 8px 9px;
  }

  .live-fullscreen-device-heading > span:last-child {
    max-width: 230px;
  }

  .live-fullscreen-mode-switcher {
    width: 100%;
  }

  .live-fullscreen-mode-switcher button {
    min-width: 0;
    flex: 1 1 0;
    padding: 0 6px;
  }

  .live-fullscreen-mode-switcher button span {
    font-size: 10px;
  }

  .live-fullscreen-mode-switcher button svg {
    display: none;
  }

  .live-fullscreen-stream-summary span:nth-child(3) {
    display: none;
  }

  .live-fullscreen-action-dock {
    width: calc(100% - 20px);
    justify-content: center;
  }

  .live-fullscreen-action-dock button {
    min-width: 0;
    flex: 1 1 0;
    padding: 0 8px;
  }
}

.task-rule-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.3fr) minmax(0, 0.7fr);
  gap: 20px;
  min-height: 0;
  height: 100%;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.tree-panel {
  padding: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.file-panel {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(241, 248, 255, 0.9)),
    rgba(255, 255, 255, 0.84);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 18px 48px rgba(26, 78, 145, 0.08);
  clip-path: inset(0 round 22px);
}

.file-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.file-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  margin: 0 10px 10px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.26);
}

.file-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  overflow: hidden;
  border-radius: 16px;
}

.file-table th,
.file-table td {
  padding: 11px 12px;
  font-size: 13px;
  vertical-align: middle;
}

.file-table th {
  text-align: left;
  font-weight: 700;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.42);
}

.file-table td {
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
}

.live-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.live-sidebar,
.live-main {
  min-width: 0;
  min-height: 0;
}

.live-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 16px;
  overflow: hidden;
}

.live-side-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.live-scroll {
  display: grid;
  gap: 12px;
  overflow: auto;
  min-height: 0;
  align-content: start;
}

.list-card {
  display: grid;
  gap: 10px;
}

.live-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.live-group-toggle-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.live-group-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.live-group-toggle.collapsed .live-group-chevron {
  transform: rotate(90deg);
}

.live-group-list {
  display: grid;
  gap: 10px;
}

.live-card {
  width: 100%;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.56);
  text-align: left;
  cursor: pointer;
}

.live-card.selected {
  background: var(--bg-selected);
  border-color: rgba(59, 130, 246, 0.26);
}

.live-preview {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.4);
  aspect-ratio: 4 / 3;
  min-height: 84px;
}

.live-preview img,
.live-hero video,
.live-hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.live-preview-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.live-card-body {
  display: grid;
  gap: 4px;
  align-content: start;
}

.live-card-body strong {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
}

.live-card-body p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.35;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin: 0;
}

.live-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}

.live-hero {
  position: relative;
  min-height: 0;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.55);
  aspect-ratio: 16 / 9;
}

.live-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.82));
  color: #fff;
}

.live-overlay h4 {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 4px;
}

.live-overlay p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
  margin: 0;
}

.live-detail-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  overflow: auto;
}

.live-detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.live-detail-section {
  display: grid;
  gap: 12px;
}

.prototype-modal-backdrop {
  background: rgba(7, 20, 38, 0.42);
  backdrop-filter: blur(10px);
}

.prototype-modal {
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(237, 247, 255, 0.92)),
    var(--surface);
  box-shadow: 0 32px 90px rgba(9, 31, 62, 0.28);
}

.prototype-modal-head {
  border-bottom: 1px solid var(--line);
}

.prototype-modal-title h3 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
}

.prototype-modal-title p {
  margin: 6px 0 0;
  color: var(--muted);
}

.prototype-modal-body {
  max-height: 520px;
  overflow: auto;
}

.workplan-ledger-modal .prototype-modal-body {
  max-height: 650px;
}

.prototype-modal-actions {
  border-top: 1px solid var(--line);
}

@media (max-width: 1400px) {
  .page-workplans .workplan-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1200px) {
  .metric-grid,
  .summary-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .query-toolbar,
  .page-workplans .workplan-toolbar,
  .task-rule-query-toolbar,
  .live-layout,
  .dashboard-body,
  .task-rule-shell {
    grid-template-columns: 1fr;
  }

  .query-field {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 6px;
  }
}

@media (max-width: 980px) {
  body {
    padding: 12px;
  }

  .app-container-formal {
    width: 98%;
    max-width: 98%;
    height: 96%;
    max-height: 96%;
  }

  .top-header {
    flex-wrap: wrap;
    height: auto;
    padding: 18px 20px;
  }

  .query-toolbar,
  .page-workplans .workplan-toolbar {
    grid-template-columns: 1fr;
  }

  .query-field {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .app-container-formal {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-menu {
    max-height: 220px;
  }
}

/* Full-height ledgers and menus */
.sidebar {
  justify-content: flex-start;
}

.nav-menu {
  padding-bottom: 8px;
}

.ledger-panel-fixed,
.page-task-generation > .panel,
.page-tasks > .panel,
.page-devices > .panel,
.page-users > .panel,
.page-permissions > .panel,
.page-logs > .panel,
.page-settings > .panel,
.page-ai-control > .panel,
.page-violation > .panel,
.page-workplans > .panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

#pageMount > .view-stack,
.page-workplans,
.page-task-generation,
.page-tasks,
.page-devices,
.page-users,
.page-permissions,
.page-logs,
.page-settings {
  grid-template-rows: minmax(0, 1fr);
}

#pageMount > .page-live,
#pageMount > .page-live-clean,
.page-live.page-live-clean {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  grid-auto-rows: unset;
  gap: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.page-ai-control,
.page-violation {
  grid-template-rows: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.page-task-rules {
  grid-template-rows: minmax(0, 1fr);
}

.ledger-panel-fixed > .table,
.ledger-panel-fixed > .table-wrap,
.ledger-panel-fixed > .device-ledger,
.ledger-panel-fixed > .task-definition-ledger,
.ledger-panel-fixed > .task-rule-risk-table-wrap,
.ledger-panel-fixed > .file-list {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

.table,
.device-ledger,
.task-definition-ledger,
.task-rule-risk-table-wrap,
.file-list,
.table-wrap {
  min-height: 0;
  height: 100%;
}

.table,
.device-ledger,
.table-wrap,
.task-rule-risk-table-wrap,
.file-list,
.task-rule-ledger-panel,
.tree-panel,
.file-panel,
.task-rule-directory-scroll,
.violation-focus-shell,
.violation-focus-layout,
.violation-gallery {
  display: flex;
  flex-direction: column;
}

.table-head,
.device-ledger .table-head {
  flex: 0 0 auto;
}

.table-empty {
  flex: 1 1 auto;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.device-ledger > .table-empty,
.file-list .empty-state,
.task-rule-risk-table-wrap .table-empty {
  flex: 1 1 auto;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.task-rule-ledger-panel,
.task-rule-risk-table-wrap,
.task-rule-risk-table {
  min-height: 0;
}

.task-rule-ledger-panel,
.task-rule-risk-table,
.task-rule-directory-scroll,
.file-list,
.violation-focus-layout,
.violation-gallery {
  flex: 1 1 auto;
}

.task-rule-shell > .tree-panel,
.task-rule-shell > .file-panel,
.task-rule-ledger-panel,
.task-rule-risk-table-wrap,
.task-rule-risk-table {
  min-width: 0;
}

.task-rule-shell > .file-panel {
  border-radius: 22px;
  overflow: hidden;
}

.task-rule-risk-table-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.task-rule-risk-table-wrap > .table,
.task-rule-risk-table-wrap > .table-wrap {
  flex: 1 1 auto;
  min-height: 0;
}

.page-logs .table,
.page-settings .table,
.page-users .table,
.page-permissions .table,
.page-devices .device-ledger,
.page-task-generation .table,
.page-tasks .table,
.page-workplans .table,
.page-ai-control .table,
.page-violation .table {
  flex: 1 1 auto;
  min-height: 0;
}

/* Work-plan ledger: full-height body with a pinned pagination bar. */
.page-workplans .workplan-ledger-container {
  --workplan-head-height: 44px;
  --workplan-row-height: 46px;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(239, 247, 255, 0.72);
}

.page-workplans .workplan-ledger-container > .workplan-table {
  flex: 1 1 0;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: none;
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
  box-sizing: border-box;
  border-radius: 12px 12px 0 0;
  background: rgba(248, 252, 255, 0.88);
}

.page-workplans .workplan-table .table-head,
.page-workplans .workplan-table .table-row {
  --table-min: 100%;
  display: grid;
  grid-template-columns:
    44px
    44px
    minmax(140px, 0.9fr)
    minmax(240px, 1.64fr)
    minmax(140px, 0.9fr)
    minmax(98px, 0.56fr)
    minmax(98px, 0.58fr)
    minmax(98px, 0.58fr)
    minmax(140px, 0.9fr)
    minmax(98px, 0.58fr)
    minmax(148px, 1fr);
  gap: 0;
  width: 100%;
  min-width: 1288px;
  padding: 0 8px;
  box-sizing: border-box;
}

.page-workplans .workplan-table .table-head {
  position: sticky;
  top: 0;
  z-index: 2;
  flex: 0 0 var(--workplan-head-height);
  height: var(--workplan-head-height);
  min-height: var(--workplan-head-height);
  max-height: var(--workplan-head-height);
  background: rgba(235, 246, 255, 0.97);
}

.page-workplans .workplan-table .table-row {
  flex: 0 0 var(--ledger-row-slot-height, var(--workplan-row-height));
  height: var(--ledger-row-slot-height, var(--workplan-row-height));
  min-height: var(--ledger-row-slot-height, var(--workplan-row-height));
  max-height: var(--ledger-row-slot-height, var(--workplan-row-height));
  background: rgba(255, 255, 255, 0.54);
}

.page-workplans .workplan-table .table-row:hover {
  background: rgba(225, 241, 255, 0.72);
}

.page-workplans .workplan-table .table-head > span,
.page-workplans .workplan-table .table-row > span {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 6px;
  overflow: hidden;
  box-sizing: border-box;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.page-workplans .workplan-table .table-head > span {
  line-height: 1.25;
}

/* Work plan ledger: header black bold, body regular text. */
.page-workplans .workplan-table > .table-head,
.page-workplans .workplan-table > .table-head > span,
.page-workplans .workplan-table > .table-head > label,
.page-workplans .workplan-table > .table-head strong,
.page-workplans .workplan-table > .table-head b {
  color: #0f172a !important;
  font-weight: 700 !important;
}

.page-workplans .workplan-table > .table-row,
.page-workplans .workplan-table > .table-row > span,
.page-workplans .workplan-table > .table-row > label,
.page-workplans .workplan-table > .table-row strong,
.page-workplans .workplan-table > .table-row b,
.page-workplans .workplan-table .workplan-cell-text,
.page-workplans .workplan-table .workplan-content-cell,
.page-workplans .workplan-table .workplan-time-cell,
.page-workplans .workplan-table .workplan-level-cell {
  color: #1f2937 !important;
  font-weight: 400 !important;
}

.page-workplans .workplan-cell-text {
  display: -webkit-box;
  width: 100%;
  max-height: calc(1.35em * 2);
  overflow: hidden;
  color: inherit;
  line-height: 1.35;
  text-align: center;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.page-workplans .workplan-table .workplan-content-cell,
.page-workplans .workplan-table .workplan-time-cell,
.page-workplans .workplan-table .workplan-level-cell {
  max-height: calc(1.35em * 2);
  line-height: 1.35;
}

.page-workplans .workplan-table .table-empty {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  background: rgba(248, 252, 255, 0.88);
}

.page-workplans .workplan-ledger-container > .workplan-pagination {
  flex: 0 0 auto;
  width: 100%;
  min-height: 52px;
  margin-top: 0;
  padding: 8px 10px;
  box-sizing: border-box;
  border-top: 1px solid rgba(112, 163, 211, 0.22);
  background: rgba(235, 246, 255, 0.88);
}

.page-workplans .workplan-pagination-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  overflow: visible;
}

/* All primary ledgers share the same full-height vertical behavior.
   Column templates stay owned by their individual table classes. */
.ledger-slot-table > .table-row {
  flex: 0 0 var(--ledger-row-slot-height, 42px);
  height: var(--ledger-row-slot-height, 42px);
  min-height: var(--ledger-row-slot-height, 42px);
  max-height: var(--ledger-row-slot-height, 42px);
}

.ledger-panel-fixed > .ledger-pagination,
.task-rule-risk-table-wrap:not(.in-modal) > .ledger-pagination {
  flex: 0 0 auto;
  margin-top: 0;
  padding-top: 8px;
}

.ledger-panel-fixed > .table-wrap,
.task-rule-risk-table-wrap:not(.in-modal) {
  flex: 1 1 0;
  min-height: 0;
}

/* Text-only ledger cells wrap to two lines, then expose the full value by Tooltip. */
.ledger-text-cell {
  min-width: 0;
  overflow: hidden;
}

.ledger-text-cell > .ledger-cell-text {
  display: -webkit-box;
  width: 100%;
  max-height: calc(1.4em * 2);
  overflow: hidden;
  color: inherit;
  line-height: 1.4;
  text-align: center;
  text-overflow: ellipsis;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.task-rule-risk-table .table-row > span:nth-child(3) > .ledger-cell-text {
  max-height: calc(1.4em * 2);
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.task-rule-risk-name-cell {
  min-width: 0;
  max-width: 100%;
  overflow: hidden !important;
  white-space: normal !important;
}

.task-rule-risk-name-text {
  display: -webkit-box !important;
  width: 100%;
  max-height: calc(1.4em * 2);
  overflow: hidden !important;
  line-height: 1.4;
  text-align: center;
  text-overflow: ellipsis;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

/* Detail values remain readable without competing with modal titles or state labels. */
.ledger-modal .detail-grid > div > strong,
.ledger-modal .task-rule-summary-grid > article > strong,
.ledger-modal .task-rule-path-summary > article > strong,
.ledger-modal .task-rule-ledger-summary > article > strong,
.ledger-modal .workplan-modal-summary > article > strong,
.ledger-modal .workplan-modal-summary > article > em,
.ledger-modal .evidence-preview-meta > strong,
.ledger-modal .mini-ledger > div > b,
.ledger-modal .task-execution-scene-grid > article > strong,
.ledger-modal .task-execution-scene-item > b,
.ledger-modal .task-execution-history-list > article > strong,
.ledger-modal .task-evidence-list > article > strong,
.ledger-modal .task-doc-list > article > strong,
.ledger-modal .device-qr-meta > strong {
  font-weight: 400;
}

.ledger-modal .task-rule-risk-table .table-row,
.ledger-modal .task-rule-risk-table .table-row > span,
.ledger-modal .task-rule-risk-table .table-row strong,
.ledger-modal .task-rule-risk-table .table-row b {
  font-weight: 400;
}

/* Formal ledger data stays regular; headers, states, and controls keep their hierarchy. */
.ledger-slot-table > .table-row,
.ledger-slot-table > .table-row > span,
.ledger-slot-table > .table-row strong,
.ledger-slot-table > .table-row b,
.ledger-panel-fixed .table-row,
.ledger-panel-fixed .table-row > span,
.ledger-panel-fixed .table-row strong,
.ledger-panel-fixed .table-row b,
.task-rule-shell .table-row,
.task-rule-shell .table-row > span,
.task-rule-shell .table-row strong,
.task-rule-shell .table-row b {
  font-weight: 400;
}

/* Shared formal ledger typography: black bold headers, regular body text. */
.page-task-rules .task-rule-risk-table > .table-head,
.page-task-rules .task-rule-risk-table > .table-head > span,
.page-task-rules .task-rule-risk-table > .table-head > label,
.page-task-generation .task-generation-table > .table-head,
.page-task-generation .task-generation-table > .table-head > span,
.page-task-generation .task-generation-table > .table-head > label,
.page-task-generation .table > .table-head,
.page-task-generation .table > .table-head > span,
.page-task-generation .table > .table-head > label,
.page-tasks .task-execution-ledger-table > .table-head,
.page-tasks .task-execution-ledger-table > .table-head > span,
.page-tasks .task-execution-ledger-table > .table-head > label,
.page-tasks .table > .table-head,
.page-tasks .table > .table-head > span,
.page-tasks .table > .table-head > label,
.page-devices .device-ledger > .table-head,
.page-devices .device-ledger > .table-head > span,
.page-devices .device-ledger > .table-head > label,
.page-users .table > .table-head,
.page-users .table > .table-head > span,
.page-users .table > .table-head > label,
.page-permissions .table > .table-head,
.page-permissions .table > .table-head > span,
.page-permissions .table > .table-head > label,
.page-logs .table > .table-head,
.page-logs .table > .table-head > span,
.page-logs .table > .table-head > label,
.page-settings .table > .table-head,
.page-settings .table > .table-head > span,
.page-settings .table > .table-head > label {
  color: #0f172a !important;
  font-weight: 700 !important;
}

.page-task-rules .task-rule-risk-table > .table-row,
.page-task-rules .task-rule-risk-table > .table-row > span,
.page-task-rules .task-rule-risk-table > .table-row > label,
.page-task-rules .task-rule-risk-table > .table-row strong,
.page-task-rules .task-rule-risk-table > .table-row b,
.page-task-rules .task-rule-risk-table .ledger-cell-text,
.page-task-rules .task-rule-risk-table .task-rule-risk-name-text,
.page-task-generation .task-generation-table > .table-row,
.page-task-generation .task-generation-table > .table-row > span,
.page-task-generation .task-generation-table > .table-row > label,
.page-task-generation .task-generation-table > .table-row strong,
.page-task-generation .task-generation-table > .table-row b,
.page-task-generation .table > .table-row,
.page-task-generation .table > .table-row > span,
.page-task-generation .table > .table-row > label,
.page-task-generation .table > .table-row strong,
.page-task-generation .table > .table-row b,
.page-tasks .task-execution-ledger-table > .table-row,
.page-tasks .task-execution-ledger-table > .table-row > span,
.page-tasks .task-execution-ledger-table > .table-row > label,
.page-tasks .task-execution-ledger-table > .table-row strong,
.page-tasks .task-execution-ledger-table > .table-row b,
.page-tasks .table > .table-row,
.page-tasks .table > .table-row > span,
.page-tasks .table > .table-row > label,
.page-tasks .table > .table-row strong,
.page-tasks .table > .table-row b,
.page-devices .device-ledger > .table-row,
.page-devices .device-ledger > .table-row > span,
.page-devices .device-ledger > .table-row > label,
.page-devices .device-ledger > .table-row strong,
.page-devices .device-ledger > .table-row b,
.page-users .table > .table-row,
.page-users .table > .table-row > span,
.page-users .table > .table-row > label,
.page-users .table > .table-row strong,
.page-users .table > .table-row b,
.page-permissions .table > .table-row,
.page-permissions .table > .table-row > span,
.page-permissions .table > .table-row > label,
.page-permissions .table > .table-row strong,
.page-permissions .table > .table-row b,
.page-logs .table > .table-row,
.page-logs .table > .table-row > span,
.page-logs .table > .table-row > label,
.page-logs .table > .table-row strong,
.page-logs .table > .table-row b,
.page-settings .table > .table-row,
.page-settings .table > .table-row > span,
.page-settings .table > .table-row > label,
.page-settings .table > .table-row strong,
.page-settings .table > .table-row b {
  color: #1f2937 !important;
  font-weight: 400 !important;
}

.live-main,
.live-detail-panel,
.task-rule-shell,
.dashboard-body {
  min-height: 0;
}

/* Remote inspection keeps the proven three-pane operator layout. */
.page-live-clean {
  display: grid;
  height: 100%;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
  grid-auto-rows: unset;
  gap: 0;
  overflow: hidden;
}

.page-live-clean > .live-module-topbar {
  min-height: 42px;
  height: 42px;
  max-height: 42px;
  padding: 0 12px;
  align-items: center;
  box-sizing: border-box;
  flex: 0 0 42px;
}

.page-live-clean .live-module-title strong {
  font-size: 16px;
}

.page-live-clean .live-module-title span,
.page-live-clean .live-device-card-meta,
.page-live-clean .live-card-meta {
  font-size: 12px;
}

.page-live-clean > .live-module-topbar .live-module-title {
  display: flex;
  align-items: center;
  min-height: 0;
}

.page-live-clean > .live-module-topbar .live-module-title span {
  display: none;
}

.page-live-clean > .live-module-topbar .live-module-mode {
  min-height: 0;
}

.page-live-clean > .live-module-topbar .live-module-mode button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.live-shell > .live-module-topbar {
  min-height: 42px;
  height: 42px;
  padding: 0 12px;
  align-items: center;
}

.live-shell > .live-module-topbar .live-module-title {
  display: flex;
  align-items: center;
  min-height: 0;
}

.live-shell > .live-module-topbar .live-module-title strong {
  font-size: 16px;
}

.live-shell > .live-module-topbar .live-module-title span {
  display: none;
}

.live-shell > .live-module-topbar .live-module-mode button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.page-live-clean .live-command-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas: "devices viewer detail";
  gap: 14px;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  align-items: stretch;
  align-self: stretch;
  overflow: hidden;
}

.page-live-clean .live-device-pane,
.page-live-clean .live-viewer-pane,
.page-live-clean .live-detail-pane {
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.58);
  border-radius: 16px;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.page-live-clean .live-pane-header {
  min-height: 52px;
  padding: 12px 14px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.page-live-clean .live-pane-header strong {
  font-size: 16px;
}

.page-live-clean .live-device-toolbar {
  padding: 10px 12px;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.page-live-clean .live-device-toolbar .live-filter-field:first-child {
  grid-column: 1 / -1;
}

.page-live-clean .live-filter-field span,
.page-live-clean .live-device-group-toggle,
.page-live-clean .live-device-card-body strong,
.page-live-clean .live-detail-section header strong {
  font-size: 14px;
}

.page-live-clean .live-device-scroll,
.page-live-clean .live-detail-scroll {
  padding: 10px 12px 14px;
}

.page-live-clean .live-device-group + .live-device-group {
  margin-top: 12px;
}

.page-live-clean .live-device-group-toggle {
  min-height: 36px;
  padding: 0 4px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.page-live-clean .live-device-list {
  gap: 8px;
  padding-top: 8px;
}

.page-live-clean .live-device-card {
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 9px;
  padding: 8px;
  border-radius: 12px;
}

.page-live-clean .live-device-preview {
  min-height: 70px;
  border-radius: 9px;
}

.page-live-clean .live-device-card-body {
  gap: 3px;
}

.page-live-clean .live-device-card-body p {
  font-size: 12px;
  line-height: 1.3;
}

.page-live-clean .live-device-meta {
  gap: 4px 8px;
}

.page-live-clean .live-device-meta span {
  font-size: 11px;
}

.page-live-clean .live-viewer-stage {
  display: flex;
  flex: 1 1 auto;
  padding: 12px;
  min-height: 0;
}

.page-live-clean .live-video-frame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  height: 100%;
  aspect-ratio: auto;
  max-height: 100%;
  border-radius: 12px;
}

.page-live-clean .live-video-toolbar {
  justify-content: center;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
}

.page-live-clean .live-detail-pane .live-detail-meta-grid {
  gap: 8px;
}

.page-live-clean .live-detail-pane .live-detail-meta-grid article {
  min-height: 58px;
  padding: 9px 10px;
  border-radius: 10px;
}

.page-live-clean .live-detail-pane .live-detail-meta-grid span,
.page-live-clean .live-detail-pane .live-detail-long-copy span {
  font-size: 11px;
}

.page-live-clean .live-detail-pane .live-detail-meta-grid strong {
  font-size: 13px;
}

.page-live-clean .live-detail-long-copy {
  gap: 5px;
  padding: 10px;
  border-radius: 10px;
}

.page-live-clean .live-detail-long-copy p {
  font-size: 13px;
  line-height: 1.5;
}

.page-live-clean .live-progress-rail {
  gap: 6px;
}

.page-live-clean .live-progress-rail span {
  min-height: 30px;
  font-size: 12px;
}

/* Force the three operator panes to consume all residual height under the topbar. */
.page-live-clean > .live-command-layout {
  grid-row: 1;
  height: 100%;
  min-height: 0;
  max-height: none;
}

.page-live-clean > .live-command-layout > .live-device-pane,
.page-live-clean > .live-command-layout > .live-viewer-pane,
.page-live-clean > .live-command-layout > .live-detail-pane {
  height: 100%;
  min-height: 0;
  max-height: none;
}

@media (min-width: 1281px) {
  .page-live-clean .live-command-layout,
  .page-live-clean .live-device-pane,
  .page-live-clean .live-viewer-pane,
  .page-live-clean .live-detail-pane {
    height: 100% !important;
    max-height: none !important;
    overflow: hidden !important;
  }
}

.task-rule-shell,
.page-ai-control,
.page-violation {
  height: 100%;
}

.tree-panel,
.file-panel,
.violation-focus-shell,
.page-ai-control > .panel,
.page-violation > .panel {
  min-height: 0;
}

/* Sidebar prototype fidelity override */
.app-shell .app-container-formal > .sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  max-width: var(--sidebar-width);
  padding: 20px 16px;
  background: rgba(255, 255, 255, 0.4);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.app-shell .app-container-formal > .sidebar .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  margin-bottom: 28px;
  width: 100%;
  min-width: 0;
}

.app-shell .app-container-formal > .sidebar .logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #60a5fa, #3b82f6);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
}

.app-shell .app-container-formal > .sidebar .logo-icon svg,
.app-shell .app-container-formal > .sidebar .nav-item svg,
.app-shell .app-container-formal > .sidebar .user-profile-actions svg {
  width: 24px;
  height: 24px;
}

.app-shell .app-container-formal > .sidebar .logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  line-height: 1.35;
}

.app-shell .app-container-formal > .sidebar .nav-menu {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 4px 0 0;
}

.app-shell .app-container-formal > .sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
  position: relative;
  transform: none;
  transition: all 0.2s ease;
}

.app-shell .app-container-formal > .sidebar .nav-item:not(.active) {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  transform: none !important;
}

.app-shell .app-container-formal > .sidebar .nav-item:hover {
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-primary);
  box-shadow: none;
  transform: none;
}

.app-shell .app-container-formal > .sidebar .nav-item:not(.active):hover,
.app-shell .app-container-formal > .sidebar .nav-item:not(.active):focus-visible {
  border: 0 !important;
  box-shadow: none !important;
}

.app-shell .app-container-formal > .sidebar .nav-item.active {
  background: var(--bg-selected);
  color: var(--primary-blue);
  font-weight: 600;
  box-shadow: none;
  transform: none;
}

.app-shell .app-container-formal > .sidebar .nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 20px;
  background: var(--primary-blue);
  border-radius: 0 3px 3px 0;
  transform: translateY(-50%);
}

.app-shell .app-container-formal > .sidebar .nav-item span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell .app-container-formal > .sidebar .user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.5);
  min-height: 65px;
}

.app-shell .app-container-formal > .sidebar .user-avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #dbe8ff;
  color: var(--primary-blue);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}

.app-shell .app-container-formal > .sidebar .user-info {
  flex: 1 1 auto;
  min-width: 0;
}

.app-shell .app-container-formal > .sidebar .user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
}

.app-shell .app-container-formal > .sidebar .user-plan {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  line-height: 1.35;
}

.app-shell .app-container-formal > .sidebar .user-profile-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.app-shell .app-container-formal > .sidebar .user-profile-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--text-primary);
  opacity: 0.9;
}

.app-shell .app-container-formal > .sidebar .user-profile-chevron svg {
  width: 20px;
  height: 20px;
}

.app-shell .app-container-formal > .sidebar .user-profile-logout {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--button-c-border);
  background: var(--button-c-bg);
  color: var(--button-c-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
}

.app-shell .app-container-formal > .sidebar .user-profile-logout:hover {
  background: var(--button-c-bg-hover);
}

/* Keep the cockpit's compact status strip from inheriting the ledger auto-row. */
#pageMount > .page-dashboard {
  grid-template-rows: 88px minmax(0, 1fr);
}

@media (max-width: 1200px) {
  #pageMount > .page-dashboard {
    grid-template-rows: auto minmax(0, 1fr);
    align-content: start;
  }
}

/* Final formal-ledger typography override.
   Headers are black and bold; every data cell stays regular, including nested strong/em/b/status text. */
.page-task-rules .task-rule-risk-table > .table-head,
.page-task-rules .task-rule-risk-table > .table-head *,
.page-task-generation .task-generation-table > .table-head,
.page-task-generation .task-generation-table > .table-head *,
.page-tasks .task-execution-ledger-table > .table-head,
.page-tasks .task-execution-ledger-table > .table-head *,
.page-devices .device-ledger > .table-head,
.page-devices .device-ledger > .table-head *,
.page-users .table > .table-head,
.page-users .table > .table-head *,
.page-permissions .table > .table-head,
.page-permissions .table > .table-head *,
.page-logs .table > .table-head,
.page-logs .table > .table-head *,
.page-settings .table > .table-head,
.page-settings .table > .table-head * {
  color: #0f172a !important;
  font-weight: 700 !important;
}

.page-task-rules .task-rule-risk-table > .table-row > span,
.page-task-rules .task-rule-risk-table > .table-row > span *,
.page-task-generation .task-generation-table > .table-row > span,
.page-task-generation .task-generation-table > .table-row > span *,
.page-tasks .task-execution-ledger-table > .table-row > span,
.page-tasks .task-execution-ledger-table > .table-row > span *,
.page-devices .device-ledger > .table-row > span,
.page-devices .device-ledger > .table-row > span *,
.page-users .table > .table-row > span,
.page-users .table > .table-row > span *,
.page-permissions .table > .table-row > span,
.page-permissions .table > .table-row > span *,
.page-logs .table > .table-row > span,
.page-logs .table > .table-row > span *,
.page-settings .table > .table-row > span,
.page-settings .table > .table-row > span * {
  font-weight: 400 !important;
}

/* Risk control measures are two lines at most; the parent title attribute shows the full text on hover. */
.page-task-rules .task-rule-risk-table .task-rule-measure-cell {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  min-width: 0;
  max-width: 100%;
  height: calc(1.4em * 2) !important;
  min-height: calc(1.4em * 2) !important;
  max-height: calc(1.4em * 2) !important;
  overflow: hidden !important;
  white-space: normal !important;
  line-height: 1.4;
  pointer-events: auto;
}

.page-task-rules .task-rule-risk-table .task-rule-measure-cell > .task-rule-measure-text {
  display: -webkit-box !important;
  width: 100%;
  height: calc(1.4em * 2) !important;
  max-height: calc(1.4em * 2);
  overflow: hidden !important;
  color: #1f2937 !important;
  font-weight: 400 !important;
  line-height: 1.4;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  pointer-events: auto;
  cursor: help;
}

.ledger-hover-tooltip {
  position: fixed;
  z-index: 99999;
  max-width: min(420px, calc(100vw - 24px));
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.94);
  color: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  white-space: normal;
  word-break: break-word;
  pointer-events: none;
}

.ledger-hover-tooltip[hidden] {
  display: none !important;
}

/* Formal ledgers only use the custom black tooltip, never the native pale title tip. */
.page-workplans .table-row [title],
.page-task-rules .table-row [title],
.page-task-generation .table-row [title],
.page-tasks .table-row [title],
.page-devices .table-row [title],
.page-users .table-row [title],
.page-permissions .table-row [title],
.page-logs .table-row [title],
.page-settings .table-row [title] {
  pointer-events: auto;
}

.page-workplans .table-row > span.has-ledger-tip,
.page-task-rules .table-row > span.has-ledger-tip,
.page-task-generation .table-row > span.has-ledger-tip,
.page-tasks .table-row > span.has-ledger-tip,
.page-devices .table-row > span.has-ledger-tip,
.page-users .table-row > span.has-ledger-tip,
.page-permissions .table-row > span.has-ledger-tip,
.page-logs .table-row > span.has-ledger-tip,
.page-settings .table-row > span.has-ledger-tip,
.task-rule-measure-cell.has-ledger-tip,
.task-rule-risk-name-cell.has-ledger-tip,
.ledger-text-cell.has-ledger-tip {
  cursor: help;
}
.device-management-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 6px 12px 0;
  border-bottom: 1px solid rgba(106, 147, 180, 0.2);
}

.device-management-tabs .ledger-tab {
  height: 34px;
  padding: 0 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted-text, #607487);
  font: inherit;
  cursor: pointer;
}

.device-management-tabs .ledger-tab.active {
  border-bottom-color: #1689a7;
  color: #12384a;
  font-weight: 700;
}

.device-registration-table .table-head,
.device-registration-table .table-row {
  grid-template-columns: 52px minmax(190px, 1.2fr) 92px minmax(130px, .8fr) minmax(160px, 1fr) 108px minmax(110px, .7fr) minmax(130px, .8fr) minmax(300px, 1.7fr);
  min-width: var(--table-min-width, 1240px);
}

.device-registration-table .table-actions {
  min-width: 300px;
  justify-content: flex-start;
  overflow: visible;
}

.page-devices .device-ledger .table-head,
.page-devices .device-ledger .table-row {
  grid-template-columns: 42px 48px minmax(128px, .95fr) minmax(90px, .7fr) 88px 78px minmax(104px, .8fr) minmax(132px, 1fr) minmax(112px, .85fr) minmax(150px, 1.1fr) 92px minmax(126px, .9fr);
}

.key-mapping-table .table-head,
.key-mapping-table .table-row {
  grid-template-columns: 52px minmax(150px, 1.2fr) minmax(100px, .8fr) 72px 92px 82px minmax(120px, 1fr) minmax(170px, 1.2fr);
}

.app-release-table .table-head,
.app-release-table .table-row {
  grid-template-columns: 52px minmax(100px, .8fr) 90px minmax(160px, 1.2fr) 92px 92px minmax(120px, .9fr) minmax(140px, 1fr) minmax(130px, .9fr);
}

.file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.user-operation-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .device-management-tabs {
    overflow-x: auto;
  }

  .device-management-tabs .ledger-tab {
    flex: 0 0 auto;
  }
}

/* AI control center prototype */
.page-ai-control {
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
}

.page-ai-control > .ai-control-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.ai-control-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px 14px 0;
  border-bottom: 1px solid rgba(106, 147, 180, 0.24);
  background: #f8fbfd;
}

.ai-control-tabs .ledger-tab {
  height: 36px;
  padding: 0 18px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #566c79;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.ai-control-tabs .ledger-tab:hover {
  color: #153d4d;
  background: #edf5f7;
}

.ai-control-tabs .ledger-tab:focus-visible {
  outline: 2px solid #1689a7;
  outline-offset: -2px;
}

.ai-control-tabs .ledger-tab.active {
  border-bottom-color: #1689a7;
  color: #12384a;
  font-weight: 700;
}

.ai-config-prototype-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex: 0 0 auto;
  min-height: 62px;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(106, 147, 180, 0.2);
  background: #eef7f8;
}

.ai-config-prototype-banner > div {
  display: grid;
  gap: 3px;
}

.ai-config-prototype-banner strong {
  color: #12384a;
  font-size: 15px;
}

.ai-config-prototype-banner span {
  color: #526b77;
  font-size: 12px;
}

.ai-config-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  cursor: pointer;
  user-select: none;
}

.ai-config-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ai-config-switch > span {
  position: relative;
  width: 38px;
  height: 22px;
  border: 1px solid #93a8b2;
  border-radius: 999px;
  background: #dbe5e9;
  transition: background 180ms ease, border-color 180ms ease;
}

.ai-config-switch > span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(23, 62, 76, 0.28);
  transition: transform 180ms ease;
}

.ai-config-switch input:checked + span {
  border-color: #1689a7;
  background: #1689a7;
}

.ai-config-switch input:checked + span::after {
  transform: translateX(16px);
}

.ai-config-switch input:focus-visible + span {
  outline: 2px solid #1689a7;
  outline-offset: 2px;
}

.ai-config-switch b {
  color: #173f50;
  font-size: 13px;
}

.ai-config-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: #fff;
}

.ai-config-section {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 22px 24px 18px;
}

.ai-config-section + .ai-config-section {
  border-left: 1px solid rgba(106, 147, 180, 0.22);
}

.ai-config-section > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  margin-bottom: 18px;
}

.ai-config-section > header > div {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 9px;
  row-gap: 2px;
  align-items: center;
}

.ai-config-section > header strong {
  color: #183b4a;
  font-size: 16px;
}

.ai-config-section > header small {
  grid-column: 2;
  color: #647985;
  font-size: 12px;
}

.ai-config-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  grid-row: span 2;
  width: 38px;
  height: 28px;
  border-radius: 6px;
  background: #dceff1;
  color: #0f6478;
  font-size: 11px;
  font-weight: 800;
}

.ai-config-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.ai-config-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.ai-config-field.span-2 {
  grid-column: span 2;
}

.ai-config-field > span {
  color: #3f5966;
  font-size: 12px;
  font-weight: 700;
}

.ai-config-field input,
.ai-config-field select,
.ai-config-field textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid #b9cbd3;
  border-radius: 6px;
  background: #fff;
  color: #142f3b;
  font: inherit;
  font-size: 13px;
}

.ai-config-field input {
  height: 38px;
  padding: 0 11px;
}

.ai-config-field select {
  height: 38px;
  padding: 0 32px 0 11px;
}

.ai-config-field textarea {
  min-height: 132px;
  padding: 10px 11px;
  line-height: 1.6;
  resize: vertical;
}

.ai-config-field input::placeholder,
.ai-config-field textarea::placeholder {
  color: #667b86;
}

.ai-config-field input:focus,
.ai-config-field select:focus,
.ai-config-field textarea:focus {
  border-color: #1689a7;
  outline: 2px solid rgba(22, 137, 167, 0.16);
  outline-offset: 0;
}

.ai-config-section-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.ai-config-test-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  color: #607682;
  font-size: 12px;
  white-space: nowrap;
}

.ai-config-test-status.success { color: #14764e; }
.ai-config-test-status.failed { color: #b23b3b; }
.ai-config-test-status.testing { color: #176e86; }

.ai-config-test-status.testing i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1689a7;
  animation: ai-test-pulse 900ms ease-in-out infinite alternate;
}

@keyframes ai-test-pulse {
  from { opacity: 0.35; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.ai-config-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex: 0 0 auto;
  min-height: 58px;
  padding: 9px 18px;
  border-top: 1px solid rgba(106, 147, 180, 0.22);
  background: #f8fbfd;
}

.ai-config-footer span {
  color: #637986;
  font-size: 12px;
}

@media (max-width: 1180px) {
  .ai-config-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-config-section + .ai-config-section {
    border-top: 1px solid rgba(106, 147, 180, 0.22);
    border-left: 0;
  }
}

@media (max-width: 720px) {
  .ai-control-tabs {
    overflow-x: auto;
  }

  .ai-control-tabs .ledger-tab {
    flex: 0 0 auto;
    padding: 0 12px;
  }

  .ai-config-prototype-banner {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
  }

  .ai-config-section {
    padding: 18px 14px;
  }

  .ai-config-section > header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .ai-config-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-config-field.span-2 {
    grid-column: auto;
  }

  .ai-config-footer {
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-config-switch > span,
  .ai-config-switch > span::after {
    transition: none;
  }

  .ai-config-test-status.testing i {
    animation: none;
  }
}
