/* v4.0 unified visual layer. Loaded after page-specific styles. */
:root {
  --bg: #080b11;
  --surface: #10151d;
  --surface-2: #151b25;
  --surface-3: #1a2230;
  --line: rgba(184, 199, 224, 0.105);
  --line-strong: rgba(184, 199, 224, 0.19);
  --text: #f2f6ff;
  --muted: #9aa6b8;
  --subtle: #697589;
  --blue: #5b83ff;
  --blue-strong: #356dff;
  --blue-soft: rgba(76, 125, 255, 0.15);
  --green: #42cc99;
  --green-soft: rgba(56, 199, 147, 0.13);
  --yellow: #efbd54;
  --yellow-soft: rgba(233, 185, 73, 0.13);
  --red: #f47681;
  --red-soft: rgba(241, 111, 121, 0.13);
  --shadow: 0 14px 38px rgba(0, 0, 0, 0.22);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.16);
  --radius: 13px;
  --sidebar-width: 196px;
}

html {
  background: var(--bg);
  scrollbar-color: #303a4b transparent;
  scrollbar-width: thin;
}

body {
  background:
    radial-gradient(circle at 74% -12%, rgba(53, 109, 255, 0.12), transparent 34rem),
    radial-gradient(circle at 14% 112%, rgba(66, 204, 153, 0.045), transparent 30rem),
    var(--bg);
}

* {
  scrollbar-color: #303a4b transparent;
  scrollbar-width: thin;
}

