/* 全屏化调整 */
.container, .container-fluid {
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.tab-content, .tab-pane {
  height: 100%;
}

/* 全路移除 Selectize 输入框产生的白色光标块 */
.selectize-input > input,
.selectize-control.single .selectize-input > input {
  display: none !important;
}

.navbar-nav {
  margin-left: 15px;
}

:root {
  --font-sans: "IBM Plex Sans", "Segoe UI", "Helvetica Neue", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", "Consolas", monospace;
  --color-text: #333;
  --color-muted: #6c757d;
  --color-hero-start: #1e3c72;
  --color-hero-end: #2a5298;
  --color-hero-accent: rgba(255, 255, 255, 0.1);
  --color-feature-border: rgba(0, 0, 0, 0.05);
  --color-feature-shadow: rgba(0, 0, 0, 0.02);
  --color-log-bg: #1e1e1e;
  --color-log-text: #d4d4d4;
  --color-log-border: #333;
  --color-log-shadow: rgba(0, 0, 0, 0.5);
  --color-log-info: #007bff;
  --color-log-warn: #ffc107;
  --color-log-error: #dc3545;
  --color-log-empty: #888;
  --radius-card: 15px;
  --radius-hero: 12px;
  --radius-log: 5px;
  --shadow-card: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-hero: 0 10px 25px rgba(0, 0, 0, 0.15);
  --shadow-log-inset: inset 0 0 10px rgba(0, 0, 0, 0.5);
  --border-card: 1px solid rgba(0, 0, 0, 0.05);
  --gap-md: 1.5rem;
  --gap-lg: 2rem;
}

/* Layout helpers */
.section-title-center {
  text-align: center;
}

/* Global card/box styling */
.card {
  border-radius: var(--radius-card) !important;
  box-shadow: var(--shadow-card);
  border: var(--border-card) !important;
  overflow: visible;
}

.card-header {
  border-top-left-radius: var(--sw-radius) !important;
  border-top-right-radius: var(--sw-radius) !important;
}

.card-footer {
  border-bottom-left-radius: var(--sw-radius) !important;
  border-bottom-right-radius: var(--sw-radius) !important;
}

.box,
.box-body,
.card-body {
  overflow: visible;
}

.nav-tabs-custom>.nav-tabs>li:first-of-type.active>a {
  border-top-left-radius: var(--sw-radius);
}

.sys-resources {
  display: inline-flex;
  gap: 15px;
  align-items: center;
  color: #343a40;
  font-weight: 600;
  font-size: 0.9rem;
}

.sys-resource {
  display: inline-flex;
  align-items: center;
}

/* Welcome page - Version 2: Analytical Excellence (Light Professional) */
.welcome-workbench {
  height: calc(100vh - 58px) !important;
  background: #f8fafc url('clean_medical_abstract_bg_1773580170627.png') no-repeat center fixed;
  background-size: cover;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  position: relative;
}

/* 装饰性背景层 */
.welcome-v2-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.4) 0%, transparent 50%),
              radial-gradient(circle at 80% 70%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.welcome-v2-content {
  max-width: 1300px;
  width: 100%;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
  padding: 30px 20px;
}

.welcome-v2-hero {
  text-align: center;
  animation: v2FadeInDown 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 800px;
}

@keyframes v2FadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

.welcome-v2-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid rgba(59, 130, 246, 0.1);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #3b82f6;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.05);
}

.welcome-v2-title {
  font-size: 4rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -2px;
}

.welcome-v2-title span {
  color: #3b82f6;
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-v2-subtitle {
  font-size: 1.2rem;
  color: #64748b;
  line-height: 1.6;
  max-width: 600px;
  margin-bottom: 0;
}

.welcome-v2-charts-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
  animation: v2FadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

@keyframes v2FadeInUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

.welcome-chart-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.05);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  display: flex;
  flex-direction: column;
}

.welcome-chart-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(59, 130, 246, 0.1);
  background: white;
}

.welcome-chart-header {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px dashed #e2e8f0;
}

.welcome-chart-header i {
  color: #3b82f6;
}

.welcome-static-chart {
  width: 100%;
  height: 220px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.welcome-v2-grid-horizontal {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
  animation: v2FadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both;
}

.welcome-v2-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid white;
  padding: 20px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  cursor: pointer;
  text-decoration: none !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.welcome-v2-card:hover {
  background: white;
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(59, 130, 246, 0.1);
  border-color: #3b82f6;
}

.welcome-v2-icon-box {
  width: 54px;
  height: 54px;
  background: #f1f5f9;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #475569;
  flex-shrink: 0;
  transition: all 0.3s;
}

.welcome-v2-card:hover .welcome-v2-icon-box {
  background: #eff6ff;
  color: #3b82f6;
}

.welcome-v2-info {
  text-align: left;
}

.welcome-v2-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
}

.welcome-v2-card-desc {
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.4;
}

.analysis-status-slot .analysis-status-rail {
  height: 100%;
}

.workbench-main-card .dataTables_wrapper {
  font-size: 0.9rem;
}

.workbench-main-card table.dataTable.compact thead th,
.workbench-main-card table.dataTable.compact thead td,
.workbench-main-card table.dataTable.compact tbody th,
.workbench-main-card table.dataTable.compact tbody td {
  padding: 4px 8px;
}

.workbench-main-card .dataTables_wrapper .dataTables_paginate {
  margin-top: 0.5rem;
}

.workbench-main-card .dataTables_wrapper .dataTables_info,
.workbench-main-card .dataTables_wrapper .dataTables_length {
  padding-top: 0.35rem;
  color: var(--color-muted);
  font-size: 0.88rem;
}

.welcome-v2-arrow {
  margin-left: auto;
  color: #cbd5e1;
  font-size: 1.2rem;
  transition: transform 0.3s;
}

.welcome-v2-card:hover .welcome-v2-arrow {
  transform: translateX(5px);
  color: #3b82f6;
}

.welcome-v2-footer {
  position: absolute;
  bottom: 30px;
  left: 0;
  right: 0;
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
  font-weight: 500;
}

/* System log */
.log-console {
  background-color: var(--color-log-bg);
  color: var(--color-log-text);
  font-family: var(--font-mono);
  padding: 15px;
  border-radius: var(--radius-log);
  height: 65vh;
  overflow-y: auto;
  border: 1px solid var(--color-log-border);
  box-shadow: var(--shadow-log-inset);
}

.log-entry {
  margin-bottom: 4px;
  border-bottom: 1px solid var(--color-log-border);
  padding-bottom: 2px;
}

.log-entry-empty {
  color: var(--color-log-empty);
}

.log-timestamp {
  color: #569cd6;
  margin-right: 10px;
  font-size: 0.85em;
}

.log-type {
  font-weight: bold;
  margin-right: 8px;
  width: 60px;
  display: inline-block;
  text-align: center;
  border-radius: 3px;
  font-size: 0.8em;
  padding: 1px 0;
}

.log-type-info {
  background-color: var(--color-log-info);
  color: white;
}

.log-type-warn {
  background-color: var(--color-log-warn);
  color: black;
}

.log-type-error {
  background-color: var(--color-log-error);
  color: white;
}

.log-message {
  color: var(--color-log-text);
}

.log-action-column {
  margin-top: 25px;
}

.log-detail-table {
  width: auto;
  margin-top: 5px;
  font-size: 0.85em;
}

/* Smooth tab transitions */
.nav-tabs-custom .tab-content>.tab-pane,
.tab-content>.tab-pane {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 220ms ease-out, transform 220ms ease-out;
}

.nav-tabs-custom .tab-content>.active,
.tab-content>.active {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {

  .nav-tabs-custom .tab-content>.tab-pane,
  .tab-content>.tab-pane {
    transition: none;
    transform: none;
  }
}

/* PD convergence banner */
.pd-convergence-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.92rem;
  line-height: 1.35;
  border: 1px solid transparent;
  background: #f8f9fa;
  color: #495057;
}

.pd-convergence-banner .fa {
  font-size: 0.95rem;
}

.pd-convergence-banner--warn {
  background: #fff7e6;
  border-color: #ffe2b3;
  color: #7a4b00;
}

.pd-convergence-banner--ok {
  background: #eefaf1;
  border-color: #c9efd5;
  color: #2f6b3d;
}

/* PD diagnostics + VPC controls */
.pd-diag-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.pd-vpc-controls {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e7edf3;
  flex-wrap: wrap;
}

.pd-vpc-controls .form-group {
  margin-bottom: 0;
  min-width: 260px;
}

.pd-vpc-btn {
  height: 38px;
}

.pd-vpc-sep {
  height: 1px;
  background: #e6e6e6;
  margin: 16px 0 10px;
}

/* Tab fade in/out for auto jump */
.pd-tab-fade-out {
  opacity: 0 !important;
  transform: translateY(6px) !important;
}

.pd-tab-fade-in {
  animation: pd-tab-fade-in 260ms ease-out;
}

@keyframes pd-tab-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {

  .pd-tab-fade-out,
  .pd-tab-fade-in {
    animation: none;
    transform: none !important;
  }
}

/* PD parameter table layout */
.pd-param-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid #e6ecf2;
  border-radius: 12px;
  overflow: visible;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.04);
}

.pd-param-table th,
.pd-param-table td {
  padding: 12px 14px;
  vertical-align: middle;
  border-bottom: 1px solid #edf1f5;
  text-align: center;
  overflow: visible;
}

.pd-param-table th:nth-child(1),
.pd-param-table td:nth-child(1) {
  width: 14%;
}

.pd-param-table th:nth-child(2),
.pd-param-table td:nth-child(2) {
  width: 22%;
  text-align: center;
}

.pd-param-table th:nth-child(3),
.pd-param-table td:nth-child(3) {
  width: 28%;
}

.pd-param-table th:nth-child(4),
.pd-param-table td:nth-child(4) {
  width: 22%;
  text-align: center;
}

.pd-param-table td:nth-child(2) .form-control,
.pd-param-table td:nth-child(4) .form-control {
  text-align: center;
}

.pd-param-table thead th {
  background: #f7f9fb;
  color: #495057;
  font-weight: 600;
}

.pd-param-table tr:last-child td {
  border-bottom: none;
}

.pd-param-table .form-group {
  margin-bottom: 0;
}

.pd-param-table .form-control {
  width: 100%;
}

.pd-param-table .text-muted {
  font-size: 0.9rem;
}

.pd-param-table .selectize-dropdown,
.pd-param-table .dropdown-menu {
  z-index: 2000;
}

.pd-explore-params-box,
.pd-explore-params-box.card,
.pd-explore-params-box.box,
.pd-explore-params-box .card,
.pd-explore-params-box .card-body,
.pd-explore-params-box .box-body,
.pd-explore-params-box .pd-explore-param-layout,
.pd-explore-params-box .pd-explore-param-table-wrap {
  overflow: visible !important;
  position: relative; /* 为 z-index 准备 */
}

/* 当卡片内部下拉框打开时，提升整个卡片层级，确保不被下方卡片遮挡 */
.pd-explore-params-box:has(.selectize-input.focus) {
  z-index: 10001 !important;
}

.pd-explore-params-box .selectize-dropdown,
.pd-explore-params-box .dropdown-menu {
  z-index: 20000 !important;
}

.pd-bootstrap-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}



/* PD auto exploration table */
.pd-explore-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid #e6ecf2;
  border-radius: 12px;
  overflow: visible;
  table-layout: fixed;
}

.pd-explore-table th,
.pd-explore-table td {
  padding: 14px 16px;
  vertical-align: top;
  border-bottom: 1px solid #edf1f5;
}

.pd-explore-table thead th {
  background: #f7f9fb;
  color: #495057;
  font-weight: 600;
}

.pd-explore-table tr:last-child td {
  border-bottom: none;
}

.pd-explore-table .form-group {
  margin-bottom: 0;
}

.pd-explore-table .shiny-options-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 6px 18px;
  align-items: start;
}

.pd-explore-table .checkbox {
  margin: 0;
}

.pd-explore-options-center .shiny-options-group {
  display: inline-grid;
  justify-content: center;
  text-align: left;
}

.pd-explore-table td:first-child {
  font-weight: 600;
  color: #495057;
}

.pd-explore-config-card > .card-body,
.pd-explore-results-card > .card-body,
.pd-grid-search-card > .card-body,
.pd-grid-search-results-card > .card-body {
  padding: 12px !important;
}

.pd-explore-config-shell,
.pd-grid-search-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pd-explore-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px 12px;
  border: 1px solid #d9e2e9;
  border-radius: 6px;
  background: linear-gradient(180deg, #fbfcfd 0%, #f3f7fa 100%);
}

.pd-explore-panel-head__text {
  min-width: 0;
}

.pd-explore-eyebrow {
  margin-bottom: 4px;
  color: #687a8d;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pd-explore-panel-head h4 {
  margin: 0;
  color: #25384a;
  font-size: 1.02rem;
  font-weight: 800;
}

.pd-explore-panel-head p,
.pd-explore-results-head__text p {
  margin: 4px 0 0;
  color: #607284;
  font-size: 0.78rem;
  line-height: 1.45;
}

.pd-explore-runbar {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.pd-explore-runbar__meta {
  color: #6a7b8c;
  font-size: 0.72rem;
  font-weight: 700;
}

.pd-explore-runbar .btn {
  min-height: 38px !important;
  padding: 8px 16px !important;
  border-radius: 4px !important;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

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

.pd-explore-selector-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid #d6e0e7;
  border-radius: 5px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fb 100%);
}

.pd-explore-selector-panel__label {
  color: #203244;
  font-size: 0.8rem;
  font-weight: 800;
}

.pd-explore-selector-panel__hint {
  color: #718395;
  font-size: 0.7rem;
  line-height: 1.35;
}

.pd-explore-selector-options .shiny-options-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.pd-explore-selector-options .checkbox {
  margin: 0;
  padding: 7px 8px;
  border: 1px solid #dce4eb;
  border-radius: 4px;
  background: linear-gradient(180deg, #fbfdff 0%, #f3f7fa 100%);
}

.pd-explore-selector-options .checkbox label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: #314455;
  font-size: 0.74rem;
  font-weight: 700;
}

.pd-explore-selector-options input[type="checkbox"] {
  margin-top: 0;
}

.pd-explore-params-shell > .card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pd-explore-param-layout {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pd-explore-param-band {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 10px;
}

.pd-explore-param-block {
  padding: 10px 12px;
  border: 1px solid #d8e1e8;
  border-radius: 5px;
  background: linear-gradient(180deg, #fbfcfd 0%, #f5f8fb 100%);
}

.pd-explore-param-block__title {
  margin-bottom: 8px;
  color: #26384a;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pd-explore-param-note {
  margin-bottom: 8px;
  color: #6a7c8e;
  font-size: 0.72rem;
  line-height: 1.4;
}

.pd-explore-param-block--matrix {
  padding-bottom: 8px;
}

.pd-explore-param-table-wrap {
  overflow: visible;
}

.pd-explore-compact-grid {
  display: grid;
  gap: 8px 12px;
}

.pd-explore-compact-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pd-explore-compact-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pd-explore-compact-grid .form-group,
.pd-explore-compact-grid .shiny-input-container {
  margin-bottom: 0 !important;
}

.pd-explore-params-shell .form-control,
.pd-explore-params-shell .selectize-control.single .selectize-input {
  min-height: 34px !important;
  height: 34px !important;
  border-radius: 3px !important;
  font-size: 0.76rem !important;
}

.pd-explore-params-shell .control-label {
  margin-bottom: 3px !important;
  color: #576a7d;
  font-size: 0.71rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em;
}

.pd-explore-param-table {
  border: 1px solid #d5dee6;
  border-radius: 5px;
  overflow: visible;
  table-layout: fixed;
}

.pd-explore-param-table thead th {
  font-size: 0.7rem !important;
  white-space: nowrap;
}

.pd-explore-param-table tbody td {
  padding: 8px 10px !important;
  vertical-align: middle;
  overflow: visible;
  position: relative;
  z-index: 1;
}

.pd-explore-param-table .form-group,
.pd-explore-param-table .shiny-input-container {
  margin-bottom: 0 !important;
  overflow: visible !important;
}

.pd-explore-param-table .selectize-control,
.pd-explore-param-table .selectize-dropdown,
.pd-explore-param-table .selectize-dropdown.form-control {
  overflow: visible !important;
}

.pd-explore-param-table .selectize-dropdown,
.pd-explore-param-table .selectize-dropdown.form-control {
  z-index: 10000 !important;
}

.pd-explore-param-table th:first-child,
.pd-explore-param-table td:first-child {
  width: 16%;
  min-width: 110px;
  color: #243649;
  font-weight: 800;
}

.pd-explore-param-table th:nth-child(2),
.pd-explore-param-table td:nth-child(2) {
  width: 24%;
}

.pd-explore-param-table th:nth-child(3),
.pd-explore-param-table td:nth-child(3) {
  width: 24%;
}

.pd-explore-param-table th:nth-child(4),
.pd-explore-param-table td:nth-child(4) {
  width: 20%;
}

.pd-explore-param-table .text-muted {
  color: #6f8293 !important;
  font-size: 0.72rem;
  font-weight: 700;
}

.pd-explore-param-table .form-control,
.pd-explore-param-table .selectize-control.single .selectize-input {
  min-height: 32px !important;
  height: 32px !important;
  font-size: 0.74rem !important;
  border-radius: 3px !important;
}

.pd-explore-param-table td:nth-child(3) select.form-control,
.pd-explore-param-table td:nth-child(3) .form-control {
  text-align: center;
  text-align-last: center;
}

.pd-explore-param-table .bootstrap-select {
  width: 100% !important;
}

.pd-explore-param-table .bootstrap-select > .dropdown-toggle {
  min-height: 32px !important;
  height: 32px !important;
  font-size: 0.74rem !important;
  font-weight: 400 !important;
  border-radius: 3px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 28px 4px 10px !important;
}

.pd-explore-param-table .bootstrap-select > .dropdown-toggle .filter-option,
.pd-explore-param-table .bootstrap-select > .dropdown-toggle .filter-option-inner,
.pd-explore-param-table .bootstrap-select > .dropdown-toggle .filter-option-inner-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  font-weight: 400 !important;
}

.pd-explore-param-table .bootstrap-select .dropdown-menu {
  z-index: 10000 !important;
}

.pd-explore-param-table .bootstrap-select .dropdown-menu .dropdown-item,
.pd-explore-param-table .bootstrap-select .dropdown-menu .text,
.pd-explore-param-table .bootstrap-select .dropdown-menu .inner li a {
  font-weight: 400 !important;
  text-align: center !important;
}

.pd-explore-param-table .bootstrap-select .dropdown-menu .dropdown-item .text,
.pd-explore-param-table .bootstrap-select .dropdown-menu .inner li a .text {
  display: block;
  width: 100%;
  text-align: center !important;
}

/* pickerInput menus with container='body' are rendered under .bs-container */
.bs-container .dropdown-menu .dropdown-item,
.bs-container .dropdown-menu .inner li a,
.bs-container .dropdown-menu li a {
  text-align: center !important;
}

.bs-container .dropdown-menu .dropdown-item,
.bs-container .dropdown-menu .inner li a,
.bs-container .dropdown-menu li a {
  justify-content: center !important;
}

.bs-container .dropdown-menu .dropdown-item .text,
.bs-container .dropdown-menu .inner li a .text,
.bs-container .dropdown-menu li a .text {
  display: block;
  width: 100%;
  text-align: center !important;
}

.pd-explore-param-table .control-label {
  display: block;
  margin-bottom: 2px !important;
  font-size: 0.64rem !important;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #718294;
}

.pd-grid-search-card .pd-explore-param-block--grid-values .pd-explore-compact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pd-grid-search-card .pd-explore-param-block--iiv .pd-explore-compact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pd-grid-search-shell {
  gap: 10px;
}

.pd-grid-search-summary {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px 14px;
  padding: 8px 10px;
  border: 1px solid #d7e0e8;
  border-radius: 4px;
  background: linear-gradient(180deg, #fafcfd 0%, #f2f6f9 100%);
}

.pd-grid-search-summary .pd-explore-eyebrow {
  margin-bottom: 0;
}

.pd-grid-search-summary__title {
  color: #223547;
  font-size: 0.96rem;
  font-weight: 800;
}

.pd-grid-search-summary__hint,
.pd-grid-search-summary__rule {
  color: #6a7d8e;
  font-size: 0.73rem;
  font-weight: 700;
  white-space: nowrap;
}

.pd-grid-search-body {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 10px;
}

.pd-grid-search-column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pd-grid-search-card .pd-explore-param-block {
  padding: 9px 10px;
}

.pd-grid-search-card .pd-explore-param-block__title {
  margin-bottom: 7px;
  font-size: 0.74rem;
}

.pd-grid-search-card .pd-explore-param-note,
.pd-grid-search-grid-note {
  margin-bottom: 6px;
  color: #708293;
  font-size: 0.7rem;
  line-height: 1.4;
}

.pd-grid-search-card .pd-explore-compact-grid {
  gap: 7px 10px;
}

.pd-grid-search-values {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.pd-grid-search-card .form-control,
.pd-grid-search-card .selectize-control.single .selectize-input {
  min-height: 33px !important;
  height: 33px !important;
  font-size: 0.75rem !important;
}

.pd-grid-search-card .control-label {
  margin-bottom: 2px !important;
  color: #5c6f81;
  font-size: 0.69rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em;
}

.pd-grid-search-actionbar {
  display: flex;
  justify-content: flex-start;
  padding-top: 2px;
  border-top: 1px solid #d9e1e8;
}

.pd-grid-search-actionbar .btn {
  min-height: 38px !important;
  padding: 8px 16px !important;
  border-radius: 4px !important;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.pd-explore-results-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.pd-explore-results-head__text {
  min-width: 0;
}

.pd-explore-runbar--grid {
  align-items: flex-start;
}

.pd-explore-results-card .pd-table-shell {
  border-color: #ccd7e0;
  background: linear-gradient(180deg, #fdfefe 0%, #f5f8fb 100%);
}

.pd-explore-results-card .pd-table-shell__body,
.pd-grid-search-results-card .pd-table-shell__body {
  padding: 0;
}

.pd-explore-results-card table.dataTable thead th,
.pd-grid-search-results-card table.dataTable thead th {
  background: linear-gradient(180deg, #e5edf3 0%, #d8e2ea 100%) !important;
  color: #314455 !important;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid #cfd8e0 !important;
}

.pd-explore-results-card table.dataTable tbody td,
.pd-grid-search-results-card table.dataTable tbody td {
  padding: 9px 12px !important;
  vertical-align: middle;
  border-bottom: 1px solid #e8eef3 !important;
}

.pd-explore-results-card table.dataTable tbody tr:nth-child(even),
.pd-grid-search-results-card table.dataTable tbody tr:nth-child(even) {
  background: #fbfcfd !important;
}

.pd-explore-results-card table.dataTable tbody tr:hover,
.pd-grid-search-results-card table.dataTable tbody tr:hover {
  background: #f4f8fb !important;
}

.pd-monitor-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pd-monitor-badge--ok {
  color: #1f7a45;
  background: #e8f7ee;
  border-color: #b7ddc4;
}

.pd-monitor-badge--bad {
  color: #9a3f3f;
  background: #fcecec;
  border-color: #efc2c2;
}

.pd-monitor-note {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
}

.pd-monitor-note--ok {
  color: #315c43;
  background: #eef8f1;
}

.pd-monitor-note--warn {
  color: #7c5b14;
  background: #fff7df;
}

.pd-monitor-note--bad {
  color: #7b3340;
  background: #fbecef;
}

/* PD plot fixed aspect ratio */
.pd-plot-frame {
  position: relative;
  width: 100%;
}

.pd-plot-4-3 {
  aspect-ratio: 4 / 3;
  max-height: calc(100vh - 240px);
}

.pd-plot-gof {
  max-height: calc(100vh - 330px);
}

.pd-plot-vpc {
  aspect-ratio: 4 / 3;
  max-height: calc(100vh - 310px);
}

.pd-plot-auec-compare {
  aspect-ratio: 3 / 2;
  max-height: calc(100vh - 280px);
}

.pd-plot-individual-fit {
  height: 720px;
  max-height: none;
}

.pd-plot-frame>.shiny-spinner-output-container,
.pd-plot-frame>.shiny-plot-output {
  position: absolute !important;
  inset: 0;
  width: 100%;
  height: 100%;
}

@media (max-width: 900px) {
  .pd-explore-table .shiny-options-group {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 600px) {
  .pd-explore-table .shiny-options-group {
    grid-template-columns: 1fr;
  }
}

/* PD Three-line Table Style (Scientific) */
.pd-three-line-table {
  width: 100% !important;
  border-collapse: collapse !important;
  /* Ensure borders collapse */
  border-top: 2px solid #000 !important;
  /* Heavy top line */
  border-bottom: 2px solid #000 !important;
  /* Heavy bottom line */
  font-family: var(--font-sans);
}

.pd-three-line-table thead th {
  background-color: #fff !important;
  /* White background */
  color: #000 !important;
  /* Black text */
  border-bottom: 1px solid #000 !important;
  /* Thin header bottom line */
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  font-weight: 700 !important;
  padding: 12px 8px !important;
  text-align: left !important;
}

.pd-three-line-table tbody td {
  background-color: #fff !important;
  color: #333 !important;
  border: none !important;
  /* Remove default grid borders */
  border-bottom: 1px solid #f0f0f0 !important;
  /* Optional: very light guideline */
  padding: 10px 8px !important;
  vertical-align: middle !important;
}

/* Remove side borders/shading from wrapper */
div[id="tbl_fixed_dt"] .dataTables_wrapper,
div[id="tbl_bootstrap_dt"] .dataTables_wrapper {
  background: white !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* Styling for specific columns to maintain highlighted visuals but lighter */
.pd-three-line-table tbody td:nth-child(4),
/* RSE */
.pd-three-line-table tbody td:nth-child(5),
/* Back-transformed */
.pd-three-line-table tbody td:nth-child(6),
/* 95% CI */
.pd-three-line-table tbody td:nth-child(7),
/* BSV */
.pd-three-line-table tbody td:nth-child(8)

/* Shrink */
  {
  font-weight: 500;
}

/* Ensure buttons look clean */
div[id="tbl_fixed_dt"] .dt-buttons .dt-button,
div[id="tbl_bootstrap_dt"] .dt-buttons .dt-button {
  background: #f8f9fa !important;
  color: #333 !important;
  border: 1px solid #ddd !important;
  box-shadow: none !important;
}

div[id="tbl_fixed_dt"] .dt-buttons .dt-button:hover,
div[id="tbl_bootstrap_dt"] .dt-buttons .dt-button:hover {
  background: #e2e6ea !important;
}

.pd-pivotal-intro {
  color: #4f5d6b;
  font-size: 0.98rem;
  line-height: 1.55;
  margin-bottom: 18px;
}

.pd-pivotal-section h5 {
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  margin-bottom: 14px;
}

.pd-pivotal-section .form-group {
  margin-bottom: 14px;
}

.pd-pivotal-section .form-control {
  min-height: 44px;
  border-radius: 10px;
}

.pd-pivotal-section .irs,
.pd-pivotal-section .js-range-slider {
  margin-top: 6px;
}

.workbench-control-actions {
  margin-top: 8px;
}

.workbench-control-actions .btn {
  min-height: 50px;
  border-radius: 12px;
  font-weight: 700;
}

.pd-pivotal-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.pd-pivotal-summary-card {
  border-radius: 18px;
  padding: 18px 20px;
  background: linear-gradient(180deg, #fbfdff 0%, #eef5fb 100%);
  border: 1px solid #d9e6f2;
  box-shadow: 0 10px 24px rgba(23, 43, 77, 0.06);
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pd-pivotal-summary-card.is-pass {
  background: linear-gradient(180deg, #f3fbf4 0%, #e4f7e7 100%);
  border-color: #bfe8c7;
}

.pd-pivotal-summary-card.is-fail {
  background: linear-gradient(180deg, #fff5f5 0%, #fde9e9 100%);
  border-color: #f1c2c2;
}

.pd-pivotal-summary-card.is-pending {
  background: linear-gradient(180deg, #f7f8fb 0%, #edf1f5 100%);
  border-color: #d6dde6;
}

.pd-pivotal-summary-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6a7785;
}

.pd-pivotal-summary-value {
  font-size: 2rem;
  line-height: 1.05;
  font-weight: 800;
  color: #1f2d3d;
  word-break: keep-all;
}

.pd-pivotal-summary-hint {
  font-size: 0.88rem;
  color: #607080;
  line-height: 1.4;
}

.pd-pivotal-main-card {
  border: 1px solid #dce7f1;
  border-radius: 18px;
  background: #fbfdff;
  padding: 20px 22px 12px;
  margin-bottom: 18px;
}

.pd-pivotal-block-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: #213547;
  margin-bottom: 14px;
}

.pd-pivotal-tabs .nav-tabs {
  border-bottom: 1px solid #e2e8f0;
}

.pd-pivotal-tabs .nav-tabs .nav-link {
  border-radius: 12px 12px 0 0;
  font-weight: 600;
  color: #667587;
}

.pd-pivotal-tabs .nav-tabs .nav-link.active {
  color: #1677e6;
}

.pd-pivotal-tabs .tab-content {
  padding-top: 14px;
}

@media (max-width: 991px) {
  .pd-pivotal-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* Modern layout components for PD preprocess workspace */
:root {
  --pd-primary: #4f46e5;
  --pd-primary-dark: #4338ca;
  --pd-accent: #10b981;
  --pd-secondary: #0f766e;
  --pd-warm: #f59e0b;
  --pd-rose: #e11d48;
  --pd-bg-soft: #f8fafc;
  --pd-bg-shell: linear-gradient(180deg, #f8fbff 0%, #f3f7fb 100%);
  --pd-border: #e2e8f0;
  --pd-text-main: #1e293b;
  --pd-text-muted: #64748b;
  --pd-card-shadow: 0 18px 40px -24px rgba(15, 23, 42, 0.28), 0 8px 18px -12px rgba(79, 70, 229, 0.16);
}

.pd-pivotal-section h5 {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #7b8794;
  margin-bottom: 12px;
}

.workbench-control-panel .form-control,
.workbench-control-panel .selectize-input,
.workbench-control-panel .form-control-file {
  border-radius: 14px !important;
  border: 1px solid rgba(203, 213, 225, 0.9) !important;
  min-height: 48px;
  box-shadow: none !important;
}

.workbench-control-panel .selectize-input {
  padding: 10px 14px !important;
}

.workbench-control-panel .selectize-input.focus,
.workbench-control-panel .form-control:focus,
.workbench-control-panel .selectize-input:focus {
  border-color: rgba(79, 70, 229, 0.85) !important;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.10) !important;
}

.pd-basic-info-panel {
  padding: 28px;
  background:
    radial-gradient(circle at top right, rgba(79, 70, 229, 0.06), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

/* PD Basic Info Cards - Premium Redesign */
.pd-basic-info-panel {
  padding: 30px;
  background: white;
}

/* Info Grid Layout Fix */
.pd-info-grid {
  margin-left: -9px;
  margin-right: -9px;
  row-gap: 18px;
}

.pd-info-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  background: #f8fafc;
  border-radius: 20px;
  padding: 30px;
  border: 1px solid #e2e8f0;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  overflow: hidden;
  min-height: 120px;
}

.pd-info-grid > [class*="col-"] {
  padding-left: 9px;
  padding-right: 9px;
}

.pd-info-card:hover {
  background: white;
  border-color: #3b82f6;
  box-shadow: 0 20px 40px -15px rgba(59, 130, 246, 0.15);
  transform: translateY(-5px);
}

.pd-info-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 4px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.14), rgba(16, 185, 129, 0.14));
}

.pd-info-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: white !important;
  color: #3b82f6 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex: 0 0 60px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.pd-info-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pd-info-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--pd-text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.pd-info-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--pd-text-main);
  line-height: 1.55;
  word-break: break-word;
}

.pd-info-card--subject .pd-info-value {
  font-size: 2.1rem;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.pd-info-card--dose .pd-info-value,
.pd-info-card--time .pd-info-value {
  font-size: 1.04rem;
  font-weight: 700;
  color: #334155;
}


.pd-info-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.pd-info-chip {
  padding: 2px 10px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  transition: all 0.2s;
}

.pd-info-card:hover .pd-info-chip {
  border-color: #cbd5e1;
}

.pd-info-chip--more {
  background: #f1f5f9;
  border-style: dashed;
  color: #64748b;
}

/* Tabs UI Refinement */
.pd-pivotal-tabs-container .nav-tabs {
  padding: 14px 20px 0;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.9) 0%, rgba(255, 255, 255, 1) 100%);
}

.pd-pivotal-tabs-container .nav-tabs .nav-link {
  border: 1px solid transparent;
  color: var(--pd-text-muted);
  font-weight: 700;
  padding: 14px 18px;
  background: transparent;
  transition: all 0.2s;
  border-radius: 14px 14px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pd-pivotal-tabs-container .nav-tabs .nav-link.active {
  color: var(--pd-primary);
  background: #fff;
  border-color: rgba(226, 232, 240, 0.95);
  border-bottom-color: #fff;
  box-shadow: 0 -8px 16px -18px rgba(79, 70, 229, 0.45);
}

.pd-pivotal-tabs-container .tab-content {
  padding: 0;
}

.pd-pivotal-tabs-container .tab-pane {
  padding: 0;
}

@media (max-width: 991px) {
  .pd-basic-info-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 767px) {
  .workbench-control-panel__header,
  .workbench-control-panel__body,
  .pd-basic-info-panel {
    padding-left: 20px;
    padding-right: 20px;
  }

  .pd-pivotal-tabs-container .nav-tabs {
    padding-left: 12px;
    padding-right: 12px;
  }

  .pd-info-card {
    min-height: 132px;
    padding: 18px;
  }

  .pd-info-card--subject .pd-info-value {
    font-size: 1.7rem;
  }

  .pd-info-card--dose .pd-info-value,
  .pd-info-card--time .pd-info-value {
    font-size: 0.96rem;
  }
}

/* Unified Instrument Panel overrides */
:root {
  --font-heading: "Segoe UI", "Avenir Next", "Helvetica Neue", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", "Helvetica Neue", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", "Consolas", monospace;
  --ui-shell: #0f172a;
  --ui-shell-strong: #111c34;
  --ui-shell-text: #e2e8f0;
  --ui-shell-muted: #94a3b8;
  --ui-bg: #edf3f8;
  --ui-bg-alt: #e7eef5;
  --ui-surface: rgba(255, 255, 255, 0.92);
  --ui-surface-strong: #ffffff;
  --ui-surface-muted: #f6f9fc;
  --ui-border: rgba(148, 163, 184, 0.28);
  --ui-border-strong: rgba(51, 65, 85, 0.18);
  --ui-text: #142235;
  --ui-text-muted: #5f7186;
  --ui-title: #091524;
  --ui-accent: #0ea5e9;
  --ui-accent-strong: #0284c7;
  --ui-accent-soft: rgba(14, 165, 233, 0.12);
  --ui-success: #10b981;
  --ui-warning: #f59e0b;
  --ui-danger: #ef4444;
  --ui-shadow-card: 0 18px 34px -26px rgba(15, 23, 42, 0.48), 0 10px 18px -16px rgba(2, 132, 199, 0.12);
  --ui-shadow-raised: 0 22px 44px -30px rgba(15, 23, 42, 0.5), 0 18px 28px -24px rgba(2, 132, 199, 0.16);
  --ui-radius-card: 16px;
  --ui-radius-pill: 999px;
  --ui-card-header-bg: linear-gradient(135deg, #13233c 0%, #19304f 100%);
  --ui-card-header-border: rgba(255, 255, 255, 0.08);
  --ui-card-header-text: #e8f1fb;
  --ui-grid-line: rgba(15, 23, 42, 0.04);
}

html,
body {
  font-family: var(--font-body);
  color: var(--ui-text);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.03) 0%, rgba(15, 23, 42, 0) 24%),
    linear-gradient(180deg, var(--ui-bg) 0%, var(--ui-bg-alt) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--ui-grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--ui-grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  opacity: 0.45;
  z-index: 0;
}

.container-fluid,
.bslib-page-fill,
.bslib-page-navbar {
  position: relative;
  z-index: 1;
}

.bslib-page-navbar > .container-fluid,
.bslib-page-navbar > .tab-content,
.bslib-page-navbar > .navbar-page-content,
.bslib-page-navbar .tab-content > .tab-pane {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.navbar,
.navbar.navbar-default {
  background: linear-gradient(135deg, var(--ui-shell) 0%, var(--ui-shell-strong) 100%) !important;
  border: none !important;
  box-shadow: 0 18px 36px -30px rgba(15, 23, 42, 0.85);
}

.navbar .navbar-brand,
.navbar .nav-link,
.navbar .navbar-nav > li > a,
.navbar .navbar-text {
  color: var(--ui-shell-text) !important;
  font-family: var(--font-heading);
}

.navbar .navbar-brand {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.navbar .nav-link,
.navbar .navbar-nav > li > a {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 12px;
  margin: 8px 4px;
  padding: 10px 14px !important;
  transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.navbar .nav-link:hover,
.navbar .navbar-nav > li > a:hover,
.navbar .nav-link:focus,
.navbar .navbar-nav > li > a:focus {
  background: rgba(148, 163, 184, 0.12) !important;
  color: #ffffff !important;
}

.navbar .active > a,
.navbar .active > .nav-link,
.navbar .nav-item.active > .nav-link {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.3) 0%, rgba(16, 185, 129, 0.2) 100%) !important;
  color: #ffffff !important;
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.18);
}

.app-navbar-status,
.sys-resources,
.sys-resource,
.welcome-workbench-footer {
  font-family: var(--font-body);
}

.app-navbar-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
}

.app-version-badge-shell .shiny-html-output {
  display: inline-flex;
}

.app-version-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.18);
  color: #0f4c81;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.sys-resources {
  color: var(--ui-shell-text);
  gap: 12px;
}

.sys-resource {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.system-resource-panel .sys-resources {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  color: var(--ui-text);
}

.system-resource-panel .sys-resource {
  min-height: 72px;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(243, 248, 252, 0.98) 100%);
  border: 1px solid var(--ui-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  color: var(--ui-title);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  justify-content: flex-start;
  gap: 10px;
}

.system-resource-panel .sys-resource .fa {
  color: var(--ui-accent-strong);
  font-size: 1rem;
}

/* ═══════════════════════════════════════════════════
   系统模块 — 统计软件风格 (SAS / R Console Inspired)
   ═══════════════════════════════════════════════════ */

/* ── 系统总览控制台 ── */
.sys-stats-console {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
}

.sys-stats-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #1e293b;
  color: #e2e8f0;
  border-bottom: 2px solid #334155;
}

.sys-stats-header__icon {
  color: #38bdf8;
  font-size: 0.85rem;
}

.sys-stats-header__title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
  flex: 1;
}

.sys-stats-header__badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  letter-spacing: 0.05em;
}

.sys-stats-header__badge.sys-val--ok {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.sys-stats-header__badge.sys-val--warn {
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24;
}

.sys-stats-header__badge.sys-val--danger {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* 核心指标表格 */
.sys-stats-table {
  width: 100%;
  border-collapse: collapse;
}

.sys-stats-table td {
  padding: 8px 16px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.82rem;
  vertical-align: middle;
}

.sys-stats-table__label {
  font-size: 0.68rem !important;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
  width: 80px;
  background: #f1f5f9;
}

.sys-stats-table__value {
  font-weight: 700;
  color: #0f172a;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.sys-stats-table tr:last-child td {
  border-bottom: none;
}

.sys-stats-footer {
  display: flex;
  justify-content: space-between;
  padding: 6px 16px;
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
  font-size: 0.68rem;
  color: #94a3b8;
  letter-spacing: 0.02em;
}

/* ── 参数配置面板 ── */
.sys-config-console {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sys-config-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}

.sys-config-section__title {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #1e293b;
  color: #94a3b8;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sys-config-section__title .fa,
.sys-config-section__title .fas {
  color: #38bdf8;
  font-size: 0.75rem;
}

.sys-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  padding: 12px 14px;
}

.sys-config-grid .form-group {
  margin-bottom: 0 !important;
}

.sys-config-grid .control-label {
  font-size: 0.72rem !important;
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px !important;
}

.sys-config-grid .form-control {
  height: 32px !important;
  font-size: 0.8rem !important;
  font-family: 'SF Mono', 'Consolas', monospace;
  border-color: #cbd5e1 !important;
  border-radius: 4px !important;
  padding: 4px 8px !important;
}

.sys-config-grid .form-control:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12) !important;
}

.sys-config-actions {
  display: flex;
  gap: 8px;
  padding-top: 4px;
}

.sys-config-actions .btn {
  font-size: 0.78rem;
  padding: 6px 16px;
  border-radius: 4px;
}

.sys-config-note {
  padding: 0;
}

.sys-config-note p {
  font-size: 0.72rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.5;
}

/* ── 活跃会话监控 ── */
.sys-session-console {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}

.sys-session-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #1e293b;
  border-bottom: 2px solid #334155;
}

.sys-session-toolbar__select {
  flex: 1;
  max-width: 360px;
}

.sys-session-toolbar__select .form-group {
  margin-bottom: 0 !important;
}

.sys-session-toolbar__select .form-control,
.sys-session-toolbar__select .selectize-input {
  height: 30px !important;
  min-height: 30px !important;
  font-size: 0.75rem !important;
  background: #334155 !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
  border-radius: 3px !important;
  font-family: 'SF Mono', 'Consolas', monospace;
}

.sys-session-toolbar__select .selectize-input .item {
  color: #e2e8f0 !important;
}

.sys-session-toolbar .btn {
  font-size: 0.72rem;
  padding: 4px 12px;
  border-radius: 3px;
}

.sys-session-table {
  width: 100%;
  border-collapse: collapse;
}

.sys-session-table thead th {
  padding: 6px 14px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
  background: #f1f5f9;
  border-bottom: 2px solid #e2e8f0;
  text-align: left;
}

.sys-session-table__head--time {
  text-align: center !important;
  width: 22%;
}

.sys-session-table__head--count {
  text-align: center !important;
  width: 12%;
}

.sys-session-table tbody td {
  padding: 6px 14px;
  font-size: 0.78rem;
  color: #334155;
  border-bottom: 1px solid #e2e8f0;
  font-family: 'SF Mono', 'Consolas', monospace;
}

.sys-session-table__id {
  font-weight: 600;
  color: #0f172a !important;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sys-session-table__cell--time {
  text-align: center;
  white-space: nowrap;
}

.sys-session-table__cell--count {
  font-weight: 700;
  text-align: center !important;
  white-space: nowrap;
}

.sys-session-table tbody tr:hover {
  background: #f1f5f9;
}

.sys-session-table__row--current {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.08), rgba(14, 165, 233, 0.03));
}

.sys-session-table__row--current td {
  box-shadow: inset 0 1px 0 rgba(59, 130, 246, 0.12), inset 0 -1px 0 rgba(59, 130, 246, 0.12);
}

.sys-session-table__badge {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.18);
  color: #1d4ed8;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.sys-session-table tbody tr:last-child td {
  border-bottom: none;
}

.sys-session-note {
  padding: 6px 14px;
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
  font-size: 0.68rem;
  color: #94a3b8;
}

/* ── R 终端视图 ── */
#system_terminal_ui {
  display: block;
  width: 100%;
}

.sys-terminal-console {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 190px);
  min-height: 400px;
  background: #ffffff;
  border: 1px solid #cccccc;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: none;
}

.sys-terminal-console__toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: #f0f0f0;
  border-bottom: 1px solid #cccccc;
  z-index: 10;
}

.sys-terminal-console__meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  padding: 2px 8px;
  background: transparent;
  border: none;
  border-radius: 0;
}

.sys-terminal-console__meta-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #666666;
}

.sys-terminal-console__meta-value {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 400;
  color: #333333;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

.sys-terminal-console__follow {
  margin-left: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
  background: transparent;
  border: 1px solid #cccccc;
  color: #555555;
  border-radius: 4px;
}

.sys-terminal-console .btn-outline-light {
  color: #555555;
  border-color: #cccccc;
  background: #ffffff;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.75rem;
  padding: 4px 10px;
  transition: all 150ms ease;
}

.sys-terminal-console .btn-outline-light:hover,
.sys-terminal-console .btn-outline-light:focus,
.sys-terminal-console .btn-outline-light:active {
  color: #333333;
  border-color: #999999;
  background: #e6e6e6;
  box-shadow: none;
}

.sys-terminal-console__follow.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.sys-terminal-console__viewport {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  padding: 12px 16px;
  background: #ffffff;
  scroll-behavior: auto;
  position: relative;
}

/* 终端内部专属滚动条 */
.sys-terminal-console__viewport::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.sys-terminal-console__viewport::-webkit-scrollbar-track {
  background: #f9f9f9;
  border-left: 1px solid #eaeaea;
}

.sys-terminal-console__viewport::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 6px;
  border: 3px solid #f9f9f9;
}

.sys-terminal-console__viewport::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.sys-terminal-console__output {
  margin: 0;
  min-height: 100%;
  color: #000000;
  font-size: 0.85rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  text-shadow: none;
}

.sys-terminal-console__footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 12px;
  border-top: 1px solid #cccccc;
  background: #f0f0f0;
  color: #666666;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0;
  font-family: 'Consolas', 'Monaco', monospace;
}


.welcome-workbench-footer {
  padding: 14px 6px 4px;
  color: var(--ui-text-muted);
  font-size: 0.88rem;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 251, 254, 0.98) 100%);
  border-radius: var(--ui-radius-card) !important;
  border: 1px solid var(--ui-border) !important;
  box-shadow: var(--ui-shadow-card);
  backdrop-filter: blur(10px);
}

.card:hover {
  box-shadow: var(--ui-shadow-raised);
}

.card-header {
  background: var(--ui-card-header-bg) !important;
  color: var(--ui-card-header-text) !important;
  border-bottom: 1px solid var(--ui-card-header-border) !important;
  padding: 14px 18px !important;
}

.card-header,
.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card-body {
  padding: 20px 22px;
}

.summary-card {
  background: linear-gradient(135deg, #ffffff 0%, #f3f8fc 100%);
  border: 1px solid var(--ui-border);
}

.summary-card .card-header {
  background: linear-gradient(135deg, #0f2744 0%, #14365a 100%) !important;
}

.summary-card-value {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--ui-title);
  letter-spacing: -0.03em;
}

.summary-card-success {
  border-color: rgba(16, 185, 129, 0.28);
  box-shadow: 0 18px 34px -26px rgba(5, 150, 105, 0.42);
}

.summary-card-muted {
  border-color: rgba(148, 163, 184, 0.28);
}

.bslib-sidebar-layout,
.layout-sidebar,
.sidebar,
.sidebar-content {
  background: transparent;
}

.sidebar,
.bslib-sidebar-layout > .sidebar,
.bslib-sidebar-layout .sidebar-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(245, 249, 253, 0.95) 100%) !important;
  border: 1px solid var(--ui-border) !important;
  border-radius: var(--sw-radius) !important;
  box-shadow: var(--ui-shadow-card);
  overflow: hidden;
}

.sidebar .sidebar-title,
.sidebar h2,
.sidebar h3,
.sidebar h4 {
  font-family: var(--font-heading);
  color: var(--ui-title);
}

.nav-tabs {
  border-bottom: 1px solid var(--ui-border);
  gap: 8px;
}

.nav-tabs .nav-link {
  border: 1px solid transparent;
  border-radius: 12px 12px 0 0;
  color: var(--ui-text-muted);
  background: rgba(255, 255, 255, 0.45);
  font-family: var(--font-heading);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 12px 16px;
}

.nav-tabs .nav-link:hover {
  color: var(--ui-title);
  border-color: rgba(14, 165, 233, 0.18);
  background: rgba(255, 255, 255, 0.72);
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
  color: #ffffff;
  background: linear-gradient(135deg, #0f2744 0%, #16456f 100%);
  border-color: rgba(12, 74, 110, 0.55);
  box-shadow: inset 0 0 0 1px rgba(186, 230, 253, 0.1);
}

.tab-content {
  background: transparent;
}

.btn,
.dt-button,
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 12px !important;
  font-family: var(--font-heading);
  font-weight: 800 !important;
  letter-spacing: 0.03em;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.btn:hover,
.dt-button:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  transform: translateY(-1px);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.7 !important;
  cursor: not-allowed !important;
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.2) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.2) 75%,
    transparent 75%,
    transparent
  ) !important;
  background-size: 1rem 1rem !important;
  animation: btn-busy-stripes 1s linear infinite !important;
  filter: saturate(0.6);
  pointer-events: none;
}

@keyframes btn-busy-stripes {
  from { background-position: 1rem 0; }
  to { background-position: 0 0; }
}

.btn-primary,
.btn-success,
.btn-info {
  background: linear-gradient(135deg, var(--ui-accent) 0%, #118ab2 100%) !important;
  border-color: rgba(2, 132, 199, 0.7) !important;
  color: #ffffff !important;
  box-shadow: 0 14px 24px -18px rgba(2, 132, 199, 0.72);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
  border-color: rgba(217, 119, 6, 0.72) !important;
  color: #fff !important;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  border-color: rgba(220, 38, 38, 0.72) !important;
  color: #fff !important;
}

.btn-secondary,
.btn-outline-secondary,
.dt-button {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(243, 248, 252, 0.98) 100%) !important;
  border: 1px solid var(--ui-border) !important;
  color: var(--ui-title) !important;
  box-shadow: none !important;
}

.btn-outline-secondary:hover,
.btn-secondary:hover,
.dt-button:hover {
  border-color: rgba(14, 165, 233, 0.38) !important;
  color: var(--ui-accent-strong) !important;
  background: #ffffff !important;
}

.form-control,
.selectize-input,
.irs,
.js-range-slider,
.selectize-dropdown,
.form-control-file,
.shiny-input-container input[type="text"],
.shiny-input-container input[type="number"],
.shiny-input-container select {
  font-family: var(--font-body);
}

.form-control,
.selectize-input,
.shiny-input-container input[type="text"],
.shiny-input-container input[type="number"],
.shiny-input-container select {
  min-height: 44px;
  border-radius: 12px !important;
  border: 1px solid var(--ui-border) !important;
  background: rgba(255, 255, 255, 0.92) !important;
  color: var(--ui-text) !important;
  box-shadow: none !important;
}

.form-control:focus,
.selectize-input.focus,
.selectize-input:focus,
.shiny-input-container input:focus,
.shiny-input-container select:focus {
  border-color: rgba(14, 165, 233, 0.6) !important;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12) !important;
}

.dataTables_wrapper,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  font-family: var(--font-body);
  color: var(--ui-text-muted);
}

.dataTables_wrapper .dataTables_filter {
  display: none !important;
}

.dataTables_wrapper .dataTables_length {
  display: none !important;
}

div.dataTables_filter,
div.dataTables_length {
  display: none !important;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  min-height: 38px;
  border-radius: 10px !important;
  border: 1px solid var(--ui-border) !important;
  background: rgba(255, 255, 255, 0.92);
}

table.dataTable thead th,
table.dataTable thead td {
  background: linear-gradient(180deg, #eff5fa 0%, #f8fbfd 100%) !important;
  color: var(--ui-title) !important;
  border-bottom: 1px solid var(--ui-border-strong) !important;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

table.dataTable tbody td {
  background: rgba(255, 255, 255, 0.72);
  color: var(--ui-text);
  border-bottom: 1px solid rgba(226, 232, 240, 0.7) !important;
}

table.dataTable.stripe tbody tr.odd,
table.dataTable.display tbody tr.odd {
  background: rgba(248, 251, 254, 0.85) !important;
}

table.dataTable.hover tbody tr:hover,
table.dataTable.display tbody tr:hover {
  background: rgba(14, 165, 233, 0.05) !important;
}

.welcome-container {
  max-width: 1280px;
}

.hero-section {
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.22) 0%, transparent 24%),
    linear-gradient(135deg, #0b1628 0%, #13233c 52%, #163c5a 100%);
  border-radius: 20px;
  box-shadow: 0 28px 46px -34px rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(125, 211, 252, 0.08);
  text-align: left;
}

.hero-section::before {
  width: 360px;
  height: 360px;
  top: -80px;
  right: -70px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.18) 0%, transparent 70%);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 3rem;
  letter-spacing: -0.04em;
}

.hero-subtitle {
  max-width: 760px;
  color: rgba(226, 232, 240, 0.92);
}

.welcome-container .card,
.feature-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 249, 253, 0.98) 100%);
  border-color: rgba(148, 163, 184, 0.22);
}

.feature-icon-wrapper {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12) 0%, rgba(16, 185, 129, 0.12) 100%);
  color: var(--ui-accent-strong);
}