*::-webkit-scrollbar { width: 7px; height: 7px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 999px; background: #303a4b; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: #42506a; background-clip: padding-box; }

::selection { background: rgba(91, 131, 255, 0.28); color: #fff; }

.app-shell {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  padding: 12px 10px;
  border-right-color: rgba(184, 199, 224, 0.1);
  background: linear-gradient(180deg, rgba(14, 18, 25, 0.98), rgba(10, 14, 20, 0.98));
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.12);
}

.brand {
  min-height: 47px;
  gap: 10px;
  padding: 2px 6px 12px;
}

.brand-mark {
  width: 35px;
  height: 35px;
  border-radius: 11px;
  background: linear-gradient(150deg, #7397ff, #356dff 60%, #2757ca);
  box-shadow: 0 10px 26px rgba(53, 109, 255, 0.3), inset 0 1px rgba(255, 255, 255, 0.18);
  font-size: 12px;
}

.brand-copy strong { color: #f6f8ff; font-size: 13px; }
.brand-copy small { color: #647086; font-size: 11px; letter-spacing: 1.45px; }

.nav-list { gap: 4px; }

.nav-item {
  grid-template-columns: 25px 1fr auto;
  min-height: 38px;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  color: #98a4b6;
  font-size: 12px;
  font-weight: 560;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #7f8ca1;
  font-size: 13px;
}

.nav-item:hover {
  border-color: rgba(184, 199, 224, 0.12);
  background: rgba(255, 255, 255, 0.035);
}

.nav-item:hover .nav-icon {
  border-color: rgba(184, 199, 224, 0.1);
  background: rgba(255, 255, 255, 0.035);
  color: #cad4e6;
}

.nav-item.is-active {
  border-color: rgba(91, 131, 255, 0.27);
  background: linear-gradient(100deg, rgba(72, 112, 225, 0.22), rgba(43, 67, 122, 0.1));
  box-shadow: inset 3px 0 #5b83ff, 0 8px 18px rgba(0, 0, 0, 0.12);
  color: #edf3ff;
}

.nav-item.is-active .nav-icon {
  border-color: rgba(91, 131, 255, 0.24);
  background: rgba(91, 131, 255, 0.16);
  color: #aac0ff;
}

.nav-item b {
  min-width: 21px;
  color: #9aa8bf;
  font-size: 12px;
}

.sidebar-foot {
  padding: 11px 7px 2px;
  border-top-color: rgba(184, 199, 224, 0.09);
}

.sidebar-foot strong { font-size: 11px; }
.sidebar-foot small { max-width: 130px; overflow: hidden; font-size: 11px; line-height: 1.35; text-overflow: ellipsis; }

.workspace {
  padding: 13px 16px 20px;
}

.topbar {
  align-items: center;
  min-height: 42px;
  gap: 18px;
  margin-bottom: 10px;
}

.heading-copy { min-width: 190px; }
.heading-line { gap: 9px; }

h1,
.page-heading h1 {
  color: #f5f7ff;
  font-size: clamp(22px, 1.75vw, 28px);
  font-weight: 740;
  letter-spacing: -0.8px;
}

h2 { color: #ecf1fb; font-weight: 680; }

.heading-copy p,
.page-heading p,
.page-note {
  color: #7f8b9f;
  font-size: 12px;
  line-height: 1.5;
}

.mode-chip,
.readonly-badge,
.role-badge,
.task-safe-note {
  border-color: rgba(91, 131, 255, 0.22);
  background: rgba(91, 131, 255, 0.085);
  color: #9fb6fb;
}

.top-actions {
  min-width: 0;
  gap: 7px;
}

.sync-status {
  min-width: 118px;
  color: #778398;
  font-size: 11px;
}

.button,
.primary-button,
.secondary-button,
.danger-button,
.text-button {
  min-height: 34px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 660;
}

.button-secondary,
.secondary-button {
  border-color: rgba(184, 199, 224, 0.14);
  background: linear-gradient(180deg, #171d27, #121720);
  color: #d1d9e7;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

.button-primary,
.primary-button {
  background: linear-gradient(145deg, #638cff, #356dff);
  box-shadow: 0 8px 22px rgba(53, 109, 255, 0.24), inset 0 1px rgba(255, 255, 255, 0.14);
}

.button:hover,
.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.text-button:hover {
  filter: brightness(1.08);
}

.account-link {
  min-width: 104px;
  max-width: 152px;
  padding-inline: 11px;
}

.account-link span { max-width: 128px; }

.filter-panel,
.collection-filters {
  border-color: rgba(184, 199, 224, 0.11);
  background: linear-gradient(180deg, rgba(17, 22, 30, 0.94), rgba(13, 18, 25, 0.94));
  box-shadow: var(--shadow-soft);
}

.search-box,
.select-box,
.form-field input,
.form-field select,
.form-field textarea,
.cost-input-grid input,
.cost-notes textarea,
.production-modal input,
.production-modal select,
.production-modal textarea {
  border-color: rgba(184, 199, 224, 0.105);
  background: rgba(8, 12, 18, 0.82);
}

.search-box:hover,
.select-box:hover,
.form-field input:hover,
.form-field select:hover,
.form-field textarea:hover {
  border-color: rgba(184, 199, 224, 0.18);
}

.search-box input,
.select-box select { font-size: 12px; }
.select-box > span { color: #6f7b8f; font-size: 11px; }

.panel,
.queue-panel,
.detail-panel,
.task-queue-panel,
.task-detail-panel,
.production-queue-panel,
.production-detail-panel {
  border-color: rgba(184, 199, 224, 0.105);
  background: linear-gradient(155deg, rgba(17, 22, 30, 0.98), rgba(14, 18, 25, 0.98));
  box-shadow: var(--shadow-soft);
}

.panel-head {
  border-bottom-color: rgba(184, 199, 224, 0.09);
}

.kpi-card,
.collection-kpis article,
.stat-card {
  border-color: rgba(184, 199, 224, 0.105);
  background: linear-gradient(145deg, rgba(20, 27, 37, 0.98), rgba(14, 19, 27, 0.98));
  box-shadow: var(--shadow-soft), inset 0 1px rgba(255, 255, 255, 0.025);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.kpi-card:hover,
.collection-kpis article:hover,
.stat-card:hover {
  border-color: rgba(91, 131, 255, 0.24);
  transform: translateY(-1px);
  box-shadow: 0 13px 28px rgba(0, 0, 0, 0.2);
}

.collection-kpis span,
.collection-kpis small,
.kpi-label,
.stat-card span { color: #8390a4; }

.collection-kpis strong,
.stat-card strong { color: #f6f8ff; }

.collection-panel-head {
  min-height: 45px;
}

.collection-table th,
.user-table th {
  background: rgba(18, 24, 33, 0.98);
  color: #778397;
  letter-spacing: 0.15px;
}

.collection-table tbody tr:nth-child(even),
.user-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.012);
}

.detail-empty,
.empty-state {
  background:
    linear-gradient(rgba(17, 22, 30, 0.93), rgba(17, 22, 30, 0.93)),
    radial-gradient(circle at center, rgba(91, 131, 255, 0.16), transparent 45%);
}

.detail-empty > span,
.empty-icon {
  border: 1px solid rgba(91, 131, 255, 0.18);
  background: rgba(91, 131, 255, 0.1);
}

.detail-section,
.task-callout,
.task-section,
.shot-card,
.production-summary-note,
.output-card {
  border-color: rgba(184, 199, 224, 0.105);
  background: rgba(9, 13, 19, 0.62);
}

.task-card {
  border-color: rgba(184, 199, 224, 0.13);
  background: linear-gradient(145deg, rgba(18, 24, 33, 0.98), rgba(13, 18, 25, 0.98));
}

.task-card:hover,
.task-card.is-selected {
  border-color: rgba(91, 131, 255, 0.68);
  background: linear-gradient(145deg, rgba(27, 39, 59, 0.98), rgba(17, 25, 38, 0.98));
  box-shadow: inset 3px 0 #5b83ff, 0 10px 22px rgba(0, 0, 0, 0.18);
}

.task-card h3 { color: #f2f5fc; font-size: 13px; }
.task-card p, .task-card small, .task-card-foot { color: #8e9aab; font-size: 12px; }

.task-detail-panel,
.production-detail-panel { overscroll-behavior: contain; }

.task-detail-head,
.production-detail-head {
  position: sticky;
  top: -12px;
  z-index: 5;
  margin: -12px -12px 0;
  padding: 12px;
  border-bottom: 1px solid rgba(184, 199, 224, 0.1);
  background: rgba(15, 20, 28, 0.93);
  backdrop-filter: blur(14px);
}

.production-detail-head {
  top: -14px;
  margin: -14px -14px 0;
  padding: 14px;
}

.task-input-grid > div,
.task-resource,
.evidence-card,
.timeline-row,
.shot-recommendation,
.cost-result > div {
  border-color: rgba(184, 199, 224, 0.105);
  background: rgba(7, 11, 17, 0.72);
}

.task-steps li::before,
.shot-order strong {
  border-color: rgba(91, 131, 255, 0.24);
  background: rgba(91, 131, 255, 0.14);
  color: #bfd0ff;
}

.production-tabs {
  border-color: rgba(184, 199, 224, 0.11);
  background: rgba(8, 12, 18, 0.72);
}

.production-tabs button.is-active {
  background: linear-gradient(180deg, rgba(48, 69, 105, 0.58), rgba(32, 47, 73, 0.58));
}

.admin-page { background: transparent; }

.admin-topbar {
  min-height: 60px;
  padding: 10px 18px;
  border-bottom-color: rgba(184, 199, 224, 0.1);
  background: rgba(9, 13, 19, 0.9);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.top-brand { min-width: 190px; }
.top-brand > span:last-child { min-width: 0; }
.top-brand strong { color: #f5f7ff; }
.top-brand small { display: block; }

.admin-main {
  width: min(1480px, 100%);
  padding: 16px 18px 32px;
}

.page-heading { align-items: center; margin-bottom: 12px; }

.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: #5b83ff;
  content: "";
}

.panel-body { background: rgba(9, 13, 19, 0.18); }

.profile-row {
  align-items: flex-start;
  border-bottom-color: rgba(184, 199, 224, 0.085);
}

.profile-row strong {
  max-width: 72%;
  color: #e9eef8;
  line-height: 1.55;
  text-align: right;
  overflow-wrap: anywhere;
}

.permission-chip-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  max-width: 76%;
}

.permission-chip {
  padding: 4px 7px;
  border: 1px solid rgba(91, 131, 255, 0.18);
  border-radius: 999px;
  background: rgba(91, 131, 255, 0.075);
  color: #a9bcf5;
  font-size: 11px;
  line-height: 1.2;
}

.auth-visual {
  background:
    linear-gradient(145deg, rgba(19, 27, 41, 0.97), rgba(9, 13, 20, 0.98)),
    var(--bg);
}

.auth-visual::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 32px 32px;
  content: "";
  mask-image: linear-gradient(to bottom right, #000, transparent 68%);
}

.auth-card {
  border-color: rgba(184, 199, 224, 0.13);
  background: linear-gradient(155deg, rgba(19, 25, 34, 0.98), rgba(13, 18, 25, 0.98));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.36), inset 0 1px rgba(255, 255, 255, 0.035);
}

.visual-copy h1 {
  font-size: clamp(34px, 4.2vw, 58px);
  letter-spacing: -2.2px;
  text-wrap: balance;
}

@media (max-width: 1220px) {
  .app-shell { grid-template-columns: 72px minmax(0, 1fr); }
  .sidebar { padding-inline: 8px; }
  .nav-item { grid-template-columns: 1fr; padding-inline: 7px; }
}

@media (max-width: 920px) {
  .app-shell { display: block; }

  .sidebar {
    position: sticky;
    top: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    height: auto;
    padding: 7px 10px;
    border-right: 0;
    border-bottom: 1px solid rgba(184, 199, 224, 0.12);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  }

  .brand { min-height: 38px; padding: 0 8px 0 0; }
  .brand-mark { width: 32px; height: 32px; }

  .nav-list {
    justify-content: flex-start;
    gap: 4px;
    padding: 2px 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar { display: none; }

  .nav-item {
    display: flex;
    flex: 0 0 auto;
    grid-template-columns: none;
    min-height: 34px;
    padding: 5px 10px;
    scroll-snap-align: center;
    white-space: nowrap;
  }

  .nav-item .nav-icon { width: 20px; height: 20px; font-size: 11px; }
  .nav-item span:not(.nav-icon) { display: inline; }
  .nav-item b { display: inline-block; }
  .sidebar-foot { display: none; }

  .workspace { padding: 11px 10px 18px; }
  .topbar { display: grid; align-items: start; gap: 8px; }

  .top-actions,
  .collection-topbar .top-actions {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    padding: 1px 1px 3px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .top-actions::-webkit-scrollbar { display: none; }
  .top-actions > * { flex: 0 0 auto; }

  .sync-status {
    min-width: auto;
    min-height: 34px;
    padding: 0 9px;
    border: 1px solid rgba(184, 199, 224, 0.1);
    border-radius: 9px;
    background: rgba(15, 20, 28, 0.75);
  }

  .account-link { min-width: 112px; max-width: 150px; }
  .collection-board, .task-board { gap: 9px; }
  .queue-panel { min-height: 360px; }

  .task-detail-head,
  .production-detail-head { position: static; }

  .admin-main { padding: 14px 12px 28px; }
}

@media (max-width: 620px) {
  :root { --shadow: 0 10px 28px rgba(0, 0, 0, 0.2); }

  .sidebar {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 6px 8px;
  }

  .brand { display: none; }
  .nav-item { min-height: 33px; padding: 5px 11px; font-size: 12px; }
  .nav-item .nav-icon { display: none; }
  .nav-item b { display: none; }

  .workspace,
  .collection-workspace { padding: 10px 8px 16px; }

  h1,
  .page-heading h1 { font-size: 22px; }

  .heading-copy p,
  .page-heading p { font-size: 11px; }

  .collection-kpis,
  .task-kpis,
  .production-kpis,
  .kpi-grid,
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .collection-kpis article:first-child { grid-column: auto; }
  .collection-kpis article { min-height: 75px; padding: 9px 10px; }
  .collection-kpis strong { font-size: 21px; }
  .kpi-card { min-height: 84px; }

  .filter-panel,
  .collection-filters,
  .task-filters,
  .production-filters { gap: 6px; padding: 7px; }

  .collection-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .collection-search { grid-column: 1 / -1; }

  .queue-panel { min-height: 310px; }
  .detail-panel { min-height: 360px; }
  .collection-panel-head { min-height: 43px; }

  .task-list { max-height: none; padding: 0 7px 7px; }
  .task-queue-panel { max-height: none; }
  .task-detail-panel { padding: 9px; }

  .task-detail-head {
    margin: -9px -9px 0;
    padding: 10px 9px;
  }

  .task-detail-head h2 { font-size: 17px; }
  .task-callout p { font-size: 13px; }

  .admin-topbar {
    align-items: center;
    gap: 8px;
    min-height: 55px;
    padding: 8px 10px;
  }

  .top-brand { min-width: 0; gap: 8px; }
  .top-brand .brand-mark { width: 33px; height: 33px; flex: 0 0 auto; }
  .top-brand > span:not(.brand-mark) { display: none; }

  .admin-topbar .top-actions {
    flex: 1 1 auto;
    justify-content: flex-end;
    padding: 0;
  }

  .admin-topbar .secondary-button,
  .admin-topbar .role-badge { min-height: 32px; padding-inline: 9px; white-space: nowrap; }

  .page-heading { align-items: center; }
  .admin-main { padding: 12px 9px 24px; }
  .archive-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .profile-row { display: grid; gap: 5px; }
  .profile-row strong,
  .permission-chip-list { max-width: 100%; justify-content: flex-start; text-align: left; }

  .auth-visual { min-height: 158px; padding: 20px; }
  .visual-copy h1 { margin: 22px 0 0; font-size: 28px; letter-spacing: -1.1px; }
  .auth-main { padding: 18px 12px 28px; }
  .auth-card { padding: 20px; border-radius: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ========================================================================== 
   v4.0 operations cockpit
   This layer intentionally stays framework-free and overrides page-level CSS.
   ========================================================================== */

html.ui-v4 {
  color-scheme: dark;
  --bg: #060b13;
  --bg-elevated: #09111d;
  --surface: #0d1623;
  --surface-2: #111c2b;
  --surface-3: #172437;
  --surface-hover: #18283d;
  --line: rgba(151, 174, 211, 0.13);
  --line-strong: rgba(151, 174, 211, 0.24);
  --text: #f3f7ff;
  --muted: #a5b2c6;
  --subtle: #718097;
  --blue: #5d8cff;
  --blue-strong: #3973f6;
  --blue-soft: rgba(72, 124, 255, 0.15);
  --green: #45d2a0;
  --green-soft: rgba(69, 210, 160, 0.13);
  --yellow: #f0bb5b;
  --yellow-soft: rgba(240, 187, 91, 0.13);
  --red: #f17882;
  --red-soft: rgba(241, 120, 130, 0.13);
  --purple: #a78bfa;
  --shadow: 0 22px 58px rgba(0, 0, 0, 0.3);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.22);
  --shadow-inset: inset 0 1px rgba(255, 255, 255, 0.035);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-width: 212px;
  background: var(--bg);
  font-size: 13px;
}

html.ui-v4,
html.ui-v4 body {
  min-width: 0;
  min-height: 100%;
  overflow-x: clip;
}

html.ui-v4 body {
  background:
    radial-gradient(circle at 72% -16%, rgba(63, 115, 246, 0.16), transparent 33rem),
    radial-gradient(circle at 10% 108%, rgba(32, 162, 146, 0.065), transparent 30rem),
    linear-gradient(180deg, #070c15 0%, #060b13 58%, #070c14 100%);
  color: var(--text);
  font-family: Inter, "SF Pro Text", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  font-feature-settings: "tnum" 1, "cv02" 1, "cv03" 1;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

html.ui-v4 body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgba(151, 174, 211, 0.017) 1px, transparent 1px),
    linear-gradient(90deg, rgba(151, 174, 211, 0.017) 1px, transparent 1px);
  background-size: 32px 32px;
  content: "";
  pointer-events: none;
  mask-image: linear-gradient(to bottom, #000, transparent 76%);
}

html.ui-v4 *,
html.ui-v4 *::before,
html.ui-v4 *::after { box-sizing: border-box; }

html.ui-v4 p { font-size: 12px !important; }
html.ui-v4 small { font-size: 11px !important; }
html.ui-v4 label { font-size: 12px; }
html.ui-v4 button,
html.ui-v4 input,
html.ui-v4 textarea,
html.ui-v4 select { font-size: 12px !important; }

/* Page modules historically used 7–10px metadata. Keep dense layouts readable. */
html.ui-v4 body :is(
  .analysis-table,
  .identity-banner,
  .identity-grid,
  .target-grid,
  .attachment-row,
  .system-analysis-empty,
  .system-analysis-running,
  .system-analysis-error,
  .system-metrics,
  .analysis-summary-grid,
  .analysis-result-group,
  .analysis-evidence-list,
  .shot-grid,
  .risk-list,
  .transcript-list,
  .uncertainty-list,
  .asset-grid,
  .library-storage-note,
  .production-task-card,
  .production-summary-note,
  .shot-order,
  .shot-copy,
  .shot-match,
  .shot-recommendation,
  .shot-decision,
  .cost-result,
  .production-warning,
  .output-toolbar,
  .output-card,
  .match-need,
  .candidate-preview,
  .material-cell,
  .secondary-stack,
  .owner-stack,
  .fact-item,
  .submission-section,
  .submission-progress,
  .upload-field,
  .archive-summary,
  .archive-table,
  .user-identity,
  .audit-item,
  .permission-group,
  .permission-option,
  .log-item
) :is(p, strong, b) { font-size: 12px !important; }

html.ui-v4 body :is(
  .analysis-table,
  .identity-banner,
  .identity-grid,
  .target-grid,
  .attachment-row,
  .system-analysis-empty,
  .system-analysis-running,
  .system-analysis-error,
  .system-metrics,
  .analysis-summary-grid,
  .analysis-result-group,
  .analysis-evidence-list,
  .shot-grid,
  .risk-list,
  .transcript-list,
  .uncertainty-list,
  .asset-grid,
  .library-storage-note,
  .production-task-card,
  .production-summary-note,
  .shot-order,
  .shot-copy,
  .shot-match,
  .shot-recommendation,
  .shot-decision,
  .cost-result,
  .production-warning,
  .output-toolbar,
  .output-card,
  .match-need,
  .candidate-preview,
  .material-cell,
  .secondary-stack,
  .owner-stack,
  .fact-item,
  .submission-section,
  .submission-progress,
  .upload-field,
  .archive-summary,
  .archive-table,
  .user-identity,
  .audit-item,
  .permission-group,
  .permission-option,
  .log-item
) :is(span, small, time, em, a) { font-size: 11px !important; }

html.ui-v4 body :is(
  .muted-line,
  .metric-main,
  .metric-sub,
  .evidence-count,
  .detail-number,
  .submission-readonly,
  .production-safe-note,
  .library-origin,
  .library-storage-note,
  .tag-list em,
  .form-hint,
  .archive-state,
  .status-toggle,
  .permission-tip,
  .task-next,
  .shot-decision
) { font-size: 11px !important; }

html.ui-v4 :is(button, a, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid rgba(111, 154, 255, 0.9);
  outline-offset: 2px;
}

html.ui-v4 a { color: inherit; }

html.ui-v4 .app-shell {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-width: 0;
}

html.ui-v4 .sidebar {
  padding: 14px 12px;
  border-right: 1px solid rgba(151, 174, 211, 0.11);
  background:
    linear-gradient(180deg, rgba(13, 22, 35, 0.98), rgba(7, 13, 22, 0.99)),
    var(--bg);
  box-shadow: 16px 0 42px rgba(0, 0, 0, 0.18);
}

html.ui-v4 .brand {
  min-height: 52px;
  gap: 11px;
  padding: 2px 7px 14px;
}

html.ui-v4 .brand-mark {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(147, 178, 255, 0.22);
  border-radius: 12px;
  background: linear-gradient(145deg, #7399ff 0%, #447dfc 48%, #2f61d5 100%);
  box-shadow: 0 10px 28px rgba(48, 102, 224, 0.34), inset 0 1px rgba(255, 255, 255, 0.2);
  font-size: 12px;
  letter-spacing: -0.25px;
}

html.ui-v4 .brand-copy { gap: 1px; }
html.ui-v4 .brand-copy strong { color: #f7f9ff; font-size: 14px; font-weight: 720; }
html.ui-v4 .brand-copy small { color: #77869d; font-size: 11px !important; letter-spacing: 0.08em; }

html.ui-v4 .nav-list { gap: 5px; }

html.ui-v4 .nav-item {
  grid-template-columns: 27px 1fr auto;
  min-height: 42px;
  gap: 9px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #9eacc0;
  font-size: 13px;
  font-weight: 600;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

html.ui-v4 .nav-icon {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid rgba(151, 174, 211, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
  color: #8191a9;
}

html.ui-v4 .nav-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html.ui-v4 .nav-item:hover {
  border-color: rgba(151, 174, 211, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #dbe5f6;
  transform: translateX(1px);
}

html.ui-v4 .nav-item.is-active {
  border-color: rgba(93, 140, 255, 0.3);
  background: linear-gradient(100deg, rgba(72, 124, 255, 0.24), rgba(43, 73, 132, 0.11));
  box-shadow: inset 3px 0 #6592ff, 0 10px 24px rgba(0, 0, 0, 0.16);
  color: #f0f5ff;
}

html.ui-v4 .nav-item.is-active .nav-icon {
  border-color: rgba(115, 153, 255, 0.3);
  background: rgba(93, 140, 255, 0.17);
  color: #b6caff;
}

html.ui-v4 .nav-item b {
  min-width: 22px;
  padding: 2px 5px;
  border: 1px solid rgba(151, 174, 211, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: #a9b7cb;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
}

html.ui-v4 .sidebar-foot {
  padding: 13px 8px 3px;
  border-top-color: rgba(151, 174, 211, 0.1);
}

html.ui-v4 .sidebar-foot strong { font-size: 12px; }
html.ui-v4 .sidebar-foot small { color: #78869a; font-size: 11px !important; }

html.ui-v4 .workspace {
  min-width: 0;
  padding: 17px 20px 24px;
}

html.ui-v4 .topbar {
  min-height: 52px;
  gap: 20px;
  margin-bottom: 12px;
  padding: 3px 1px;
}

html.ui-v4 h1,
html.ui-v4 .page-heading h1 {
  color: #f7f9ff;
  font-size: clamp(23px, 1.65vw, 29px);
  font-weight: 760;
  letter-spacing: -0.75px;
}

html.ui-v4 h2 { color: #edf3ff; font-weight: 710; letter-spacing: -0.25px; }
html.ui-v4 h3 { color: #e7eefb; }

html.ui-v4 .heading-copy p,
html.ui-v4 .page-heading p,
html.ui-v4 .page-note {
  color: #8796ab;
  font-size: 12px !important;
}

html.ui-v4 .mode-chip,
html.ui-v4 .readonly-badge,
html.ui-v4 .role-badge,
html.ui-v4 .task-safe-note {
  min-height: 25px;
  padding: 4px 8px;
  border: 1px solid rgba(93, 140, 255, 0.25);
  border-radius: 999px;
  background: rgba(72, 124, 255, 0.11);
  color: #aac0ff;
  font-size: 11px;
  font-weight: 650;
}

html.ui-v4 .top-actions { min-width: 0; gap: 8px; }

html.ui-v4 .sync-status {
  min-width: 126px;
  color: #8290a5;
  font-size: 11px;
}

html.ui-v4 .button,
html.ui-v4 .primary-button,
html.ui-v4 .secondary-button,
html.ui-v4 .danger-button,
html.ui-v4 .text-button {
  min-height: 36px;
  padding-inline: 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 680;
  letter-spacing: 0;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, color 150ms ease, transform 150ms ease;
}

html.ui-v4 .button-secondary,
html.ui-v4 .secondary-button,
html.ui-v4 .button-ghost {
  border-color: rgba(151, 174, 211, 0.16);
  background: linear-gradient(180deg, rgba(25, 36, 52, 0.94), rgba(15, 24, 36, 0.94));
  color: #d7e0ee;
  box-shadow: var(--shadow-inset);
}

html.ui-v4 .button-primary,
html.ui-v4 .primary-button {
  border-color: rgba(137, 169, 255, 0.34);
  background: linear-gradient(145deg, #6793ff, #3973f6);
  box-shadow: 0 9px 24px rgba(57, 115, 246, 0.25), inset 0 1px rgba(255, 255, 255, 0.17);
  color: #fff;
}

html.ui-v4 .button:hover,
html.ui-v4 .primary-button:hover,
html.ui-v4 .secondary-button:hover,
html.ui-v4 .danger-button:hover,
html.ui-v4 .text-button:hover {
  filter: none;
  transform: translateY(-1px);
}

html.ui-v4 .button-secondary:hover,
html.ui-v4 .secondary-button:hover,
html.ui-v4 .button-ghost:hover {
  border-color: rgba(111, 154, 255, 0.33);
  background: linear-gradient(180deg, rgba(31, 46, 68, 0.96), rgba(18, 29, 44, 0.96));
}

html.ui-v4 .button-primary:hover,
html.ui-v4 .primary-button:hover { box-shadow: 0 12px 30px rgba(57, 115, 246, 0.32), inset 0 1px rgba(255, 255, 255, 0.18); }

html.ui-v4 .button:active,
html.ui-v4 .primary-button:active,
html.ui-v4 .secondary-button:active { transform: translateY(0); }

html.ui-v4 .account-link { min-width: 112px; max-width: 172px; }
html.ui-v4 .account-link small { color: #76859b; font-size: 11px !important; }

/* Native controls stay usable until JavaScript enhances them. */
html.ui-v4 select {
  color-scheme: dark;
  border-color: rgba(151, 174, 211, 0.16);
  background-color: #0b1420;
  color: var(--text);
}

html.ui-v4 select option,
html.ui-v4 select optgroup {
  background: #101a28;
  color: #edf3ff;
}

html.ui-v4 select.ui-select-native {
  position: absolute !important;
  width: 1px !important;
  min-width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

html.ui-v4 .ui-select {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

html.ui-v4 .ui-select-trigger {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  gap: 7px;
  padding: 0 9px 0 10px;
  border: 1px solid rgba(151, 174, 211, 0.16);
  border-radius: 9px;
  background: linear-gradient(180deg, rgba(14, 24, 37, 0.96), rgba(9, 17, 27, 0.96));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
  color: #e7edf7;
  font: inherit;
  font-size: 12px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

html.ui-v4 .ui-select-trigger:hover {
  border-color: rgba(125, 158, 221, 0.32);
  background: linear-gradient(180deg, rgba(19, 32, 49, 0.98), rgba(11, 21, 33, 0.98));
}

html.ui-v4 .ui-select.is-open .ui-select-trigger,
html.ui-v4 .ui-select-trigger:focus-visible {
  border-color: rgba(93, 140, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(72, 124, 255, 0.13), inset 0 1px rgba(255, 255, 255, 0.04);
}

html.ui-v4 .ui-select-trigger.is-invalid {
  border-color: rgba(241, 120, 130, 0.76);
  box-shadow: 0 0 0 3px rgba(241, 120, 130, 0.12);
}

html.ui-v4 .ui-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html.ui-v4 .ui-select.is-placeholder .ui-select-value { color: #8795aa; }

html.ui-v4 .ui-select-chevron {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: #8fa0b9;
  transition: transform 160ms ease, color 160ms ease;
}

html.ui-v4 .ui-select-chevron svg,
html.ui-v4 .ui-select-menu svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html.ui-v4 .ui-select.is-open .ui-select-chevron { color: #abc0ff; transform: rotate(180deg); }
html.ui-v4 .ui-select.is-disabled { opacity: 0.52; }
html.ui-v4 .ui-select.is-disabled .ui-select-trigger { cursor: not-allowed; }

html.ui-v4 .select-box.has-ui-select {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 3px 4px 3px 10px;
}

html.ui-v4 .select-box.has-ui-select > span {
  color: #8190a6;
  font-size: 11px;
  font-weight: 600;
}

html.ui-v4 .select-box.has-ui-select .ui-select-trigger {
  min-height: 32px;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  text-align: right;
}

html.ui-v4 .select-box.has-ui-select:focus-within {
  border-color: rgba(93, 140, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(72, 124, 255, 0.11);
}

html.ui-v4 .select-box.has-ui-select:focus-within .ui-select-trigger { border-color: transparent; box-shadow: none; }

html.ui-v4 .form-field.has-ui-select .ui-select-trigger,
html.ui-v4 td .ui-select-trigger {
  min-height: 40px;
  background: rgba(8, 15, 24, 0.9);
}

html.ui-v4 td .ui-select { min-width: 112px; }
html.ui-v4 td .ui-select-trigger { min-height: 34px; }

.ui-select-scrim[hidden],
.ui-select-menu[hidden] { display: none !important; }

.ui-select-scrim {
  position: fixed;
  z-index: 2147483000;
  inset: 0;
  background: transparent;
}

.ui-select-menu {
  position: fixed;
  z-index: 2147483001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(145, 169, 211, 0.24);
  border-radius: 12px;
  background: rgba(13, 22, 35, 0.985);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.025) inset;
  color: #edf3ff;
  backdrop-filter: blur(18px) saturate(125%);
  animation: ui-select-enter 140ms cubic-bezier(.2, .8, .2, 1);
}

.ui-select-menu.opens-above { transform-origin: bottom center; }

.ui-select-menu-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  gap: 10px;
  padding: 8px 8px 8px 12px;
  border-bottom: 1px solid rgba(151, 174, 211, 0.11);
  background: rgba(18, 29, 44, 0.92);
}

.ui-select-menu-title {
  overflow: hidden;
  color: #b8c5d8;
  font-size: 11px;
  font-weight: 680;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-select-menu-close {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8291a7;
  cursor: pointer;
}

.ui-select-menu-close:hover { background: rgba(255, 255, 255, 0.055); color: #eef3fc; }

.ui-select-options {
  min-height: 0;
  padding: 6px;
  overflow: auto;
  overscroll-behavior: contain;
  outline: none;
}

.ui-select-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  min-height: 38px;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #cbd5e4;
  font-size: 12px;
  line-height: 1.35;
  cursor: pointer;
  transition: color 100ms ease, background 100ms ease, border-color 100ms ease;
}

.ui-select-option > span { min-width: 0; overflow-wrap: anywhere; }
.ui-select-option > svg { color: transparent; }

.ui-select-option.is-active {
  border-color: rgba(93, 140, 255, 0.22);
  background: rgba(72, 124, 255, 0.12);
  color: #f1f5ff;
}

.ui-select-option.is-selected { color: #c4d4ff; font-weight: 650; }
.ui-select-option.is-selected > svg { color: #76a0ff; }
.ui-select-option[aria-disabled="true"] { color: #59677b; cursor: not-allowed; opacity: 0.66; }

.ui-select-group {
  padding: 9px 10px 5px;
  color: #68778d;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.ui-select-empty { padding: 18px 12px; color: #75849a; font-size: 12px; text-align: center; }

.ui-select-portal-host { overflow: visible !important; }

@keyframes ui-select-enter {
  from { opacity: 0; transform: translateY(-3px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

html.ui-v4 .filter-panel,
html.ui-v4 .collection-filters,
html.ui-v4 .task-filters,
html.ui-v4 .production-filters {
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(151, 174, 211, 0.13);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(15, 25, 39, 0.95), rgba(10, 18, 29, 0.95));
  box-shadow: var(--shadow-soft), var(--shadow-inset);
}

html.ui-v4 .search-box,
html.ui-v4 .select-box {
  min-height: 40px;
  border-color: rgba(151, 174, 211, 0.14);
  border-radius: 9px;
  background: rgba(7, 14, 23, 0.76);
  color: #8e9db2;
}

html.ui-v4 .search-box { padding-inline: 11px; }
html.ui-v4 .search-box input { font-size: 12px; }
html.ui-v4 .search-box input::placeholder { color: #68768b; }

html.ui-v4 .search-box:hover,
html.ui-v4 .select-box:hover { border-color: rgba(151, 174, 211, 0.26); }

html.ui-v4 .search-box:focus-within,
html.ui-v4 .select-box:focus-within {
  border-color: rgba(93, 140, 255, 0.62);
  box-shadow: 0 0 0 3px rgba(72, 124, 255, 0.11);
}

html.ui-v4 .panel,
html.ui-v4 .queue-panel,
html.ui-v4 .detail-panel,
html.ui-v4 .task-queue-panel,
html.ui-v4 .task-detail-panel,
html.ui-v4 .production-queue-panel,
html.ui-v4 .production-detail-panel {
  border: 1px solid rgba(151, 174, 211, 0.13);
  border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(15, 25, 39, 0.985), rgba(10, 17, 27, 0.985));
  box-shadow: var(--shadow-soft), var(--shadow-inset);
}

html.ui-v4 .panel-head {
  min-height: 50px;
  padding: 11px 13px;
  border-bottom-color: rgba(151, 174, 211, 0.1);
  background: linear-gradient(180deg, rgba(21, 34, 51, 0.34), transparent);
}

html.ui-v4 .panel-head h2 { font-size: 15px; }
html.ui-v4 .panel-head p,
html.ui-v4 .panel-meta,
html.ui-v4 .queue-legend { color: #8492a7; font-size: 11px; }

html.ui-v4 .kpi-card,
html.ui-v4 .collection-kpis article,
html.ui-v4 .stat-card {
  position: relative;
  overflow: hidden;
  min-height: 88px;
  padding: 12px 13px;
  border: 1px solid rgba(151, 174, 211, 0.13);
  border-radius: 13px;
  background:
    linear-gradient(145deg, rgba(20, 34, 52, 0.97), rgba(11, 19, 30, 0.98)),
    var(--surface);
  box-shadow: var(--shadow-soft), var(--shadow-inset);
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

html.ui-v4 .kpi-card::after,
html.ui-v4 .collection-kpis article::after,
html.ui-v4 .stat-card::after {
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(93, 140, 255, 0.58), transparent 70%);
  content: "";
}

html.ui-v4 .kpi-card:hover,
html.ui-v4 .collection-kpis article:hover,
html.ui-v4 .stat-card:hover {
  border-color: rgba(93, 140, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.26), var(--shadow-inset);
}

html.ui-v4 .collection-kpis span,
html.ui-v4 .collection-kpis small,
html.ui-v4 .kpi-label,
html.ui-v4 .stat-card span {
  color: #8d9bb0;
  font-size: 11px !important;
}

html.ui-v4 .collection-kpis strong,
html.ui-v4 .stat-card strong,
html.ui-v4 .kpi-value {
  color: #f7f9ff;
  font-variant-numeric: tabular-nums;
}

html.ui-v4 .risk-card {
  min-height: 48px;
  border-color: rgba(151, 174, 211, 0.14);
  background: linear-gradient(145deg, rgba(17, 28, 43, 0.97), rgba(10, 18, 28, 0.97));
  box-shadow: var(--shadow-inset);
}

html.ui-v4 .risk-card:hover { border-color: rgba(240, 187, 91, 0.34); background: rgba(240, 187, 91, 0.065); }

html.ui-v4 .status-pill,
html.ui-v4 .pill,
html.ui-v4 [class$="-badge"]:not(.brand-mark) {
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.25;
}

html.ui-v4 .table-wrap,
html.ui-v4 .collection-table-wrap,
html.ui-v4 .user-table-wrap { overscroll-behavior: contain; }

html.ui-v4 table {
  border-collapse: separate;
  border-spacing: 0;
  color: #cbd5e4;
  font-size: 12px;
}

html.ui-v4 th {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 38px;
  padding-block: 10px;
  border-bottom: 1px solid rgba(151, 174, 211, 0.14);
  background: rgba(14, 24, 37, 0.97);
  color: #8d9bb0;
  font-size: 11px;
  font-weight: 680;
  letter-spacing: 0.02em;
  backdrop-filter: blur(12px);
}

html.ui-v4 td {
  padding-block: 11px;
  border-bottom-color: rgba(151, 174, 211, 0.085);
  font-size: 12px;
}

html.ui-v4 tbody tr { transition: background 120ms ease, box-shadow 120ms ease; }
html.ui-v4 tbody tr:nth-child(even) { background: rgba(151, 174, 211, 0.018); }
html.ui-v4 tbody tr:hover { background: rgba(93, 140, 255, 0.07); }
html.ui-v4 tbody tr.is-selected { background: rgba(93, 140, 255, 0.1); box-shadow: inset 3px 0 #5d8cff; }

html.ui-v4 .detail-empty,
html.ui-v4 .empty-state {
  background:
    radial-gradient(circle at center, rgba(93, 140, 255, 0.1), transparent 45%),
    rgba(10, 18, 28, 0.72);
  color: #8b99ad;
}

html.ui-v4 .detail-empty > span,
html.ui-v4 .empty-icon {
  border: 1px solid rgba(93, 140, 255, 0.22);
  background: rgba(93, 140, 255, 0.11);
  color: #aac0ff;
}

html.ui-v4 .detail-section,
html.ui-v4 .asset-section,
html.ui-v4 .task-callout,
html.ui-v4 .task-section,
html.ui-v4 .shot-card,
html.ui-v4 .production-summary-note,
html.ui-v4 .output-card,
html.ui-v4 .submission-section {
  border-color: rgba(151, 174, 211, 0.13);
  border-radius: 11px;
  background: rgba(7, 14, 23, 0.64);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.018);
}

html.ui-v4 .task-card,
html.ui-v4 .production-task-card {
  border-color: rgba(151, 174, 211, 0.13);
  background: linear-gradient(145deg, rgba(17, 29, 45, 0.98), rgba(10, 18, 29, 0.98));
}

html.ui-v4 .task-card:hover,
html.ui-v4 .task-card.is-selected,
html.ui-v4 .production-task-card:hover,
html.ui-v4 .production-task-card.is-selected {
  border-color: rgba(93, 140, 255, 0.66);
  background: linear-gradient(145deg, rgba(26, 42, 65, 0.98), rgba(13, 24, 38, 0.98));
  box-shadow: inset 3px 0 #5d8cff, 0 10px 24px rgba(0, 0, 0, 0.18);
}

html.ui-v4 .task-card h3,
html.ui-v4 .production-task-card h3 { color: #f1f5fd; font-size: 14px; }

html.ui-v4 .task-card p,
html.ui-v4 .task-card small,
html.ui-v4 .task-card-foot,
html.ui-v4 .production-task-card p,
html.ui-v4 .production-task-card-foot { color: #94a2b6; }

html.ui-v4 .task-detail-head,
html.ui-v4 .production-detail-head {
  background: rgba(12, 21, 33, 0.94);
  backdrop-filter: blur(16px) saturate(120%);
}

html.ui-v4 .task-input-grid > div,
html.ui-v4 .task-resource,
html.ui-v4 .evidence-card,
html.ui-v4 .timeline-row,
html.ui-v4 .shot-recommendation,
html.ui-v4 .cost-result > div,
html.ui-v4 .asset-grid > div {
  border-color: rgba(151, 174, 211, 0.13);
  background: rgba(5, 11, 18, 0.7);
}

html.ui-v4 .production-tabs {
  border-color: rgba(151, 174, 211, 0.14);
  background: rgba(6, 12, 20, 0.74);
}

html.ui-v4 .production-tabs button { min-height: 34px; color: #8e9db3; font-size: 12px; }
html.ui-v4 .production-tabs button.is-active {
  border: 1px solid rgba(93, 140, 255, 0.28);
  background: linear-gradient(180deg, rgba(52, 78, 119, 0.58), rgba(28, 44, 68, 0.58));
  color: #edf3ff;
}

html.ui-v4 dialog.modal {
  padding: 18px;
  border: 1px solid rgba(151, 174, 211, 0.22);
  border-radius: 16px;
  background: linear-gradient(155deg, rgba(17, 28, 43, 0.995), rgba(9, 16, 26, 0.995));
  color: var(--text);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.62), inset 0 1px rgba(255, 255, 255, 0.035);
}

html.ui-v4 dialog.modal::backdrop {
  background: rgba(2, 6, 12, 0.78);
  backdrop-filter: blur(8px) saturate(75%);
}

html.ui-v4 dialog[open] { animation: ui-dialog-enter 170ms cubic-bezier(.2, .8, .2, 1); }

@keyframes ui-dialog-enter {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

html.ui-v4 .modal-head {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(151, 174, 211, 0.11);
}

html.ui-v4 .modal-head h2 { font-size: 19px; }
html.ui-v4 .modal-head p { color: #8391a6; font-size: 11px !important; }

html.ui-v4 .form-field {
  gap: 6px;
  color: #91a0b5;
  font-size: 12px;
}

html.ui-v4 .form-field > span,
html.ui-v4 .cost-input-grid label,
html.ui-v4 .cost-notes { color: #91a0b5; font-size: 11px; font-weight: 600; }

html.ui-v4 .form-field input,
html.ui-v4 .form-field textarea,
html.ui-v4 .cost-input-grid input,
html.ui-v4 .cost-notes textarea,
html.ui-v4 .production-modal input,
html.ui-v4 .production-modal textarea,
html.ui-v4 .review-grid input,
html.ui-v4 .review-grid textarea {
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid rgba(151, 174, 211, 0.16);
  border-radius: 9px;
  background: rgba(6, 13, 21, 0.86);
  color: #edf3fc;
  font: inherit;
  font-size: 12px;
}

html.ui-v4 textarea { line-height: 1.6; }

html.ui-v4 .form-field input:hover,
html.ui-v4 .form-field textarea:hover,
html.ui-v4 .cost-input-grid input:hover,
html.ui-v4 .cost-notes textarea:hover { border-color: rgba(151, 174, 211, 0.3); }

html.ui-v4 .form-field input:focus,
html.ui-v4 .form-field textarea:focus,
html.ui-v4 .cost-input-grid input:focus,
html.ui-v4 .cost-notes textarea:focus {
  border-color: rgba(93, 140, 255, 0.66);
  box-shadow: 0 0 0 3px rgba(72, 124, 255, 0.11);
  outline: 0;
}

html.ui-v4 .modal-actions {
  gap: 9px;
  padding-top: 12px;
  border-top-color: rgba(151, 174, 211, 0.11);
  background: transparent;
}

html.ui-v4 .admin-page { background: transparent; }

html.ui-v4 .admin-topbar {
  min-height: 64px;
  padding: 11px 20px;
  border-bottom: 1px solid rgba(151, 174, 211, 0.11);
  background: rgba(7, 13, 22, 0.91);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.17);
  backdrop-filter: blur(16px);
}

html.ui-v4 .admin-main { width: min(1500px, 100%); padding: 18px 20px 34px; }
html.ui-v4 .panel-body { background: rgba(7, 14, 23, 0.2); }

html.ui-v4 .profile-row { border-bottom-color: rgba(151, 174, 211, 0.09); }
html.ui-v4 .profile-row strong { color: #e7eef9; font-size: 12px; }

html.ui-v4 .permission-chip {
  padding: 4px 8px;
  border-color: rgba(93, 140, 255, 0.21);
  background: rgba(72, 124, 255, 0.09);
  color: #b5c7f7;
  font-size: 11px;
}

html.ui-v4 .auth-shell { background: transparent; }

html.ui-v4 .auth-visual {
  background:
    radial-gradient(circle at 18% 18%, rgba(93, 140, 255, 0.22), transparent 26rem),
    linear-gradient(145deg, rgba(16, 28, 46, 0.98), rgba(6, 12, 21, 0.99));
}

html.ui-v4 .auth-card {
  border-color: rgba(151, 174, 211, 0.17);
  border-radius: 18px;
  background: linear-gradient(155deg, rgba(18, 29, 44, 0.99), rgba(9, 17, 28, 0.99));
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.46), inset 0 1px rgba(255, 255, 255, 0.04);
}

html.ui-v4 .visual-copy h1 {
  font-size: clamp(36px, 4.3vw, 62px);
  letter-spacing: -2.3px;
  line-height: 1.04;
}

html.ui-v4 .toast {
  right: 18px;
  bottom: 18px;
  padding: 12px 15px;
  border-color: rgba(151, 174, 211, 0.2);
  border-radius: 11px;
  background: rgba(18, 29, 44, 0.97);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.42);
  font-size: 12px;
  backdrop-filter: blur(16px);
}

@media (max-width: 1220px) {
  html.ui-v4 .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
  html.ui-v4 .sidebar { padding-inline: 9px; }
  html.ui-v4 .nav-item { grid-template-columns: 1fr; padding-inline: 7px; }
  html.ui-v4 .nav-icon { width: 29px; height: 29px; }
}

@media (max-width: 920px) {
  html.ui-v4 .app-shell { display: block; }

  html.ui-v4 .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    height: auto;
    padding: 8px 11px;
    border-right: 0;
    border-bottom: 1px solid rgba(151, 174, 211, 0.14);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(18px);
  }

  html.ui-v4 .brand { min-height: 39px; padding: 0 9px 0 0; }
  html.ui-v4 .brand-mark { width: 34px; height: 34px; }

  html.ui-v4 .nav-list {
    justify-content: flex-start;
    gap: 5px;
    padding: 2px 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  html.ui-v4 .nav-list::-webkit-scrollbar { display: none; }

  html.ui-v4 .nav-item {
    display: flex;
    flex: 0 0 auto;
    min-height: 36px;
    padding: 5px 10px;
    scroll-snap-align: center;
    white-space: nowrap;
  }

  html.ui-v4 .nav-item .nav-icon { width: 23px; height: 23px; }
  html.ui-v4 .sidebar-foot { display: none; }
  html.ui-v4 .workspace { padding: 13px 11px 20px; }
  html.ui-v4 .topbar { display: grid; align-items: start; gap: 9px; }

  html.ui-v4 .top-actions,
  html.ui-v4 .collection-topbar .top-actions {
    display: flex;
    justify-content: flex-start;
    width: 100%;
    padding: 1px 1px 4px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  html.ui-v4 .top-actions::-webkit-scrollbar { display: none; }
  html.ui-v4 .top-actions > * { flex: 0 0 auto; }

  html.ui-v4 .sync-status {
    min-width: auto;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid rgba(151, 174, 211, 0.12);
    border-radius: 10px;
    background: rgba(13, 22, 35, 0.78);
  }

  html.ui-v4 .task-detail-head,
  html.ui-v4 .production-detail-head { position: static; }
  html.ui-v4 .admin-main { padding: 15px 12px 28px; }
}

@media (max-width: 620px) {
  html.ui-v4 { --shadow: 0 12px 30px rgba(0, 0, 0, 0.28); }

  html.ui-v4 .sidebar {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 7px 8px;
  }

  html.ui-v4 .brand { display: none; }
  html.ui-v4 .nav-item { min-height: 35px; padding: 5px 11px; font-size: 12px; }
  html.ui-v4 .nav-item .nav-icon { display: none; }
  html.ui-v4 .nav-item b { display: none; }

  html.ui-v4 .workspace,
  html.ui-v4 .collection-workspace { padding: 11px 8px 18px; }

  html.ui-v4 h1,
  html.ui-v4 .page-heading h1 { font-size: 23px; }

  html.ui-v4 .collection-kpis,
  html.ui-v4 .task-kpis,
  html.ui-v4 .production-kpis,
  html.ui-v4 .kpi-grid,
  html.ui-v4 .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  html.ui-v4 .collection-kpis article,
  html.ui-v4 .kpi-card,
  html.ui-v4 .stat-card { min-height: 82px; padding: 10px 11px; }

  html.ui-v4 .filter-panel,
  html.ui-v4 .collection-filters,
  html.ui-v4 .task-filters,
  html.ui-v4 .production-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 7px;
  }

  html.ui-v4 .filter-panel .search-box,
  html.ui-v4 .collection-filters .collection-search,
  html.ui-v4 .task-filters .collection-search,
  html.ui-v4 .production-filters .collection-search { grid-column: 1 / -1; }

  html.ui-v4 .select-box.has-ui-select { min-width: 0; }
  html.ui-v4 .select-box.has-ui-select > span:not(.ui-select) { display: none; }
  html.ui-v4 .select-box.has-ui-select { grid-template-columns: minmax(0, 1fr); padding-left: 4px; }
  html.ui-v4 .select-box.has-ui-select .ui-select-trigger { text-align: left; }

  html.ui-v4 .table-wrap,
  html.ui-v4 .collection-table-wrap { border-radius: 0 0 12px 12px; }

  html.ui-v4 .task-list { max-height: none; padding: 0 7px 7px; }
  html.ui-v4 .task-queue-panel { max-height: none; }
  html.ui-v4 .task-detail-panel { padding: 10px; }

  html.ui-v4 dialog.modal {
    width: calc(100vw - 14px);
    max-width: none;
    max-height: calc(100dvh - 14px);
    padding: 14px;
    border-radius: 15px;
  }

  html.ui-v4 .admin-topbar { min-height: 57px; padding: 9px 10px; }
  html.ui-v4 .admin-main { padding: 13px 9px 24px; }

  .ui-select-scrim.is-mobile { background: rgba(2, 6, 12, 0.62); backdrop-filter: blur(4px); }

  .ui-select-menu.is-mobile {
    inset: auto 7px 7px !important;
    width: auto !important;
    max-height: min(58dvh, 520px) !important;
    border-radius: 16px;
    transform-origin: bottom center;
    animation-name: ui-select-sheet-enter;
  }

  .ui-select-menu.is-mobile .ui-select-menu-head { min-height: 48px; padding: 9px 10px 9px 14px; }
  .ui-select-menu.is-mobile .ui-select-menu-title { font-size: 12px; }
  .ui-select-menu.is-mobile .ui-select-options { max-height: calc(min(58dvh, 520px) - 49px) !important; padding: 7px; }
  .ui-select-menu.is-mobile .ui-select-option { min-height: 44px; padding: 10px 11px; font-size: 13px; }

  @keyframes ui-select-sheet-enter {
    from { opacity: 0; transform: translateY(18px) scale(0.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  html.ui-v4.ui-select-is-open,
  html.ui-v4 body.ui-select-is-open { overscroll-behavior: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ui-select-menu,
  html.ui-v4 dialog[open] { animation: none !important; }
}

/* v4 command center: role-aware focus and end-to-end pipeline. */
html.ui-v4 .command-summary,
html.ui-v4 .pipeline-panel {
  border: 1px solid rgba(151, 174, 211, 0.12);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(18, 25, 37, 0.96), rgba(11, 17, 26, 0.94));
  box-shadow: var(--shadow-soft);
}

html.ui-v4 .command-summary {
  display: grid;
  grid-template-columns: minmax(185px, 0.7fr) minmax(0, 2.3fr);
  gap: 10px;
  margin: 0 0 9px;
  padding: 11px;
}

html.ui-v4 .command-identity {
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 4px 8px;
  border-right: 1px solid rgba(151, 174, 211, 0.1);
}

html.ui-v4 .command-eyebrow { color: #83a4ff; font-size: 11px; font-weight: 720; letter-spacing: 0.06em; }
html.ui-v4 .command-identity h2 { margin: 0; font-size: 17px; }
html.ui-v4 .command-identity p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
html.ui-v4 .command-focus-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }

html.ui-v4 .command-focus-card {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid rgba(151, 174, 211, 0.1);
  border-radius: 10px;
  background: rgba(6, 11, 18, 0.46);
  color: var(--text);
  text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

html.ui-v4 .command-focus-card:hover { border-color: rgba(91, 131, 255, 0.38); background: rgba(38, 62, 112, 0.18); transform: translateY(-1px); }
html.ui-v4 .command-focus-card > span { color: #83a4ff; font-size: 11px; font-weight: 700; }
html.ui-v4 .command-focus-card > strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
html.ui-v4 .command-focus-card > small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
html.ui-v4 .command-focus-card.is-warning { border-color: rgba(239, 189, 84, 0.24); }
html.ui-v4 .command-focus-card.is-danger { border-color: rgba(244, 118, 129, 0.28); }
html.ui-v4 .command-empty { display: grid; grid-column: 1 / -1; place-content: center; min-height: 62px; color: var(--muted); text-align: center; }
html.ui-v4 .command-empty strong { color: var(--text); font-size: 13px; }

html.ui-v4 .pipeline-panel { margin: 0 0 9px; padding: 10px; }
html.ui-v4 .pipeline-panel .section-heading { margin-bottom: 7px; }
html.ui-v4 .pipeline-track { display: grid; grid-template-columns: repeat(8, minmax(90px, 1fr)); gap: 6px; overflow-x: auto; }
html.ui-v4 .pipeline-stage {
  position: relative;
  display: grid;
  min-width: 92px;
  gap: 2px;
  padding: 8px 8px 8px 31px;
  border: 1px solid rgba(151, 174, 211, 0.1);
  border-radius: 10px;
  background: rgba(7, 12, 20, 0.54);
  color: var(--text);
  text-decoration: none;
}
html.ui-v4 .pipeline-stage:hover { border-color: rgba(91, 131, 255, 0.35); background: rgba(39, 67, 126, 0.16); }
html.ui-v4 .pipeline-stage.is-blocked { border-color: rgba(239, 189, 84, 0.28); background: rgba(114, 77, 16, 0.1); }
html.ui-v4 .pipeline-order { position: absolute; top: 9px; left: 8px; display: grid; place-items: center; width: 17px; height: 17px; border-radius: 6px; background: var(--blue-soft); color: #9bb5ff; font-size: 11px; font-weight: 750; }
html.ui-v4 .pipeline-stage strong { font-size: 12px; }
html.ui-v4 .pipeline-stage b { color: #fff; font-size: 18px; line-height: 1.1; }
html.ui-v4 .pipeline-stage small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
html.ui-v4 #pipelineHealth.is-danger { color: var(--yellow); }

@media (max-width: 1180px) {
  html.ui-v4 .command-focus-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html.ui-v4 .pipeline-track { grid-template-columns: repeat(8, minmax(118px, 1fr)); }
}

@media (max-width: 620px) {
  html.ui-v4 .command-summary { grid-template-columns: 1fr; padding: 9px; }
  html.ui-v4 .command-identity { border-right: 0; border-bottom: 1px solid rgba(151, 174, 211, 0.1); padding: 3px 3px 8px; }
  html.ui-v4 .command-focus-list { grid-template-columns: 1fr; }
  html.ui-v4 .pipeline-panel { padding: 9px; }
}