.feature-card:hover .feature-icon-wrapper {
  background: linear-gradient(135deg, #0ea5e9 0%, #10b981 100%);
}

.pd-pivotal-main-card,
.pd-info-card,
.pd-pivotal-summary-card {
  border-radius: 16px;
  border-color: var(--ui-border);
  box-shadow: var(--ui-shadow-card);
}

.workbench-control-panel__header,
.workbench-main-card > .card-header {
  background: var(--ui-card-header-bg);
  border-bottom: 1px solid var(--ui-card-header-border);
}

.workbench-control-panel__header h4,
.pd-pivotal-block-title,
.pd-basic-info-headline h5 {
  font-family: var(--font-heading);
  color: var(--ui-card-header-text);
}

.workbench-control-panel__header h4 i {
  background: linear-gradient(135deg, #0ea5e9 0%, #10b981 100%);
  box-shadow: 0 10px 18px -10px rgba(14, 165, 233, 0.75);
}

.pd-pivotal-block-title,
.pd-basic-info-headline h5 {
  color: var(--ui-title);
}

.pd-pivotal-section h5,
.pd-info-label,
.pd-pivotal-summary-label,
.pd-basic-info-kicker {
  color: var(--ui-text-muted);
}

.pd-pivotal-summary-card.is-pass {
  background: linear-gradient(180deg, rgba(236, 253, 245, 0.95) 0%, rgba(220, 252, 231, 0.95) 100%);
}

.pd-pivotal-summary-card.is-fail {
  background: linear-gradient(180deg, rgba(254, 242, 242, 0.96) 0%, rgba(254, 226, 226, 0.96) 100%);
}

.pd-pivotal-summary-card.is-pending {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98) 0%, rgba(241, 245, 249, 0.98) 100%);
}

.pd-pivotal-tabs .nav-tabs,
.pd-pivotal-tabs-container .nav-tabs {
  background: linear-gradient(180deg, rgba(244, 248, 251, 0.94) 0%, rgba(255, 255, 255, 0.98) 100%);
  border-bottom: 1px solid var(--ui-border);
}

.pd-param-table,
.pd-explore-table {
  border-color: var(--ui-border);
  box-shadow: none;
}

.pd-explore-config-card,
.pd-explore-results-card,
.pd-grid-search-card,
.pd-grid-search-results-card,
.pd-explore-params-shell {
  border-radius: 6px !important;
  border-color: #d3dce4 !important;
  box-shadow: none !important;
}

.pd-param-table thead th,
.pd-explore-table thead th {
  background: linear-gradient(180deg, #eef4f9 0%, #f8fbfd 100%);
  color: var(--ui-title);
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.76rem;
}

.log-console {
  background:
    linear-gradient(180deg, rgba(9, 21, 36, 0.98) 0%, rgba(15, 23, 42, 0.98) 100%);
  color: #d6e3ef;
  border: 1px solid rgba(30, 41, 59, 0.8);
  border-radius: 16px;
  box-shadow: inset 0 0 18px rgba(2, 6, 23, 0.55), 0 18px 34px -28px rgba(15, 23, 42, 0.65);
}

.log-entry {
  border-bottom-color: rgba(51, 65, 85, 0.8);
}

.log-timestamp {
  color: #7dd3fc;
}

@media (max-width: 991px) {
  .hero-section {
    text-align: center;
  }

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }
}

/* Statistical software workbench overrides - Modern High-End UI (Platinum & Slate Silver) */
:root {
  --sw-shell: #171717;
  --sw-shell-deep: #0a0a0a;
  --sw-shell-text: #f5f5f5;
  --sw-bg: #fafafa;
  --sw-panel: #ffffff;
  --sw-panel-strong: #ffffff;
  --sw-panel-muted: #f5f5f5;
  --sw-border: rgba(229, 229, 229, 0.8);
  --sw-border-strong: #d4d4d4;
  --sw-text: #171717;
  --sw-text-muted: #737373;
  --sw-accent: #525252;
  --sw-accent-strong: #171717;
  --sw-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
  --sw-shadow-raised: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --sw-radius: 8px;
  --sw-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  background: linear-gradient(135deg, #fdfdfd 0%, #f5f5f5 100%);
  color: var(--sw-text);
}

body::before {
  opacity: 0.14;
  background-size: 28px 28px;
}

.navbar,
.navbar.navbar-default {
  background: rgba(255, 255, 255, 0.95) !important;
  border-bottom: 1px solid rgba(229, 229, 229, 1) !important;
  box-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.navbar .navbar-brand,
.navbar .nav-link,
.navbar .navbar-nav > li > a,
.navbar .navbar-text {
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
  color: var(--sw-text) !important;
}

.navbar .navbar-brand {
  font-size: 1rem;
  font-weight: 800;
  text-transform: none;
  color: var(--sw-accent-strong) !important;
}

.navbar .nav-link,
.navbar .navbar-nav > li > a {
  font-size: 0.86rem;
  font-weight: 600;
  text-transform: none;
  border-radius: 6px;
  margin: 6px 4px;
  padding: 8px 14px !important;
  transition: all var(--sw-transition) !important;
}

.navbar .nav-link:hover,
.navbar .navbar-nav > li > a:hover,
.navbar .nav-link:focus,
.navbar .navbar-nav > li > a:focus {
  background: rgba(23, 23, 23, 0.04) !important;
  color: var(--sw-accent) !important;
}

.navbar .active > a,
.navbar .active > .nav-link,
.navbar .nav-item.active > .nav-link {
  background: #ffffff !important;
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.05) !important;
  color: var(--sw-accent-strong) !important;
  font-weight: 700;
  border-bottom: 2px solid var(--sw-accent-strong) !important;
}

.welcome-workbench-footer {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 0 4px;
  color: var(--sw-text-muted);
  font-size: 0.84rem;
}

.card,
.welcome-container .card,
.feature-card,
.pd-pivotal-main-card,
.pd-info-card,
.pd-pivotal-summary-card {
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--sw-border) !important;
  border-radius: var(--sw-radius) !important;
  box-shadow: var(--sw-shadow);
  transition: box-shadow var(--sw-transition), transform var(--sw-transition);
}

.card:hover,
.feature-card:hover,
.pd-info-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--sw-shadow-raised);
}

.card-header,
.workbench-main-card > .card-header,
.workbench-control-panel__header,
.workbench-control-panel > .card-header {
  background: linear-gradient(180deg, #e5ebf0 0%, #d7e0e7 100%) !important;
  border-bottom: 1px solid var(--sw-border) !important;
  color: var(--sw-text) !important;
  padding: 10px 14px !important;
  border-top-left-radius: var(--sw-radius) !important;
  border-top-right-radius: var(--sw-radius) !important;
}

.card-header,
.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6,
.workbench-control-panel__header h4 {
  font-family: "Segoe UI", "Avenir Next", sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: none;
  color: var(--sw-text) !important;
}

.card-body,
.workbench-control-panel__body,
.workbench-main-card .card-body {
  padding: 16px 18px;
}

.summary-card .card-header {
  background: linear-gradient(180deg, #dce5ec 0%, #d0dbe3 100%) !important;
}

.summary-card-value,
.pd-pivotal-summary-value {
  color: var(--sw-text);
  font-weight: 700;
}

.nav-tabs,
.pd-pivotal-tabs .nav-tabs,
.pd-pivotal-tabs-container .nav-tabs {
  gap: 3px;
  border-bottom: 1px solid var(--sw-border);
  background: linear-gradient(180deg, #edf2f5 0%, #e3e9ee 100%);
  padding: 6px 8px 0;
  border-top-left-radius: var(--sw-radius) !important;
  border-top-right-radius: var(--sw-radius) !important;
}

.nav-tabs .nav-link,
.pd-pivotal-tabs .nav-tabs .nav-link,
.pd-pivotal-tabs-container .nav-tabs .nav-link {
  border-radius: 4px 4px 0 0;
  border: 1px solid transparent;
  background: linear-gradient(180deg, #e6ecf1 0%, #d9e1e7 100%);
  color: var(--sw-text-muted);
  font-family: "Segoe UI", "Avenir Next", sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  padding: 8px 12px;
  border-bottom: none;
}

.tab-content,
.tab-pane,
.nav-panel {
  padding: 0 !important;
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link,
.pd-pivotal-tabs .nav-tabs .nav-link.active,
.pd-pivotal-tabs-container .nav-tabs .nav-link.active {
  background: #ffffff;
  color: var(--sw-accent-strong);
  border-color: var(--sw-border) var(--sw-border) #ffffff;
  box-shadow: inset 0 2px 0 var(--sw-accent-strong);
}

.btn,
.dt-button {
  border-radius: 6px !important;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
  transition: all var(--sw-transition);
}

.btn:hover,
.dt-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-primary,
.btn-success,
.btn-info {
  background: var(--sw-accent-strong) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 2px 4px rgba(23, 23, 23, 0.2) !important;
}

.btn-primary:hover,
.btn-success:hover,
.btn-info:hover {
  background: var(--sw-accent) !important;
}

.btn-warning {
  background: #f59e0b !important;
  color: #fff !important;
  border: none !important;
}

.btn-danger {
  background: #ef4444 !important;
  color: #fff !important;
  border: none !important;
}

.btn-secondary,
.btn-outline-secondary,
.dt-button {
  background: #f8fafc !important;
  border: 1px solid var(--sw-border-strong) !important;
  color: var(--sw-text) !important;
}

.form-control,
.selectize-input,
.shiny-input-container input[type="text"],
.shiny-input-container input[type="number"],
.shiny-input-container select,
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  min-height: 38px;
  border-radius: 6px !important;
  border: 1px solid var(--sw-border-strong) !important;
  background: #ffffff !important;
  color: var(--sw-text) !important;
  transition: all var(--sw-transition);
}

.form-control:focus,
.selectize-input.focus,
.selectize-input:focus,
.shiny-input-container input:focus,
.shiny-input-container select:focus {
  border-color: var(--sw-accent-strong) !important;
  box-shadow: 0 0 0 3px rgba(23, 23, 23, 0.1) !important;
  outline: none;
}

table.dataTable thead th,
table.dataTable thead td,
.pd-param-table thead th,
.pd-explore-table thead th {
  background: linear-gradient(180deg, #e0e7ec 0%, #d4dde5 100%) !important;
  color: var(--sw-text) !important;
  border-bottom: 1px solid var(--sw-border-strong) !important;
  font-family: "Segoe UI", "Avenir Next", sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
}

table.dataTable tbody td {
  background: #ffffff;
  color: var(--sw-text);
  border-bottom: 1px solid #dde5eb !important;
  font-size: 0.84rem;
}

table.dataTable.stripe tbody tr.odd,
table.dataTable.display tbody tr.odd {
  background: #f7fafc !important;
}

table.dataTable.hover tbody tr:hover,
table.dataTable.display tbody tr:hover {
  background: #eef4f8 !important;
}

.welcome-container {
  max-width: 1180px;
}

.hero-section {
  background: linear-gradient(135deg, #041b2d 0%, #0d324d 100%);
  border: none;
  border-radius: 16px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  color: #ffffff;
  padding: 3.5rem 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  display: block;
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(2, 132, 199, 0.2) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-title {
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.hero-subtitle {
  color: var(--sw-text-muted);
  font-size: 1rem;
  font-weight: 400;
  max-width: 760px;
}

.feature-card {
  padding: 1.35rem;
  text-align: left;
}

.feature-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  background: linear-gradient(180deg, #e5ecf2 0%, #dce4eb 100%);
  color: var(--sw-accent-strong);
  margin-bottom: 1rem;
}

.feature-card:hover .feature-icon-wrapper {
  background: linear-gradient(180deg, #d6e0e8 0%, #cad5de 100%);
  color: var(--sw-accent-strong);
}

.feature-title {
  color: var(--sw-text);
  font-family: "Segoe UI", "Avenir Next", sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.feature-desc,
.pd-pivotal-intro,
.pd-basic-info-note,
.pd-pivotal-summary-hint,
.dataTables_wrapper,
.dataTables_wrapper .dataTables_info {
  color: var(--sw-text-muted);
}

.workbench-control-panel__header h4 i {
  background: linear-gradient(180deg, #7f95a8 0%, #6b8092 100%);
  box-shadow: none;
  border-radius: 4px;
}

.pd-pivotal-summary-card.is-pass,
.pd-pivotal-summary-card.is-fail,
.pd-pivotal-summary-card.is-pending {
  background: linear-gradient(180deg, #fbfcfd 0%, #f2f5f8 100%);
  border-color: var(--sw-border);
}

.pd-info-icon,
.pd-info-card--trial .pd-info-icon,
.pd-info-card--subject .pd-info-icon,
.pd-info-card--dose .pd-info-icon,
.pd-info-card--time .pd-info-icon {
  border-radius: 4px;
  background: linear-gradient(180deg, #e6edf2 0%, #dbe3ea 100%);
  color: var(--sw-accent-strong);
  box-shadow: none;
}

.log-console {
  background: linear-gradient(180deg, #f4f7fa 0%, #ecf1f5 100%);
  color: var(--sw-text);
  border: 1px solid var(--sw-border);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.log-entry {
  border-bottom-color: #d6e0e8;
}

.log-timestamp {
  color: var(--sw-accent-strong);
}

.pk-control-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100%; /* 使用 min-height 以确保即使内容少也能撑满并推到底部 */
  height: auto;
  padding-bottom: 0; /* padding 改为由 action-bar 的 margin/padding 处理 */
  position: relative;
}

/* 轨道背景：连接各步骤的垂直线 */
.pk-control-shell::before {
  content: "";
  position: absolute;
  left: 11px; /* 对应进一步压缩后的 pk-control-step 中心 */
  top: 40px;
  bottom: 120px; /* 进一步缩短，避免在大屏/短内容时穿透 Action Bar */
  width: 2px;
  background: #e2e8f0;
  z-index: 0;
}

.pk-control-header {
  padding-bottom: 2px;
  border-bottom: 1px solid #d4dde5;
}

.pk-control-title {
  margin: 0 0 4px 0;
  font-family: "Segoe UI", "Avenir Next", sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--sw-text);
}

.pk-control-subtitle {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--sw-text-muted);
}

.pk-control-section {
  padding: 0 0 10px 27px; /* 进一步压缩时间线占位，给右侧控件留空间 */
  border: none !important;
  border-radius: 0;
  background: transparent !important;
  position: relative;
  z-index: 1;
}

.pk-control-section:last-child {
  padding-bottom: 0;
}

.pk-control-step {
  position: absolute;
  left: -1px;
  top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  color: #64748b;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 800;
  z-index: 2;
  box-shadow: 0 0 0 4px #fafafa;
}

.pk-control-section--active .pk-control-step {
  border-color: var(--sw-accent-strong);
  background: var(--sw-accent-strong);
  color: #fff;
}

.pk-control-section-title {
  margin: 0 0 4px 0;
  font-family: "Segoe UI", "Avenir Next", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--sw-text);
}

.pk-control-section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.pk-control-title-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pk-control-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid #c7d2db;
  border-radius: 8px;
  background: linear-gradient(180deg, #fdfefe 0%, #edf3f7 100%);
  color: var(--sw-accent-strong);
  text-decoration: none;
  flex: 0 0 auto;
}

.pk-control-title-icon:hover,
.pk-control-title-icon:focus {
  color: var(--sw-accent-strong);
  text-decoration: none;
  border-color: #9ec6df;
  background: #ffffff;
}

.pk-control-title-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pk-control-title-actions .pk-import-status-badge {
  margin-right: 2px;
}

.pk-control-title-icon--mapping.needs-mapping {
  border-color: #f59e0b !important;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
  color: #92400e !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2), 0 1px 4px rgba(245, 158, 11, 0.15);
  animation: pk-mapping-pulse-v2 1.5s ease-in-out infinite;
  position: relative;
  overflow: visible !important;
}

.pk-control-title-icon--mapping.needs-mapping::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border: 2px solid #f59e0b;
  border-radius: 50%;
  animation: pk-mapping-halo 1.5s ease-out infinite;
  pointer-events: none;
  z-index: -1;
}

.pk-control-title-icon--mapping.needs-mapping::after {
  content: "\f0a7"; /* 手指指向图标或闪电图标 */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 0.7rem;
  background: #f59e0b;
  color: #fff;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: -7px;
  right: -7px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  animation: pk-mapping-badge-bounce 1s ease-in-out infinite;
}

.pk-control-title-icon--mapping.needs-mapping:hover,
.pk-control-title-icon--mapping.needs-mapping:focus {
  border-color: #d97706;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2), 0 2px 8px rgba(245, 158, 11, 0.18);
}

.pk-control-section-note {
  margin: 0 0 8px 0;
  font-size: 0.76rem;
  line-height: 1.35;
  color: var(--sw-text-muted);
}

.pk-import-action-bundle {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  background: #f8fafc;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.pk-import-upload-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pk-import-upload-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.pk-import-upload-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.pk-import-file-wrap .form-group {
  margin-bottom: 0 !important;
}

.pk-import-file-wrap > .form-group > label.control-label {
  display: none !important;
}

@keyframes pk-mapping-pulse-v2 {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2), 0 1px 4px rgba(245, 158, 11, 0.15);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.1), 0 3px 12px rgba(245, 158, 11, 0.25);
    transform: scale(1.05);
  }
}

@keyframes pk-mapping-halo {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}

@keyframes pk-mapping-badge-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes pk-mapping-badge-pop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.pk-import-status-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 3px 7px !important;
  background: #ecfdf3 !important;
  color: #166534 !important;
  border: 1px solid #bbf7d0 !important;
  border-radius: 999px !important;
  font-size: 0.68rem !important;
  font-weight: 700 !important;
  white-space: nowrap !important;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 优化上传进度条，使其更加紧凑且符合专业调性 */
.pk-import-action-bundle .progress {
  height: 4px !important;
  margin: 6px 0 2px 0 !important;
  background-color: #e2e8f0 !important;
  border-radius: 2px !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

.pk-import-action-bundle .progress-bar {
  background-color: #3b82f6 !important;
  line-height: 4px !important;
  font-size: 0 !important; /* 隐藏进度条内的文字，因为条太细了 */
}

.pk-control-source-actions,
.pk-control-inline-group {
  display: none !important; /* Hide old classes now that they are bundled */
}

.pk-control-section-title-row .pk-control-step {
  /* 已经在 pk-control-step 中定义，这里置空或覆盖 */
  position: absolute;
}

.pk-control-section-title-row .pk-control-section-title {
  margin-bottom: 0;
  font-size: 0.92rem;
  color: #0f172a;
}

.pk-example-preview-modal {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 520px !important;
  padding: 10px 0;
}

.pk-example-preview-note {
  margin: 0 0 8px;
  color: #475569;
  font-size: 0.88rem;
  line-height: 1.5;
  background: #f1f5f9;
  padding: 10px 16px;
  border-radius: 8px;
  border-left: 4px solid #94a3b8;
}

.pk-example-preview-table-wrap {
  max-height: 500px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.pk-example-preview-table {
  margin: 0;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
}

.pk-example-preview-table--uniform {
  table-layout: fixed;
}

.pk-example-preview-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #1e293b !important;
  color: #ffffff !important;
  padding: 12px 16px !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #0f172a;
}

.pk-example-preview-table tbody td {
  padding: 10px 16px !important;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
}

.pk-example-preview-table--uniform thead th,
.pk-example-preview-table--uniform tbody td {
  width: 1%;
}

.pk-example-preview-table tbody tr:last-child td {
  border-bottom: none;
}

.pk-example-preview-table tbody tr:hover {
  background: #f8fafc;
}

/* PK CT Mapping Modal - Ultra-Compact 3-Column Style (v7 Actions Fix) */
.pk-ct-mapping-modal {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 85vh;
  padding: 2px;
}

/* Force Modal Centering & Fixed Display */
.modal {
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}

.modal-dialog {
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  max-width: 95vw !important;
}

.modal-content {
  border-radius: 4px !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
  border: 1px solid #cbd5e1 !important;
  width: 1000px !important;
}

/* Fixed Mapping Modal Footprint */
.modal-dialog.pk-ct-mapping-dialog,
.pk-ct-mapping-dialog.modal-dialog,
.modal-dialog:has(.pk-ct-mapping-dialog),
.modal-dialog:has(.pk-ct-mapping-modal) {
  width: 1300px !important;
  max-width: 1300px !important;
}

.modal-dialog.pk-ct-mapping-dialog .modal-content,
.modal-content.pk-ct-mapping-dialog,
.modal-dialog .modal-content.pk-ct-mapping-dialog,
.modal-dialog:has(.pk-ct-mapping-dialog) .modal-content,
.modal-dialog:has(.pk-ct-mapping-modal) .modal-content {
  width: 1300px !important;
  max-width: 1300px !important;
  min-height: 85vh !important;
  max-height: 85vh !important;
  overflow: hidden !important;
}

.modal-dialog.pk-ct-mapping-dialog .pk-ct-mapping-modal,
.modal-content.pk-ct-mapping-dialog .pk-ct-mapping-modal,
.modal-dialog:has(.pk-ct-mapping-modal) .pk-ct-mapping-modal {
  min-height: 100%;
  max-height: 100%;
}

.pk-ct-mapping-modal .shiny-input-container,
.pk-ct-mapping-modal .form-group {
  margin-bottom: 0 !important;
}

/* Compact Selection Bar with Actions */
.pk-ct-mapping-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 6px 16px;
  background: #f1f5f9;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
}

.pk-ct-mapping-modal__file,
.pk-ct-mapping-modal__sheet {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pk-ct-mapping-modal__actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.pk-ct-mapping-modal__label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pk-ct-mapping-modal__value {
  font-size: 0.72rem;
  font-weight: 500;
  color: #1e293b;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pk-ct-mapping-modal__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
  flex: 1;
}

/* 3-Column Grid Fix */
.pk-ct-mapping-required {
  background: #e2e8f0;
  padding: 4px 10px;
  border-radius: 4px 4px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-bottom: none;
}

.pk-ct-mapping-required__label {
  font-weight: 800;
  color: #1e293b;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.pk-ct-mapping-field-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  padding: 4px;
}

.pk-ct-mapping-field-grid--pk-required-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.pd-preprocess-mapping-field-grid--required-6,
.pd-preprocess-mapping-field-grid--pilot-required-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.pk-ct-mapping-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px 8px; /* Ultra-compressed row padding */
  border: none !important;
}

.pk-ct-mapping-item--span-all {
  grid-column: 1 / -1;
}

.pk-ct-mapping-item--span-2 {
  grid-column: span 2;
}

.pk-ct-mapping-field-grid .pk-ct-mapping-item.pk-ct-mapping-item--span-all,
.pk-ct-mapping-field-grid .pk-ct-mapping-item.pk-ct-mapping-item--span-all .shiny-input-container,
.pk-ct-mapping-field-grid .pk-ct-mapping-item.pk-ct-mapping-item--span-all .form-group,
.pk-ct-mapping-field-grid .pk-ct-mapping-item.pk-ct-mapping-item--span-all .selectize-control,
.pk-ct-mapping-field-grid .pk-ct-mapping-item.pk-ct-mapping-item--span-all .selectize-control.multi {
  width: 100% !important;
  max-width: 100% !important;
}

.pk-ct-mapping-field-grid .pk-ct-mapping-item.pk-ct-mapping-item--span-all .selectize-input,
.pk-ct-mapping-field-grid .pk-ct-mapping-item.pk-ct-mapping-item--span-all .selectize-input.items,
.pk-ct-mapping-field-grid .pk-ct-mapping-item.pk-ct-mapping-item--span-all .selectize-input.items-not-full,
.pk-ct-mapping-field-grid .pk-ct-mapping-item.pk-ct-mapping-item--span-all .selectize-input.has-items {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  min-height: 52px !important;
  padding: 8px 10px !important;
  align-content: flex-start !important;
}

.pk-ct-mapping-item .control-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Narrow & Compact Inputs - Remove White Cursor */
.pk-ct-mapping-item .selectize-control {
  width: 100% !important;
  max-width: 280px !important;
}

.pk-ct-mapping-field-grid .pk-ct-mapping-item.pk-ct-mapping-item--span-all .selectize-control {
  max-width: 100% !important;
}

.pk-ct-mapping-field-grid .pk-ct-mapping-item.pk-ct-mapping-item--span-2,
.pk-ct-mapping-field-grid .pk-ct-mapping-item.pk-ct-mapping-item--span-2 .shiny-input-container,
.pk-ct-mapping-field-grid .pk-ct-mapping-item.pk-ct-mapping-item--span-2 .form-group,
.pk-ct-mapping-field-grid .pk-ct-mapping-item.pk-ct-mapping-item--span-2 .selectize-control,
.pk-ct-mapping-field-grid .pk-ct-mapping-item.pk-ct-mapping-item--span-2 .selectize-control.multi {
  width: 100% !important;
  max-width: 100% !important;
}

.pk-ct-mapping-item .selectize-input {
  border-radius: 4px !important;
  min-height: 28px !important;
  height: auto !important;
  padding: 2px 8px !important;
  font-size: 0.78rem !important;
  background: #ffffff !important;
  box-shadow: none !important;
  border: 1px solid #cbd5e1 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 3px !important;
}

.pk-ct-mapping-item .selectize-control.multi .selectize-input > div {
  background: #f1f5f9 !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 3px !important;
  padding: 0 6px !important;
  font-size: 0.72rem !important;
  color: #334155 !important;
  margin: 0 !important;
  line-height: 1.6 !important;
}

.pk-ct-mapping-item .selectize-control.multi .selectize-input {
  align-items: flex-start !important;
  position: relative !important;
  padding-bottom: 2px !important;
}

.pk-ct-mapping-item .selectize-control.multi .selectize-input > input,
.pk-ct-mapping-item .selectize-control.multi .selectize-input.items-not-full > input,
.pk-ct-mapping-item .selectize-control.multi .selectize-input.has-items > input {
  position: absolute !important;
  left: -9999px !important;
  top: 0 !important;
  width: 1px !important;
  min-width: 1px !important;
  max-width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  line-height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
}


.pk-ct-mapping-item .selectize-input .item {
  line-height: 20px !important;
}

.pk-ct-mapping-item .selectize-input:after {
  right: 6px !important;
}

/* Preview Table Refinement */
.pk-ct-preview-block {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pk-ct-mapping-modal .pk-example-preview-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.pk-ct-mapping-modal .pk-example-preview-table {
  margin-bottom: 0;
}

.pk-ct-mapping-modal .pk-example-preview-table thead th {
  padding: 4px 10px !important;
  font-size: 0.72rem;
  background: #475569 !important;
}

.pk-ct-mapping-modal .pk-example-preview-table tbody td {
  padding: 3px 10px !important;
  font-size: 0.72rem;
}

.pk-ct-mapping-required__label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
}

.pk-ct-mapping-required__note {
  font-size: 0.8rem;
  color: #64748b;
}

.pk-example-preview-empty {
  padding: 16px 18px;
  border: 1px dashed #c0ccd6;
  border-radius: 10px;
  color: var(--sw-text-muted);
  background: #f7fafc;
}

.pk-control-inline-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--sw-text);
}

.pk-control-action-bar {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: auto;
  padding: 12px 10px 10px;
  border-top: 1px solid #d4dde5;
  background: #f8fafc; /* 使用实色背景遮盖轨道线 */
  backdrop-filter: blur(4px);
  box-shadow: 0 -6px 12px rgba(218, 225, 232, 0.72);
  display: flex;
  flex-direction: column;
  gap: 8px; /* 按钮之间增加间距 */
}

.pk-download-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid #d4dde5;
  position: relative;
}

.pk-download-panel__title {
  margin: 0;
  color: #334155;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

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

.pk-download-btn {
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: normal;
}

.pk-advanced-header {
  margin: 18px 0 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pk-advanced-header:not(:first-child) {
  border-top: 1px dashed #e2e8f0;
  padding-top: 18px;
  margin-top: 4px;
}

.pk-setting-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: flex-start !important; 
  gap: 16px;
  margin-bottom: 12px;
  min-height: 38px;
}

.pk-setting-row--wide-label {
  grid-template-columns: 110px 1fr !important;
}

.pk-setting-row--wide-label .pk-setting-label {
  white-space: nowrap;
}

.pk-desc-params-control .shiny-options-group {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 4px 8px !important;
  padding-top: 4px;
}

.pk-desc-params-control .checkbox {
  margin: 0 !important;
  padding: 0 !important;
}

.pk-desc-params-control .checkbox label {
  display: flex !important;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem !important;
  color: #334155 !important;
  margin-bottom: 0 !important;
  cursor: pointer;
  line-height: 1.1;
}

.pk-desc-params-control .checkbox input[type="checkbox"] {
  margin-top: 0 !important;
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.pk-setting-label {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 500;
  line-height: 1.2;
  display: flex;
  align-items: center;
  padding-top: 9px;
}

.pk-setting-control .form-group {
  margin-bottom: 0 !important;
}

.pk-setting-control .shiny-input-container {
  width: 100% !important;
  margin-bottom: 0 !important;
}

/* 统一复选框在行内的高度和位置 */
.pk-setting-row .checkbox {
  margin: 0 !important;
  min-height: auto;
}

.pk-setting-row .checkbox label {
  padding-left: 24px;
  font-size: 0.78rem !important;
  color: #1e293b;
  font-weight: 600;
}

.pk-setting-row .checkbox input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin-top: 2px;
}

.pk-setting-control input:not([type="checkbox"]):not([type="radio"]),
.pk-setting-control select {
  height: 34px !important;
  padding: 6px 10px !important;
  font-size: 0.8rem !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  background-color: #ffffff !important;
  transition: all 0.2s ease;
}

/* 修复复选框变形：明确指定尺寸并重置继承的高度 */
.pk-setting-row .checkbox input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  margin: 0 !important;
  cursor: pointer;
  appearance: auto; /* 恢复系统原生渲染或受控样式 */
  flex-shrink: 0;
}

.pk-setting-row .checkbox {
  display: flex;
  align-items: center;
  margin: 0 !important;
  min-height: 34px; /* 与普通输入框高度一致，保证对齐 */
}

.pk-setting-row .checkbox label {
  padding-left: 10px;
  margin-bottom: 0;
  display: flex !important;
  align-items: center;
  font-size: 0.78rem !important;
  color: #1e293b;
  font-weight: 600;
  cursor: pointer;
}

.pk-setting-control input:focus,
.pk-setting-control select:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
  outline: none !important;
}

.pk-setting-control .selectize-input {
  min-height: 34px !important;
  height: auto !important;
  padding: 4px 8px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 4px !important;
}

.pk-setting-control .selectize-input.focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.pk-setting-control .selectize-control.multi .selectize-input > div {
  background: #f1f5f9 !important;
  border-radius: 4px !important;
  border: 1px solid #e2e8f0 !important;
  padding: 1px 6px !important;
  font-size: 0.74rem !important;
  color: #475569 !important;
  margin: 0 !important;
  line-height: 1.4 !important;
}

.pk-setting-control .selectize-control.multi .selectize-input > div.active {
  background: #3b82f6 !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}

.pk-advanced-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 4px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #f1f5f9;
}

.pk-advanced-checkbox-group .checkbox {
  margin: 0 !important;
}

.pk-advanced-checkbox-group .checkbox label {
  font-size: 0.78rem !important;
  color: #334155;
  font-weight: 500;
  display: flex !important;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.4;
}

.pk-advanced-checkbox-group .checkbox input[type="checkbox"] {
  margin-top: 3px !important;
  width: 15px !important;
  height: 15px !important;
  flex-shrink: 0;
}

.pk-control-shell .accordion {
  --bs-accordion-border-radius: 4px;
  --bs-accordion-border-color: #cfd8e0;
}

.pk-control-shell .accordion-button {
  padding: 8px 10px;
  font-family: "Segoe UI", "Avenir Next", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--sw-text);
  background: linear-gradient(180deg, #eef3f6 0%, #e4ebf1 100%);
}

.pk-control-shell .accordion-button:not(.collapsed) {
  color: var(--sw-text);
  background: linear-gradient(180deg, #e7edf2 0%, #dfe7ee 100%);
  box-shadow: inset 0 -1px 0 rgba(143, 156, 168, 0.18);
}

.pk-control-shell .accordion-body {
  padding: 10px;
  background: #f9fbfc;
}

/* Workbench density tuning */
.bslib-sidebar-layout {
  column-gap: 0 !important;
  row-gap: 0 !important;
  align-items: stretch;
  padding: 0 !important;
}

.bslib-sidebar-layout > .sidebar,
.bslib-sidebar-layout > [class*="main"],
.bslib-sidebar-layout > .html-fill-container,
.bslib-sidebar-layout > .html-fill-item {
  margin-bottom: 0 !important;
  height: 100%;
}

.bslib-sidebar-layout .bslib-mb-spacing {
  margin-bottom: 8px !important;
}

.bslib-sidebar-layout > .sidebar,
.bslib-sidebar-layout .sidebar-panel,
.bslib-sidebar-layout .sidebar {
  padding: 0 !important;
}

.bslib-sidebar-layout .sidebar-content.bslib-gap-spacing,
.bslib-sidebar-layout .sidebar-content {
  height: 100%;
  gap: 8px !important;
  padding: 10px 12px 12px !important;
  background: linear-gradient(180deg, var(--sw-panel-strong) 0%, var(--sw-panel) 100%) !important;
  border-radius: var(--sw-radius) !important;
  border: 1px solid var(--sw-border) !important;
  margin: 0 !important;
  overflow: hidden;
}

.bslib-sidebar-layout .sidebar-title {
  margin: 0 0 4px 0 !important;
  padding: 0 !important;
  font-size: 0.82rem;
  line-height: 1.2;
}

.bslib-sidebar-layout .collapse-toggle {
  top: 8px;
  right: 8px;
}

.bslib-sidebar-layout .sidebar h2,
.bslib-sidebar-layout .sidebar h3,
.bslib-sidebar-layout .sidebar h4,
.bslib-sidebar-layout .sidebar h5,
.bslib-sidebar-layout .sidebar p {
  margin-bottom: 8px;
}

.bslib-sidebar-layout .sidebar hr {
  margin: 10px 0 !important;
}

.bslib-sidebar-layout .sidebar .shiny-input-container,
.bslib-sidebar-layout .sidebar .form-group,
.bslib-sidebar-layout .sidebar .radio,
.bslib-sidebar-layout .sidebar .checkbox,
.bslib-sidebar-layout .sidebar .selectize-control,
.bslib-sidebar-layout .sidebar .input-group,
.bslib-sidebar-layout .sidebar .form-control {
  margin-bottom: 8px !important;
}

.bslib-sidebar-layout .sidebar .control-label,
.bslib-sidebar-layout .sidebar .shiny-input-radiogroup > label,
.bslib-sidebar-layout .sidebar .shiny-input-checkboxgroup > label {
  margin-bottom: 4px !important;
  font-size: 0.84rem;
}

.bslib-sidebar-layout .sidebar .radio label,
.bslib-sidebar-layout .sidebar .checkbox label {
  line-height: 1.25;
}

.bslib-sidebar-layout .sidebar .btn,
.bslib-sidebar-layout .sidebar .dt-button {
  min-height: 36px !important;
  padding: 7px 10px !important;
}

.bslib-sidebar-layout .sidebar .btn-lg {
  min-height: 40px !important;
  padding: 8px 12px !important;
}

.bslib-sidebar-layout .sidebar .form-control,
.bslib-sidebar-layout .sidebar .selectize-input,
.bslib-sidebar-layout .sidebar .shiny-input-container input[type="text"],
.bslib-sidebar-layout .sidebar .shiny-input-container input[type="number"],
.bslib-sidebar-layout .sidebar .shiny-input-container select {
  min-height: 34px !important;
}

.bslib-sidebar-layout .sidebar .input-group-btn > .btn,
.bslib-sidebar-layout .sidebar .input-group-btn > .btn-file {
  min-height: 34px !important;
}

.bslib-sidebar-layout .sidebar .btn-block + .btn-block {
  margin-top: 6px;
}

.bslib-sidebar-layout > .main,
.bslib-sidebar-layout > [class*="main"],
.bslib-sidebar-layout > .html-fill-item:not(.sidebar),
.bslib-sidebar-layout > .html-fill-container:not(.sidebar) {
  padding-left: 0 !important;
  padding-top: 0 !important;
  padding-right: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-right: 0 !important;
  margin-bottom: 0 !important;
}

.bslib-sidebar-layout > .main .card,
.bslib-sidebar-layout > [class*="main"] .card,
.bslib-sidebar-layout > .html-fill-item:not(.sidebar) .card,
.bslib-sidebar-layout > .html-fill-container:not(.sidebar) .card {
  margin-bottom: 0 !important;
}

.bslib-sidebar-layout > .main > .card:first-child,
.bslib-sidebar-layout > [class*="main"] > .card:first-child,
.bslib-sidebar-layout > .html-fill-item:not(.sidebar) > .card:first-child,
.bslib-sidebar-layout > .html-fill-container:not(.sidebar) > .card:first-child {
  margin-top: 0 !important;
}

.pk-results-card {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.pk-results-card .card-body {
  padding: 0;
  flex: 1 1 auto !important;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.pk-results-card .nav-tabs {
  padding: 8px 12px 0;
  border-bottom: 1px solid #d6e0e8;
  background: linear-gradient(180deg, #f5f8fb 0%, #edf2f6 100%);
  border-top-left-radius: var(--sw-radius) !important;
  border-top-right-radius: var(--sw-radius) !important;
}

.pk-results-card .tab-content {
  padding: 12px;
  flex: 1 1 auto !important;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.pk-results-card .tab-pane.active {
  flex: 1 1 auto;
  min-height: 0;
}

.pk-results-card .dataTables_wrapper {
  height: 100%;
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}

.pk-results-card .dataTables_wrapper > table.dataTable {
  flex: 1 1 auto;
}



.pk-visual-results-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pk-visual-results-pane-shell--mean {
  flex: 0 0 auto !important;
  height: auto !important;
  min-height: 0 !important;
  padding-top: 4px;
}

.pk-visual-plot-box {
  display: flex;
  justify-content: center;
  margin-inline: auto;
}

.pk-visual-plot-box--mean {
  flex: 0 0 auto;
  height: auto;
  padding-top: 12px;
}

.pk-visual-plot-box--report {
  width: min(100%, 760px);
}

.pk-visual-plot-box--report-wide {
  width: min(100%, 770px);
}

.pk-visual-plot-box .shiny-plot-output,
.pk-visual-plot-box .shiny-plot-output-container {
  max-width: 100%;
}

.pk-visual-plot-box--mean > .shiny-spinner-output-container,
.pk-visual-plot-box--mean > .shiny-plot-output {
  flex: 0 0 auto;
  height: 420px;
  margin-inline: auto;
}



.pk-be-boundary-input-shell {
  padding: 8px 0 4px;
}

.pd-pivotal-judge-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pd-pivotal-judge-group {
  padding: 2px 0 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.pd-pivotal-judge-group + .pd-pivotal-judge-group {
  padding-top: 10px;
  border-top: 1px solid #e2e9ef;
}

.pd-pivotal-judge-card__head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
}

.pd-pivotal-judge-card__title {
  color: #1f3144;
  font-size: 0.79rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-transform: none;
}

.pd-pivotal-judge-inline-field {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
}

.pd-pivotal-judge-inline-field__prefix {
  min-width: 78px;
  padding: 0 2px;
  color: #42566b;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.pd-pivotal-judge-inline-field .shiny-input-container,
.pd-pivotal-judge-inline-field .form-group {
  margin-bottom: 0 !important;
  width: 100%;
}

.pd-pivotal-judge-inline-field .control-label {
  display: none !important;
}

.pd-pivotal-judge-inline-field .form-control {
  min-height: 40px;
  height: 40px;
  border-radius: 10px !important;
  border: 1px solid #d7e0e8 !important;
  background: #ffffff !important;
  box-shadow: none !important;
  font-size: 0.95rem !important;
  font-weight: 700;
  color: #1f2937 !important;
  transition: all 0.2s ease;
}

.pd-pivotal-judge-inline-field .form-control:hover {
  border-color: #c2d0dd !important;
  background: #fbfdff !important;
}

.pd-pivotal-judge-inline-field .form-control:focus {
  border-color: var(--sw-accent-strong) !important;
  box-shadow: 0 0 0 4px rgba(var(--sw-accent-rgb, 59, 130, 246), 0.12) !important;
}

.pd-pivotal-judge-group .pk-be-boundary-input-shell {
  padding: 2px 0 0;
}

.pd-pivotal-judge-group .pk-be-boundary-input-grid {
  gap: 10px;
}

.pd-pivotal-judge-group .pk-be-boundary-input-field__label {
  color: #64748b;
  font-size: 0.72rem;
}

.pd-pivotal-judge-group .pk-be-boundary-input-field__control .form-control {
  min-height: 40px;
  height: 40px;
  border-radius: 10px !important;
  border-color: #d7e0e8 !important;
  box-shadow: none !important;
}

.pd-pivotal-judge-group .pk-be-boundary-input-field__unit {
  right: 12px;
}

.pk-be-boundary-input-grid {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pk-be-boundary-input-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pk-be-boundary-input-field__label {
  font-size: 0.7rem;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-left: 2px;
}

.pk-be-boundary-input-field__control {
  position: relative;
  transition: transform 0.2s ease;
}

.pk-be-boundary-input-field__control:focus-within {
  transform: translateY(-1px);
}

.pk-be-boundary-input-field__control .shiny-input-container,
.pk-be-boundary-input-field__control .form-group {
  margin-bottom: 0 !important;
}

.pk-be-boundary-input-field__control .control-label {
  display: none !important;
}

.pk-be-boundary-input-field__control .form-control {
  min-height: 42px;
  height: 42px;
  padding: 0 35px 0 14px;
  border-radius: 10px !important;
  border: 1.5px solid #e2e8f0 !important;
  background: #ffffff !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02) !important;
  font-size: 0.95rem !important;
  font-weight: 700;
  color: #1e293b !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.pk-be-boundary-input-field__control .form-control:hover {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
}

.pk-be-boundary-input-field__control .form-control:focus {
  border-color: var(--sw-accent-strong) !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(var(--sw-accent-rgb, 59, 130, 246), 0.12) !important;
}

.pk-be-boundary-input-field__unit {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 800;
  pointer-events: none;
  transition: color 0.2s ease;
}

.pk-be-boundary-input-field__control:focus-within .pk-be-boundary-input-field__unit {
  color: var(--sw-accent-strong);
}

/* 新增：连接器样式 */
.pk-be-boundary-range-separator {
  margin-top: 18px;
  color: #cbd5e1;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
}

.pk-be-boundary-range-separator::before,
.pk-be-boundary-range-separator::after {
  content: "";
  height: 1.5px;
  width: 8px;
  background: #e2e8f0;
  margin: 0 4px;
}

@media (max-width: 991px) {
  .pk-be-boundary-input-grid {
    grid-template-columns: 1fr;
  }
}

.welcome-workbench {
  min-height: calc(100vh - 170px);
  padding: 0 !important;
}

.workbench-control-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: calc(100vh - 210px);
  border-radius: var(--sw-radius);
  background: transparent;
}

.workbench-control-panel__header {
  padding-bottom: 6px;
  border-bottom: 1px solid #d4dde5;
}

.workbench-control-panel__header h4 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--sw-text);
}

.workbench-control-panel__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.workbench-control-section {
  padding: 10px 10px 8px;
  border: 1px solid #d7dfe6;
  border-radius: 4px;
  background: linear-gradient(180deg, #fbfcfd 0%, #f4f7fa 100%);
}

.workbench-control-section h5 {
  margin: 0 0 6px 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--sw-text);
}

.workbench-control-section p,
.workbench-control-section li {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--sw-text-muted);
}

.workbench-main-card {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  border-bottom-left-radius: var(--sw-radius) !important;
  border-bottom-right-radius: var(--sw-radius) !important;
}

.workbench-main-card .card-body {
  padding: 0;
}

.workbench-main-card .nav-tabs {
  padding: 8px 12px 0;
  border-bottom: 1px solid #d6e0e8;
  background: linear-gradient(180deg, #f5f8fb 0%, #edf2f6 100%);
  border-top-left-radius: var(--sw-radius) !important;
  border-top-right-radius: var(--sw-radius) !important;
}

.workbench-main-card .tab-content {
  padding: 12px;
}

.workbench-tab-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.workbench-main-card .tab-content,
.workbench-main-card .tab-pane.active,
.workbench-main-card .tab-pane.show.active {
  height: 100%;
}

.workbench-tab-pane--about {
  height: 100%;
  min-height: 0;
}

.pk-analysis-main {
  gap: 8px;
  padding: 4px 2px;
}

.pk-analysis-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.pk-analysis-section + .pk-analysis-section {
  padding-top: 8px;
}

.pk-analysis-section > .workbench-tab-pane {
  gap: 4px;
}

.pk-analysis-section--be .dataTables_wrapper,
.pk-analysis-section--compare .dataTables_wrapper {
  width: 100%;
}

.pk-analysis-section--be table.dataTable,
.pk-analysis-section--compare table.dataTable {
  width: 100% !important;
  table-layout: fixed !important;
}

.pk-analysis-section--be table.dataTable th,
.pk-analysis-section--be table.dataTable td,
.pk-analysis-section--compare table.dataTable th,
.pk-analysis-section--compare table.dataTable td {
  white-space: normal !important;
  word-break: break-word;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.pk-analysis-section__title {
  color: #44576a;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.pk-report-preview-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.pk-report-preview-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 2px 4px 0;
  text-align: center;
}

.pk-report-preview-meta__title {
  color: #1f2c3a;
  font-family: var(--font-heading);
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.45;
}

.pk-report-preview-meta__note {
  color: #5d7288;
  font-size: 0.92rem;
  line-height: 1.45;
}

#pk_report_expand_factors .shiny-options-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-top: 8px;
}

#pk_report_expand_factors .checkbox {
  margin: 0;
}

#pk_report_expand_factors .checkbox label {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #d7e0ea;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfcfd 0%, #f4f7fa 100%);
  font-weight: 700;
  color: #31465b;
  transition: all 0.2s ease;
}

#pk_report_expand_factors .checkbox label:hover {
  border-color: #9db7d5;
  background: #f7fbff;
}

#pk_report_expand_factors input[type="checkbox"] {
  margin-top: 0;
}

[id$="pivotal_expand_factors"] .shiny-options-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-top: 8px;
}

[id$="pivotal_expand_factors"] .checkbox {
  margin: 0;
}

[id$="pivotal_expand_factors"] .checkbox label {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #d7e0ea;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfcfd 0%, #f4f7fa 100%);
  font-weight: 700;
  color: #31465b;
  transition: all 0.2s ease;
}

[id$="pivotal_expand_factors"] .checkbox label:hover {
  border-color: #9db7d5;
  background: #f7fbff;
}

[id$="pivotal_expand_factors"] input[type="checkbox"] {
  margin-top: 0;
}

.pk-report-expand-preview-shell .nav-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 4px;
  border-bottom: none;
  background: #edf4fb;
  border: 1px solid #d9e5f2;
  border-radius: 14px;
  margin-bottom: 10px;
}

.pk-report-expand-preview-shell .nav-tabs > li {
  float: none;
  margin-bottom: 0;
}

.pk-report-expand-preview-shell .nav-tabs > li > a {
  margin-right: 0;
  border: none !important;
  border-radius: 10px;
  color: #5f7387;
  font-weight: 700;
  padding: 10px 18px;
  background: transparent;
}

.pk-report-expand-preview-shell .nav-tabs > li.active > a,
.pk-report-expand-preview-shell .nav-tabs > li.active > a:focus,
.pk-report-expand-preview-shell .nav-tabs > li.active > a:hover {
  color: #17324d;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(27, 73, 124, 0.12);
}

.pk-report-col-head {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  line-height: 1.2;
}

.pk-report-col-head__label {
  font-weight: 700;
}

.pk-report-col-head__unit {
  color: #6c7f92;
  font-size: 0.86em;
  font-weight: 500;
}

.pk-report-preview-panel .dataTables_wrapper,
.pk-report-preview-panel .dataTables_scroll,
.pk-report-preview-panel .dataTables_scrollHead,
.pk-report-preview-panel .dataTables_scrollHeadInner,
.pk-report-preview-panel .dataTables_scrollBody {
  width: 100% !important;
}

.pk-report-preview-panel table.dataTable {
  min-width: 100% !important;
  width: 100% !important;
  table-layout: auto !important;
}

.pk-report-preview-panel--pkps table.dataTable {
  table-layout: fixed !important;
}

.pk-report-preview-panel--compact table.dataTable {
  table-layout: fixed !important;
}

.pk-report-preview-panel--pkps .dataTables_scrollBody {
  overflow-x: hidden !important;
}

.pk-report-preview-panel table.dataTable th,
.pk-report-preview-panel table.dataTable td {
  white-space: normal !important;
  word-break: break-word;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.pk-report-preview-panel--pkps table.dataTable th:first-child,
.pk-report-preview-panel--pkps table.dataTable td:first-child {
  width: 80px !important;
  min-width: 80px !important;
  max-width: 80px !important;
  text-align: center !important;
}

.pk-report-preview-panel--pkps table.dataTable th:nth-child(n+2):nth-child(-n+4),
.pk-report-preview-panel--pkps table.dataTable td:nth-child(n+2):nth-child(-n+4) {
  width: 35px !important;
  min-width: 35px !important;
  max-width: 35px !important;
}

.pk-report-preview-panel--compact table.dataTable th:first-child,
.pk-report-preview-panel--compact table.dataTable td:first-child,
.pk-report-preview-panel--compact table.dataTable th:nth-child(n+2):nth-child(-n+4),
.pk-report-preview-panel--compact table.dataTable td:nth-child(n+2):nth-child(-n+4) {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
}

.pk-report-preview-panel .dataTables_info {
  display: none !important;
}

.pk-results-card .dataTables_info {
  display: none !important;
}

.pk-results-card .dataTables_paginate {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-top: auto;
  padding: 4px 2px 0;
}

.pk-results-card .dataTables_paginate .paginate_button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 28px !important;
  height: 28px !important;
  min-width: 0 !important;
  margin: 0 4px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  border: none !important;
  background: transparent !important;
  color: #64748b !important;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: none !important;
  text-decoration: none !important;
  outline: none !important;
}

.pk-results-card .dataTables_paginate .paginate_button:hover:not(.disabled):not(.current) {
  background: #f1f5f9 !important;
  color: #1e293b !important;
}

.pk-results-card .dataTables_paginate .paginate_button.current,
.pk-results-card .dataTables_paginate .paginate_button.current:hover {
  background: #0ea5e9 !important;
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(14, 165, 233, 0.25) !important;
}

.pk-results-card .dataTables_paginate .paginate_button.disabled,
.pk-results-card .dataTables_paginate .paginate_button.disabled:hover {
  opacity: 0.35;
  cursor: not-allowed;
  background: transparent !important;
  color: #94a3b8 !important;
}

.pk-results-card .dataTables_paginate .previous,
.pk-results-card .dataTables_paginate .next {
  width: auto !important;
  min-width: 28px !important;
  font-size: 1.1rem !important;
  line-height: 1;
}

.pk-report-preview-panel .dataTables_paginate {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  padding: 4px 2px 0;
}

.pk-report-preview-panel .dataTables_paginate .paginate_button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 28px !important;
  height: 28px !important;
  min-width: 0 !important;
  margin: 0 4px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  border: none !important;
  background: transparent !important;
  color: #64748b !important;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: none !important;
  text-decoration: none !important;
  outline: none !important;
}

.pk-report-preview-panel .dataTables_paginate .paginate_button:hover:not(.disabled):not(.current) {
  background: #f1f5f9 !important;
  color: #1e293b !important;
}

.pk-report-preview-panel .dataTables_paginate .paginate_button.current,
.pk-report-preview-panel .dataTables_paginate .paginate_button.current:hover {
  background: #0ea5e9 !important;
  color: #fff !important;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(14, 165, 233, 0.25) !important;
}

.pk-report-preview-panel .dataTables_paginate .paginate_button.disabled,
.pk-report-preview-panel .dataTables_paginate .paginate_button.disabled:hover {
  opacity: 0.35;
  cursor: not-allowed;
  background: transparent !important;
  color: #94a3b8 !important;
}

.pk-report-preview-panel .dataTables_paginate .previous,
.pk-report-preview-panel .dataTables_paginate .next {
  width: auto !important;
  min-width: 28px !important;
  font-size: 1.1rem !important; /* 使‹ ›符号更显眼 */
  line-height: 1;
}

.workbench-empty-state {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 18px;
  background: linear-gradient(180deg, #fbfcfd 0%, #f4f7fa 100%);
  border: 1px dashed #ced8e1;
  border-radius: 4px;
}

.workbench-empty-state h3,
.workbench-empty-state h4 {
  margin: 0;
  color: var(--sw-text);
}

.workbench-empty-state p {
  margin: 0;
  color: var(--sw-text-muted);
}

.analysis-console-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bslib-sidebar-layout .bslib-grid,
.bslib-sidebar-layout .layout-columns {
  column-gap: 2px !important;
  row-gap: 2px !important;
}

.bslib-sidebar-layout .bslib-grid > *,
.bslib-sidebar-layout .layout-columns > * {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.analysis-status-panel {
  height: 100%;
  min-height: 100%;
  border-radius: var(--sw-radius) !important;
  border: 1px solid var(--sw-border) !important;
  box-shadow: var(--sw-shadow);
  overflow: hidden;
}

.analysis-status-panel .card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 8px 10px;
}

.analysis-status-panel .card-header {
  padding: 8px 8px 7px;
  border-bottom: 1px solid #cfd8e0;
  background: linear-gradient(180deg, #dfe6ec 0%, #d6dee5 100%);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}


.bslib-sidebar-layout .pk-workbench-sidebar .sidebar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 41px;
  margin: -10px -12px 10px !important;
  padding: 10px 14px !important;
  border-bottom: 1px solid #cfd8e0;
  border-top-left-radius: var(--sw-radius);
  border-top-right-radius: var(--sw-radius);
  background: linear-gradient(180deg, #dfe6ec 0%, #d6dee5 100%);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.5;
  text-transform: none;
  color: var(--sw-text);
}


.bslib-sidebar-layout:has(.pk-workbench-sidebar) > .collapse-toggle {
  display: none !important;
}

.bslib-sidebar-layout:has(.pk-workbench-sidebar) {
  height: calc(100vh - 132px) !important;
  min-height: calc(100vh - 132px) !important;
  max-height: calc(100vh - 132px) !important;
  overflow: hidden;
}

.bslib-sidebar-layout:has(.pk-workbench-sidebar) > .sidebar,
.bslib-sidebar-layout:has(.pk-workbench-sidebar) > .main,
.bslib-sidebar-layout:has(.pk-workbench-sidebar) > [class*="main"],
.bslib-sidebar-layout:has(.pk-workbench-sidebar) > .html-fill-container,
.bslib-sidebar-layout:has(.pk-workbench-sidebar) > .html-fill-item {
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
}

.bslib-sidebar-layout .sidebar-content {
  padding: 0 !important;
}

.bslib-sidebar-layout .sidebar-content:has(.pk-control-shell),
.bslib-sidebar-layout .sidebar-content:has(.pd-workbench-control-shell),
.bslib-sidebar-layout .sidebar-content:has(.ivpt-workbench-control-shell) {
  display: flex !important;
  flex-direction: column !important;
  height: auto !important;
  min-height: 100% !important;
  max-height: 100% !important;
  overflow-y: auto !important;
}

.pd-workbench-control-shell,
.ivpt-workbench-control-shell {
  min-height: 100%;
}

.bslib-sidebar-layout .sidebar-content:has(.pk-control-shell) .pk-control-shell,
.bslib-sidebar-layout .sidebar-content:has(.pd-workbench-control-shell) .pd-workbench-control-shell,
.bslib-sidebar-layout .sidebar-content:has(.ivpt-workbench-control-shell) .pk-control-shell,
.bslib-sidebar-layout .sidebar-content:has(.ivpt-workbench-control-shell) .ivpt-workbench-control-shell {
  flex: 1 1 auto;
  min-height: 100%;
}

.bslib-sidebar-layout .sidebar-content:has(.pd-preprocess-control-shell) {
  display: flex !important;
  flex-direction: column !important;
  height: auto !important;
  min-height: 100% !important;
  max-height: 100% !important;
  overflow-y: auto !important;
  padding-bottom: 12px !important;
}

.bslib-sidebar-layout .sidebar-content:has(.pd-preprocess-control-shell) .pd-preprocess-control-shell {
  flex: 1 1 auto;
  min-height: 100%;
}

.pd-workbench-control-shell,
.pd-preprocess-control-shell {
  gap: 12px;
  padding: 16px 0 0; /* 顶部留白，底部由 action-bar 处理 */
}

.pd-preprocess-control-shell .pk-control-section,
.pd-preprocess-control-shell .pk-control-source-actions,
.pd-preprocess-control-shell .pk-control-inline-group,
.pd-preprocess-control-shell .pk-control-advanced {
  width: 100%;
}

.pd-workbench-control-section > .pk-control-section-title-row {
  margin-bottom: 4px;
}

.pd-workbench-control-section > .pk-control-section-title-row .pk-control-step {
  min-width: 24px;
  min-height: 24px;
  margin-bottom: 0;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0;
  text-transform: none;
}

.pd-workbench-control-section > .pk-control-section-title-row .pk-control-section-title {
  margin-bottom: 0;
}

.pd-preprocess-trial-tabs .shiny-input-radiogroup,
.pk-data-type-tabs .shiny-input-radiogroup {
  margin-bottom: 0 !important;
}

.pd-preprocess-trial-tabs .shiny-options-group,
.pk-data-type-tabs .shiny-options-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.pd-preprocess-trial-tabs .radio-inline,
.pk-data-type-tabs .radio-inline {
  margin: 0 !important;
  padding: 11px 15px !important;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 54px;
  border: 1px solid #d2dde7;
  border-radius: 13px;
  background: linear-gradient(180deg, #fbfdff 0%, #f3f7fb 100%);
  color: #233243;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
}

.pd-preprocess-trial-tabs .radio-inline + .radio-inline,
.pk-data-type-tabs .radio-inline + .radio-inline {
  margin-left: 0 !important;
}

.pd-preprocess-trial-tabs .radio-inline span,
.pk-data-type-tabs .radio-inline span {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.pd-preprocess-trial-tabs .radio-inline span::after,
.pk-data-type-tabs .radio-inline span::after {
  content: "";
  order: -1;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: inset 0 0 0 2px #b3c2d1;
  transition: all 0.18s ease;
}

.pd-preprocess-trial-tabs .radio-inline:hover,
.pk-data-type-tabs .radio-inline:hover {
  color: #152334;
  border-color: #b7cddd;
  background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
  box-shadow: 0 8px 18px rgba(128, 149, 169, 0.1);
}

.pd-preprocess-trial-tabs .radio-inline:has(input:checked),
.pk-data-type-tabs .radio-inline:has(input:checked) {
  border-color: #2890d8;
  background: linear-gradient(180deg, #ffffff 0%, #f3f9fe 100%);
  box-shadow: 0 12px 24px rgba(40, 144, 216, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.94);
  color: var(--sw-text);
}

.pd-preprocess-trial-tabs .radio-inline:has(input:checked) span::after,
.pk-data-type-tabs .radio-inline:has(input:checked) span::after {
  background: #ffffff;
  box-shadow: inset 0 0 0 7px #1480cf, 0 0 0 2px rgba(20, 128, 207, 0.14);
}

.pd-preprocess-trial-tabs .radio-inline:has(input:checked)::before,
.pk-data-type-tabs .radio-inline:has(input:checked)::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 13px;
  box-shadow: inset 0 0 0 1px rgba(20, 128, 207, 0.15);
  pointer-events: none;
}

.pd-preprocess-trial-tabs input[type="radio"],
.pk-data-type-tabs input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pd-preprocess-advanced-panel .accordion {
  --bs-accordion-border-radius: 10px;
  --bs-accordion-border-color: #d8e2ea;
}

.pd-preprocess-advanced-panel .accordion-item {
  border: 1px solid #d8e2ea;
  border-radius: 10px;
  background: linear-gradient(180deg, #fafcfd 0%, #f5f8fb 100%);
  box-shadow: none;
}

.pd-preprocess-advanced-panel .accordion-button {
  padding: 8px 11px;
  background: transparent;
  color: #465565;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: none;
}

.pd-preprocess-advanced-panel .accordion-button:not(.collapsed) {
  background: transparent;
  color: var(--sw-text);
}

.pd-preprocess-advanced-panel .accordion-body {
  padding: 4px 10px 6px;
  background: transparent;
  border-top: 1px solid #e2e9ef;
}

.pd-preprocess-advanced-fields {
  gap: 0;
}

.pd-preprocess-filter-summary {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #d9e2ea;
  border-radius: 7px;
  background: linear-gradient(180deg, #fdfefe 0%, #f5f8fb 100%);
  color: #647487;
  font-size: 0.77rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pd-preprocess-filter-summary > span {
  display: inline-flex;
  align-items: center;
}

.pd-preprocess-filter-summary:empty,
.pd-preprocess-filter-summary:has(> span:empty) {
  display: none;
}

.pd-preprocess-filter-notice {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #fff8ea;
  border: 1px solid #f2dfb0;
  color: #8c6413;
  font-size: 0.76rem;
  line-height: 1.35;
}

.pd-preprocess-advanced-fields .form-group {
  margin-bottom: 0 !important;
}

.pd-preprocess-advanced-fields .form-group + .form-group {
  margin-top: 4px !important;
}

.pd-preprocess-advanced-fields .control-label {
  margin-bottom: 1px !important;
  font-size: 0.66rem !important;
  font-weight: 700;
  color: #6a7a89;
}

.pd-preprocess-advanced-fields .selectize-control,
.pd-preprocess-advanced-fields .selectize-input,
.pd-preprocess-advanced-fields .form-control {
  box-shadow: none !important;
}

.pd-preprocess-advanced-fields .selectize-input,
.pd-preprocess-advanced-fields .form-control {
  min-height: 34px !important;
  height: auto !important;
  border-color: #cbd5e1 !important;
  background: #ffffff !important;
}

.pd-preprocess-advanced-fields .selectize-control {
  margin-bottom: 0 !important;
}

.pd-preprocess-advanced-fields .selectize-input {
  padding: 3px 7px !important;
  border-radius: 7px !important;
}


.pd-preprocess-advanced-fields .selectize-input.items-not-full > input,
.pd-preprocess-advanced-fields .selectize-input.has-items > input {
  width: 1px !important;
}

.pd-preprocess-sheet-slot {
  gap: 6px !important;
}

.pd-preprocess-sheet-slot > .shiny-html-output {
  width: 100%;
}

.pd-preprocess-sheet-slot .form-group {
  margin-bottom: 0 !important;
}

.pd-preprocess-sheet-slot .control-label {
  margin-bottom: 4px !important;
  font-size: 0.72rem !important;
  font-weight: 700;
  color: #6a7a89;
}

.pd-preprocess-sheet-note {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px dashed #cfdae4;
  border-radius: 8px;
  background: #f7fafc;
  color: #718194;
  font-size: 0.74rem;
  line-height: 1.35;
}

.pd-preprocess-sheet-note--warning {
  border-color: #e9cf94;
  background: #fff9eb;
  color: #8c6413;
}

.pd-preprocess-control-shell .pk-control-source-actions .form-group,
.pd-preprocess-control-shell .pk-control-source-actions .shiny-input-container {
  margin-bottom: 0 !important;
}

.pd-preprocess-control-shell .pk-control-source-actions .shiny-file-input-progress {
  margin-top: 6px;
  margin-bottom: 0;
}

.pd-preprocess-control-shell .pk-control-source-actions .input-group {
  margin-bottom: 0;
}

.bslib-sidebar-layout .pd-workbench-sidebar + .sidebar-content,
.bslib-sidebar-layout .sidebar.pd-workbench-sidebar .sidebar-content,
.bslib-sidebar-layout .sidebar:has(.pd-workbench-control-shell) .sidebar-content,
.bslib-sidebar-layout .sidebar-content:has(.pd-workbench-control-shell) {
  gap: 10px !important;
  padding-bottom: 0 !important;
}

.pd-workbench-control-shell .pk-control-action-bar {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: auto;
  padding: 8px 0 0;
  border-top: 1px solid #d4dde5;
  background: linear-gradient(180deg, rgba(244, 247, 250, 0.82) 0%, rgba(239, 243, 246, 0.98) 100%);
  backdrop-filter: blur(4px);
  box-shadow: 0 -6px 12px rgba(218, 225, 232, 0.72);
}

.pd-preprocess-action-bar {
  gap: 8px;
}

.pd-preprocess-import-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pd-preprocess-import-grid--single {
  grid-template-columns: minmax(0, 1fr);
}

.pd-workbench-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-x: hidden; /* 禁止横向滚动 */
}

/* 修正 Bootstrap fluidRow 负 margin 在 pd-workbench-pane 内造成的横向溢出 */
.pd-workbench-pane > .row,
.pd-workbench-pane .row {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.pd-preprocess-plot-shell {
  position: relative;
  padding: 22px 18px 16px;
  border: 1px solid #c8d1d9;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 0 1px rgba(0, 0, 0, 0.06);
  transition: box-shadow 0.3s ease;
}

.pd-preprocess-plot-shell:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07), 0 0 1px rgba(0, 0, 0, 0.08);
}

.pd-preprocess-export-panel {
  display: grid;
  gap: 12px;
}

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

.pd-preprocess-export-grid .btn {
  min-height: 40px;
  border-radius: 10px;
  font-weight: 600;
}

.pd-preprocess-plot-shell::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  pointer-events: none;
  border-radius: 8px 8px 0 0;
}

.pd-preprocess-plot-shell--individual {
  background: #ffffff;
  border-color: #c0cad3;
}

.pd-preprocess-plot-shell--individual::before {
  background: linear-gradient(90deg, #2B6A99, #3D9EA3);
}

.pd-preprocess-plot-shell--mean {
  background: #ffffff;
  border-color: #c0cad3;
}

.pd-preprocess-plot-shell--mean::before {
  background: linear-gradient(90deg, #3D9EA3, #3D8B6E);
}

.pd-preprocess-plot-shell > .shiny-plot-output,
.pd-preprocess-plot-shell > .shiny-spinner-output-container {
  position: relative;
  z-index: 1;
}

.pd-preprocess-plot-shell .shiny-plot-output {
  border-radius: 4px;
}

.bslib-sidebar-layout:has(.pk-workbench-sidebar) .workbench-main-card,
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .workbench-main-card .card-body,
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .workbench-main-card .tab-content,
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .workbench-main-card .tab-pane.active,
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .workbench-main-card .workbench-tab-pane,
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .workbench-main-card .pd-workbench-pane {
  height: 100%;
  min-height: 0;
}

.bslib-sidebar-layout:has(.pk-workbench-sidebar) .workbench-main-card .tab-content,
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .workbench-main-card .workbench-tab-pane,
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .workbench-main-card .pd-workbench-pane {
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}

@media (max-width: 991px) {
  .pd-preprocess-plot-shell {
    padding: 8px;
    border-radius: 10px;
  }
}

.bslib-sidebar-layout:has(.pk-workbench-sidebar) .pk-results-card .tab-pane {
  overflow: hidden;
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 0;
}

.bslib-sidebar-layout:has(.pk-workbench-sidebar) .card-body,
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .tab-content {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  height: 100% !important;
}

.bslib-sidebar-layout:has(.pk-workbench-sidebar) {
  height: calc(100vh - 100px) !important;
  min-height: 0 !important;
  max-height: calc(100vh - 100px) !important;
  width: 100% !important;
  max-width: none !important;
  align-items: stretch !important;
  margin-bottom: 0 !important;
  gap: 0 !important;
  --bslib-sidebar-gutter: 0 !important;
  --bslib-grid-gap: 0 !important;
}

.bslib-sidebar-layout:has(.pk-workbench-sidebar) > .sidebar {
  height: 100% !important;
}

.bslib-sidebar-layout:has(.pk-workbench-sidebar) > .main {
  height: 100% !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

/* 展示区占比 10 (针对子列) */
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .main .bslib-column-layout > div:has(.workbench-main-card),
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .main .bslib-grid > div:has(.workbench-main-card) {
  flex: 10 !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-width: 0;
}

.bslib-sidebar-layout:has(.pk-workbench-sidebar) .main .bslib-column-layout > div:has(.pk-results-card),
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .main .bslib-grid > div:has(.pk-results-card) {
  flex: 10 !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  align-self: stretch !important;
  min-width: 0;
}

/* 状态栏占比 2 (针对子列) */
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .main .bslib-column-layout > div:has(.analysis-status-rail),
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .main .bslib-grid > div:has(.analysis-status-rail),
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .main .bslib-column-layout > div:has([id*="status_panel"]),
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .main .bslib-grid > div:has([id*="status_panel"]) {
  flex: 2 !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-width: 0;
}

.bslib-sidebar-layout:has(.pk-workbench-sidebar) .main > .row,
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .main > .bslib-column-layout,
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .main > .bslib-grid {
  flex: 1 !important;
  display: flex !important;
  align-items: stretch !important;
  margin: 0 !important;
  height: 100% !important;
  width: 100% !important;
  gap: 0 !important;
  --bslib-grid-gap: 0 !important;
}

/* 确保所有容器内的卡片都没有底部间距并且撑满 */
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .main .card {
  height: 100% !important;
  margin-bottom: 0 !important;
  flex: 1 !important;
}

/* 确保 uiOutput 内部也撑满 */
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .main .bslib-column-layout > div,
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .main .bslib-grid > div,
.system-workbench-wrapper .bslib-column-layout > div {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  flex: 1 !important;
}

.ai-workbench-grid > div {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 0 !important;
}

.analysis-status-slot:has(> .shiny-html-output:empty) {
  display: none !important;
}

.bslib-sidebar-layout:has(.pk-workbench-sidebar) .main .bslib-column-layout > div:has(.analysis-status-slot > .shiny-html-output:empty),
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .main .bslib-grid > div:has(.analysis-status-slot > .shiny-html-output:empty),
.system-workbench-wrapper .bslib-column-layout > div:has(.analysis-status-slot > .shiny-html-output:empty),
.ai-workbench-grid > div:has(.analysis-status-slot > .shiny-html-output:empty) {
  display: none !important;
  flex: 0 0 0 !important;
  width: 0 !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* 系统页面专项高度修正（少一层页签） */
.system-workbench-wrapper .bslib-sidebar-layout:has(.pk-workbench-sidebar) {
  height: calc(100vh - 58px) !important;
  max-height: calc(100vh - 58px) !important;
  gap: 0 !important;
  --bslib-sidebar-gutter: 0 !important;
  --bslib-grid-gap: 0 !important;
}

.ai-workbench-wrapper .bslib-sidebar-layout {
  height: calc(100vh - 58px) !important;
  max-height: calc(100vh - 58px) !important;
  gap: 0 !important;
  --bslib-sidebar-gutter: 0 !important;
  --bslib-grid-gap: 0 !important;
}

/* 确保系统状态面板层级也撑满 */
.system-workbench-wrapper div:has(> .analysis-status-slot) {
  flex: 2 !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
}

.ai-workbench-grid > div:has(> .analysis-status-slot) {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 0 !important;
}

.bslib-sidebar-layout:has(.pk-workbench-sidebar) .analysis-status-rail {
  position: static;
  top: auto;
  height: 100% !important;
  min-height: 0;
  max-height: 100%;
  max-width: none !important;
  margin: 0 !important;
  flex: 1 1 0% !important;
}

.bslib-sidebar-layout:has(.pk-workbench-sidebar) .analysis-status-panel {
  height: 100% !important;
  min-height: 0;
  max-height: 100%;
}

.bslib-sidebar-layout:has(.pk-workbench-sidebar) .analysis-status-panel .card-body {
  min-height: 0;
  overflow: auto;
}

.bslib-sidebar-layout:has(.pk-workbench-sidebar) .workbench-main-card {
  height: 100% !important;
  margin-bottom: 0 !important;
  flex: 1 !important;
}

.bslib-sidebar-layout:has(.pk-workbench-sidebar) > .sidebar,
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .workbench-main-card,
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .analysis-status-panel {
  border-bottom-left-radius: var(--sw-radius) !important;
  border-bottom-right-radius: var(--sw-radius) !important;
}

.welcome-workbench {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.welcome-workbench > .bslib-sidebar-layout {
  flex: 1 1 auto;
}

.pd-workbench-note,
.ivpt-workbench-note {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--sw-text-muted);
}



.ivpt-workbench-note {
  font-size: 0.74rem;
  line-height: 1.42;
  color: #66788a;
}

.ivpt-desktop-upload-shell .shiny-input-container,
.ivpt-desktop-upload-shell .form-group {
  margin-bottom: 0 !important;
}

.ivpt-desktop-upload-shell .control-label {
  margin-bottom: 4px !important;
  font-size: 0.72rem !important;
  font-weight: 700;
  color: #596b7e;
}

.ivpt-desktop-upload-shell .input-group {
  display: flex;
  align-items: stretch;
}

.ivpt-desktop-upload-shell .btn-default,
.ivpt-desktop-upload-shell .input-group-btn > .btn {
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 4px 0 0 4px;
  border: 1px solid #b8c7d5;
  background: linear-gradient(180deg, #ffffff 0%, #edf3f8 100%);
  color: #223140;
  font-size: 0.79rem;
  font-weight: 700;
  box-shadow: none;
}

.ivpt-desktop-upload-shell .form-control {
  min-height: 34px;
  border-radius: 0 4px 4px 0;
  border: 1px solid #c6d3de;
  background: #ffffff;
  color: #2f4256;
  font-size: 0.8rem;
  box-shadow: inset 0 1px 1px rgba(19, 36, 55, 0.03);
}

.ivpt-desktop-upload-shell .shiny-file-input-progress {
  margin-top: 6px;
  margin-bottom: 0;
}

.ivpt-desktop-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding-top: 2px;
}

.ivpt-desktop-meta__tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eaf0f6;
  color: #5e7083;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.ivpt-desktop-meta__text {
  color: #6b7b8d;
  font-size: 0.72rem;
  line-height: 1.35;
}

.ivpt-desktop-mapping-shell {
  padding: 8px 9px;
  border: 1px solid #d4dde6;
  border-radius: 5px;
  background: linear-gradient(180deg, #f9fbfc 0%, #f4f7fa 100%);
}

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

.ivpt-desktop-mapping-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ivpt-desktop-mapping-field--wide {
  grid-column: 1 / -1;
}

.ivpt-desktop-mapping-field__label,
.ivpt-desktop-property__label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: #5b6e81;
  letter-spacing: 0.02em;
}

.ivpt-desktop-mapping-grid .shiny-input-container,
.ivpt-desktop-mapping-grid .form-group,
.ivpt-desktop-property .shiny-input-container,
.ivpt-desktop-property .form-group {
  margin-bottom: 0 !important;
}

.ivpt-desktop-mapping-grid .control-label,
.ivpt-desktop-property .control-label {
  display: none !important;
}

.ivpt-desktop-mapping-grid .form-control,
.ivpt-desktop-mapping-grid .selectize-control.single .selectize-input,
.ivpt-desktop-property .form-control,
.ivpt-desktop-property .selectize-control.single .selectize-input {
  min-height: 33px !important;
  height: 33px !important;
  border-radius: 4px !important;
  border-color: #bfccd8 !important;
  background: #ffffff !important;
  box-shadow: inset 0 1px 1px rgba(19, 36, 55, 0.03) !important;
  font-size: 0.8rem !important;
}


.ivpt-desktop-mapping-grid .selectize-control,
.ivpt-desktop-property .selectize-control {
  margin-bottom: 0 !important;
}

.ivpt-desktop-mode-shell .shiny-input-radiogroup {
  margin-bottom: 0 !important;
}

.ivpt-desktop-mode-shell .control-label {
  margin-bottom: 4px !important;
  font-size: 0.7rem !important;
  font-weight: 700;
  color: #5b6e81;
}

.ivpt-desktop-mode-shell .shiny-options-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.ivpt-desktop-mode-shell .radio-inline {
  margin: 0 !important;
  padding: 8px 10px !important;
  min-height: 34px;
  border: 1px solid #c7d3de;
  border-radius: 5px;
  background: linear-gradient(180deg, #ffffff 0%, #edf3f8 100%);
  color: #2a3d50;
  font-size: 0.77rem;
  font-weight: 700;
  text-align: center;
  justify-content: center;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.ivpt-desktop-mode-shell .radio-inline + .radio-inline {
  margin-left: 0 !important;
}

.ivpt-desktop-mode-shell .radio-inline:has(input:checked) {
  border-color: #2a84c8;
  background: linear-gradient(180deg, #fefefe 0%, #e9f3fb 100%);
  color: #16334f;
  box-shadow: inset 0 0 0 1px rgba(42, 132, 200, 0.12);
}

.ivpt-desktop-mode-shell input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

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

.ivpt-desktop-property {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ivpt-desktop-actionbar {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin-top: auto;
  padding: 8px 0 0;
  border-top: 1px solid #d2dbe4;
  background: linear-gradient(180deg, rgba(244, 247, 250, 0.82) 0%, rgba(239, 243, 246, 0.98) 100%);
  backdrop-filter: blur(4px);
}

.ivpt-desktop-actionbar .btn {
  min-height: 37px;
  border-radius: 5px;
  border-color: #1e2329;
  background: linear-gradient(180deg, #23272c 0%, #171a1e 100%);
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.ivpt-desktop-actionbar .btn:hover,
.ivpt-desktop-actionbar .btn:focus {
  background: linear-gradient(180deg, #282d33 0%, #1b1f24 100%);
  color: #ffffff;
}

@media (max-width: 991px) {
  .ivpt-desktop-mapping-grid,
  .ivpt-desktop-property-grid,
  .ivpt-desktop-mode-shell .shiny-options-group {
    grid-template-columns: 1fr;
  }
}

.pd-model-build-main-pane {
  display: grid;
  gap: 14px;
}

.pd-model-build-param-shell,
.pd-model-build-formula-shell {
  border: 1px solid #d6dee5;
  border-radius: 6px;
  background: linear-gradient(180deg, #fcfdfe 0%, #f7fafc 100%);
  box-shadow: 0 1px 2px rgba(32, 51, 70, 0.04);
}

.pd-model-build-param-shell__header,
.pd-model-build-formula-shell__header {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid #dbe3ea;
  background: linear-gradient(180deg, #edf3f8 0%, #e4ebf2 100%);
}

.pd-model-build-param-shell__title,
.pd-model-build-formula-shell__title {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #243748;
}

.pd-model-build-param-shell__meta,
.pd-model-build-formula-shell__meta {
  display: none;
}

.pd-model-build-param-shell {
  overflow: visible;
}

.pd-model-build-formula-shell--inline {
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.pd-model-build-formula-shell--inline .pd-model-build-formula-shell__body {
  padding: 12px 14px 8px;
}

.pd-model-build-param-shell .pd-param-table {
  margin-bottom: 0;
  border: 0;
  overflow: visible;
}

.pd-model-build-param-shell .pd-param-table thead th {
  background: #f7fafc;
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  color: #53687a;
}

.pd-model-build-param-shell .pd-param-table th:nth-child(1),
.pd-model-build-param-shell .pd-param-table td:nth-child(1) {
  width: 116px;
  min-width: 116px;
  max-width: 116px;
}

.pd-model-build-param-shell .pd-param-table th:nth-child(2),
.pd-model-build-param-shell .pd-param-table td:nth-child(2) {
  width: 180px;
}

.pd-model-build-param-shell .pd-param-table th:nth-child(3),
.pd-model-build-param-shell .pd-param-table td:nth-child(3) {
  width: 170px;
}

.pd-model-build-param-shell .pd-param-table th:nth-child(4),
.pd-model-build-param-shell .pd-param-table td:nth-child(4) {
  width: 124px;
}

.pd-model-build-param-shell .pd-param-table tbody td {
  padding-top: 10px;
  padding-bottom: 10px;
  background: #ffffff;
  overflow: visible;
  position: relative;
  z-index: 1;
}

.pd-model-build-param-shell .pd-model-build-param-row td:first-child {
  position: relative;
  padding-left: 18px;
  font-weight: 800;
  color: #203243;
}

.pd-model-build-param-shell .pd-model-build-param-row td:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 4px;
  border-radius: 999px;
  background: #d7e1ea;
}

.pd-model-build-param-shell .pd-model-build-param-row--baseline td:first-child::before {
  background: #9fb4c7;
}

.pd-model-build-param-shell .pd-model-build-param-row--effect td:first-child::before {
  background: #4e89c7;
}

.pd-model-build-param-shell .pd-model-build-param-row--potency td:first-child::before {
  background: #6ea57e;
}

.pd-model-build-param-shell .pd-model-build-param-row--shape td:first-child::before {
  background: #8f79b8;
}

.pd-model-build-param-shell .pd-param-table .form-control,
.pd-model-build-param-shell .pd-param-table .selectize-input {
  min-height: 32px !important;
  height: 32px !important;
  border-radius: 4px !important;
  border-color: #cad5df !important;
  font-size: 0.75rem !important;
}

.pd-model-build-param-shell .pd-param-table .selectize-input {
  padding: 4px 26px 4px 8px !important;
}

.pd-model-build-param-shell .pd-param-table td:nth-child(2) .form-group,
.pd-model-build-param-shell .pd-param-table td:nth-child(2) .shiny-input-container,
.pd-model-build-param-shell .pd-param-table td:nth-child(3) .form-group,
.pd-model-build-param-shell .pd-param-table td:nth-child(3) .shiny-input-container,
.pd-model-build-param-shell .pd-param-table td:nth-child(4) .form-group,
.pd-model-build-param-shell .pd-param-table td:nth-child(4) .shiny-input-container {
  width: 100%;
  max-width: 220px;
}

.pd-model-build-param-shell .pd-param-table td:nth-child(4) .form-group,
.pd-model-build-param-shell .pd-param-table td:nth-child(4) .shiny-input-container {
  max-width: 150px;
}

.pd-model-build-param-shell .pd-param-table td:nth-child(3) .form-control,
.pd-model-build-param-shell .pd-param-table td:nth-child(3) .selectize-input,
.pd-model-build-param-shell .pd-param-table td:nth-child(4) .form-control,
.pd-model-build-param-shell .pd-param-table td:nth-child(4) .selectize-input {
  background: linear-gradient(180deg, #fbfdff 0%, #f2f6fa 100%) !important;
  border-color: #dbe3ea !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92) !important;
}

.pd-model-build-param-shell .pd-param-table td:nth-child(3) select.form-control,
.pd-model-build-param-shell .pd-param-table td:nth-child(3) .form-control {
  text-align: center;
  text-align-last: center;
}

.pd-model-build-param-shell .pd-param-table .bootstrap-select {
  width: 100% !important;
}

.pd-model-build-param-shell .pd-param-table .bootstrap-select > .dropdown-toggle {
  min-height: 32px !important;
  height: 32px !important;
  font-size: 0.75rem !important;
  font-weight: 400 !important;
  border-radius: 4px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 28px 4px 10px !important;
  background: linear-gradient(180deg, #fbfdff 0%, #f2f6fa 100%) !important;
  border-color: #dbe3ea !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92) !important;
}

.pd-model-build-param-shell .pd-param-table .bootstrap-select > .dropdown-toggle .filter-option,
.pd-model-build-param-shell .pd-param-table .bootstrap-select > .dropdown-toggle .filter-option-inner,
.pd-model-build-param-shell .pd-param-table .bootstrap-select > .dropdown-toggle .filter-option-inner-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  font-weight: 400 !important;
}

.pd-model-build-param-shell .pd-param-table .bootstrap-select .dropdown-menu {
  z-index: 10000 !important;
}

.pd-model-build-param-shell .pd-param-table .bootstrap-select .dropdown-menu .dropdown-item,
.pd-model-build-param-shell .pd-param-table .bootstrap-select .dropdown-menu .text,
.pd-model-build-param-shell .pd-param-table .bootstrap-select .dropdown-menu .inner li a {
  font-weight: 400 !important;
  text-align: center !important;
}

.pd-model-build-param-shell .pd-param-table .bootstrap-select .dropdown-menu .dropdown-item .text,
.pd-model-build-param-shell .pd-param-table .bootstrap-select .dropdown-menu .inner li a .text {
  display: block;
  width: 100%;
  text-align: center !important;
}

.pd-model-build-param-shell .pd-param-table td:nth-child(3) .selectize-input,
.pd-model-build-param-shell .pd-param-table td:nth-child(4) .selectize-input {
  border-style: solid !important;
}

.pd-model-build-param-shell .pd-param-table td:nth-child(3) .selectize-input.focus,
.pd-model-build-param-shell .pd-param-table td:nth-child(3) .form-control:focus,
.pd-model-build-param-shell .pd-param-table td:nth-child(4) .selectize-input.focus,
.pd-model-build-param-shell .pd-param-table td:nth-child(4) .form-control:focus {
  border-color: #a8bac9 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.96), 0 0 0 1px rgba(137, 159, 177, 0.18) !important;
}

.pd-model-build-param-shell .pd-param-table td:nth-child(3) .selectize-control.single .selectize-input::after {
  border-top-color: #73879a !important;
  right: 10px !important;
}


.pd-model-build-param-shell .pd-param-table td:nth-child(4) input[type="number"] {
  font-weight: 600;
  color: #33485b;
}

.pd-model-build-param-shell .pd-param-table code,
.pd-model-build-formula-shell code {
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef3f7;
  color: #304558;
  font-size: 0.72rem;
}

.pd-model-build-param-note {
  padding: 8px 14px 10px;
  border-top: 1px dashed #d8e1e8;
  color: #6a7c8d;
  font-size: 0.72rem;
}

.pd-model-build-formula-shell__body {
  padding: 12px 14px;
}

.pd-model-formula-preview {
  display: grid;
  gap: 10px;
}

.pd-model-formula-preview__topline {
  display: block;
}

.pd-model-formula-preview__type {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: #edf3f8;
  color: #2b4458;
  font-size: 0.7rem;
  font-weight: 700;
}

.pd-model-formula-preview__equation {
  padding: 8px 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #203243;
  overflow-x: auto;
}

.pd-model-formula-preview__equation p {
  margin: 0;
}

.pd-model-formula-preview__note {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.5;
  color: #66798a;
}





.pd-model-build-shell .workbench-title-icon,
.pd-model-build-shell .pk-control-title-icon {
  width: 30px;
  height: 30px;
  min-height: 30px !important;
  padding: 0 !important;
  border-radius: 4px;
  border-color: #c5d1db !important;
  background: linear-gradient(180deg, #fdfefe 0%, #edf2f6 100%) !important;
  color: #42576a !important;
  box-shadow: none !important;
}

.pd-model-build-shell .form-group,
.pd-model-build-shell .shiny-input-container,
.pd-model-build-shell .selectize-control,
.pd-model-build-shell .input-group {
  margin-bottom: 5px !important;
}

.pd-model-build-shell .control-label {
  margin-bottom: 3px !important;
  font-size: 0.72rem !important;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #56697b;
}

.pd-model-build-shell .form-control,
.pd-model-build-shell .selectize-input,
.pd-model-build-shell .shiny-input-container input[type="text"],
.pd-model-build-shell .shiny-input-container input[type="number"],
.pd-model-build-shell .shiny-input-container select {
  min-height: 34px !important;
  height: 34px !important;
  border-radius: 3px !important;
  border-color: #c9d4dd !important;
  background: #ffffff !important;
  box-shadow: none !important;
  font-size: 0.78rem;
  line-height: 1.2 !important;
}

.pd-model-build-shell .form-control:focus,
.pd-model-build-shell .selectize-input.focus,
.pd-model-build-shell .selectize-input:focus,
.pd-model-build-shell .shiny-input-container input:focus,
.pd-model-build-shell .shiny-input-container select:focus {
  border-color: #7fa2bd !important;
  box-shadow: 0 0 0 2px rgba(82, 120, 150, 0.12) !important;
}

.pd-model-build-shell .selectize-input {
  width: 100% !important;
  min-width: 100% !important;
  padding: 4px 30px 4px 9px !important;
}

.pd-model-build-shell .input-group-btn > .btn,
.pd-model-build-shell .input-group-btn > .btn-file {
  min-height: 34px !important;
  height: 34px !important;
  border-radius: 3px !important;
  padding: 5px 10px !important;
  background: linear-gradient(180deg, #fefefe 0%, #eef3f7 100%) !important;
  border-color: #bac8d4 !important;
  color: #33475a !important;
  font-weight: 700;
  box-shadow: none !important;
}

.pd-model-build-shell .input-group .form-control[readonly] {
  background: #ffffff !important;
  color: #556677 !important;
}

.pd-model-build-shell .shiny-file-input-progress {
  margin-top: 4px;
  margin-bottom: 2px;
}

.pd-model-build-shell .row.pd-model-build-compact-grid {
  --bs-gutter-x: 10px;
  --bs-gutter-y: 0;
  margin-top: 0;
}

.pd-model-build-shell .row.pd-model-build-compact-grid > [class*="col-"] {
  padding-top: 0;
  padding-bottom: 0;
}

.pd-model-build-property-table {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pd-model-build-property-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 34px;
}

.pd-model-build-property-row__label {
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #56697b;
}

.pd-model-build-property-row__control {
  min-width: 0;
}

.pd-model-build-property-row__control > .form-group,
.pd-model-build-property-row__control > .shiny-input-container {
  margin-bottom: 0 !important;
}

.pd-model-build-property-row__control .control-label {
  display: none !important;
}

.pd-model-build-property-subgroup {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px 0 0 0;
  border-top: 1px dashed #d7dfe6;
}

.pd-model-build-shell .pd-model-build-section--source [id$="model_upload_container"],
.pd-model-build-shell .pd-model-build-section--source [id$="explore_upload_container"],
.pd-model-build-shell .pd-model-build-section--source [id$="col_mapping_ui"] {
  margin-top: 2px;
}

.pd-model-build-source-banner {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 4px 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #cfd8e0;
  border-radius: 3px;
  background: linear-gradient(180deg, #fefefe 0%, #f5f8fb 100%);
  margin-bottom: 4px;
}

.pd-model-build-source-banner__label,
.pd-model-build-source-banner__meta-label {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6a7b8b;
}

.pd-model-build-source-banner__value {
  font-size: 0.9rem;
  font-weight: 800;
  color: #223446;
}

.pd-model-build-source-banner__meta {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 4px 10px;
}

.pd-model-build-source-banner__meta-value {
  font-size: 0.76rem;
  color: #415365;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pd-model-build-source-banner__hint {
  grid-column: 1 / -1;
  font-size: 0.7rem;
  line-height: 1.35;
  color: #6f8090;
}

.pd-model-build-source-banner--imported {
  background: linear-gradient(180deg, #f8fbfe 0%, #edf4f9 100%);
  border-color: #c5d7e5;
}

.pd-model-build-shell .pd-model-build-section--assist .btn-info {
  min-height: 34px !important;
  border-radius: 3px !important;
  background: linear-gradient(180deg, #1e1e1e 0%, #151515 100%) !important;
  border-color: #1f1f1f !important;
  color: #ffffff !important;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: none !important;
}

.pd-model-build-shell .pd-model-build-section--assist .btn-info:hover {
  background: linear-gradient(180deg, #2a2a2a 0%, #1b1b1b 100%) !important;
}

.pd-model-build-mapping-modal .pk-ct-mapping-modal__body {
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
}

.pd-model-build-mapping-preview .dataTables_wrapper {
  margin-top: 6px;
}

.pd-model-build-mapping-preview table.dataTable thead th {
  font-size: 0.72rem;
  white-space: nowrap;
}

.pd-model-build-mapping-preview table.dataTable tbody td {
  font-size: 0.74rem;
  white-space: nowrap;
}

.pd-model-build-shell .pd-model-build-section--structure .shiny-panel-conditional > .form-group:first-child,
.pd-model-build-shell .pd-model-build-section--structure .shiny-panel-conditional > .shiny-input-container:first-child {
  margin-top: 0 !important;
}





.pd-model-build-shell .input-group {
  display: flex;
  align-items: stretch;
}

.pd-model-build-shell .input-group .form-control {
  min-height: 34px !important;
  height: 34px !important;
  padding: 4px 10px !important;
  font-size: 0.76rem !important;
  line-height: 1.2 !important;
}

.pd-model-build-shell .selectize-control {
  width: 100% !important;
}

.pd-model-build-param-shell .selectize-control,
.pd-model-build-param-shell .shiny-input-container,
.pd-model-build-param-shell .form-group {
  overflow: visible !important;
}

.pd-model-build-shell .selectize-control.single .selectize-input,
.pd-model-build-shell .selectize-control.multi .selectize-input {
  display: flex;
  align-items: center;
  width: 100% !important;
  min-width: 100% !important;
  min-height: 34px !important;
  height: 34px !important;
  padding: 4px 30px 4px 9px !important;
  font-size: 0.76rem !important;
  line-height: 1.2 !important;
  border-radius: 3px !important;
  box-sizing: border-box !important;
}

.pd-model-build-shell .selectize-control.single .selectize-input .item,
.pd-model-build-shell .selectize-control.multi .selectize-input .item {
  font-size: 0.76rem !important;
  line-height: 1.2 !important;
  color: #243547;
}


.pd-model-build-shell .selectize-control.single .selectize-input::after {
  right: 9px !important;
  margin-top: -2px !important;
  border-width: 6px 6px 0 6px !important;
  border-top-color: #475a6d !important;
}

.pd-model-build-shell .selectize-dropdown,
.pd-model-build-shell .selectize-dropdown.form-control {
  border-radius: 3px !important;
  border-color: #c9d4dd !important;
  box-shadow: 0 6px 18px rgba(86, 109, 131, 0.12) !important;
}

.pd-model-build-param-shell .selectize-dropdown,
.pd-model-build-param-shell .selectize-dropdown.form-control {
  z-index: 3500 !important;
}

.pd-model-build-shell .selectize-dropdown .option,
.pd-model-build-shell .selectize-dropdown .item {
  font-size: 0.75rem !important;
  line-height: 1.25 !important;
}

.pd-model-build-shell .pd-model-build-clear-btn {
  min-height: 31px !important;
  border-radius: 3px !important;
  padding: 4px 8px !important;
  font-size: 0.72rem;
  font-weight: 700;
  box-shadow: none !important;
}

.pd-model-build-shell .pd-model-build-action-bar {
  padding-top: 6px;
  border-top: 1px solid #d3dce4;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.84) 0%, rgba(240, 244, 247, 0.98) 100%);
  box-shadow: none;
}

.pd-model-build-shell .pd-model-build-action-bar .btn-primary {
  min-height: 36px !important;
  border-radius: 3px !important;
  background: linear-gradient(180deg, #181818 0%, #101010 100%) !important;
  border-color: #111111 !important;
  color: #ffffff !important;
  font-weight: 800;
  letter-spacing: 0.03em;
  box-shadow: none !important;
}

.pd-model-build-shell .pd-model-build-action-bar .btn-primary:hover {
  background: linear-gradient(180deg, #252525 0%, #151515 100%) !important;
}

.pd-workbench-subcard {
  border-radius: var(--sw-radius) !important;
  border: 1px solid var(--sw-border) !important;
  box-shadow: var(--sw-shadow);
}

.pd-workbench-subcard > .card-body {
  padding: 12px !important;
}

.pd-workbench-tab-card > .card-body {
  padding: 0 !important;
}

.pd-workbench-tab-card .nav-tabs {
  padding: 8px 12px 0;
  border-bottom: 1px solid #d6e0e8;
  background: linear-gradient(180deg, #f5f8fb 0%, #edf2f6 100%);
  border-top-left-radius: var(--sw-radius) !important;
  border-top-right-radius: var(--sw-radius) !important;
}

.pd-workbench-tab-card .tab-content {
  padding: 12px;
}

.pd-workbench-tab-card .tab-pane.active,
.pd-workbench-tab-card .tab-pane.show.active {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pd-model-results-shell .tab-pane.active,
.pd-model-results-shell .tab-pane.show.active {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pd-model-results-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pd-model-results-content {
  min-height: 88px;
}

.pd-bootstrap-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 0;
  flex-wrap: wrap;
}

.pd-bootstrap-toolbar__label {
  color: #495057;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1;
}

.pd-bootstrap-toolbar__input {
  width: 110px;
}

.pd-bootstrap-toolbar__input input.form-control {
  min-height: 42px;
}

.pd-bootstrap-actionbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pd-bootstrap-actionbar .btn {
  min-width: 132px;
  min-height: 42px;
}

.pd-model-results-panel .shiny-output-error-validation {
  display: flex;
  align-items: center;
  min-height: 88px;
  padding: 10px 4px 4px;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #6c757d;
  font-size: 18px;
  font-weight: 500;
  box-shadow: none;
}

.pd-model-results-panel .dataTables_wrapper,
.pd-model-results-content .dataTables_wrapper {
  margin: 0;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.pd-model-plots-shell {
  width: 100%;
}

.pd-model-plots-shell > .bslib-sidebar-layout {
  --_sidebar-width: 340px;
}

.pd-model-plots-sidebar {
  border-right: 1px solid #d8e1e8;
}

.pd-model-plots-controls {
  gap: 14px;
}

.pd-model-plots-type-tabs .shiny-input-radiogroup {
  margin-bottom: 0 !important;
}

.pd-model-plots-type-tabs .shiny-options-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.pd-model-plots-type-tabs .radio {
  margin: 0 !important;
}

.pd-model-plots-type-tabs .radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pd-model-plots-type-tabs .radio label {
  margin: 0 !important;
  padding: 11px 15px !important;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 48px;
  border: 1px solid #d2dde7;
  border-radius: 11px;
  background: linear-gradient(180deg, #fbfdff 0%, #f3f7fb 100%);
  color: #233243;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
}

.pd-model-plots-type-tabs .radio span {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.pd-model-plots-type-tabs .radio span::after {
  content: "";
  order: -1;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: inset 0 0 0 2px #b3c2d1;
  transition: all 0.18s ease;
}

.pd-model-plots-type-tabs .radio label:hover {
  color: #152334;
  border-color: #b7cddd;
  background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
  box-shadow: 0 8px 18px rgba(128, 149, 169, 0.1);
}

.pd-model-plots-type-tabs .radio:has(input:checked) label {
  border-color: #2890d8;
  background: linear-gradient(180deg, #ffffff 0%, #f3f9fe 100%);
  box-shadow: 0 12px 24px rgba(40, 144, 216, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.94);
  color: var(--sw-text);
}

.pd-model-plots-type-tabs .radio:has(input:checked) span::after {
  background: #ffffff;
  box-shadow: inset 0 0 0 7px #1480cf, 0 0 0 2px rgba(20, 128, 207, 0.14);
}

.pd-model-plots-type-tabs .radio:has(input:checked) label::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 11px;
  box-shadow: inset 0 0 0 1px rgba(20, 128, 207, 0.15);
  pointer-events: none;
}

.pd-model-plots-section .selectize-control,
.pd-model-plots-section .form-group {
  margin-bottom: 0 !important;
}

.pd-model-plots-action-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pd-model-plots-action-stack .btn,
.pd-model-plots-action-stack .shiny-download-link {
  min-height: 36px !important;
}

.pd-model-plots-action-stack .shiny-download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pd-model-plots-shell {
  padding: 12px 14px 14px;
}

.bslib-sidebar-layout:has(.pk-workbench-sidebar) .workbench-tab-pane:has(.pd-model-plots-shell),
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .pd-model-plots-shell:has(.pd-plot-gof) {
  overflow-y: hidden !important;
}

.pd-model-plot-box {
  position: relative;
  width: min(84%, 880px);
  margin: 0 auto;
}

.pd-model-plot-box > .shiny-spinner-output-container,
.pd-model-plot-box > .shiny-plot-output {
  position: absolute !important;
  inset: 0;
  width: 100%;
  height: 100%;
}

.pd-model-plots-pane {
  min-height: 0;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 100%;
  width: 100%;
}

.bslib-sidebar-layout:has(.pk-workbench-sidebar) .pd-model-plots-shell .pd-model-plot-box--preview {
  width: 680px;
}

.bslib-sidebar-layout:has(.pk-workbench-sidebar) .pd-model-plots-shell .pd-model-plot-box--review {
  width: 680px;
}

.bslib-sidebar-layout:has(.pk-workbench-sidebar) .pd-model-plots-shell .pd-plot-frame--gof {
  width: 840px;
}

.bslib-sidebar-layout:has(.pk-workbench-sidebar) .pd-model-plots-shell .pd-plot-frame--vpc {
  width: 760px;
}

.bslib-sidebar-layout:has(.pk-workbench-sidebar) .pd-model-plots-shell .pd-model-plot-box--auec-compare,
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .pd-model-plots-shell .pd-plot-frame--auec-compare {
  width: 820px;
}

.bslib-sidebar-layout:has(.pk-workbench-sidebar) .pd-model-plots-shell .pd-plot-frame--individual-fit {
  width: 900px;
  height: 720px;
}

.bslib-sidebar-layout:has(.pk-workbench-sidebar) .pd-model-plots-shell .pd-plot-frame--auec-compare {
  margin-top: 10px;
}

.bslib-sidebar-layout:has(.pk-workbench-sidebar) .pd-model-plots-shell .pd-plot-4-3,
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .pd-model-plots-shell .pd-plot-gof,
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .pd-model-plots-shell .pd-plot-vpc,
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .pd-model-plots-shell .pd-plot-auec-compare,
.bslib-sidebar-layout:has(.pk-workbench-sidebar) .pd-model-plots-shell .pd-plot-individual-fit {
  max-height: none;
}

.pd-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid #d8e1e8;
  border-radius: 4px;
  background: linear-gradient(180deg, #fbfcfd 0%, #f4f7fa 100%);
}

.pd-toolbar--compact {
  padding: 8px 10px;
}

.pd-toolbar--end {
  justify-content: flex-end;
}

.pd-toolbar .btn,
.pd-toolbar .dt-button {
  min-height: 36px !important;
}

.pd-toolbar .form-group {
  margin-bottom: 0 !important;
}

.pd-table-shell {
  border: 1px solid #d7dfe6;
  border-radius: 4px;
  background: linear-gradient(180deg, #fcfdfe 0%, #f6f9fb 100%);
  overflow: visible;
}

.pd-table-shell__body {
  padding: 10px 12px 12px;
}

.pd-table-shell .dataTables_wrapper {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.pd-table-shell table.dataTable thead th,
.pd-table-shell table.dataTable thead td,
.pd-param-table thead th,
.pd-explore-table thead th {
  background: linear-gradient(180deg, #eff4f8 0%, #e4ebf1 100%) !important;
  color: #4c5d6d !important;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid #d6e0e8 !important;
}

.pd-table-shell table.dataTable tbody td,
.pd-param-table tbody td,
.pd-explore-table tbody td {
  background: #ffffff;
  border-bottom: 1px solid #ebf0f4 !important;
}

.pd-table-shell .dt-buttons {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.pd-table-shell .dt-buttons .dt-button,
div[id="tbl_fixed_dt"] .dt-buttons .dt-button,
div[id="tbl_bootstrap_dt"] .dt-buttons .dt-button {
  min-height: 28px;
  min-width: 72px;
  padding: 3px 8px !important;
  border-radius: 3px !important;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  background: linear-gradient(180deg, #fbfcfd 0%, #f1f5f8 100%) !important;
  color: #4f5f6f !important;
  border: 1px solid #cfd8e0 !important;
  box-shadow: none !important;
}

.pd-table-shell .dt-buttons .dt-button:hover,
div[id="tbl_fixed_dt"] .dt-buttons .dt-button:hover,
div[id="tbl_bootstrap_dt"] .dt-buttons .dt-button:hover {
  background: linear-gradient(180deg, #f4f8fb 0%, #e8eef4 100%) !important;
  color: #3f5060 !important;
}

.pd-pivotal-summary-grid {
  gap: 10px;
  margin-bottom: 0;
}

.pd-pivotal-analysis-layout {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.pd-pivotal-report-section {
  gap: 12px;
  padding: 2px 2px 0;
}

.pd-pivotal-report-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pd-pivotal-report-panel__title {
  color: #1f3144;
  font-family: var(--font-heading);
  font-size: 1.06rem;
  font-weight: 900;
  line-height: 1.45;
  letter-spacing: 0.01em;
  text-align: center;
  width: 100%;
}

.pd-pivotal-analysis-layout .pk-analysis-section + .pk-analysis-section {
  padding-top: 4px;
}

.pd-pivotal-analysis-layout .dataTables_wrapper {
  width: 100% !important;
}

.pd-pivotal-analysis-layout table.dataTable {
  width: 100% !important;
  table-layout: fixed !important;
}

.pd-pivotal-analysis-layout .dataTables_wrapper .dataTables_scrollHead table.dataTable thead th,
.pd-pivotal-analysis-layout .dataTables_wrapper .dataTables_scrollHead table.dataTable thead td,
.pd-pivotal-analysis-layout .dataTables_wrapper table.dataTable thead th,
.pd-pivotal-analysis-layout .dataTables_wrapper table.dataTable thead td,
.pd-pivotal-analysis-layout .dataTables_wrapper table.dataTable thead th.sorting,
.pd-pivotal-analysis-layout .dataTables_wrapper table.dataTable thead th.sorting_asc,
.pd-pivotal-analysis-layout .dataTables_wrapper table.dataTable thead th.sorting_desc,
.pd-pivotal-analysis-layout .dataTables_wrapper table.dataTable thead th.sorting_disabled {
  text-align: left !important;
  vertical-align: middle !important;
}

.pd-pivotal-analysis-layout .dataTables_wrapper table.dataTable thead th *,
.pd-pivotal-analysis-layout .dataTables_wrapper table.dataTable thead td * {
  text-align: left !important;
}

.pd-pivotal-analysis-layout table.dataTable th,
.pd-pivotal-analysis-layout table.dataTable td {
  text-align: left !important;
  white-space: normal !important;
  word-break: break-word;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.pd-pivotal-analysis-layout .dataTables_scroll,
.pd-pivotal-analysis-layout .dataTables_scrollHead,
.pd-pivotal-analysis-layout .dataTables_scrollBody {
  width: 100% !important;
}

.pd-pivotal-summary-card {
  position: relative;
  min-height: 124px;
  padding: 14px 16px;
  border-radius: 4px !important;
  background: linear-gradient(180deg, #fbfcfd 0%, #f4f7fa 100%) !important;
  border: 1px solid #d7dfe6 !important;
  box-shadow: none !important;
}

.pd-pivotal-summary-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: #9aa8b5;
}

.pd-pivotal-summary-card.is-pass::before {
  background: #5aa36b;
}

.pd-pivotal-summary-card.is-fail::before {
  background: #c87272;
}

.pd-pivotal-summary-card.is-pending::before {
  background: #9aa8b5;
}

.pd-pivotal-summary-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7b8a;
}

.pd-pivotal-summary-value {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--sw-text);
}

.pd-pivotal-summary-hint {
  font-size: 0.8rem;
  color: var(--sw-text-muted);
}

.pd-plot-frame {
  border: 1px solid #d7dfe6;
  border-radius: 4px;
  background: linear-gradient(180deg, #fcfdfe 0%, #f6f9fb 100%);
  box-shadow: none;
}

@media (max-width: 991px) {
  .bslib-sidebar-layout:has(.pk-workbench-sidebar) .pd-model-plots-shell .pd-model-plot-box--review {
    width: min(84%, 880px);
  }

  .bslib-sidebar-layout:has(.pk-workbench-sidebar) .pd-model-plots-shell .pd-model-plot-box--auec-compare,
  .bslib-sidebar-layout:has(.pk-workbench-sidebar) .pd-model-plots-shell .pd-plot-frame--auec-compare {
    width: min(88%, 980px);
  }

  .pd-explore-selector-grid,
  .pd-explore-compact-grid--2,
  .pd-explore-compact-grid--3 {
    grid-template-columns: 1fr;
  }

  .pd-explore-param-band,
  .pd-grid-search-body,
  .pd-grid-search-card .pd-explore-param-block--grid-values .pd-explore-compact-grid,
  .pd-grid-search-card .pd-explore-param-block--iiv .pd-explore-compact-grid {
    grid-template-columns: 1fr;
  }

  .pd-grid-search-summary {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .pd-explore-panel-head,
  .pd-explore-results-head {
    flex-direction: column;
    align-items: stretch;
  }

  .pd-explore-runbar {
    align-items: stretch;
  }
}

.analysis-status-section {
  padding: 7px 0 0;
  border: none;
  border-top: 1px solid #d8e1e8;
  border-radius: 0;
  background: transparent;
}

.analysis-status-section:first-child {
  border-top: none;
  padding-top: 0;
}

.analysis-status-section h5 {
  margin: 0 0 6px 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #738395;
}

.analysis-status-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 0;
  border-top: 1px dashed #e1e7ec;
}

.analysis-status-item:first-of-type {
  border-top: none;
  padding-top: 0;
}

.analysis-status-label {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #667788;
}

.analysis-status-chip {
  display: inline-flex;
  align-self: flex-start;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #e2e8ee;
  color: #607181;
  border: 1px solid #cbd5de;
}

.analysis-status-value {
  font-size: 0.78rem;
  line-height: 1.32;
  color: var(--sw-text);
}

.analysis-status-chip.is-ready,
.analysis-status-item.is-ready .analysis-status-value {
  color: #1f6b43;
}

.analysis-status-chip.is-ready {
  background: #e7f4eb;
  border-color: #bfdcc9;
}

.analysis-status-chip.is-warn,
.analysis-status-item.is-warn .analysis-status-value {
  color: #9a5a00;
}

.analysis-status-chip.is-warn {
  background: #fff3de;
  border-color: #ecd2a8;
}

.analysis-status-chip.is-running,
.analysis-status-item.is-running .analysis-status-value {
  color: #005f9e;
}

.analysis-status-chip.is-running {
  background: #e3f0fb;
  border-color: #bfd6ed;
}

.analysis-status-chip.is-error,
.analysis-status-item.is-error .analysis-status-value {
  color: #a02d2d;
}

.analysis-status-chip.is-error {
  background: #f8e6e6;
  border-color: #e0bcbc;
}

.analysis-status-chip.is-pending {
  background: #eef1f4;
  border-color: #d2dae2;
  color: #6d7c8a;
}

.analysis-status-rail {
  position: sticky;
  top: 0;
  max-width: 220px;
  margin-left: -2px;
}

.bslib-sidebar-layout > .main > .card:last-child,
.bslib-sidebar-layout > [class*="main"] > .card:last-child,
.bslib-sidebar-layout > .html-fill-item:not(.sidebar) > .card:last-child,
.bslib-sidebar-layout > .html-fill-container:not(.sidebar) > .card:last-child {
  margin-bottom: 0 !important;
}

/* DataTables Pagination Beautification */
.dataTables_wrapper .dataTables_paginate {
  margin-top: 15px !important;
  display: flex !important;
  justify-content: flex-end;
  gap: 4px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  min-width: 32px;
  height: 32px;
  padding: 0 8px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 6px !important;
  border: 1px solid #e2e8f0 !important;
  background: white !important;
  color: #64748b !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  transition: all 0.2s !important;
  margin: 0 !important;
  cursor: pointer;
  text-decoration: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
  text-decoration: none !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
  color: white !important;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.25) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  color: #94a3b8 !important;
}

.dataTables_wrapper .dataTables_info {
  padding-top: 15px !important;
  font-size: 0.82rem !important;
  color: #64748b !important;
}

/* --- Modern Popups & Notifications Stylings --- */

/* 1. Shiny Notifications (Enhanced Aesthetics) */
#shiny-notification-container {
  bottom: 20px;
  right: 20px;
  width: 380px;
}

.shiny-notification {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.5) !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08) !important;
  padding: 18px 20px !important;
  margin-bottom: 12px !important;
  color: #1e293b !important;
  font-weight: 500 !important;
  animation: notificationEnter 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
  position: relative;
  overflow: hidden;
}

@keyframes notificationEnter {
  from { opacity: 0; transform: translateX(30px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

.shiny-notification::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: #cbd5e1;
}

/* Notification Types */
.shiny-notification-message {
  border-left: 5px solid #3b82f6 !important;
}
.shiny-notification-message::before { background: #3b82f6; }

.shiny-notification-warning {
  border-left: 5px solid #f59e0b !important;
  background: rgba(255, 251, 235, 0.9) !important;
}
.shiny-notification-warning::before { background: #f59e0b; }

.shiny-notification-error {
  border-left: 5px solid #ef4444 !important;
  background: rgba(254, 242, 242, 0.9) !important;
}
.shiny-notification-error::before { background: #ef4444; }

.shiny-notification .shiny-notification-close {
  top: 15px !important;
  right: 15px !important;
  color: #94a3b8 !important;
  font-size: 18px !important;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.shiny-notification .shiny-notification-close:hover {
  opacity: 1;
}

/* 2. Modal Dialogs (Professional Refinement) */
.modal-content {
  border: none !important;
  border-radius: 20px !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15) !important;
  overflow: hidden;
  background: #ffffff !important;
}

.modal-header {
  padding: 24px 30px !important;
  background: #ffffff !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

.modal-title {
  width: 100% !important;
  font-size: 1.25rem !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  letter-spacing: -0.01em;
  margin-bottom: 0 !important;
  display: block !important;
}

.modal-header-container {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100% !important;
  padding-right: 10px !important;
}

.modal-header-actions {
  display: flex !important;
  gap: 12px !important;
  align-items: center !important;
  margin-left: auto !important;
}

.modal-header-actions .btn {
  padding: 6px 16px !important;
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  border-radius: 8px !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.modal-body {
  padding: 30px !important;
  background: #ffffff !important;
  font-size: 0.95rem !important;
  line-height: 1.6 !important;
  color: #334155 !important;
}

.modal-footer {
  padding: 20px 30px !important;
  background: #f8fafc !important;
  border-top: 1px solid #f1f5f9 !important;
  display: flex !important;
  gap: 12px;
}

/* Modal Action Buttons */
.modal-footer .btn {
  padding: 10px 24px !important;
  border-radius: 10px !important;
  font-weight: 700 !important;
  font-size: 0.9rem !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.modal-footer .btn-primary {
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.2) !important;
}

.modal-footer .btn-primary:hover {
  background: #2563eb !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 15px rgba(59, 130, 246, 0.3) !important;
}

.modal-footer .btn-default {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  color: #64748b !important;
}

.modal-footer .btn-default:hover {
  background: #f8fafc !important;
  color: #1e293b !important;
  border-color: #cbd5e1 !important;
}

/* 隐藏默认的 Bootstrap 关闭 'X'，统一使用我们的功能键 */
.modal-header .close {
  display: none !important;
}

/* Premium Backdrop effect */
.modal-backdrop.in {
  opacity: 0.4 !important;
  background-color: #0f172a !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
}

.report-workbench-shell {
  --report-bg: linear-gradient(165deg, #f0ece4 0%, #e8e2d6 35%, #f2efe8 70%, #ebe6dc 100%);
  --report-panel: rgba(255, 253, 248, 0.82);
  --report-panel-strong: rgba(255, 255, 255, 0.94);
  --report-border: rgba(20, 42, 52, 0.1);
  --report-rule: rgba(20, 42, 52, 0.07);
  --report-ink: #1a2730;
  --report-muted: #546872;
  --report-soft-ink: #7a8d96;
  --report-accent: #0b6b5e;
  --report-accent-deep: #0f3d42;
  --report-accent-soft: rgba(11, 107, 94, 0.09);
  --report-warm-soft: rgba(188, 160, 100, 0.12);
  --report-accent-glow: rgba(11, 107, 94, 0.16);
  --report-success: #2d7a4f;
  --report-warning: #b8852a;
  --report-error: #b5403a;
  --report-shadow: 0 28px 64px rgba(15, 25, 32, 0.12), 0 8px 20px rgba(15, 25, 32, 0.06);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--report-border);
  border-radius: 28px;
  background: linear-gradient(165deg, #f0ece4 0%, #e8e2d6 35%, #f2efe8 70%, #ebe6dc 100%);
  box-shadow: var(--report-shadow);
  padding: 24px;
  display: grid;
  gap: 16px;
  animation: report-shell-enter 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes report-shell-enter {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.report-workbench-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(rgba(23, 36, 45, 0.045) 0.5px, transparent 0.5px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.28) 0%, transparent 40%),
    radial-gradient(ellipse at 80% 20%, rgba(188, 160, 100, 0.06) 0%, transparent 50%);
  background-size: 10px 10px, auto, auto;
  opacity: 0.25;
}

.report-workbench-section,
.report-workbench-meta-panel,
.report-ct-import-card,
.report-workbench-actions,
.report-workbench-analysis-panel {
  position: relative;
  z-index: 1;
}
.report-workbench-panel-kicker {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--report-accent);
  margin-bottom: 8px;
}

.report-workbench-panel-head p,
.report-ct-import-card__head p {
  margin: 0;
  color: var(--report-muted);
  line-height: 1.6;
  max-width: 62ch;
}

.report-workbench-section {
  display: grid;
  gap: 12px;
  animation: report-section-enter 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.report-workbench-section:nth-child(2) { animation-delay: 0.08s; }
.report-workbench-section:nth-child(3) { animation-delay: 0.16s; }
.report-workbench-section:nth-child(4) { animation-delay: 0.24s; }

@keyframes report-section-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.report-workbench-section__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.report-workbench-section__index {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(15, 61, 66, 0.12), rgba(11, 107, 94, 0.08));
  color: var(--report-accent-deep);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.06em;
  flex-shrink: 0;
  border: 1px solid rgba(11, 107, 94, 0.1);
  box-shadow: 0 2px 8px rgba(11, 107, 94, 0.06);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
}

.report-workbench-section:hover .report-workbench-section__index {
  transform: scale(1.06);
  box-shadow: 0 4px 14px rgba(11, 107, 94, 0.12);
}

.report-workbench-section__copy h3 {
  margin: 2px 0 2px;
  color: var(--report-ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: 24px;
  letter-spacing: -0.01em;
}

.report-workbench-section__copy p {
  margin: 0;
  color: var(--report-muted);
  line-height: 1.45;
  font-size: 13px;
}

.report-workbench-section__body {
  display: grid;
  gap: 12px;
}

.report-workbench-meta-panel,
.report-ct-import-card,
.report-workbench-actions,
.report-workbench-analysis-panel {
  background: var(--report-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 20px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.05), 0 2px 6px rgba(15, 23, 42, 0.03);
  transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

.report-workbench-meta-panel:hover,
.report-workbench-analysis-panel:hover {
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.08), 0 4px 10px rgba(15, 23, 42, 0.04);
  border-color: rgba(255, 255, 255, 0.88);
}

.report-workbench-meta-panel,
.report-workbench-actions,
.report-workbench-analysis-panel {
  padding: 16px;
}

.report-workbench-panel-head h4,
.report-ct-import-card__head h4 {
  margin: 0 0 6px;
  color: var(--report-ink);
  font-family: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-size: 21px;
}

.report-workbench-meta-section + .report-workbench-meta-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--report-rule);
}

.report-workbench-meta-disclosure {
  margin-top: 12px;
  border: 1px solid rgba(11, 107, 94, 0.18);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(11, 107, 94, 0.04), rgba(255, 255, 255, 0.6));
  overflow: hidden;
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.report-workbench-meta-disclosure::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--report-accent) 0%, rgba(11, 107, 94, 0.4) 100%);
  border-radius: 14px 0 0 14px;
}

.report-workbench-meta-disclosure[open] {
  border-color: rgba(11, 107, 94, 0.24);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 16px rgba(11, 107, 94, 0.06);
}

.report-workbench-meta-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px 12px 20px;
  cursor: pointer;
  list-style: none;
  transition: background 0.2s ease;
}

.report-workbench-meta-disclosure > summary:hover {
  background: rgba(11, 107, 94, 0.05);
}

.report-workbench-meta-disclosure > summary::-webkit-details-marker {
  display: none;
}

.report-workbench-meta-disclosure__title {
  color: var(--report-accent-deep);
  font-weight: 700;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.report-workbench-meta-disclosure__hint {
  color: var(--report-accent);
  font-size: 11.5px;
  font-weight: 600;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.report-workbench-meta-disclosure__hint::after {
  content: '▸';
  font-size: 10px;
  transition: transform 0.25s ease;
}

.report-workbench-meta-disclosure[open] .report-workbench-meta-disclosure__hint::after {
  transform: rotate(90deg);
}

.report-workbench-meta-disclosure__body {
  padding: 0 16px 14px 20px;
}

.report-workbench-meta-section__title {
  margin-bottom: 6px;
  color: var(--report-ink);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 12px;
}

.report-workbench-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
}

.report-workbench-field-grid--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-workbench-meta-panel .form-group,
.report-workbench-meta-panel .shiny-input-container,
.report-workbench-analysis-panel .form-group,
.report-workbench-analysis-panel .shiny-input-container,
.report-ct-import-card .form-group,
.report-ct-import-card .shiny-input-container {
  margin-bottom: 0;
}

.report-workbench-meta-panel .control-label,
.report-workbench-analysis-panel .control-label,
.report-ct-import-card .control-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--report-ink);
  margin-bottom: 4px;
}

.report-workbench-meta-panel .form-control,
.report-workbench-analysis-panel .form-control,
.report-ct-import-card .form-control {
  min-height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(20, 42, 52, 0.1);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
  color: var(--report-ink);
  padding: 7px 12px;
  font-size: 13px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.report-workbench-meta-panel textarea.form-control,
.report-workbench-analysis-panel textarea.form-control,
.report-ct-import-card textarea.form-control {
  min-height: 56px;
}

.report-workbench-meta-panel .form-control:hover,
.report-workbench-analysis-panel .form-control:hover,
.report-ct-import-card .form-control:hover {
  border-color: rgba(20, 42, 52, 0.18);
  background: rgba(255, 255, 255, 0.98);
}

.report-workbench-meta-panel .form-control:focus,
.report-workbench-analysis-panel .form-control:focus,
.report-ct-import-card .form-control:focus {
  border-color: rgba(11, 107, 94, 0.45);
  box-shadow: 0 0 0 4px rgba(11, 107, 94, 0.1), inset 0 1px 2px rgba(0, 0, 0, 0.02);
  background: #fff;
}

.report-workbench-settings-summary {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(20, 42, 52, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.report-workbench-settings-summary__title {
  color: var(--report-accent-deep);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.report-workbench-settings-summary__items {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.report-workbench-settings-summary__item {
  display: grid;
  gap: 4px;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid rgba(20, 42, 52, 0.07);
  background: rgba(252, 253, 251, 0.92);
  color: var(--report-ink);
  font-weight: 600;
}

.report-workbench-settings-summary__item > span:first-child {
  color: var(--report-muted);
  font-size: 12px;
  font-weight: 700;
}

.report-workbench-settings-summary__items--scenarios {
  grid-template-columns: 1fr;
  gap: 8px;
}

.report-workbench-settings-summary__item--scenario {
  display: grid;
  grid-template-columns: 110px repeat(5, minmax(0, 1fr)) minmax(220px, 1.25fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
  align-items: stretch;
}

.report-workbench-settings-summary__scenario-name {
  color: var(--report-accent-deep);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-right: 1px solid rgba(20, 42, 52, 0.08);
  background: rgba(241, 245, 242, 0.88);
}

.report-workbench-settings-summary__metric {
  display: grid;
  gap: 4px;
  padding: 12px 16px;
  align-content: center;
  border-right: 1px solid rgba(20, 42, 52, 0.08);
  min-width: 0;
}

.report-workbench-settings-summary__metric > span:first-child {
  color: var(--report-muted);
  font-size: 11px;
  letter-spacing: 0.03em;
  font-weight: 700;
}

.report-workbench-settings-summary__metric > strong {
  color: var(--report-ink);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 800;
  min-width: 0;
  word-break: break-word;
}

.report-workbench-settings-summary__metric--distribution {
  border-right: none;
}

.report-workbench-settings-summary__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-workbench-settings-summary__chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid rgba(111, 138, 173, 0.35);
  background: rgba(244, 248, 255, 0.88);
  color: #304764;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.report-workbench-settings-summary__empty {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(20, 42, 52, 0.14);
  color: var(--report-soft-ink);
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.82);
}

.report-workbench-core-settings {
  display: grid;
  gap: 8px;
}

.report-workbench-param-picker {
  display: grid;
  gap: 10px;
}

.report-workbench-param-picker__block {
  display: grid;
  gap: 8px;
}

.report-workbench-param-picker__label {
  color: var(--report-ink);
  font-size: 11px;
  font-weight: 700;
}

.report-workbench-param-picker__required {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.report-workbench-param-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(20, 42, 52, 0.1);
  background: rgba(255, 255, 255, 0.9);
  color: var(--report-ink);
  font-size: 12px;
  font-weight: 600;
}

.report-workbench-param-chip.is-required {
  background: rgba(240, 247, 243, 0.92);
  border-color: rgba(13, 108, 103, 0.16);
}

.report-workbench-analysis-panel .shiny-input-checkboxgroup {
  margin-bottom: 0;
}

.report-workbench-analysis-panel .checkbox-group-buttons,
.report-workbench-analysis-panel .shiny-options-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.report-workbench-analysis-panel .checkbox-group-buttons .checkbox,
.report-workbench-analysis-panel .shiny-options-group .checkbox {
  margin: 0;
}

.report-workbench-analysis-panel .checkbox-group-buttons label,
.report-workbench-analysis-panel .shiny-options-group label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  margin: 0;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(20, 42, 52, 0.09);
  background: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 600;
}

.report-workbench-advanced-disclosure {
  border: 1px solid rgba(11, 107, 94, 0.18);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(11, 107, 94, 0.04), rgba(255, 255, 255, 0.6));
  overflow: hidden;
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.report-workbench-advanced-disclosure::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--report-accent) 0%, rgba(11, 107, 94, 0.4) 100%);
  border-radius: 14px 0 0 14px;
}

.report-workbench-advanced-disclosure[open] {
  border-color: rgba(11, 107, 94, 0.24);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 16px rgba(11, 107, 94, 0.06);
}

.report-workbench-advanced-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px 12px 20px;
  cursor: pointer;
  list-style: none;
  transition: background 0.2s ease;
}

.report-workbench-advanced-disclosure > summary:hover {
  background: rgba(11, 107, 94, 0.05);
}

.report-workbench-advanced-disclosure > summary::-webkit-details-marker {
  display: none;
}

.report-workbench-advanced-disclosure__title {
  color: var(--report-accent-deep);
  font-weight: 700;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.report-workbench-advanced-disclosure__hint {
  color: var(--report-accent);
  font-size: 11.5px;
  font-weight: 600;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.report-workbench-advanced-disclosure__hint::after {
  content: '▸';
  font-size: 10px;
  transition: transform 0.25s ease;
}

.report-workbench-advanced-disclosure[open] .report-workbench-advanced-disclosure__hint::after {
  transform: rotate(90deg);
}

.report-workbench-advanced-disclosure__body {
  padding: 0 16px 14px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(340px, 0.95fr);
  gap: 16px;
  align-items: start;
}

.report-workbench-advanced-pane {
  min-width: 0;
}

.report-workbench-meta-section--params,
.report-workbench-meta-section--amplification {
  min-width: 0;
}

.report-workbench-field-grid--advanced-main {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 16px;
}

.report-workbench-field-stack {
  display: grid;
  gap: 10px;
}

.report-workbench-field-stack--left {
  max-width: 420px;
}

.report-workbench-field-grid--amplification {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.report-workbench-meta-section--amplification {
  padding-top: 18px;
  border-top: 1px solid rgba(20, 42, 52, 0.08);
}

.report-workbench-advanced-side-stack {
  display: grid;
  gap: 12px;
}

.report-workbench-advanced-checks {
  display: grid;
  gap: 8px;
}

.report-workbench-advanced-checks .checkbox {
  margin-bottom: 0;
}

.report-workbench-advanced-checks label {
  min-height: auto !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  border-radius: 0 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: var(--report-ink) !important;
}

.report-workbench-advanced-checks input[type="checkbox"] {
  margin-top: 0;
}

.report-workbench-advanced-boundary {
  margin-top: 2px;
}

.report-workbench-advanced-alpha .form-group {
  margin-bottom: 0;
}

.report-workbench-advanced-alpha .shiny-input-container > label.control-label {
  display: block;
}

.report-workbench-advanced-amplification .shiny-input-checkboxgroup {
  margin-bottom: 0;
}

.report-workbench-meta-section--amplification .shiny-input-checkboxgroup {
  margin-top: 2px;
}

.report-workbench-meta-section--amplification .checkbox {
  margin-bottom: 0;
}

.report-workbench-meta-section--amplification .checkbox input[type="checkbox"] {
  margin-top: 0;
}

.report-workbench-meta-section--amplification .shiny-input-container > label.control-label {
  display: none;
}

.report-workbench-meta-section--amplification .pk-be-boundary-inputs {
  margin-bottom: 0;
}

.report-workbench-meta-section--amplification .pk-be-boundary-input-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.report-workbench-meta-section--amplification .pk-be-boundary-input-field {
  min-width: 0;
}

.report-workbench-meta-section--amplification .pk-be-boundary-input-field__control .form-control {
  width: 100%;
  min-width: 0;
}

.report-workbench-meta-section--amplification .pk-be-boundary-range-separator {
  padding-top: 0;
  margin-top: 0;
  justify-content: center;
  align-self: end;
}

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

.report-ct-import-card {
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.94), rgba(255, 255, 255, 0.86));
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.report-ct-import-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.08), 0 4px 10px rgba(15, 23, 42, 0.04);
}

.report-ct-import-card__head {
  margin-bottom: 0;
}

.report-ct-import-card__head h4 {
  margin: 0;
}

.report-ct-import-card__actions {
  padding-top: 8px;
  border-top: 1px solid rgba(20, 42, 52, 0.06);
}

.report-ct-import-params-disclosure {
  border: 1px solid rgba(20, 42, 52, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  overflow: hidden;
}

.report-ct-import-params-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}

.report-ct-import-params-disclosure > summary::-webkit-details-marker {
  display: none;
}

.report-ct-import-params-disclosure__title {
  color: var(--report-ink);
  font-size: 13px;
  font-weight: 800;
}

.report-ct-import-params-disclosure__hint {
  color: var(--report-muted);
  font-size: 11px;
  font-weight: 700;
}

.report-ct-import-params-disclosure__body {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
  border-top: 1px solid rgba(20, 42, 52, 0.06);
}

.report-ct-import-param-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  padding-top: 12px;
}

.report-ct-import-param-grid .form-group,
.report-ct-import-param-grid .shiny-input-container,
.report-ct-import-param-boundary .form-group,
.report-ct-import-param-boundary .shiny-input-container,
.report-ct-import-param-optional .form-group,
.report-ct-import-param-optional .shiny-input-container {
  margin-bottom: 0 !important;
}

.report-ct-import-param-checks {
  display: grid;
  gap: 8px;
}

.report-ct-import-param-checks .checkbox {
  margin: 0;
}

.report-ct-import-param-checks label {
  color: var(--report-muted);
  font-size: 12px;
  font-weight: 700;
}

.report-ct-import-param-optional {
  display: grid;
  gap: 8px;
}

.report-ct-import-param-optional__label {
  color: var(--report-ink);
  font-size: 12px;
  font-weight: 800;
}

.report-ct-import-param-optional .shiny-options-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.report-ct-import-param-optional .checkbox-inline {
  margin-left: 0 !important;
}

.report-ct-import-param-amplification {
  display: grid;
  gap: 6px;
  grid-column: 1 / -1;
  padding-top: 4px;
  border-top: 1px solid rgba(20, 42, 52, 0.06);
}

.report-ct-import-param-amplification .shiny-input-container {
  width: auto !important;
  margin-bottom: 0;
}

.report-ct-import-param-amplification .shiny-options-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.report-ct-import-param-amplification .checkbox-inline {
  margin-left: 0 !important;
  font-size: 12.5px;
}

.report-ct-import-card__required-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  border-radius: 12px;
  padding: 8px 10px;
  margin-bottom: 10px;
  background: var(--report-accent-soft);
  color: var(--report-muted);
  font-size: 11px;
  line-height: 1.5;
}

.report-ct-import-card__label {
  color: var(--report-accent);
  font-weight: 700;
  white-space: nowrap;
}

.report-ct-import-analysis-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(17, 38, 56, 0.05);
  color: var(--report-muted);
}

.report-ct-import-analysis-status__label {
  font-weight: 700;
  color: var(--report-ink);
}

.report-ct-import-analysis-status.is-ready {
  background: rgba(13, 107, 102, 0.12);
}

.report-ct-import-analysis-status.is-running {
  background: rgba(204, 138, 28, 0.14);
}

.report-ct-import-analysis-status.is-error {
  background: rgba(181, 62, 54, 0.14);
}

.report-workbench-actions {
  margin-top: 4px;
  background:
    linear-gradient(180deg, rgba(255, 254, 250, 0.97), rgba(244, 248, 246, 0.92)),
    linear-gradient(135deg, rgba(188, 160, 100, 0.08), transparent);
  border: 1px solid rgba(11, 107, 94, 0.08);
  padding: 20px;
  display: grid;
  gap: 16px;
}

/* 双卡片网格 */
.report-workbench-output-deck__cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* 操作卡片基础 */
.report-workbench-action-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid rgba(20, 42, 52, 0.08);
  background: rgba(255, 255, 255, 0.85);
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.report-workbench-action-card:hover {
  border-color: rgba(20, 42, 52, 0.14);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

/* 图标区域 */
.report-workbench-action-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  background: linear-gradient(145deg, rgba(11, 107, 94, 0.12), rgba(11, 107, 94, 0.06));
  color: var(--report-accent);
  border: 1px solid rgba(11, 107, 94, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.report-workbench-action-card:hover .report-workbench-action-card__icon {
  transform: scale(1.06);
  box-shadow: 0 4px 12px rgba(11, 107, 94, 0.1);
}

.report-workbench-action-card__icon--download {
  background: linear-gradient(145deg, rgba(56, 78, 86, 0.12), rgba(56, 78, 86, 0.06));
  color: #546872;
  border-color: rgba(56, 78, 86, 0.1);
}

.report-workbench-action-card:hover .report-workbench-action-card__icon--download {
  box-shadow: 0 4px 12px rgba(56, 78, 86, 0.1);
}

/* 文案区域 */
.report-workbench-action-card__body {
  flex: 1;
  min-width: 0;
}

.report-workbench-action-card__title {
  color: var(--report-ink);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 3px;
}

.report-workbench-action-card__desc {
  color: var(--report-muted);
  font-size: 12px;
  line-height: 1.45;
}

/* 操作按钮 */
.report-workbench-generate,
.report-workbench-cancel,
.report-workbench-download {
  min-height: 38px !important;
  height: auto !important;
  width: auto !important;
  padding: 8px 20px !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12.5px !important;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  border: 0 !important;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.report-workbench-generate {
  background: linear-gradient(135deg, #0f3d42 0%, #0b6b5e 50%, #1a7a6e 100%) !important;
  box-shadow: 0 6px 18px rgba(11, 107, 94, 0.22);
  color: #fff !important;
}

.report-workbench-generate:hover {
  box-shadow: 0 10px 26px rgba(11, 107, 94, 0.3) !important;
  transform: translateY(-1px);
}

.report-workbench-generate:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(11, 107, 94, 0.16) !important;
}

.report-workbench-cancel {
  background: linear-gradient(135deg, #ad4a43 0%, #c85a52 52%, #d67163 100%) !important;
  box-shadow: 0 6px 18px rgba(181, 64, 58, 0.2);
  color: #fff !important;
}

.report-workbench-cancel:hover {
  box-shadow: 0 10px 26px rgba(181, 64, 58, 0.28) !important;
  transform: translateY(-1px);
}

.report-workbench-cancel:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(181, 64, 58, 0.14) !important;
}

.report-workbench-cancel:disabled,
.report-workbench-cancel[disabled],
.report-workbench-cancel.disabled,
.report-workbench-cancel.shinyjs-disabled,
.report-workbench-cancel[aria-disabled="true"],
.btn.disabled.report-workbench-cancel {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  opacity: 1 !important;
  color: rgba(181, 64, 58, 0.5) !important;
  background: linear-gradient(135deg, #f3e2e0, #f7ecea) !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04) !important;
  cursor: not-allowed !important;
  pointer-events: none;
  text-decoration: none !important;
  border: 1px solid rgba(181, 64, 58, 0.12) !important;
}

.report-workbench-cancel:disabled:hover,
.report-workbench-cancel[disabled]:hover,
.report-workbench-cancel.disabled:hover,
.report-workbench-cancel.shinyjs-disabled:hover,
.report-workbench-cancel[aria-disabled="true"]:hover,
.btn.disabled.report-workbench-cancel:hover {
  transform: none;
  box-shadow: none !important;
}

.report-workbench-download {
  background: linear-gradient(135deg, #384e56, #546872) !important;
  box-shadow: 0 6px 16px rgba(56, 78, 86, 0.18);
  color: #fff !important;
}

.report-workbench-download:hover {
  box-shadow: 0 10px 24px rgba(56, 78, 86, 0.26) !important;
  transform: translateY(-1px);
}

.report-workbench-download:active {
  transform: translateY(0);
}

.report-workbench-download:disabled,
.report-workbench-download[disabled],
.report-workbench-download.disabled,
.report-workbench-download.shinyjs-disabled,
.report-workbench-download[aria-disabled="true"],
.report-workbench-download.shiny-download-link.disabled,
.btn.disabled.report-workbench-download {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  opacity: 1 !important;
  color: rgba(56, 78, 86, 0.5) !important;
  background: linear-gradient(135deg, #e4e9ec, #edf0f2) !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04) !important;
  cursor: not-allowed !important;
  pointer-events: none;
  text-decoration: none !important;
  border: 1px solid rgba(20, 42, 52, 0.08) !important;
}

.report-workbench-download:disabled:hover,
.report-workbench-download[disabled]:hover,
.report-workbench-download.disabled:hover,
.report-workbench-download.shinyjs-disabled:hover,
.report-workbench-download[aria-disabled="true"]:hover,
.report-workbench-download.shiny-download-link.disabled:hover,
.btn.disabled.report-workbench-download:hover {
  transform: none;
  box-shadow: none !important;
}

.report-workbench-generate .fa,
.report-workbench-cancel .fa,
.report-workbench-download .fa,
.report-workbench-generate .fas,
.report-workbench-cancel .fas,
.report-workbench-download .fas {
  margin-right: 0;
}

.report-workbench-output-deck__summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  margin-bottom: 16px;
}

.report-workbench-output-deck__summary-item {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(20, 42, 52, 0.08);
  background: rgba(255, 255, 255, 0.72);
  color: var(--report-muted);
}

.report-workbench-output-deck__summary-label {
  color: var(--report-ink);
  font-weight: 700;
}

.report-workbench-task-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 14px;
  border: 1px solid rgba(20, 42, 52, 0.07);
  background: rgba(255, 255, 255, 0.75);
  color: var(--report-muted);
  transition: all 0.35s ease;
}

.report-workbench-task-status.is-running {
  background: linear-gradient(135deg, #f8edd9, #f2e4c8);
  border-color: rgba(184, 133, 42, 0.2);
  box-shadow: 0 4px 16px rgba(184, 133, 42, 0.08);
}

.report-workbench-task-status.is-ready {
  background: linear-gradient(135deg, #e8f5ed, #dff0e5);
  border-color: rgba(45, 122, 79, 0.2);
  box-shadow: 0 4px 16px rgba(45, 122, 79, 0.08);
}

.report-workbench-task-status.is-error {
  background: linear-gradient(135deg, #fce8e7, #f8dada);
  border-color: rgba(181, 64, 58, 0.2);
  box-shadow: 0 4px 16px rgba(181, 64, 58, 0.08);
}

.report-workbench-task-status__label {
  color: var(--report-ink);
  font-weight: 700;
  white-space: nowrap;
  font-size: 13px;
}

.report-workbench-task-status__body {
  flex: 1;
  display: grid;
  gap: 8px;
}

.report-workbench-task-status__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.report-workbench-task-status__stage {
  color: var(--report-ink);
  font-weight: 700;
  font-size: 13px;
}

.report-workbench-task-status__percent {
  color: var(--report-muted);
  font-weight: 700;
  font-size: 13px;
}

.report-workbench-task-status__bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(20, 42, 52, 0.07);
  overflow: hidden;
  position: relative;
}

.report-workbench-task-status__bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0b6b5e 0%, #1a8a7a 50%, #245d7b 100%);
  transition: width 280ms cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.report-workbench-task-status.is-running .report-workbench-task-status__bar-fill {
  background: linear-gradient(90deg, #b8852a 0%, #d4a03a 50%, #c49030 100%);
}

.report-workbench-task-status.is-running .report-workbench-task-status__bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.35) 50%, transparent 100%);
  animation: report-bar-shimmer 1.8s ease-in-out infinite;
}

@keyframes report-bar-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

.report-workbench-task-status.is-ready .report-workbench-task-status__bar-fill {
  background: linear-gradient(90deg, #2d7a4f 0%, #3a9960 100%);
}

.report-workbench-task-status.is-error .report-workbench-task-status__bar-fill {
  background: linear-gradient(90deg, #b5403a 0%, #d04e46 100%);
}

.report-workbench-task-status__message {
  font-size: 12px;
  line-height: 1.4;
  color: var(--report-muted);
}

.report-ct-import-card .btn-primary {
  min-height: 36px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(135deg, #0f3d42 0%, #0b6b5e 50%, #1a7a6e 100%);
  box-shadow: 0 6px 16px rgba(11, 107, 94, 0.18);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.01em;
  color: #fff;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.report-ct-import-card .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(11, 107, 94, 0.24);
}

.report-ct-import-card .btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(11, 107, 94, 0.14);
}

@media (max-width: 1199px) {
  .report-workbench-field-grid,
  .report-workbench-field-grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-ct-import-param-grid {
    grid-template-columns: 1fr;
  }

  .report-workbench-settings-summary__items {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .report-workbench-settings-summary__items--scenarios {
    grid-template-columns: 1fr;
  }

  .report-workbench-settings-summary__item--scenario {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .report-workbench-settings-summary__scenario-name {
    grid-column: 1 / -1;
    border-right: none;
    border-bottom: 1px solid rgba(20, 42, 52, 0.08);
  }

  .report-workbench-settings-summary__metric {
    border-right: none;
    border-bottom: 1px solid rgba(20, 42, 52, 0.06);
  }

  .report-workbench-settings-summary__metric--distribution {
    grid-column: 1 / -1;
    border-bottom: none;
  }

  .report-workbench-advanced-disclosure__body {
    grid-template-columns: 1fr;
  }

  .report-workbench-field-grid--advanced-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .report-workbench-shell {
    padding: 18px;
    border-radius: 20px;
  }

  .report-workbench-sources,
  .report-workbench-field-grid,
  .report-workbench-field-grid--compact,
  .report-workbench-settings-summary__items {
    grid-template-columns: 1fr;
  }

  .report-workbench-field-grid--advanced-main {
    grid-template-columns: 1fr;
  }

  .report-workbench-settings-summary__item--scenario {
    grid-template-columns: 1fr;
  }

  .report-workbench-settings-summary__scenario-name {
    grid-column: auto;
    border-bottom: 1px solid rgba(20, 42, 52, 0.08);
  }

  .report-workbench-settings-summary__metric {
    border-bottom: 1px solid rgba(20, 42, 52, 0.06);
  }

  .report-workbench-settings-summary__metric--distribution {
    grid-column: auto;
    border-bottom: none;
  }

  .report-workbench-section__copy h3 {
    font-size: 26px;
  }

  .report-workbench-output-deck__cards {
    grid-template-columns: 1fr;
  }

  .report-workbench-action-card {
    padding: 14px 16px;
  }

  .report-ct-import-param-grid {
    grid-template-columns: 1fr;
  }
}

/* 报告工作台 - 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  .report-workbench-shell,
  .report-workbench-section {
    animation: none;
  }

  .report-workbench-task-status.is-running .report-workbench-task-status__bar-fill::after {
    animation: none;
  }

  .report-ct-import-card,
  .report-workbench-download,
  .report-workbench-generate,
  .report-ct-import-card .btn-primary,
  .report-workbench-section__index {
    transition: none;
  }
}

/* ==========================================================================
   AI Workbench & Chat Module Styles (Refined Technical AI Aesthetic)
   ========================================================================== */
:root {
  --ai-primary: #3b82f6;
  --ai-primary-hover: #2563eb;
  --ai-accent: #8b5cf6;
  --ai-bg-main: #f8fafc;
  --ai-border: rgba(226, 232, 240, 0.8);
  --ai-text-main: #1e293b;
  --ai-text-muted: #64748b;
  --ai-shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.03);
  --ai-shadow-glow: 0 0 20px rgba(139, 92, 246, 0.15);
}

/* Sidebar Overrides */
.ai-workbench-sidebar {
  background: var(--ai-bg-main);
}

.ai-sidebar-intro {
  margin-bottom: 24px;
  padding: 16px;
  background: linear-gradient(145deg, #ffffff, #f1f5f9);
  border-radius: 12px;
  border: 1px solid var(--ai-border);
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.8);
}

.ai-sidebar-intro__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 100px;
  color: var(--ai-accent);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.ai-sidebar-intro__desc {
  font-size: 0.85rem;
  color: var(--ai-text-muted);
  line-height: 1.6;
  margin: 0;
}

.ai-sidebar-report-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--ai-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-sidebar-report-panel__title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--ai-text-main);
  letter-spacing: 0.02em;
}

.ai-sidebar-report-panel__hint {
  margin: 0 0 4px 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--ai-text-muted);
}

.ai-sidebar-report-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-sidebar-report-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-left-width: 4px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 249, 252, 0.96) 100%);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  padding: 14px 14px 13px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.ai-sidebar-report-card--pk {
  border-left-color: #2563eb;
}

.ai-sidebar-report-card--pd {
  border-left-color: #0f766e;
}

.ai-sidebar-report-card--ivpt {
  border-left-color: #b45309;
}

.ai-sidebar-report-card__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-sidebar-report-card__eyebrow {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ai-text-muted);
}

.ai-sidebar-report-card__title {
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.3;
  color: #102033;
}

.ai-sidebar-report-card__desc {
  font-size: 0.78rem;
  line-height: 1.55;
  color: #5a6a7e;
}

.ai-sidebar-report-btn {
  width: 100%;
  text-align: left;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.92);
  color: #16324f;
  font-weight: 700;
  padding: 10px 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.ai-sidebar-report-btn:hover,
.ai-sidebar-report-btn:focus {
  border-color: rgba(37, 99, 235, 0.28);
  background: #ffffff;
  color: #102033;
}

.ai-sidebar-report-card:has(.ai-sidebar-report-btn:not(:disabled)) {
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.ai-sidebar-report-card:has(.ai-sidebar-report-btn:not(:disabled)):hover {
  transform: translateY(-1px);
}

.ai-sidebar-report-btn:disabled,
.ai-sidebar-report-btn.disabled {
  background: rgba(241, 245, 249, 0.88);
  border-color: rgba(203, 213, 225, 0.85);
  color: #8a98aa;
  box-shadow: none;
}

.ai-sidebar-report-card:has(.ai-sidebar-report-btn:disabled) {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96) 0%, rgba(243, 246, 249, 0.96) 100%);
  box-shadow: none;
}

.ai-sidebar-report-status {
  margin-top: -4px;
  font-size: 0.76rem;
  color: var(--ai-text-muted);
}

/* Main Layout */
.ai-workbench-main-card {
  height: 100%;
  border-radius: 20px;
}

.ai-workbench-main-card > .card-body {
  padding: 16px;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto;
}

.ai-chat-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0; /* important for preventing flex child stretching issues */
  position: relative;
}

/* Banner */
.ai-chat-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 14px;
  border: 1px solid var(--ai-border);
  margin-bottom: 16px;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.ai-chat-banner__icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.18);
  flex-shrink: 0;
}

.ai-chat-banner__text {
  flex: 1;
  min-width: 0;
}

.ai-chat-banner__title {
  margin: 0 !important;
  font-size: 1.03rem;
  font-weight: 800;
  color: var(--ai-text-main);
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.ai-sidebar-banner {
  align-items: center !important;
  gap: 12px !important;
  padding: 14px 16px !important;
  background: linear-gradient(180deg, #ffffff, #f8fafc) !important;
}

.ai-sidebar-banner .ai-chat-banner__icon {
  width: 34px;
  height: 34px;
  font-size: 0.95rem;
}

.ai-chat-banner__desc {
  margin: 4px 0 0 0;
  font-size: 0.77rem;
  color: var(--ai-text-muted);
  line-height: 1.45;
}

.ai-sidebar-banner .ai-chat-banner__desc {
  font-size: 0.76rem;
}

.ai-chat-summary-btn:disabled {
  opacity: 0.6;
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  transform: none;
}

.ai-chat-summary-hint {
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 500;
  background: rgba(0,0,0,0.04);
  padding: 2px 8px;
  border-radius: 100px;
}

/* Chat Messages Area */
.ai-chat-messages-frame {
  flex: 1;
  min-height: 0;
  background: #fcfcfd;
  border: 1px solid var(--ai-border);
  border-radius: 16px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ai-chat-messages-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ai-chat-live-region:empty {
  display: none;
}

.ai-chat-live-text {
  white-space: pre-wrap;
}

.ai-chat-report {
  width: min(100%, 980px);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  border: 1px solid #dbe4f0;
  border-radius: 18px;
  box-shadow: 0 16px 36px -28px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

.ai-chat-report__header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid #e8eef5;
  background: linear-gradient(180deg, #f8fbff 0%, #fdfefe 100%);
}

.ai-chat-report__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4f46e5;
}

.ai-chat-report__title {
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.35;
  color: #0f172a;
}

.ai-chat-report__body {
  padding: 22px 24px 26px;
  font-size: 0.98rem;
  line-height: 1.82;
  color: #1e293b;
}

.ai-chat-markdown h1,
.ai-chat-markdown h2,
.ai-chat-markdown h3,
.ai-chat-markdown h4 {
  margin: 0 0 10px;
  line-height: 1.35;
  color: #0f172a;
}

.ai-chat-markdown h1,
.ai-chat-markdown h2 {
  font-size: 1.08rem;
  font-weight: 800;
}

.ai-chat-markdown h3 {
  font-size: 0.98rem;
  font-weight: 800;
  margin-top: 16px;
}

.ai-chat-markdown h4 {
  font-size: 0.92rem;
  font-weight: 700;
  margin-top: 14px;
}

.ai-chat-markdown p {
  margin: 0 0 10px;
}

.ai-chat-report__body p {
  margin-bottom: 14px;
}

.ai-chat-markdown ul,
.ai-chat-markdown ol {
  margin: 8px 0 12px 18px;
  padding-left: 18px;
}

.ai-chat-report__body ul,
.ai-chat-report__body ol {
  margin: 10px 0 16px 20px;
  padding-left: 20px;
}

.ai-chat-markdown li {
  margin-bottom: 6px;
}

.ai-chat-report__body li {
  margin-bottom: 8px;
}

.ai-chat-markdown strong {
  color: #0f172a;
  font-weight: 800;
}

.ai-chat-markdown blockquote {
  margin: 12px 0;
  padding: 10px 14px;
  border-left: 3px solid #93c5fd;
  background: #f8fbff;
  color: #334155;
  border-radius: 0 10px 10px 0;
}

.ai-chat-markdown hr {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 14px 0;
}

.ai-chat-report__body table {
  width: 100%;
  margin: 14px 0 18px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.ai-chat-report__body th,
.ai-chat-report__body td {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
  text-align: left;
}

.ai-chat-report__body th {
  background: #f8fafc;
  font-weight: 800;
  color: #0f172a;
}

/* Empty State */
.ai-chat-empty-state {
  margin: auto;
  text-align: center;
  padding: 40px 20px;
  color: #cbd5e1;
}

.ai-chat-empty-state__icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.ai-chat-empty-state__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ai-text-muted);
  margin-bottom: 8px;
}

.ai-chat-empty-state__desc {
  font-size: 0.85rem;
  color: #94a3b8;
}

/* Bubble Rows */
.ai-chat-msg-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: 85%;
  animation: fadeInMsg 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInMsg {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-chat-msg-row--user {
  margin-left: auto;
  flex-direction: row;
}

.ai-chat-msg-row--ai {
  margin-right: auto;
}

/* Avatars */
.ai-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.ai-chat-avatar--ai {
  background: linear-gradient(135deg, #e0e7ff, #ede9fe);
  color: var(--ai-accent);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.ai-chat-avatar--user {
  background: linear-gradient(135deg, #bae6fd, #e0f2fe);
  color: #0284c7;
  border: 1px solid rgba(2, 132, 199, 0.2);
}

/* Bubbles */
.ai-chat-bubble {
  padding: 14px 18px;
  font-size: 0.95rem;
  line-height: 1.6;
  border-radius: 16px;
  position: relative;
  word-wrap: break-word;
}

.ai-chat-bubble p:last-child {
  margin-bottom: 0;
}

.ai-chat-bubble--user {
  background: linear-gradient(135deg, var(--ai-primary), var(--ai-primary-hover));
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.ai-chat-bubble--ai {
  background: #ffffff;
  color: var(--ai-text-main);
  border: 1px solid var(--ai-border);
  border-bottom-left-radius: 4px;
  box-shadow: var(--ai-shadow-subtle);
}

.ai-chat-bubble--ai pre {
  background: #1e293b;
  color: #f8fafc;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  overflow-x: auto;
  border: 1px solid #334155;
  margin: 10px 0;
}

.ai-chat-bubble--ai code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  color: #e11d48;
}

.ai-chat-bubble--ai pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.ai-chat-bubble--ai table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 0.85rem;
}

.ai-chat-bubble--ai th, .ai-chat-bubble--ai td {
  border: 1px solid #e2e8f0;
  padding: 8px 12px;
}

.ai-chat-bubble--ai th {
  background: #f8fafc;
  font-weight: 700;
}

/* Typing Indicator */
.ai-chat-typing-cursor {
  display: inline-block;
  width: 6px;
  height: 1.2em;
  background: var(--ai-accent);
  vertical-align: middle;
  margin-left: 2px;
  animation: blinkCursor 1s step-end infinite;
}

@keyframes blinkCursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.ai-chat-loading {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px;
}

.ai-chat-loading[style*="display: none"] {
  display: none !important;
}

.ai-chat-loading__dots {
  display: flex;
  gap: 4px;
}

.ai-chat-loading__dot {
  width: 8px;
  height: 8px;
  background: var(--ai-accent);
  border-radius: 50%;
  animation: typingDot 1.4s infinite ease-in-out both;
}

.ai-chat-loading__dot:nth-child(1) { animation-delay: -0.32s; }
.ai-chat-loading__dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingDot {
  0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

.ai-chat-loading__text {
  font-size: 0.85rem;
  color: var(--ai-text-muted);
  font-weight: 500;
}

/* Input Area */
.ai-chat-input-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--ai-bg-main);
  padding: 16px;
  border-radius: 16px;
  border: none;
  flex-shrink: 0;
}

.ai-chat-input-wrapper {
  position: relative;
}

.ai-chat-input-wrapper .form-group {
  margin-bottom: 0 !important;
}

.ai-chat-input-wrapper textarea.form-control {
  width: 100%;
  resize: none;
  border: 1px solid #cbd5e1 !important;
  border-radius: 12px !important;
  padding: 12px 16px 48px 16px !important; /* 给底部留出按钮空间 */
  font-size: 0.95rem !important;
  transition: all 0.2s;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02) !important;
  line-height: 1.5;
}

.ai-chat-input-wrapper textarea.form-control:focus {
  outline: none;
  border-color: var(--ai-primary) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

.ai-chat-actions {
  position: absolute;
  bottom: 10px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 10;
}

.ai-chat-send-btn, 
.ai-chat-stop-btn, 
.ai-chat-clear-btn {
  width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 8px !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border: none !important;
}

.ai-chat-send-btn {
  background: linear-gradient(135deg, var(--ai-primary), var(--ai-primary-hover)) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25) !important;
}

.ai-chat-send-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4) !important;
}

.ai-chat-stop-btn {
  background: #f8fafc !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05) !important;
}

.ai-chat-stop-btn:not(:disabled):hover {
  background: #f1f5f9 !important;
  color: #1e293b !important;
  transform: translateY(-2px);
}

.ai-chat-clear-btn {
  background: transparent !important;
  color: #94a3b8 !important;
  border: none !important;
}

.ai-chat-clear-btn:hover {
  background: #fef2f2 !important;
  color: #ef4444 !important;
}

.ai-chat-send-btn:disabled,
.ai-chat-stop-btn:disabled {
  background: #f1f5f9 !important;
  color: #cbd5e1 !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* ═══════════════════════════════════════════════════
   系统 — 关于平台页面 (Premium About Page)
   ═══════════════════════════════════════════════════ */

.sys-about-container {
  padding: 0;
  background: #ffffff;
  height: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* Grid Layout */
.sys-about-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  padding: 40px;
  margin-top: -20px;
  flex: 1;
  overflow-y: auto;
}

.sys-about-card {
  background: white;
  border-radius: 24px;
  border: 1px solid #e2e8f0;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.sys-about-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 24px;
}

.sys-about-card__header i {
  color: #0ea5e9;
}

.sys-about-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sys-about-list li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 12px;
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.5;
}

.sys-about-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38bdf8;
}

/* Version Grid */
.sys-about-version-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.sys-about-version-item {
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 16px;
}

.sys-about-version-item__label {
  font-size: 0.7rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.sys-about-version-item__value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
}

.sys-about-version-item__value code {
  color: #0e7490;
  background: transparent;
  padding: 0;
}

.sys-about-env-pill {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.sys-about-env-pill--production { background: #dcfce7; color: #166534; }
.sys-about-env-pill--dev { background: #e0f2fe; color: #075985; }

/* Footer */
@media (max-width: 991px) {
  .sys-about-grid {
    grid-template-columns: 1fr;
  }
}
