:root {
        --sidebar-bg: #0c1a2e;
        --sidebar-hover: #162640;
        --sidebar-active: #1e3a5f;
        --sidebar-border: rgba(255, 255, 255, 0.06);
        --accent: #3b82f6;
        --accent-light: #60a5fa;
        --accent-glow: rgba(59, 130, 246, 0.15);
        --success: #10b981;
        --warning: #f59e0b;
        --danger: #ef4444;
        --info: #06b6d4;
        --purple: #8b5cf6;
        --orange: #f97316;
        --bg: #f0f4f8;
        --surface: #ffffff;
        --surface-2: #f8fafc;
        --border: #e2e8f0;
        --border-light: #f1f5f9;
        --text-primary: #0f172a;
        --text-secondary: #475569;
        --text-muted: #94a3b8;
        --shadow-sm:
          0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
        --shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
        --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
        --radius: 10px;
        --radius-lg: 16px;
        --sidebar-w: 248px;
        --shell-header-h: 104px;
      }

      * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
      }
      html,
      body {
        height: 100%;
        font-family: "Plus Jakarta Sans", sans-serif;
        background: var(--bg);
        color: var(--text-primary);
        overflow: hidden;
      }

      /* LAYOUT */
      .app {
        display: flex;
        height: 100vh;
      }

      /* SIDEBAR */
      .sidebar {
        width: var(--sidebar-w);
        min-width: var(--sidebar-w);
        background: var(--sidebar-bg);
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        border-right: 1px solid rgba(255, 255, 255, 0.04);
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
      }
      .sidebar::-webkit-scrollbar {
        width: 3px;
      }
      .sidebar::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 3px;
      }

      .sidebar-logo {
        padding: 20px 16px 16px;
        border-bottom: 1px solid var(--sidebar-border);
        display: flex;
        align-items: center;
        gap: 10px;
        cursor: pointer;
      }
      .sidebar-logo:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: -2px;
      }
      .logo-icon {
        width: 34px;
        height: 34px;
        background: linear-gradient(135deg, #3b82f6, #1d4ed8);
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
        font-size: 14px;
        color: white;
        letter-spacing: -0.5px;
      }
      .logo-text {
        color: white;
        display: grid;
        gap: 2px;
      }
      .logo-text .brand {
        font-weight: 800;
        font-size: 17px;
        line-height: 1;
        letter-spacing: 0.04em;
      }
      .logo-text .sub {
        font-size: 9.5px;
        font-weight: 600;
        line-height: 1.1;
        color: rgba(255, 255, 255, 0.5);
        text-transform: uppercase;
        letter-spacing: 1px;
      }

      .sidebar-section {
        padding: 12px 0 4px;
      }
      .sidebar-section-label {
        font-size: 9.5px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 1.2px;
        color: rgba(255, 255, 255, 0.25);
        padding: 0 16px 6px;
      }
      .sidebar-item {
        display: flex;
        align-items: center;
        gap: 9px;
        padding: 8px 16px;
        cursor: pointer;
        color: rgba(255, 255, 255, 0.55);
        font-size: 12.5px;
        font-weight: 500;
        border-left: 2px solid transparent;
        transition: all 0.15s;
        white-space: nowrap;
      }
      .sidebar-item:hover {
        background: var(--sidebar-hover);
        color: rgba(255, 255, 255, 0.85);
      }
      .sidebar-item.active {
        background: var(--sidebar-active);
        color: white;
        border-left-color: var(--accent);
      }
      .sidebar-item.is-hidden,
      .sidebar-section.is-hidden {
        display: none;
      }
      .sidebar-item .icon {
        width: 16px;
        text-align: center;
        opacity: 0.7;
        font-size: 13px;
      }
      .sidebar-item.active .icon {
        opacity: 1;
      }
      .sidebar-badge {
        margin-left: auto;
        background: var(--danger);
        color: white;
        font-size: 9px;
        font-weight: 700;
        border-radius: 10px;
        padding: 1px 5px;
      }
      .sidebar-badge.blue {
        background: var(--accent);
      }
      .sidebar-badge.green {
        background: var(--success);
      }
      .sidebar-badge.orange {
        background: var(--orange);
      }

      .sidebar-user {
        margin-top: auto;
        padding: 14px 16px;
        border-top: 1px solid var(--sidebar-border);
        display: flex;
        align-items: center;
        gap: 10px;
      }
      .user-avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: linear-gradient(135deg, #3b82f6, #7c3aed);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        font-weight: 700;
        color: white;
        flex-shrink: 0;
      }
      .user-info {
        overflow: hidden;
      }
      .user-name {
        font-size: 12px;
        font-weight: 600;
        color: white;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .user-role {
        font-size: 10px;
        color: rgba(255, 255, 255, 0.35);
      }
      .online-dot {
        width: 7px;
        height: 7px;
        background: var(--success);
        border-radius: 50%;
        margin-left: auto;
        flex-shrink: 0;
        box-shadow: 0 0 6px var(--success);
      }

      /* MAIN */
      .main {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        position: relative;
      }
      .topbar {
        height: 54px;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        display: flex;
        align-items: center;
        gap: 16px;
        padding: 0 24px;
        flex-shrink: 0;
      }
      .topbar-title {
        font-size: 15px;
        font-weight: 700;
        color: var(--text-primary);
      }
      .topbar-sub {
        font-size: 12px;
        color: var(--text-muted);
        margin-left: 4px;
      }
      .topbar-spacer {
        flex: 1;
      }
      .topbar-actions {
        display: flex;
        align-items: center;
        gap: 10px;
      }
      .topbar-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 6px 12px;
        border-radius: 7px;
        border: 1px solid var(--border);
        background: var(--surface);
        cursor: pointer;
        font-size: 12px;
        font-weight: 500;
        color: var(--text-secondary);
        transition: all 0.15s;
      }
      .topbar-btn:hover {
        background: var(--surface-2);
        border-color: var(--accent);
        color: var(--accent);
      }
      .topbar-btn.primary {
        background: var(--accent);
        color: white;
        border-color: var(--accent);
      }
      .topbar-btn.primary:hover {
        background: #2563eb;
      }
      .lang-toggle {
        gap: 8px;
        padding: 4px 6px;
      }
      .lang-toggle-pill {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 4px 8px;
        border-radius: 999px;
        color: var(--text-muted);
        background: transparent;
        transition: all 0.15s;
      }
      .lang-toggle-pill.active {
        background: var(--surface-2);
        color: var(--accent);
        box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.18);
      }
      .lang-toggle-flag {
        font-size: 13px;
        line-height: 1;
      }
      .notif-btn {
        width: 34px;
        height: 34px;
        border-radius: 8px;
        border: 1px solid var(--border);
        background: var(--surface);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        position: relative;
        color: var(--text-secondary);
        transition: all 0.15s;
      }
      .notif-btn:hover {
        background: var(--surface-2);
        color: var(--accent);
      }
      .notif-count {
        position: absolute;
        top: -3px;
        right: -3px;
        background: var(--danger);
        color: white;
        font-size: 9px;
        font-weight: 700;
        width: 16px;
        height: 16px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid var(--surface);
      }
      .date-range {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 6px 12px;
        border: 1px solid var(--border);
        border-radius: 7px;
        background: var(--surface);
        font-size: 11.5px;
        color: var(--text-secondary);
        cursor: pointer;
      }

      .content {
        flex: 1;
        overflow-y: auto;
        padding: 20px 24px;
      }
      .content::-webkit-scrollbar {
        width: 5px;
      }
      .content::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 5px;
      }

      /* PAGE */
      .page {
        display: none;
      }
      .page.active {
        display: block;
        animation: fadeIn 0.2s ease;
      }
      @keyframes fadeIn {
        from {
          opacity: 0;
          transform: translateY(4px);
        }
        to {
          opacity: 1;
          transform: translateY(0);
        }
      }

      /* KPI CARDS */
      .kpi-grid {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 12px;
        margin-bottom: 20px;
      }
      .kpi-grid-4 {
        grid-template-columns: repeat(4, 1fr);
      }
      .kpi-grid-3 {
        grid-template-columns: repeat(3, 1fr);
      }
      .kpi-grid-5 {
        grid-template-columns: repeat(5, 1fr);
      }
      .home-kpi-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px;
      }
      .kpi-card {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 14px 16px;
        box-shadow: var(--shadow-sm);
      }
      .home-kpi-grid .kpi-card {
        padding: 10px 12px;
      }
      .home-kpi-grid .kpi-label {
        font-size: 10px;
        margin-bottom: 4px;
      }
      .home-kpi-grid .kpi-value {
        font-size: 18px;
      }
      .home-kpi-grid .kpi-change {
        font-size: 9.5px;
        margin-top: 4px;
      }
      .kpi-label {
        font-size: 11px;
        color: var(--text-muted);
        font-weight: 500;
        margin-bottom: 6px;
        display: flex;
        align-items: center;
        gap: 5px;
      }
      .kpi-value {
        font-size: 22px;
        font-weight: 800;
        color: var(--text-primary);
        letter-spacing: -0.5px;
        line-height: 1;
      }
      .kpi-value.blue {
        color: var(--accent);
      }
      .kpi-value.green {
        color: var(--success);
      }
      .kpi-value.orange {
        color: var(--orange);
      }
      .kpi-value.red {
        color: var(--danger);
      }
      .kpi-value.purple {
        color: var(--purple);
      }
      .kpi-change {
        font-size: 10.5px;
        margin-top: 5px;
        display: flex;
        align-items: center;
        gap: 3px;
      }
      .kpi-inline-field {
        margin-top: 2px;
      }
      .kpi-inline-field select {
        width: 100%;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--surface);
        color: var(--text-primary);
        padding: 9px 10px;
        font: inherit;
        font-size: 12px;
        font-weight: 700;
      }
      .viz-kpi-selector {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        margin-top: 2px;
      }
      .viz-kpi-selector .viz-preview-tab {
        min-height: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 9px 6px;
        text-align: center;
      }
      .viz-kpi-selector .viz-preview-tab-label {
        font-size: 11px;
        letter-spacing: 0.02em;
      }
      .viz-kpi-placeholder {
        border: 1px dashed var(--border);
        border-radius: 10px;
        background: var(--surface-2);
        color: var(--text-muted);
        font-size: 11px;
        font-weight: 700;
        text-align: center;
        padding: 10px 8px;
      }
      .kpi-change.up {
        color: var(--success);
      }
      .kpi-change.down {
        color: var(--danger);
      }
      .kpi-change .prev {
        color: var(--text-muted);
        margin-left: 2px;
      }

      /* GRID LAYOUTS */
      .grid-2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        margin-bottom: 16px;
      }
      .grid-3 {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 16px;
        margin-bottom: 16px;
      }
      .grid-2-1 {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 16px;
        margin-bottom: 16px;
      }
      .grid-1-2 {
        display: grid;
        grid-template-columns: 1fr 2fr;
        gap: 16px;
        margin-bottom: 16px;
      }
      .grid-3-1 {
        display: grid;
        grid-template-columns: 3fr 1fr;
        gap: 16px;
        margin-bottom: 16px;
      }
      .grid-1-1-1 {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 16px;
        margin-bottom: 16px;
      }
      .grid-4 {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
        margin-bottom: 16px;
      }

      /* CARD */
      .card {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius-lg);
        padding: 18px 20px;
        box-shadow: var(--shadow-sm);
        overflow: hidden;
      }
      .card-sm {
        padding: 14px 16px;
      }
      .card-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 14px;
      }
      .card-title {
        font-size: 13px;
        font-weight: 700;
        color: var(--text-primary);
      }
      .card-sub {
        font-size: 11px;
        color: var(--text-muted);
        margin-top: 2px;
      }
      .card-action {
        font-size: 11px;
        color: var(--accent);
        cursor: pointer;
        font-weight: 600;
      }
      .card-action:hover {
        text-decoration: underline;
      }
      .viz-console {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        align-items: start;
        min-height: calc(100vh - 148px);
      }
      .visualization-page-head {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        margin-bottom: 10px;
        min-height: 42px;
        padding: 0 2px;
      }
      .visualization-view-switch {
        display: inline-flex;
        flex-wrap: nowrap;
        gap: 4px;
        padding: 4px;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: var(--surface-2);
        box-shadow: var(--shadow-sm);
      }
      .visualization-view-btn {
        flex: 0 0 auto;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: var(--text-secondary);
        cursor: pointer;
        font-family: inherit;
        font-size: 12px;
        font-weight: 750;
        padding: 8px 14px;
        transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
      }
      .visualization-view-switch .visualization-view-btn {
        min-width: 110px;
        white-space: nowrap;
      }
      .visualization-view-btn:hover {
        color: var(--text-primary);
        background: var(--surface);
      }
      .visualization-view-btn:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
      }
      .visualization-view-btn.active {
        color: #fff;
        background: linear-gradient(135deg, var(--accent), #60a5fa);
        box-shadow: 0 5px 14px rgba(37, 99, 235, 0.2);
      }
      .viz-dashboard-language-switch {
        display: inline-flex;
        flex-wrap: wrap;
        gap: 4px;
        margin-top: 8px;
      }
      .viz-dashboard-language-switch .visualization-view-btn {
        flex: 0 0 auto;
        border: 1px solid var(--border);
      }
      .visualization-panel[hidden] {
        display: none;
      }
      .dataset-builder-shell {
        display: grid;
        grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.5fr);
        gap: 16px;
        align-items: start;
        min-height: calc(100vh - 148px);
      }
      .dataset-builder-rail,
      .dataset-builder-preview {
        border: 1px solid var(--border);
        border-radius: 16px;
        background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
        box-shadow: var(--shadow-sm);
        overflow: hidden;
      }
      .dataset-builder-rail-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 15px 16px;
        border-bottom: 1px solid var(--border);
        background: var(--surface);
      }
      .dataset-builder-rail-body {
        display: grid;
        gap: 12px;
        padding: 12px;
      }
      .dataset-builder-section {
        display: grid;
        gap: 8px;
        padding: 11px;
        border: 1px solid var(--border-light);
        border-radius: 12px;
        background: var(--surface);
      }
      .dataset-builder-section > label,
      .dataset-builder-section-title {
        color: var(--text-secondary);
        font-size: 11px;
        font-weight: 750;
      }
      .dataset-builder-section-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
      }
      .dataset-builder-section select,
      .dataset-builder-row select,
      .dataset-builder-row input,
      .dataset-builder-savebar input {
        min-width: 0;
        min-height: 36px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--surface);
        color: var(--text-primary);
        font: inherit;
        font-size: 11.5px;
        padding: 7px 9px;
      }
      .dataset-builder-rows {
        display: grid;
        gap: 7px;
      }
      .dataset-builder-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(100px, 0.72fr) auto;
        gap: 6px;
        align-items: center;
      }
      .dataset-builder-join-row {
        grid-template-columns: minmax(0, 0.82fr) minmax(0, 1fr) 74px minmax(0, 0.82fr) minmax(0, 1fr) auto;
      }
      .dataset-builder-filter-row {
        grid-template-columns: minmax(0, 0.72fr) minmax(0, 0.9fr) minmax(100px, 0.72fr) minmax(0, 0.9fr) auto;
      }
      .dataset-builder-add,
      .dataset-builder-remove {
        border: 0;
        background: transparent;
        color: var(--accent);
        cursor: pointer;
        font: inherit;
        font-size: 10.5px;
        font-weight: 750;
        padding: 6px 2px;
      }
      .dataset-builder-remove {
        color: #dc2626;
      }
      .dataset-builder-add:hover,
      .dataset-builder-remove:hover {
        text-decoration: underline;
      }
      .dataset-builder-preview {
        display: grid;
        grid-template-rows: auto minmax(0, 1fr) auto;
        min-height: 680px;
      }
      .dataset-builder-preview .viz-top {
        align-items: center;
      }
      .dataset-builder-limit {
        color: var(--text-muted);
        font-size: 11px;
        font-weight: 650;
      }
      .dataset-builder-preview-body {
        min-width: 0;
        overflow: auto;
        padding: 14px;
      }
      .dataset-builder-savebar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        padding: 12px 14px;
        border-top: 1px solid var(--border);
        background: var(--surface);
      }
      .viz-side {
        display: grid;
        grid-template-columns: repeat(var(--viz-side-cols, 4), minmax(0, 1fr));
        gap: 10px;
        align-items: stretch;
        min-width: 0;
      }
      #page-dashboard-viewer .viz-side,
      #page-visualization [data-visualization-panel="dashboard"] .viz-side {
        --viz-side-cols: 4;
      }
      #page-histogram-viewer .viz-side,
      #page-visualization [data-visualization-panel="histogram"] .viz-side {
        --viz-side-cols: 2;
      }
      .viz-side > .viz-section {
        min-width: 0;
      }
      .viz-section {
        border: 1px solid var(--border);
        border-radius: 14px;
        background: var(--surface);
        overflow: hidden;
        box-shadow: var(--shadow-sm);
        min-width: 0;
        align-self: stretch;
        display: flex;
        flex-direction: column;
      }
      .viz-section-head {
        width: 100%;
        border: 0;
        background: var(--surface-2);
        color: var(--text-primary);
        padding: 10px 12px;
        font-size: 12px;
        font-weight: 700;
        font-family: inherit;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        min-height: 40px;
      }
      .viz-section.collapsed {
        box-shadow: none;
      }
      .viz-section.collapsed > .viz-section-head {
        border-bottom: 0;
      }
      .viz-section.collapsed > .viz-section-body {
        display: none !important;
      }
      .viz-section-body {
        display: grid;
        gap: 8px;
        padding: 10px;
        border-top: 1px solid var(--border-light);
      }
      .viz-side > .viz-section > .viz-section-body {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        align-items: stretch;
        align-content: center;
        overflow: visible;
        flex: 1 1 auto;
      }
      .viz-side > .viz-section > .viz-section-body > * {
        flex: 1 1 150px;
        min-width: 0;
      }
      .viz-field {
        display: grid;
        gap: 6px;
        min-width: 0;
      }
      .viz-field label {
        font-size: 10.5px;
        font-weight: 700;
        color: var(--text-muted);
        letter-spacing: 0.02em;
      }
      .viz-field input {
        width: 100%;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--surface);
        color: var(--text-primary);
        padding: 8px 10px;
        font-size: 12px;
      }
      .viz-field select {
        width: 100%;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: var(--surface);
        color: var(--text-primary);
        padding: 8px 10px;
        font: inherit;
        font-size: 12px;
      }
      .viz-main {
        min-width: 0;
        min-height: 680px;
        border: 1px solid var(--border);
        border-radius: 16px;
        background: linear-gradient(
          180deg,
          var(--surface) 0%,
          var(--surface-2) 100%
        );
        box-shadow: var(--shadow-sm);
        overflow: hidden;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
      }
      .viz-top {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 16px;
        padding: 16px 18px;
        border-bottom: 1px solid var(--border);
        background: var(--surface);
        min-width: 0;
      }
      .viz-title {
        font-size: 18px;
        line-height: 1.15;
        font-weight: 800;
        color: var(--text-primary);
      }
      .viz-subtitle {
        margin-top: 5px;
        font-size: 11.5px;
        color: var(--text-muted);
        line-height: 1.35;
        overflow-wrap: anywhere;
      }
      .viz-body {
        padding: 14px;
        overflow: auto;
        min-width: 0;
      }
      .viz-hero {
        border: 1px solid var(--border-light);
        border-radius: 14px;
        padding: 14px;
        background: var(--surface);
        margin-bottom: 14px;
        min-width: 0;
      }
      .viz-tabs {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
        gap: 8px;
        margin-top: 12px;
        overflow: visible;
      }
      .viz-tab-btn,
      .viz-feature-btn {
        border: 1px solid var(--border);
        background: var(--surface);
        color: var(--text-secondary);
        border-radius: 9px;
        padding: 7px 9px;
        font-size: 11.5px;
        font-weight: 650;
        cursor: pointer;
        text-align: center;
        overflow: hidden;
        text-overflow: initial;
        white-space: normal;
        width: 100%;
        min-width: 0;
      }
      .viz-tab-btn.active,
      .viz-feature-btn.active {
        border-color: transparent;
        background: linear-gradient(135deg, var(--accent), #60a5fa);
        color: #fff;
      }
      .viz-preview-tab {
        display: grid;
        gap: 4px;
        text-align: left;
        min-height: 64px;
        align-content: center;
      }
      .viz-preview-tab-label {
        font-size: 12px;
        font-weight: 750;
        line-height: 1.2;
      }
      .viz-preview-tab-sub {
        font-size: 10.5px;
        line-height: 1.3;
        color: inherit;
        opacity: 0.78;
      }
      .viz-preview-actions {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
        flex-wrap: wrap;
      }
      .viz-preview-actions .action-btn {
        padding: 9px 14px;
        font-size: 11.5px;
      }
      .viz-export-format {
        display: inline-flex;
        align-items: stretch;
        min-height: 38px;
        padding: 3px;
        border: 1px solid var(--border);
        border-radius: 9px;
        background: var(--surface-2);
      }
      .viz-export-format-option {
        min-width: 46px;
        padding: 0 10px;
        border: 0;
        border-radius: 6px;
        background: transparent;
        color: var(--text-muted);
        cursor: pointer;
        font: inherit;
        font-size: 10.5px;
        font-weight: 750;
        letter-spacing: 0.04em;
      }
      .viz-export-format-option:hover:not(:disabled) {
        color: var(--text-primary);
      }
      .viz-export-format-option[aria-pressed="true"] {
        background: var(--surface);
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.16);
        color: var(--accent);
      }
      .viz-export-format-option:focus-visible {
        outline: 2px solid var(--accent);
        outline-offset: 2px;
      }
      .viz-export-format-option:disabled {
        cursor: not-allowed;
        opacity: 0.55;
      }
      .action-btn.success {
        border-color: #16a34a;
        background: #16a34a;
        color: #fff;
      }
      .action-btn:disabled {
        cursor: not-allowed;
        opacity: 0.65;
      }
      .viz-preview-meta {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 10px;
        color: var(--text-muted);
        font-size: 11px;
      }
      .viz-preview-table-wrap {
        border: 1px solid var(--border);
        border-radius: 16px;
        background: #fff;
        box-shadow: var(--shadow-sm);
        overflow: auto;
      }
      .viz-preview-table {
        min-width: 760px;
        margin: 0;
      }
      .viz-preview-table th {
        position: sticky;
        top: 0;
        z-index: 1;
        background: #f8fafc;
        text-transform: uppercase;
        letter-spacing: 0.02em;
      }
      .viz-preview-table td {
        max-width: 280px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .viz-preview-table tr:last-child td {
        border-bottom: 0;
      }
      .viz-main-full {
        width: 100%;
      }
      .viz-dashboard-launch-card {
        margin-top: 14px;
      }
      .viz-dashboard-embed-wrap {
        margin-top: 14px;
        border: 1px solid var(--border);
        border-radius: 14px;
        overflow: hidden;
        background: #fff;
        min-height: 720px;
      }
      .viz-dashboard-embed-stage {
        min-height: 720px;
        background:
          radial-gradient(circle at top left, rgba(96, 165, 250, 0.14), transparent 36%),
          linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.98));
      }
      .viz-dashboard-embed-status {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        min-height: 46px;
        padding: 12px 16px;
        border-bottom: 1px solid rgba(148, 163, 184, 0.18);
        color: var(--text-muted);
        font-size: 11px;
        font-weight: 650;
        letter-spacing: 0.02em;
        text-transform: uppercase;
      }
      .viz-dashboard-embed-status[data-state="info"] {
        color: #0f766e;
      }
      .viz-dashboard-embed-status[data-state="success"] {
        color: #166534;
      }
      .viz-dashboard-embed-status[data-state="danger"] {
        color: #b91c1c;
      }
      .viz-dashboard-embed-status.active {
        color: #0f766e;
      }
      .viz-dashboard-embed-host-shell {
        min-height: 674px;
        width: 100%;
      }
      .viz-dashboard-embed-host {
        display: block;
        width: 100%;
        min-height: 674px;
        border: 0;
        background: #fff;
      }
      .viz-dashboard-embed-host iframe {
        display: block;
        width: 100%;
        min-height: 674px;
        border: 0;
        background: #fff;
      }
      .viz-superset-workspace-wrap,
      .viz-superset-workspace-frame {
        min-height: calc(100vh - 210px);
      }
      .viz-superset-workspace-frame {
        height: calc(100vh - 210px);
      }
      #foxaiSupersetWorkspacePortal {
        position: absolute;
        inset: var(--foxai-superset-workspace-top, 86px) 0 0;
        z-index: 10;
        overflow: hidden;
        padding: 20px 24px;
        background: var(--bg);
      }
      #foxaiSupersetWorkspacePortal[hidden] {
        display: none;
      }
      #foxaiSupersetWorkspacePortal .viz-superset-workspace-frame {
        height: 100%;
        min-height: 100%;
        border: 1px solid var(--border);
        border-radius: 14px;
      }
      .viz-dashboard-embed-frame {
        display: block;
        width: 100%;
        min-height: 720px;
        border: 0;
        background: #fff;
      }
      .viz-dashboard-grid {
        display: grid;
        grid-template-columns: repeat(12, minmax(0, 1fr));
        gap: 14px;
      }
      .viz-dashboard-card {
        grid-column: span 12;
        border: 1px solid var(--border);
        border-radius: 14px;
        background: var(--surface);
        padding: 14px;
        min-width: 0;
      }
      .viz-dashboard-card.span-3 {
        grid-column: span 3;
      }
      .viz-dashboard-card.span-4 {
        grid-column: span 4;
      }
      .viz-dashboard-card.span-6 {
        grid-column: span 6;
      }
      .viz-dashboard-card.span-8 {
        grid-column: span 8;
      }
      .viz-dashboard-card.span-12 {
        grid-column: span 12;
      }
      .viz-card-title {
        font-size: 13px;
        font-weight: 750;
        color: var(--text-primary);
        margin-bottom: 4px;
        line-height: 1.25;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
      }
      .viz-card-sub {
        font-size: 10.5px;
        color: var(--text-muted);
        margin-bottom: 10px;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
      }
      .viz-kpi-value {
        font-size: 22px;
        font-weight: 800;
        color: var(--accent);
        line-height: 1.1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .viz-progress-row {
        display: grid;
        gap: 6px;
        margin-top: 10px;
      }
      .viz-progress-head {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        font-size: 10.8px;
        color: var(--text-secondary);
      }
      .viz-progress-head span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
      .viz-dashboard-card .pipeline-flow {
        flex-wrap: wrap;
        gap: 10px;
        overflow: hidden;
      }
      .viz-dashboard-card .pipeline-step {
        min-width: 0;
        flex: 1 1 170px;
      }
      .viz-dashboard-card .step-arrow {
        display: none;
      }
      .viz-dashboard-card .step-box {
        min-height: 92px;
        padding: 10px;
      }
      .viz-dashboard-card .step-name,
      .viz-dashboard-card .step-data {
        line-height: 1.25;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
      }
      .viz-progress-track {
        height: 8px;
        border-radius: 999px;
        background: var(--surface-2);
        overflow: hidden;
      }
      .viz-progress-fill {
        height: 100%;
        border-radius: 999px;
        background: linear-gradient(135deg, var(--accent), #60a5fa);
      }
      .viz-donut-layout {
        display: grid;
        grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
        gap: 16px;
        align-items: center;
        min-width: 0;
      }
      .viz-donut {
        width: min(220px, 100%);
        aspect-ratio: 1;
        height: auto;
        border-radius: 50%;
        display: grid;
        place-items: center;
        margin: 0 auto;
      }
      .viz-donut-center {
        width: 44%;
        height: 44%;
        border-radius: 50%;
        background: var(--surface);
        display: grid;
        place-items: center;
        font-weight: 900;
        color: var(--text-primary);
      }
      .viz-feature-list {
        display: flex;
        flex-wrap: nowrap;
        gap: 10px;
        font-family: inherit;
        overflow-x: auto;
        overflow-y: hidden;
      }
      .viz-feature-list .viz-section {
        box-shadow: none;
        border-color: var(--border-light);
        flex: 0 0 clamp(220px, 24vw, 260px);
      }
      .viz-feature-list .viz-section-body {
        display: none;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
      }
      .viz-feature-list .viz-section.open .viz-section-body {
        display: flex;
      }
      .viz-histogram-frame {
        border: 1px solid var(--border);
        border-radius: 16px;
        background: #fff;
        min-height: calc(100vh - 260px);
        display: grid;
        place-items: center;
        padding: 8px;
        box-shadow: var(--shadow-sm);
      }
      .viz-histogram-wrap {
        width: 100%;
        height: 100%;
        display: grid;
        gap: 10px;
        place-items: center;
      }
      .viz-histogram-wrap img {
        width: 100%;
        height: 100%;
        max-height: calc((100vh - 290px) / 2);
        object-fit: contain;
        object-position: center;
        border-radius: 12px;
        border: 1px solid #e5e7eb;
        background: #fff;
      }
      .viz-mini-list {
        display: grid;
        gap: 8px;
      }
      .viz-mini-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        border: 1px solid var(--border-light);
        border-radius: 9px;
        padding: 8px 10px;
        background: var(--surface);
        font-size: 11.5px;
        color: var(--text-secondary);
        overflow: hidden;
        min-width: 0;
        flex: 1 1 150px;
      }
      .viz-mini-item > span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .viz-mini-item > span:first-child {
        white-space: normal;
      }
      .viz-mini-item > span:last-child {
        white-space: nowrap;
      }
      @media (max-width: 1280px) {
        .viz-dashboard-card.span-3 {
          grid-column: span 12;
        }
        .viz-donut-layout {
          grid-template-columns: minmax(0, 1fr);
        }
      }
      @media (max-width: 980px) {
        .viz-side {
          gap: 8px;
        }
      }

      /* STATUS BADGES */
      .badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 3px 8px;
        border-radius: 20px;
        font-size: 10.5px;
        font-weight: 600;
      }
      .badge-success {
        background: #ecfdf5;
        color: #059669;
      }
      .badge-warning {
        background: #fffbeb;
        color: #d97706;
      }
      .badge-danger {
        background: #fef2f2;
        color: #dc2626;
      }
      .badge-info {
        background: #eff6ff;
        color: #2563eb;
      }
      .badge-purple {
        background: #f5f3ff;
        color: #7c3aed;
      }
      .badge-gray {
        background: #f8fafc;
        color: #64748b;
        border: 1px solid var(--border);
      }
      .badge .dot {
        width: 5px;
        height: 5px;
        border-radius: 50%;
        background: currentColor;
      }
      .status-badge {
        width: 72px;
        justify-content: center;
        box-sizing: border-box;
        white-space: nowrap;
      }

      /* TABLE */
      .data-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 12px;
      }
      .data-table th {
        padding: 8px 12px;
        text-align: left;
        font-size: 10.5px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--text-muted);
        background: var(--surface-2);
        border-bottom: 1px solid var(--border);
      }
      .data-table td {
        padding: 10px 12px;
        border-bottom: 1px solid var(--border-light);
        color: var(--text-secondary);
      }
      .data-table tr:hover td {
        background: #fafbfc;
      }
      .data-table tr:last-child td {
        border-bottom: none;
      }
      .table-wrapper {
        overflow-x: auto;
        border-radius: var(--radius);
        border: 1px solid var(--border);
      }
      .table-wrapper.catalog-table-scroll {
        max-height: 560px;
        overflow-y: auto;
      }
      .table-wrapper.catalog-table-scroll .data-table th {
        position: sticky;
        top: 0;
        z-index: 1;
      }

      /* PROGRESS */
      .progress {
        height: 5px;
        background: var(--border);
        border-radius: 10px;
        overflow: hidden;
      }
      .progress-bar {
        height: 100%;
        border-radius: 10px;
        transition: width 0.6s ease;
      }
      .progress-blue {
        background: var(--accent);
      }
      .progress-green {
        background: var(--success);
      }
      .progress-orange {
        background: var(--orange);
      }
      .progress-purple {
        background: var(--purple);
      }
      .progress-red {
        background: var(--danger);
      }

      /* METRIC ROW */
      .metric-row {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 0;
        border-bottom: 1px solid var(--border-light);
      }
      .metric-row:last-child {
        border-bottom: none;
      }
      .metric-label {
        font-size: 12px;
        color: var(--text-secondary);
        flex: 1;
      }
      .metric-value {
        font-size: 12px;
        font-weight: 700;
        color: var(--text-primary);
        min-width: 60px;
        text-align: right;
      }
      .metric-bar {
        width: 90px;
      }

      /* SOURCE CARD */
      .source-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
      }
      .source-card {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 12px 14px;
        cursor: pointer;
        transition: all 0.15s;
        position: relative;
      }
      .source-card:hover {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px var(--accent-glow);
      }
      .source-card .src-icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        margin-bottom: 8px;
      }
      .source-card .src-name {
        font-size: 12px;
        font-weight: 700;
        color: var(--text-primary);
      }
      .source-card .src-type {
        font-size: 10.5px;
        color: var(--text-muted);
        margin-top: 2px;
      }
      .source-card .src-status {
        position: absolute;
        top: 10px;
        right: 10px;
      }

      /* PIPELINE STEPS */
      .pipeline-flow {
        display: flex;
        align-items: center;
        gap: 0;
        margin: 14px 0;
        overflow-x: auto;
        padding-bottom: 4px;
      }
      .pipeline-step {
        display: flex;
        align-items: center;
      }
      .step-box {
        background: var(--surface-2);
        border: 1.5px solid var(--border);
        border-radius: 8px;
        padding: 10px 14px;
        text-align: center;
        min-width: 90px;
        position: relative;
        transition: all 0.15s;
      }
      .step-box.done {
        background: #ecfdf5;
        border-color: #a7f3d0;
      }
      .step-box.running {
        background: #eff6ff;
        border-color: #bfdbfe;
        animation: pulse-border 1.5s infinite;
      }
      .step-box.error {
        background: #fef2f2;
        border-color: #fca5a5;
      }
      @keyframes pulse-border {
        0%,
        100% {
          border-color: #bfdbfe;
        }
        50% {
          border-color: #3b82f6;
        }
      }
      .step-icon {
        font-size: 16px;
        margin-bottom: 4px;
      }
      .step-name {
        font-size: 10px;
        font-weight: 700;
        color: var(--text-primary);
      }
      .step-data {
        font-size: 9.5px;
        color: var(--text-muted);
        margin-top: 2px;
        font-family: "IBM Plex Mono", monospace;
      }
      .step-arrow {
        width: 24px;
        height: 1px;
        background: var(--border);
        position: relative;
        flex-shrink: 0;
      }
      .step-arrow::after {
        content: "▶";
        position: absolute;
        right: -5px;
        top: -5px;
        font-size: 9px;
        color: var(--border);
      }

      /* LAYER CARDS */
      .layer-card {
        border-radius: var(--radius);
        padding: 14px 16px;
        margin-bottom: 10px;
      }
      .layer-bronze {
        background: linear-gradient(135deg, #fef3c7, #fde68a);
        border: 1px solid #fcd34d;
      }
      .layer-silver {
        background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
        border: 1px solid #cbd5e1;
      }
      .layer-gold {
        background: linear-gradient(135deg, #fff7ed, #fed7aa);
        border: 1px solid #fb923c;
      }
      .layer-title {
        font-size: 13px;
        font-weight: 800;
        display: flex;
        align-items: center;
        gap: 6px;
      }
      .layer-desc {
        font-size: 11.5px;
        color: var(--text-secondary);
        margin-top: 4px;
      }
      .layer-stats {
        display: flex;
        gap: 16px;
        margin-top: 10px;
      }
      .layer-stat {
        font-size: 11px;
      }
      .layer-stat strong {
        font-size: 16px;
        font-weight: 800;
        display: block;
      }

      /* DONUT CHART LEGEND */
      .legend-item {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 6px 0;
        border-bottom: 1px solid var(--border-light);
      }
      .legend-item:last-child {
        border-bottom: none;
      }
      .legend-dot {
        width: 10px;
        height: 10px;
        border-radius: 3px;
        flex-shrink: 0;
      }
      .legend-name {
        font-size: 12px;
        color: var(--text-secondary);
        flex: 1;
      }
      .legend-val {
        font-size: 12px;
        font-weight: 700;
        color: var(--text-primary);
      }
      .legend-pct {
        font-size: 10.5px;
        color: var(--text-muted);
        min-width: 35px;
        text-align: right;
      }

      /* SEARCH BAR */
      .search-bar {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 14px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 8px;
        margin-bottom: 16px;
      }
      .search-bar input {
        border: none;
        outline: none;
        font-size: 13px;
        color: var(--text-primary);
        width: 100%;
        background: transparent;
        font-family: inherit;
      }
      .search-bar input::placeholder {
        color: var(--text-muted);
      }

      /* FILTER ROW */
      .filter-row {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 16px;
        flex-wrap: wrap;
      }
      .filter-select {
        padding: 6px 12px;
        border: 1px solid var(--border);
        border-radius: 7px;
        font-size: 12px;
        color: var(--text-secondary);
        background: var(--surface);
        cursor: pointer;
        font-family: inherit;
        outline: none;
        min-width: 130px;
      }
      .filter-select:focus {
        border-color: var(--accent);
      }
      .add-btn {
        display: flex;
        align-items: center;
        gap: 6px;
        padding: 6px 14px;
        border-radius: 7px;
        background: var(--accent);
        color: white;
        border: none;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        font-family: inherit;
        margin-left: auto;
      }
      .add-btn:hover {
        background: #2563eb;
      }

      /* LINEAGE DIAGRAM */
      .lineage-grid-wrap {
        overflow-x: auto;
        padding: 12px 0;
      }
      .lineage-grid {
        display: grid;
        grid-template-columns: 150px 30px 164px 30px 206px 30px 206px 30px 164px 30px 180px;
        grid-template-rows: auto repeat(5, 76px);
        gap: 8px 0;
        min-width: 1220px;
      }
      .lineage-head {
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--text-muted);
        text-align: center;
        padding-bottom: 4px;
      }
      .lineage-arrow-col {
        grid-row: 1 / span 6;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--text-muted);
        font-size: 14px;
      }
      .lineage-cell {
        background: var(--surface-2);
        border: 1px solid var(--border);
        border-radius: 7px;
        padding: 8px 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        overflow: hidden;
      }
      .lineage-cell.source {
        background: #eff6ff;
        border-color: #bfdbfe;
      }
      .lineage-cell.transform {
        background: #fff7ed;
        border-color: #fed7aa;
      }
      .lineage-cell.target {
        background: #ecfdf5;
        border-color: #bbf7d0;
      }
      .lineage-cell.consumer {
        background: #f5f3ff;
        border-color: #ddd6fe;
      }
      .lineage-cell.merged {
        align-items: center;
        justify-content: center;
        padding: 14px 16px;
        text-align: center;
      }
      .lineage-stack {
        display: flex;
        flex-direction: column;
        gap: 4px;
        width: 100%;
        align-items: center;
        justify-content: center;
        text-align: center;
      }
      .lineage-stack.tight {
        gap: 3px;
      }
      .lineage-stack.relaxed {
        gap: 10px;
      }
      .lineage-title {
        font-size: 11px;
        font-weight: 700;
        line-height: 1.3;
        color: var(--text-primary);
      }
      .lineage-cell.source .lineage-title {
        color: var(--accent);
      }
      .lineage-cell.transform .lineage-title {
        color: #c2410c;
      }
      .lineage-cell.target .lineage-title {
        color: #059669;
      }
      .lineage-cell.consumer .lineage-title {
        color: #7c3aed;
      }
      .lineage-sub {
        font-size: 10px;
        font-weight: 500;
        line-height: 1.4;
        color: var(--text-secondary);
      }
      .lineage-id {
        font-family: inherit;
        font-size: 11px;
        font-weight: 700;
        line-height: 1.3;
        color: var(--text-primary);
        white-space: normal;
      }
      .lineage-cell.merged .lineage-stack {
        align-items: center;
        justify-content: center;
        max-width: 168px;
      }
      #page-lineage .data-table th,
      #page-lineage .data-table td {
        text-align: center;
        vertical-align: middle;
      }

      /* GOVERNANCE SCORE */
      .score-circle {
        width: 80px;
        height: 80px;
        border-radius: 50%;
        background: conic-gradient(
          var(--success) 0% 98.2%,
          var(--border) 98.2% 100%
        );
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
      }
      .score-inner {
        width: 62px;
        height: 62px;
        border-radius: 50%;
        background: var(--surface);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
      }
      .score-val {
        font-size: 16px;
        font-weight: 800;
        color: var(--success);
      }
      .score-label {
        font-size: 8px;
        color: var(--text-muted);
      }

      /* CHART CONTAINER */
      .chart-container {
        position: relative;
        height: 200px;
      }
      .chart-container-sm {
        position: relative;
        height: 160px;
      }
      .chart-container-lg {
        position: relative;
        height: 260px;
      }

      /* ALERTS */
      .alert-item {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        padding: 10px 14px;
        border-radius: 8px;
        margin-bottom: 8px;
        font-size: 12px;
      }
      .alert-danger {
        background: #fef2f2;
        border-left: 3px solid var(--danger);
      }
      .alert-warning {
        background: #fffbeb;
        border-left: 3px solid var(--warning);
      }
      .alert-success {
        background: #ecfdf5;
        border-left: 3px solid var(--success);
      }
      .alert-info {
        background: #eff6ff;
        border-left: 3px solid var(--accent);
      }
      .alert-icon {
        font-size: 14px;
      }
      .alert-content .title {
        font-weight: 700;
        color: var(--text-primary);
      }
      .alert-content .desc {
        color: var(--text-secondary);
        margin-top: 2px;
      }
      .alert-content .time {
        color: var(--text-muted);
        font-size: 10.5px;
        margin-top: 3px;
      }

      /* USER CARD */
      .user-card {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        border-radius: 8px;
        border: 1px solid var(--border);
        margin-bottom: 8px;
      }
      .uc-avatar {
        width: 34px;
        height: 34px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 13px;
        font-weight: 700;
        color: white;
        flex-shrink: 0;
      }
      .uc-info {
        flex: 1;
      }
      .uc-name {
        font-size: 12.5px;
        font-weight: 700;
        color: var(--text-primary);
      }
      .uc-role {
        font-size: 11px;
        color: var(--text-muted);
      }
      .uc-actions {
        display: flex;
        gap: 6px;
      }
      .icon-btn {
        width: 28px;
        height: 28px;
        border-radius: 6px;
        border: 1px solid var(--border);
        background: var(--surface);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 11px;
        color: var(--text-muted);
        transition: all 0.15s;
      }
      .icon-btn:hover {
        background: var(--surface-2);
        color: var(--accent);
        border-color: var(--accent);
      }

      /* STORAGE TIER */
      .tier-row {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 0;
        border-bottom: 1px solid var(--border-light);
      }
      .tier-row:last-child {
        border-bottom: none;
      }
      .tier-icon {
        width: 36px;
        height: 36px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        flex-shrink: 0;
      }
      .tier-info {
        flex: 1;
      }
      .tier-name {
        font-size: 12.5px;
        font-weight: 700;
        color: var(--text-primary);
      }
      .tier-desc {
        font-size: 11px;
        color: var(--text-muted);
        margin-top: 1px;
      }
      .tier-stats {
        text-align: right;
      }
      .tier-size {
        font-size: 14px;
        font-weight: 800;
        color: var(--text-primary);
      }
      .tier-pct {
        font-size: 10.5px;
        color: var(--text-muted);
      }

      /* COST CHART */
      .cost-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 0;
        border-bottom: 1px solid var(--border-light);
      }
      .cost-item:last-child {
        border-bottom: none;
      }
      .cost-name {
        flex: 1;
        font-size: 12px;
        color: var(--text-secondary);
      }
      .cost-amount {
        font-size: 13px;
        font-weight: 700;
        color: var(--text-primary);
      }
      .cost-change {
        font-size: 10.5px;
        color: var(--success);
      }
      .cost-change.up {
        color: var(--danger);
      }

      /* SECTION DIVIDER */
      .section-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 14px;
      }
      .section-title {
        font-size: 14px;
        font-weight: 700;
        color: var(--text-primary);
      }
      .section-sub {
        font-size: 12px;
        color: var(--text-muted);
        margin-top: 2px;
      }

      /* TABS */
      .tabs {
        display: flex;
        gap: 2px;
        background: var(--surface-2);
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 3px;
        margin-bottom: 16px;
      }
      .tab {
        padding: 6px 16px;
        border-radius: 6px;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
        color: var(--text-muted);
        transition: all 0.15s;
      }
      .tab.active {
        background: var(--surface);
        color: var(--text-primary);
        box-shadow: var(--shadow-sm);
      }
      .tab:hover:not(.active) {
        color: var(--text-secondary);
      }

      /* API card */
      .api-card {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 12px 14px;
        transition: all 0.15s;
        cursor: pointer;
      }
      .api-card:hover {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px var(--accent-glow);
      }
      .api-name {
        font-size: 12.5px;
        font-weight: 700;
        color: var(--text-primary);
      }
      .api-domain {
        font-size: 10.5px;
        color: var(--text-muted);
        margin-top: 2px;
      }
      .api-stats {
        display: flex;
        gap: 12px;
        margin-top: 8px;
      }
      .api-stat {
        font-size: 10.5px;
        color: var(--text-muted);
      }
      .api-stat strong {
        color: var(--text-primary);
        font-weight: 700;
      }

      /* DATA QUALITY DETAIL */
      .dq-metric {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 9px 0;
        border-bottom: 1px solid var(--border-light);
      }
      .dq-metric:last-child {
        border-bottom: none;
      }
      .dq-label {
        flex: 1;
        font-size: 12px;
        color: var(--text-secondary);
      }
      .dq-score {
        width: 80px;
      }
      .dq-pct {
        font-size: 12.5px;
        font-weight: 700;
        text-align: right;
        min-width: 45px;
      }
      .dq-pct.high {
        color: var(--success);
      }
      .dq-pct.med {
        color: var(--warning);
      }
      .dq-pct.low {
        color: var(--danger);
      }

      #page-lakehouse .dq-pct {
        overflow-wrap: anywhere;
        word-break: break-word;
      }

      /* LOG TABLE */
      .log-line {
        display: flex;
        gap: 12px;
        padding: 7px 12px;
        border-bottom: 1px solid var(--border-light);
        font-size: 11.5px;
        font-family: "IBM Plex Mono", monospace;
        align-items: center;
      }
      .log-line:hover {
        background: var(--surface-2);
      }
      .log-time {
        color: var(--text-muted);
        min-width: 135px;
      }
      .log-level {
        min-width: 55px;
      }
      .log-msg {
        flex: 1;
        color: var(--text-secondary);
      }
      .log-src {
        color: var(--text-muted);
        min-width: 130px;
        text-align: right;
      }

      /* RESPONSIVE */
      @media (max-width: 1280px) {
        .kpi-grid {
          grid-template-columns: repeat(3, 1fr);
        }
        .home-kpi-grid {
          grid-template-columns: repeat(4, minmax(0, 1fr));
        }
        .source-grid {
          grid-template-columns: repeat(3, 1fr);
        }
        .grid-2 {
          grid-template-columns: 1fr;
        }
      }

      /* SCROLLBAR */
      .content::-webkit-scrollbar-track {
        background: transparent;
      }

      /* QUICK STATS ROW */
      .quick-stats {
        display: flex;
        gap: 10px;
        margin-bottom: 16px;
        flex-wrap: wrap;
      }
      .qs {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 10px 16px;
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 140px;
      }
      .qs-icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 15px;
      }
      .qs-data .val {
        font-size: 16px;
        font-weight: 800;
        color: var(--text-primary);
      }
      .qs-data .lbl {
        font-size: 10.5px;
        color: var(--text-muted);
      }

      /* OVERVIEW PIPELINE STATUS */
      .pipe-status {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 9px 0;
        border-bottom: 1px solid var(--border-light);
      }
      .pipe-status:last-child {
        border-bottom: none;
      }
      .pipe-name {
        flex: 1;
        font-size: 12px;
        font-weight: 600;
        color: var(--text-primary);
      }
      .pipe-meta {
        font-size: 10.5px;
        color: var(--text-muted);
      }
      .pipe-time {
        font-size: 11px;
        color: var(--text-secondary);
        min-width: 90px;
        text-align: right;
      }

.topbar-actions {
  gap: 10px;
}

/* Local bootstrap and login surface. */
.dbos-access {
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 24px;
  color: #e6edf7;
  background:
    radial-gradient(circle at 12% 12%, rgba(22, 112, 163, 0.34), transparent 32rem),
    radial-gradient(circle at 88% 86%, rgba(12, 62, 105, 0.42), transparent 28rem),
    #07111f;
  font-family: "Plus Jakarta Sans", sans-serif;
}

.access-card {
  width: min(100%, 430px);
  box-sizing: border-box;
  padding: 42px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 24px;
  background: rgba(12, 25, 42, 0.94);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
}

/* Dark login card + dark-blue brand asset: render it white, as in the sidebar. */
.access-logo { width: 118px; height: 44px; object-fit: contain; filter: brightness(0) invert(1); }
.access-kicker { margin: 26px 0 8px; color: #7dd3fc; font: 700 11px/1.2 "IBM Plex Mono", monospace; letter-spacing: 0.13em; }
.access-card h1 { margin: 0; font-size: 29px; letter-spacing: -0.04em; }
.access-copy { margin: 12px 0 28px; color: #aab9c9; font-size: 14px; line-height: 1.6; }
.access-card form { display: grid; gap: 9px; }
.access-card label { margin-top: 7px; color: #cbd5e1; font-size: 12px; font-weight: 700; }
.access-card input { width: 100%; box-sizing: border-box; min-height: 44px; padding: 0 12px; border: 1px solid #31445c; border-radius: 10px; color: #edf5ff; background: #081625; font: 14px "Plus Jakarta Sans", sans-serif; }
.access-card input:focus { outline: 3px solid rgba(56, 189, 248, 0.2); border-color: #38bdf8; }
.access-card button { min-height: 46px; margin-top: 15px; border: 0; border-radius: 10px; color: #fff; background: #0878a8; cursor: pointer; font: 700 14px "Plus Jakarta Sans", sans-serif; }
.access-card button:disabled { cursor: wait; opacity: 0.62; }
.access-status { min-height: 20px; margin: 18px 0 0; color: #86efac; font-size: 13px; }
.access-status.is-error { color: #fca5a5; }

@media (max-width: 520px) {
  .dbos-access { padding: 16px; }
  .access-card { padding: 30px 24px; border-radius: 18px; }
}

/* V2 presentation layer */
body.dbos-v2-shell {
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.14), transparent 26%),
    linear-gradient(180deg, #eef4fb 0%, #f7f9fc 52%, #eef3f8 100%);
}

.dbos-v2-shell .app {
  background: transparent;
}

.dbos-v2-shell .sidebar {
  width: 264px;
  min-width: 264px;
  background:
    linear-gradient(180deg, rgba(6, 19, 39, 0.98) 0%, rgba(10, 28, 56, 0.98) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 18px 0 50px rgba(15, 23, 42, 0.18);
}

/* Brand block stacks: mark above, wordmark below. Height comes from the shared
   header variable so the sidebar header still lines up with the topbar. */
/* Mark and wordmark side by side, left-aligned to the SAME 18px rail the section
   labels and nav items use below — a centered block breaks that rail and reads
   as empty. Height comes from the shared header variable so the sidebar header
   stays flush with the topbar. */
/* Mark and wordmark side by side on the same 18px rail the nav uses below, with
   the wordmark centred against the logo's vertical midpoint — the lockup every
   comparable console uses. --brand-mark-h drives the logo height only; the row
   itself fills the shared header band so it stays flush with the topbar. */
.dbos-v2-shell .sidebar-logo {
  --brand-mark-h: 46px;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  height: var(--shell-header-h);
  min-height: var(--shell-header-h);
  padding: 0 18px;
  flex-shrink: 0;
}

/* The brand asset is dark blue on transparent. The sidebar is dark in BOTH
   themes, so instead of sitting the logo on a white chip we render it white —
   same treatment the other FOXAI consoles use. */
/* Full brand asset, slogan included — no crop. The box matches the PNG's own
   3:1.3 ratio (604x261) so `contain` letterboxes nothing; set the height and let
   the width follow. Rendered white because the sidebar is dark in both themes. */
.dbos-v2-shell .logo-image-wrap {
  width: auto;
  height: var(--brand-mark-h, 46px);
  display: block;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  flex-shrink: 0;
}

.dbos-v2-shell .logo-image {
  width: auto;
  height: 100%;
  object-fit: contain;
  object-position: left top;
  display: block;
  filter: brightness(0) invert(1);
}

.dbos-v2-shell .logo-text {
  text-align: left;
  justify-items: start;
}

.dbos-v2-shell .sidebar-section {
  padding-top: 14px;
}

.dbos-v2-shell .sidebar-section-label {
  padding: 0 18px 8px;
  color: rgba(191, 219, 254, 0.34);
}

.dbos-v2-shell .sidebar-item {
  margin: 2px 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border-left: none;
  color: rgba(226, 232, 240, 0.72);
  font-size: 13px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.dbos-v2-shell .sidebar-item:hover {
  transform: translateX(2px);
  background: rgba(59, 130, 246, 0.12);
  color: rgba(255, 255, 255, 0.92);
}

.dbos-v2-shell .sidebar-item:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: -2px;
  background: rgba(59, 130, 246, 0.16);
  color: #fff;
}

.dbos-v2-shell .sidebar-item.active {
  background:
    linear-gradient(180deg, rgba(59, 130, 246, 0.22) 0%, rgba(37, 99, 235, 0.12) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(96, 165, 250, 0.22),
    0 10px 24px rgba(15, 23, 42, 0.16);
}

.dbos-v2-shell .sidebar-item-label {
  flex: 1;
  min-width: 0;
}

.dbos-v2-shell .icon.icon-svg {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.88;
}

.dbos-v2-shell .icon.icon-svg svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dbos-v2-shell .sidebar-item.active .icon.icon-svg {
  opacity: 1;
}

.dbos-v2-shell .sidebar-user {
  margin: 18px 12px 12px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.36);
}

.dbos-v2-shell .sidebar-user-button {
  width: calc(100% - 24px);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.dbos-v2-shell .sidebar-user-button:hover,
.dbos-v2-shell .sidebar-user-button:focus-visible {
  border-color: rgba(125, 211, 252, 0.58);
  background: rgba(14, 116, 144, 0.2);
  outline: none;
}

/* Account page uses the app-wide card/form vocabulary; only the identity fact
   list stays bespoke, because no equivalent component exists elsewhere. */
.account-page { display: grid; gap: 16px; }
#page-account .grid-2 { align-items: start; }
.account-facts { display: grid; gap: 14px; margin: 0; }
.account-facts div { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; }
.account-facts dt { color: var(--text-secondary); font-size: 13px; }
.account-facts dd { margin: 0; font-weight: 700; }
.account-password-form { display: grid; gap: 10px; max-width: 320px; }
.account-password-form label { display: block; color: var(--text-muted); font-size: 11px; font-weight: 700; margin-bottom: 5px; }
.account-password-form .runtime-input { width: 100%; max-width: none; box-sizing: border-box; }
.account-password-form .action-btn { justify-self: start; margin-top: 2px; }
.account-status { min-height: 19px; margin: 6px 0 0; color: #15803d; font-size: 13px; }
.account-status.is-error { color: #dc2626; }
.account-signout { border-color: rgba(220, 38, 38, 0.38); color: #b91c1c; }
.account-signout:hover { border-color: #b91c1c; color: #b91c1c; background: rgba(220, 38, 38, 0.06); }


.dbos-v2-shell .sidebar-user .user-role {
  margin-top: 2px;
  line-height: 1.3;
  white-space: normal;
}

.dbos-v2-shell .topbar {
  min-height: var(--shell-header-h);
  height: var(--shell-header-h);
  padding: 14px 24px;
  align-items: center;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.dbos-v2-shell .topbar-primary {
  display: grid;
  gap: 6px;
}

.dbos-v2-shell .topbar-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #2563eb;
}

.dbos-v2-shell .topbar-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dbos-v2-shell .topbar-title {
  font-size: 22px;
  letter-spacing: -0.03em;
}

.dbos-v2-shell .topbar-sub {
  margin-left: 0;
  max-width: 860px;
  line-height: 1.45;
}

.dbos-v2-shell .topbar-context-cluster {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dbos-v2-shell .context-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(248, 250, 252, 0.9);
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.dbos-v2-shell .context-chip-live {
  background: rgba(220, 252, 231, 0.86);
  color: #166534;
  border-color: rgba(34, 197, 94, 0.24);
}

.dbos-v2-shell .context-chip.is-empty {
  color: #64748b;
  background: rgba(241, 245, 249, 0.84);
}

.dbos-v2-shell .context-chip.is-error {
  color: #991b1b;
  background: rgba(254, 226, 226, 0.94);
  border-color: rgba(239, 68, 68, 0.25);
}

.dbos-v2-shell .topbar-btn {
  min-width: 104px;
  min-height: 38px;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.08);
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.dbos-v2-shell .topbar-btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dbos-v2-shell .topbar-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dbos-v2-shell .topbar-btn:disabled {
  cursor: wait;
  opacity: 0.76;
}

.dbos-v2-shell .topbar-btn.is-loading svg {
  animation: topbar-refresh-spin 900ms linear infinite;
}

.dbos-v2-shell .topbar-btn.is-success {
  border-color: rgba(16, 185, 129, 0.36);
  color: #047857;
  background: rgba(236, 253, 245, 0.92);
}

.dbos-v2-shell .topbar-btn.is-error {
  border-color: rgba(239, 68, 68, 0.34);
  color: #b91c1c;
  background: rgba(254, 242, 242, 0.94);
}

@keyframes topbar-refresh-spin {
  to {
    transform: rotate(360deg);
  }
}

.dbos-v2-shell .lang-toggle-pill {
  min-width: 56px;
  justify-content: center;
  font-weight: 700;
}

.dbos-v2-shell .lang-toggle-pill.active {
  background: rgba(219, 234, 254, 0.96);
  color: #1d4ed8;
  box-shadow:
    inset 0 0 0 1px rgba(59, 130, 246, 0.22),
    0 2px 8px rgba(59, 130, 246, 0.14);
}

.dbos-v2-shell .notif-btn {
  width: 38px;
  height: 38px;
  position: relative;
}

.dbos-v2-shell .notif-btn .icon {
  display: inline-flex;
}

.dbos-v2-shell .notif-count {
  top: 5px;
  right: 5px;
}

.dbos-v2-shell .content {
  padding: 22px;
}

.dbos-v2-shell .page {
  display: grid;
  gap: 18px;
}

.dbos-v2-shell .page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.8fr);
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(248, 250, 252, 0.92) 100%);
  box-shadow:
    0 14px 42px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.dbos-v2-shell .page-eyebrow {
  font-size: 11px;
  font-weight: 800;
  color: #2563eb;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.dbos-v2-shell .page-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
}

.dbos-v2-shell .page-subtitle {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 820px;
}

.dbos-v2-shell .page-hero-note {
  align-self: stretch;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(30, 64, 175, 0.08), rgba(59, 130, 246, 0.04));
  color: #1e3a8a;
  font-size: 12px;
  line-height: 1.55;
  border: 1px solid rgba(59, 130, 246, 0.12);
}

.dbos-v2-shell .card,
.dbos-v2-shell .kpi-card {
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.96) 100%);
  box-shadow:
    0 14px 38px rgba(15, 23, 42, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.dbos-v2-shell .card-elevated {
  box-shadow:
    0 18px 44px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.dbos-v2-shell .card-muted {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.94) 0%, rgba(241, 245, 249, 0.96) 100%);
}

.dbos-v2-shell .card-header {
  align-items: flex-start;
  gap: 14px;
}

.dbos-v2-shell .card-header-stack {
  display: flex;
  justify-content: space-between;
}

.dbos-v2-shell .card-header-note {
  max-width: 260px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(241, 245, 249, 0.88);
  color: #475569;
  font-size: 11px;
  line-height: 1.55;
}

.dbos-v2-shell .card-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.dbos-v2-shell .card-sub {
  margin-top: 4px;
  line-height: 1.5;
}

.dbos-v2-shell .kpi-card {
  padding: 18px;
}

.dbos-v2-shell .kpi-card-hero {
  position: relative;
  overflow: hidden;
}

.dbos-v2-shell .kpi-card-hero::after {
  content: "";
  position: absolute;
  inset: auto -20px -24px auto;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.12), transparent 68%);
}

.dbos-v2-shell .kpi-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.dbos-v2-shell .kpi-value {
  margin-top: 10px;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.05em;
}

.dbos-v2-shell .kpi-change {
  margin-top: 10px;
  line-height: 1.5;
}

.dbos-v2-shell .empty-state {
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.3);
  background: rgba(248, 250, 252, 0.8);
  color: #64748b;
}

.dbos-v2-shell .home-command-grid,
.dbos-v2-shell .dashboard-primary-grid {
  align-items: stretch;
}

.dbos-v2-shell .home-selection-summary-v2 {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(241, 245, 249, 0.86);
}

.dbos-v2-shell .home-topic-card {
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.96));
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.dbos-v2-shell .home-topic-card.active {
  border-color: rgba(59, 130, 246, 0.28);
  box-shadow:
    0 18px 30px rgba(37, 99, 235, 0.1),
    inset 0 0 0 1px rgba(96, 165, 250, 0.26);
}

.dbos-v2-shell .home-topic-meta {
  margin-top: 10px;
}

.dbos-v2-shell .home-domain-btn {
  border-radius: 999px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  background: rgba(255, 255, 255, 0.9);
}

.dbos-v2-shell .home-domain-btn.active {
  border-color: rgba(59, 130, 246, 0.24);
  background: rgba(219, 234, 254, 0.88);
  color: #1d4ed8;
}

.dbos-v2-shell .dashboard-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dbos-v2-shell .dashboard-storage-layout {
  display: flex;
  align-items: center;
  gap: 20px;
}

.dbos-v2-shell .dashboard-donut-canvas {
  max-width: 148px;
  max-height: 148px;
}

.dbos-v2-shell .dashboard-storage-legend {
  flex: 1;
}

.dbos-v2-shell .dashboard-metric-stack {
  margin-top: 16px;
}

.dbos-v2-shell .dashboard-cluster-card {
  margin-bottom: 20px;
}

.dbos-v2-shell .dashboard-cluster-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 28px;
}

.dbos-v2-shell .dashboard-metric-tag {
  min-width: 48px;
  font-size: 11px;
}

.dbos-v2-shell .dashboard-pending-card {
  padding-top: 18px;
}

.dbos-v2-shell .dashboard-pending-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.dbos-v2-shell .dashboard-pending-item {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(203, 213, 225, 0.75);
  background: rgba(255, 255, 255, 0.78);
}

.dbos-v2-shell .dashboard-pending-item-wide {
  grid-column: 1 / -1;
}

.dbos-v2-shell .dashboard-pending-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.dbos-v2-shell .dashboard-pending-copy {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: #475569;
}

.dbos-v2-shell .pipeline-kpi-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dbos-v2-shell .pipeline-focus-card,
.dbos-v2-shell .pipeline-log-card {
  margin-bottom: 18px;
}

.pipeline-focus-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.pipeline-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(248, 250, 252, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.pipeline-view-toggle-btn {
  min-width: 108px;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.pipeline-view-toggle-btn:hover {
  color: var(--text-primary);
}

.pipeline-view-toggle-btn.active {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.16), rgba(59, 130, 246, 0.08));
  color: #1d4ed8;
  box-shadow:
    0 8px 18px rgba(59, 130, 246, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.dbos-v2-shell .pipeline-run-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.dbos-v2-shell .pipeline-run-metric {
  padding: 12px;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.94);
  text-align: center;
}

.dbos-v2-shell .pipeline-run-metric-value {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.dbos-v2-shell .pipeline-run-metric-value-success {
  color: var(--success);
}

.dbos-v2-shell .pipeline-run-metric-value-warning {
  color: var(--warning);
}

.dbos-v2-shell .pipeline-run-metric-value-running {
  color: #2563eb;
}

.dbos-v2-shell .pipeline-run-metric-value-queued {
  color: #d97706;
}

.dbos-v2-shell .pipeline-run-metric-value-danger {
  color: var(--danger);
}

.dbos-v2-shell .pipeline-run-metric-label {
  margin-top: 6px;
  font-size: 11px;
  color: #64748b;
}

.dbos-v2-shell .pipeline-search-bar {
  margin-bottom: 10px;
}

.dbos-v2-shell .pipeline-side-panels {
  margin-bottom: 12px;
}

.dbos-v2-shell .pipeline-side-title {
  margin-bottom: 8px;
}

.dbos-v2-shell .pipeline-panel-box {
  min-height: 116px;
  padding: 10px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.78);
}

.dbos-v2-shell .runtime-list,
.dbos-v2-shell .log-box,
.dbos-v2-shell .task-flow {
  border-radius: 14px;
}

.dbos-v2-shell .pipeline-flow {
  background: rgba(248, 250, 252, 0.82);
}

@media (max-width: 1280px) {
  .dbos-v2-shell .dashboard-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dbos-v2-shell .page-hero {
    grid-template-columns: 1fr;
  }

  .pipeline-simple-flow {
  }

  .pipeline-simple-track {
    gap: 0;
  }

  .pipeline-simple-stage {
    flex-basis: 112px;
    min-width: 112px;
    min-height: 72px;
    padding: 7px 8px;
  }

  .pipeline-simple-arrow {
    flex-basis: 14px;
    width: 14px;
    min-width: 14px;
    margin-inline: 3px;
  }

  .pipeline-simple-arrow::after {
    right: -4px;
    top: -4px;
    font-size: 8px;
  }

  .pipeline-simple-stage-kicker {
    font-size: 8.5px;
  }

  .pipeline-simple-stage-title {
    font-size: 10px;
  }

  .pipeline-simple-stage-state {
    min-width: 50px;
    min-height: 20px;
    font-size: 8.5px;
  }
}

@media (max-width: 980px) {
  .dbos-v2-shell .sidebar-logo,
  .dbos-v2-shell .topbar {
    height: auto;
    min-height: 0;
  }

  .dbos-v2-shell .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .dbos-v2-shell .topbar-spacer {
    display: none;
  }

  .dbos-v2-shell .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .dbos-v2-shell .dashboard-pending-grid {
    grid-template-columns: 1fr;
  }

  .dbos-v2-shell .pipeline-run-metrics,
  .dbos-v2-shell .pipeline-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .dbos-v2-shell .content {
    padding: 14px;
  }

  .dbos-v2-shell .dashboard-kpi-grid,
  .dbos-v2-shell .dashboard-cluster-metrics,
  .dbos-v2-shell .pipeline-run-metrics,
  .dbos-v2-shell .pipeline-kpi-grid {
    grid-template-columns: 1fr;
  }

  .dbos-v2-shell .topbar-title {
    font-size: 19px;
  }
}

.topbar-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.kpi-value {
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.kpi-change,
.card-sub,
.src-type,
.tier-desc,
.tier-size,
.metric-label,
.metric-value,
.metric-val,
.dq-pct,
.lineage-node,
.log-msg {
  overflow-wrap: anywhere;
}

.dbos-v2-shell .topbar-sub,
.dbos-v2-shell .page-subtitle,
.dbos-v2-shell .page-hero-note,
.dbos-v2-shell .card-header-note,
.dbos-v2-shell .kpi-change,
.dbos-v2-shell .home-selection-summary-v2,
.dbos-v2-shell .card-sub:not([role="status"]),
.dbos-v2-shell .viz-subtitle,
.dbos-v2-shell .viz-card-sub,
.dbos-v2-shell .lineage-sub {
  display: none !important;
}

.logo-image-wrap {
  width: 80px;
  height: 34px;
  border-radius: 8px;
  background: #ffffff;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 2px 6px;
  flex-shrink: 0;
}

.logo-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: contrast(1.08) saturate(1.08) brightness(1.02);
}

.runtime-input {
  flex: 1 1 150px;
  width: auto;
  max-width: 220px;
  min-width: 0;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 11px;
  font-family: inherit;
  outline: none;
}

.runtime-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.runtime-input-sm {
  flex: 0 1 88px;
  max-width: 92px;
}

.settings-runtime-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.settings-runtime-grid label {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.settings-runtime-grid .runtime-input {
  width: 100%;
  max-width: none;
}

.source-connection-card {
  margin-top: 16px;
}

.source-connection-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 12px;
}

.source-connection-form label {
  display: grid;
  gap: 5px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.source-connection-form .runtime-input {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.source-connection-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.source-connection-result {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.source-connection-result.is-success {
  color: #15803d;
  font-weight: 700;
}

.source-connection-result.is-error {
  color: #b91c1c;
  font-weight: 700;
}

.source-records {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.source-records-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.source-records-head h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 800;
}

.source-records-head span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.ingest-page-head { margin: 0 0 16px; }
.ingest-page-head h2 { margin: 0; color: var(--text-primary); font-size: 25px; letter-spacing: -0.035em; }

.ingest-workspace { display: grid; gap: 16px; }
.ingest-connection-card, .ingest-bind-card, .ingest-registry-card { margin: 0; }
.ingest-card-header, .ingest-registry-header { align-items: flex-start; }
.ingest-connection-card .source-connection-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.source-binding-flow { display: grid; gap: 14px; }
.source-binding-selection { display: flex; align-items: baseline; gap: 10px; min-height: 0; padding: 11px 13px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.source-binding-selection > span { color: var(--text-muted); font-size: 11px; font-weight: 700; }
.source-binding-selection strong { color: var(--text-primary); font-size: 12.5px; }
.source-binding-key-field { display: grid; gap: 5px; color: var(--text-muted); font-size: 11px; font-weight: 700; }
.source-binding-key-field .runtime-input { width: 100%; max-width: none; box-sizing: border-box; }
.source-binding-dags { display: grid; gap: 8px; }
.source-binding-dags-head { display: flex; justify-content: space-between; gap: 10px; color: var(--text-primary); font-size: 11.5px; font-weight: 800; }
.source-binding-dags-head span:last-child { color: var(--text-muted); font-size: 10.5px; font-weight: 700; }
.source-binding-dag-list { display: grid; grid-template-columns: minmax(0, 1fr); max-height: 300px; overflow: auto; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.source-binding-dag-option { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--border); background: transparent; cursor: pointer; }
.source-binding-dag-option:last-child { border-bottom: 0; }
.source-binding-dag-option:hover { background: rgba(59, 130, 246, 0.045); }
.source-binding-dag-option span { display: grid; min-width: 0; gap: 2px; }
.source-binding-dag-option strong { overflow: hidden; color: var(--text-primary); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.source-binding-dag-option small { overflow: hidden; color: var(--text-muted); font-family: "IBM Plex Mono", monospace; font-size: 9.5px; text-overflow: ellipsis; white-space: nowrap; }
.source-binding-dag-toggle {
  order: 2;
  flex: 0 0 auto;
  width: 38px;
  height: 22px;
  margin: 0 0 0 auto;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: #cbd5e1;
  cursor: pointer;
  transition: background 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.source-binding-dag-toggle::after {
  display: block;
  width: 18px;
  height: 18px;
  margin: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.24);
  content: "";
  transform: translateX(0);
  transition: transform 160ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.source-binding-dag-toggle:checked { background: #059669; }
.source-binding-dag-toggle:checked::after { transform: translateX(16px); }
.source-binding-dag-toggle:focus-visible { outline: 3px solid rgba(16, 185, 129, 0.35); outline-offset: 2px; }
.source-binding-actions { display: flex; align-items: center; gap: 10px; padding-top: 2px; }
.source-select-btn, .source-browse-btn, .source-binding-remove { min-width: 72px; padding: 7px 10px; font-size: 10.5px; }
.source-browse-btn { margin-right: 7px; border-color: rgba(15, 118, 110, 0.28); color: #0f766e; }
.source-browse-btn:hover { border-color: rgba(15, 118, 110, 0.62); background: rgba(204, 251, 241, 0.72); }
.source-select-btn.is-selected { border-color: rgba(59, 130, 246, 0.65); background: rgba(59, 130, 246, 0.12); color: #1d4ed8; }
.source-binding-remove { border-color: rgba(239, 68, 68, 0.24); color: #b91c1c; }
.source-binding-remove:hover { border-color: rgba(239, 68, 68, 0.46); background: rgba(254, 226, 226, 0.7); }
.ingest-registry-card { margin-top: 16px; }
.registry-count { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; background: rgba(59, 130, 246, 0.1); color: #1d4ed8; font-size: 10.5px; font-weight: 800; }
.source-binding-registry { margin-bottom: 8px; }

.trigger-source-section { display: grid; gap: 11px; padding: 15px 16px; border: 1px solid rgba(59, 130, 246, 0.25); border-radius: 14px; background: linear-gradient(135deg, rgba(239, 246, 255, 0.88), rgba(255, 255, 255, 0.92)); }
.trigger-source-head { display: flex; justify-content: space-between; gap: 12px; }
.trigger-source-mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.trigger-source-mode { display: flex; gap: 9px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 11px; background: rgba(255, 255, 255, 0.86); cursor: pointer; }
.trigger-source-mode.active { border-color: rgba(59, 130, 246, 0.6); box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1); }
.trigger-source-mode.is-disabled { cursor: not-allowed; opacity: 0.58; }
.trigger-source-mode input, .trigger-source-binding-option input { width: 15px; height: 15px; margin: 1px 0 0; accent-color: var(--accent); }
.trigger-source-mode span, .trigger-source-binding-option span { display: grid; gap: 3px; }
.trigger-source-mode strong, .trigger-source-binding-option strong { color: var(--text-primary); font-size: 11.5px; }
.trigger-source-mode small, .trigger-source-binding-option small { color: var(--text-secondary); font-size: 10.5px; line-height: 1.4; }
.trigger-source-mode code { font-family: "IBM Plex Mono", monospace; font-size: 9.5px; }
.trigger-source-binding-list { display: grid; gap: 7px; }
.trigger-source-binding-list.is-hidden { display: none; }
.trigger-source-binding-option { display: flex; gap: 9px; padding: 10px 11px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255, 255, 255, 0.72); cursor: pointer; }

.source-records-table {
  min-width: 680px;
}

.source-browser-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 0 0 16px; }
.source-browser-head h2 { margin: 4px 0 5px; color: var(--text-primary); font-size: 26px; letter-spacing: -0.04em; }
.source-browser-meta, .source-browser-path { margin: 0; color: var(--text-muted); font-family: "IBM Plex Mono", monospace; font-size: 10.5px; line-height: 1.5; }
.source-browser-meta:empty, .source-browser-status:empty { display: none; }
.text-action { padding: 0; border: 0; background: transparent; color: #0f766e; font-size: 11px; font-weight: 800; cursor: pointer; }
.text-action:hover { color: #115e59; text-decoration: underline; }
.source-browser-workspace { display: grid; grid-template-columns: minmax(230px, 0.58fr) minmax(0, 1.42fr); min-height: 500px; border: 1px solid var(--border); border-radius: 15px; overflow: hidden; background: var(--surface); }
.source-browser-tree-pane, .source-browser-preview-pane { min-width: 0; padding: 18px; }
.source-browser-tree-pane { border-right: 1px solid var(--border); background: linear-gradient(180deg, var(--surface-2), var(--surface)); }
.source-browser-pane-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.source-browser-pane-head h3 { margin: 4px 0 0; color: var(--text-primary); font-size: 15px; letter-spacing: -0.02em; }
.source-browser-head-actions { display: flex; gap: 8px; }
.source-browser-count { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 999px; background: rgba(15, 118, 110, 0.1); color: #0f766e; font-size: 9.5px; font-weight: 850; letter-spacing: 0.03em; text-transform: uppercase; white-space: nowrap; }
.source-browser-status { display: block; margin: 0 0 10px; color: var(--text-muted); font-size: 11px; line-height: 1.45; }
.source-browser-status.is-error { color: #b91c1c; font-weight: 700; }
.source-browser-tree { display: grid; gap: 4px; }
.source-browser-branch { display: grid; gap: 4px; }
.source-browser-branch-schema { margin-left: 13px; padding-left: 11px; border-left: 1px solid rgba(15, 118, 110, 0.16); }
.source-browser-branch-table { margin-left: 13px; padding-left: 11px; border-left: 1px solid rgba(15, 118, 110, 0.1); }
.source-browser-node { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 7px 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text-secondary); font-family: "IBM Plex Mono", monospace; font-size: 10.5px; text-align: left; cursor: pointer; }
.source-browser-node:hover { background: rgba(15, 118, 110, 0.06); color: var(--text-primary); }
.source-browser-node.is-active { border-color: rgba(15, 118, 110, 0.24); background: rgba(204, 251, 241, 0.58); color: #115e59; font-weight: 800; }
.source-browser-node-marker { flex: 0 0 auto; width: 22px; color: #0f766e; font-size: 8px; font-weight: 900; letter-spacing: 0.04em; }
.source-browser-table-entry { display: flex; align-items: center; gap: 5px; }
.source-browser-table-entry > input { flex: 0 0 auto; margin: 0; accent-color: var(--accent); }
.source-browser-table-entry .source-browser-node { flex: 1 1 auto; }
.source-browser-empty { padding: 7px 8px; color: var(--text-muted); font-size: 10px; font-style: italic; }
.source-browser-preview { min-height: 365px; padding-top: 8px; }
.source-browser-table-wrap { max-height: 420px; overflow: auto; border-radius: 11px; }
.source-browser-table { min-width: max-content; }
.source-browser-table th, .source-browser-table td { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-browser-sql { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.source-browser-sql-code { min-height: 70px; max-height: 260px; margin: 0; padding: 13px; overflow: auto; border: 1px solid #19324a; border-radius: 10px; background: #0d1b2a; color: #d6f0ea; font: 12px/1.55 "IBM Plex Mono", monospace; white-space: pre-wrap; }

/* Custom Pipeline Builder: the code surface is intentional, but template ownership stays visible. */
.pipeline-builder-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.pipeline-builder-head h2 { font-size: 28px; letter-spacing: -0.04em; }
.pipeline-builder-head-actions { display: flex; gap: 8px; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.pipeline-builder-layout { display: block; }
.pipeline-builder-main { min-width: 0; }
.pipeline-builder-draft-list { display: grid; gap: 12px; max-height: calc(100vh - 260px); overflow: auto; }
.pipeline-builder-draft-group { display: grid; gap: 5px; }
.pipeline-builder-draft-group > strong { font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--text-secondary); }
.pipeline-builder-version, .pipeline-builder-task-item { border: 1px solid var(--border); background: var(--surface-2); border-radius: 8px; padding: 9px 10px; text-align: left; color: var(--text-primary); cursor: pointer; display: grid; gap: 3px; }
.pipeline-builder-version:hover, .pipeline-builder-task-item:hover { border-color: var(--accent-light); }
.pipeline-builder-version.is-active, .pipeline-builder-task-item.is-active { border-color: var(--accent); background: var(--accent-glow); }
.pipeline-builder-version span, .pipeline-builder-task-item strong { font-family: "IBM Plex Mono", monospace; font-size: 12px; overflow-wrap: anywhere; }
.pipeline-builder-version small, .pipeline-builder-task-item span { color: var(--text-muted); font-size: 10px; }
.pipeline-builder-main { display: grid; gap: 18px; }
.pipeline-builder-project-fields, .pipeline-builder-task-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 16px; }
.pipeline-builder-project-fields label, .pipeline-builder-task-fields label { display: grid; gap: 6px; color: var(--text-secondary); font-size: 12px; font-weight: 700; }
.pipeline-builder-description { grid-column: 1 / -1; }
.pipeline-builder-dag-card { min-width: 0; }
.pipeline-builder-task-top { display: grid; grid-template-columns: 172px minmax(0, 1fr); gap: 15px; }
.pipeline-builder-task-top .pipeline-builder-task-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 0; }
.pipeline-builder-task-top .pipeline-builder-description { grid-column: auto; }
.pipeline-builder-task-list { display: grid; align-content: start; gap: 7px; max-height: 122px; overflow: auto; padding-right: 3px; }
.pipeline-builder-editor { min-width: 0; margin-top: 16px; }
.pipeline-builder-code-head { display: flex; justify-content: space-between; gap: 14px; color: var(--text-secondary); font-size: 12px; font-weight: 700; margin: 14px 0 7px; }
.pipeline-builder-code { width: 100%; min-height: 270px; resize: vertical; padding: 15px; border: 1px solid #19324a; border-radius: 10px; background: #0d1b2a; color: #d6f0ea; font: 13px/1.6 "IBM Plex Mono", monospace; tab-size: 2; }
.pipeline-builder-dag-code { min-height: 190px; margin-top: 14px; }
.pipeline-builder-code:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.danger-text { color: var(--danger) !important; }
.pipeline-builder-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pipeline-builder-status { display: block; color: var(--text-muted); font-size: 11px; margin: 10px 0; }
.pipeline-builder-status.is-error { color: var(--danger); }
.pipeline-builder-status.is-success { color: var(--success); }
.pipeline-builder-deployment-log { display: grid; gap: 4px; margin: 0 0 10px; padding: 0; list-style: none; color: var(--text-secondary); font-size: 11px; }
.pipeline-builder-deployment-log:empty { display: none; }
.pipeline-builder-deployment-log li::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 7px 1px 1px; border-radius: 50%; background: var(--accent); }
.pipeline-builder-generated { display: grid; gap: 8px; }
.pipeline-builder-generated-file { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.pipeline-builder-generated-file summary { cursor: pointer; padding: 10px 12px; color: var(--text-secondary); font: 12px "IBM Plex Mono", monospace; }
.pipeline-builder-generated-file pre { overflow: auto; max-height: 360px; margin: 0; padding: 14px; border-top: 1px solid var(--border); background: #0d1b2a; color: #d6f0ea; font: 12px/1.55 "IBM Plex Mono", monospace; }
.pipeline-builder-draft-dialog { position: fixed; inset: 0; margin: auto; width: min(520px, calc(100vw - 32px)); max-height: min(680px, calc(100vh - 48px)); padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text-primary); box-shadow: var(--shadow-lg); }
.pipeline-builder-draft-dialog::backdrop { background: rgba(15, 23, 42, 0.44); backdrop-filter: blur(2px); }
.pipeline-builder-draft-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pipeline-builder-draft-dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.pipeline-builder-draft-entry { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; align-items: center; }
.pipeline-builder-draft-entry input { margin: 0; accent-color: var(--accent); }
.pipeline-builder-draft-dialog h3 { font-size: 16px; }
body.dark-mode .pipeline-builder-version, body.dark-mode .pipeline-builder-task-item, body.dark-mode .pipeline-builder-status, body.dark-mode .pipeline-builder-generated-file, body.dark-mode .pipeline-builder-draft-dialog { background: var(--surface-2); }

.notif-btn {
  flex: 0 0 auto;
}

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

.home-topic-card {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: inherit;
  text-align: left;
  cursor: pointer;
  padding: 14px;
  font: inherit;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.home-topic-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.home-topic-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.home-topic-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.home-topic-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.home-topic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.home-topic-note {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
}

.home-domain-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.home-domain-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  padding: 8px 12px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.home-domain-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.home-domain-btn.active {
  background: rgba(59, 130, 246, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}

.home-selection-summary {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 11.5px;
  line-height: 1.55;
}

.runtime-grid {
  display: grid;
  grid-template-columns: minmax(312px, 340px) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.pipeline-airflow-shell {
  display: grid;
  gap: 16px;
}

.pipeline-airflow-hero {
  padding: 18px 20px;
}

.pipeline-airflow-hero-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.pipeline-airflow-eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.pipeline-airflow-title {
  font-size: 18px;
  line-height: 1.2;
}

.pipeline-airflow-sub {
  font-size: 12px;
  max-width: 720px;
}

.pipeline-airflow-summary-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.pipeline-summary-chip {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  gap: 6px;
}

.pipeline-summary-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.pipeline-summary-value,
.pipeline-metric-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.pipeline-summary-value.is-success,
.pipeline-metric-value.is-success {
  color: var(--success);
}

.pipeline-summary-value.is-warning,
.pipeline-metric-value.is-warning {
  color: var(--warning);
}

.pipeline-summary-value.is-danger,
.pipeline-metric-value.is-danger {
  color: var(--danger);
}

.pipeline-summary-value.is-info {
  color: var(--info);
}

.pipeline-airflow-workspace {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr) minmax(300px, 360px);
  gap: 16px;
  align-items: start;
}

.pipeline-pane {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.pipeline-pane-fill {
  min-height: 0;
}

.pipeline-pane-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.pipeline-search-bar {
  margin-bottom: 12px;
}

.pipeline-dag-list {
  max-height: 720px;
}

.pipeline-runtime-actions {
  margin-bottom: 0;
}

.pipeline-run-grid {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 16px;
}

.pipeline-run-list {
  max-height: 240px;
}

.pipeline-run-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.pipeline-metric-tile {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  padding: 10px 12px;
  display: grid;
  gap: 6px;
}

.pipeline-metric-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.pipeline-run-summary {
  min-height: 132px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

.pipeline-simple-flow {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 6px;
  scrollbar-width: thin;
  scroll-padding-inline: 2px;
}

.pipeline-simple-track {
  display: flex;
  width: max-content;
  min-width: 100%;
  justify-content: center;
  align-items: stretch;
  gap: 0;
}

.pipeline-simple-stage {
  flex: 0 0 124px;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 6px;
  min-width: 124px;
  min-height: 76px;
  padding: 8px 9px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  box-shadow:
    0 10px 22px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  overflow: hidden;
  text-align: left;
  font-family: inherit;
  color: var(--text-primary);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.pipeline-simple-arrow {
  flex: 0 0 18px;
  width: 18px;
  min-width: 18px;
  position: relative;
  align-self: center;
  height: 1px;
  margin-inline: 4px;
  background: rgba(148, 163, 184, 0.55);
}

.pipeline-simple-arrow::before {
  content: "";
  position: absolute;
  left: -2px;
  top: -1px;
  width: 10px;
  height: 3px;
  border-radius: 999px;
  opacity: 0;
  background: linear-gradient(90deg, rgba(59, 130, 246, 0), rgba(59, 130, 246, 0.9), rgba(147, 197, 253, 0));
}

.pipeline-simple-arrow::after {
  content: "▶";
  position: absolute;
  right: -4px;
  top: -5px;
  font-size: 9px;
  line-height: 1;
  color: rgba(100, 116, 139, 0.78);
  transition: color 0.18s ease, text-shadow 0.18s ease;
}

.pipeline-simple-arrow.is-flowing::before {
  animation: pipeline-simple-arrow-flow 1.1s linear infinite;
}

.pipeline-simple-arrow.is-flowing::after {
  color: #3b82f6;
  text-shadow: 0 0 8px rgba(59, 130, 246, 0.28);
}

@keyframes pipeline-simple-arrow-flow {
  0% {
    transform: translateX(0);
    opacity: 0;
  }
  15% {
    opacity: 0.9;
  }
  85% {
    opacity: 0.9;
  }
  100% {
    transform: translateX(14px);
    opacity: 0;
  }
}

button.pipeline-simple-stage {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.pipeline-simple-stage::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 12px 0 0 12px;
  background: rgba(148, 163, 184, 0.55);
}

.pipeline-simple-stage.is-clickable:hover {
  transform: translateY(-1px);
}

.pipeline-simple-stage.is-idle {
  border-color: #cbd5e1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
}

.pipeline-simple-stage.is-idle::before {
  background: linear-gradient(180deg, #cbd5e1, #94a3b8);
}

.pipeline-simple-stage.is-idle .pipeline-simple-stage-state,
.pipeline-simple-stage.is-unused .pipeline-simple-stage-state,
.pipeline-simple-stage.is-idle .pipeline-simple-stage-action,
.pipeline-simple-stage.is-unused .pipeline-simple-stage-action {
  color: #64748b;
}

.pipeline-simple-stage.is-success {
  border-color: #a7f3d0;
  background:
    linear-gradient(180deg, rgba(236, 253, 245, 0.98), rgba(219, 252, 233, 0.94));
}

.pipeline-simple-stage.is-success::before {
  background: linear-gradient(180deg, #34d399, #059669);
}

.pipeline-simple-stage.is-running {
  border-color: #93c5fd;
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.99), rgba(219, 234, 254, 0.95));
  animation: pipeline-graph-node-running-pulse 1.6s infinite;
}

.pipeline-simple-stage.is-running::before {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.pipeline-simple-stage.is-queued {
  border-color: #fcd34d;
  background:
    linear-gradient(180deg, rgba(255, 251, 235, 0.99), rgba(254, 243, 199, 0.95));
}

.pipeline-simple-stage.is-queued::before {
  background: linear-gradient(180deg, #fbbf24, #d97706);
}

.pipeline-simple-stage.is-retry {
  border-color: #c4b5fd;
  background:
    linear-gradient(180deg, rgba(245, 243, 255, 0.99), rgba(237, 233, 254, 0.95));
}

.pipeline-simple-stage.is-retry::before {
  background: linear-gradient(180deg, #a78bfa, #7c3aed);
}

.pipeline-simple-stage.is-failed {
  border-color: #fca5a5;
  background:
    linear-gradient(180deg, rgba(254, 242, 242, 0.98), rgba(254, 226, 226, 0.94));
}

.pipeline-simple-stage.is-failed::before {
  background: linear-gradient(180deg, #f87171, #dc2626);
}

.pipeline-simple-stage.is-skipped {
  border-color: #fdba74;
  background:
    linear-gradient(180deg, rgba(255, 247, 237, 0.98), rgba(255, 237, 213, 0.95));
}

.pipeline-simple-stage.is-skipped::before {
  background: linear-gradient(180deg, #fb923c, #c2410c);
}

.pipeline-simple-stage.is-unused {
  border-color: #cbd5e1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  filter: saturate(0.76);
  opacity: 0.7;
}

.pipeline-simple-stage-top {
  display: block;
  min-width: 0;
}

.pipeline-simple-stage-kicker {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.25;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pipeline-simple-stage-title {
  margin-top: 3px;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.3;
  color: inherit;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.pipeline-simple-stage-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  justify-self: center;
  min-width: 54px;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #f1f5f9;
  color: #64748b;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.pipeline-simple-stage.is-success .pipeline-simple-stage-state {
  background: #dff8ec;
  border-color: #86efac;
  color: #047857;
}

.pipeline-simple-stage.is-running .pipeline-simple-stage-state {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #2563eb;
}

.pipeline-simple-stage.is-queued .pipeline-simple-stage-state {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #b45309;
}

.pipeline-simple-stage.is-retry .pipeline-simple-stage-state {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #7c3aed;
}

.pipeline-simple-stage.is-failed .pipeline-simple-stage-state {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

.pipeline-simple-stage.is-skipped .pipeline-simple-stage-state {
  background: #ffedd5;
  border-color: #fdba74;
  color: #c2410c;
}

.pipeline-simple-stage.is-idle .pipeline-simple-stage-state,
.pipeline-simple-stage.is-unused .pipeline-simple-stage-state {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
}

.pipeline-graph-flow {
  margin: 0;
  padding-bottom: 0;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}

.pipeline-graph-flow .pipeline-step {
  flex: 1 1 170px;
  min-width: 0;
}

.pipeline-graph-flow .step-arrow {
  display: none;
}

.pipeline-graph-flow .step-box {
  min-height: 108px;
  height: 100%;
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 12px;
}

.pipeline-task-section {
  margin-top: 16px;
  border-top: 1px solid var(--border-light);
  padding-top: 14px;
}

.pipeline-task-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.pipeline-task-flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  min-height: 120px;
}

.pipeline-log-box {
  min-height: 720px;
  max-height: 720px;
  border-radius: 10px;
}

.runtime-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 380px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px 8px 8px 6px;
  scroll-padding: 8px;
  scrollbar-gutter: stable both-edges;
}

.runtime-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  padding: 9px 10px;
  box-shadow: none;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.runtime-item:hover,
.runtime-item.active {
  border-color: var(--accent);
  background: #eff6ff;
  color: var(--accent);
}

.runtime-item strong {
  color: var(--text-primary);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.runtime-item-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.runtime-item-sub,
.runtime-item-meta {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.35;
  font-family: "IBM Plex Mono", monospace;
}

.dag-state-action {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.dag-state-action:hover .badge {
  filter: brightness(0.96);
  transform: translateY(-1px);
}

.runtime-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.action-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: 7px;
  padding: 7px 11px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  white-space: nowrap;
}

.action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface-2);
}

.action-btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.task-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 74px;
  align-items: flex-start;
}

.task-node {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 150px;
  cursor: pointer;
}

.task-node.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.task-node-name {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-primary);
  word-break: break-word;
}

.task-node-meta {
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-muted);
  font-family: "IBM Plex Mono", monospace;
}

.task-node-duration {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: "IBM Plex Mono", monospace;
}

.pipeline-task-flow .task-node {
  min-width: 0;
  border-radius: 10px;
  background: var(--surface);
  padding: 10px 11px;
}

.pipeline-task-flow .task-node.done {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.pipeline-task-flow .task-node.running {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.pipeline-task-flow .task-node.error {
  background: #fef2f2;
  border-color: #fca5a5;
}

#activePipelineFlow.pipeline-flow {
  display: block;
  overflow: hidden;
  padding: 4px 4px 2px;
}

.pipeline-graph-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.pipeline-graph-toolbar-copy {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.pipeline-graph-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pipeline-graph-zoom-btn {
  min-width: 38px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.pipeline-graph-zoom-btn:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--accent);
}

.pipeline-graph-zoom-readout {
  min-width: 62px;
}

.pipeline-graph-viewport {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(248, 250, 252, 0.96)),
    linear-gradient(90deg, rgba(148, 163, 184, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(148, 163, 184, 0.1) 1px, transparent 1px);
  background-size: auto, 24px 24px, 24px 24px;
  min-height: 360px;
}

.pipeline-graph-stage {
  position: relative;
  min-width: 100%;
  min-height: 100%;
}

.pipeline-graph-canvas {
  position: relative;
  transform-origin: top left;
}

.pipeline-graph-svg {
  position: absolute;
  inset: 0;
  overflow: visible;
}

.pipeline-graph-edge {
  fill: none;
  stroke: #94a3b8;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.88;
  transition:
    opacity 0.18s ease,
    stroke 0.18s ease,
    stroke-width 0.18s ease,
    filter 0.18s ease;
}

.pipeline-graph-edge.is-active {
  stroke: #2563eb;
  stroke-width: 3.5;
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(37, 99, 235, 0.2));
}

.pipeline-graph-edge.is-layer-active {
  opacity: 0.82;
}

.pipeline-graph-node {
  position: absolute;
  width: 176px;
  min-height: 88px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  color: var(--text-primary);
  box-shadow:
    0 10px 22px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.pipeline-graph-node::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 12px 0 0 12px;
  background: rgba(148, 163, 184, 0.55);
}

.pipeline-graph-node:hover {
  transform: translateY(-1px);
}

.pipeline-graph-node.active {
  border-color: #ffffff;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.96),
    0 0 0 6px rgba(59, 130, 246, 0.2),
    0 18px 34px rgba(37, 99, 235, 0.18);
  transform: translateY(-3px) scale(1.02);
  z-index: 2;
}

.pipeline-graph-node.active.pipeline-graph-node-success,
.pipeline-graph-node.active.pipeline-graph-node-running,
.pipeline-graph-node.active.pipeline-graph-node-queued,
.pipeline-graph-node.active.pipeline-graph-node-retry,
.pipeline-graph-node.active.pipeline-graph-node-failed,
.pipeline-graph-node.active.pipeline-graph-node-skipped,
.pipeline-graph-node.active.pipeline-graph-node-idle {
  border-color: #ffffff;
}

.pipeline-graph-node.active.pipeline-graph-node-running {
  animation: pipeline-graph-node-running-active-pulse 1.6s infinite;
}

.pipeline-graph-node.layer-active {
  opacity: 1;
  box-shadow:
    0 0 0 2px rgba(59, 130, 246, 0.12),
    0 12px 24px rgba(15, 23, 42, 0.1);
}

.pipeline-graph-node.pipeline-graph-node-success {
  border-color: #a7f3d0;
  background:
    linear-gradient(180deg, rgba(236, 253, 245, 0.98), rgba(219, 252, 233, 0.94));
}

.pipeline-graph-node.pipeline-graph-node-success::before {
  background: linear-gradient(180deg, #34d399, #059669);
}

.pipeline-graph-node.pipeline-graph-node-running {
  border-color: #93c5fd;
  background:
    linear-gradient(180deg, rgba(239, 246, 255, 0.99), rgba(219, 234, 254, 0.95));
  animation: pipeline-graph-node-running-pulse 1.6s infinite;
}

.pipeline-graph-node.pipeline-graph-node-running::before {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.pipeline-graph-node.pipeline-graph-node-queued {
  border-color: #fcd34d;
  background:
    linear-gradient(180deg, rgba(255, 251, 235, 0.99), rgba(254, 243, 199, 0.95));
}

.pipeline-graph-node.pipeline-graph-node-queued::before {
  background: linear-gradient(180deg, #fbbf24, #d97706);
}

.pipeline-graph-node.pipeline-graph-node-retry {
  border-color: #c4b5fd;
  background:
    linear-gradient(180deg, rgba(245, 243, 255, 0.99), rgba(237, 233, 254, 0.95));
}

.pipeline-graph-node.pipeline-graph-node-retry::before {
  background: linear-gradient(180deg, #a78bfa, #7c3aed);
}

.pipeline-graph-node.pipeline-graph-node-failed {
  border-color: #fca5a5;
  background:
    linear-gradient(180deg, rgba(254, 242, 242, 0.98), rgba(254, 226, 226, 0.94));
}

.pipeline-graph-node.pipeline-graph-node-failed::before {
  background: linear-gradient(180deg, #f87171, #dc2626);
}

.pipeline-graph-node.pipeline-graph-node-skipped {
  border-color: #fdba74;
  background:
    linear-gradient(180deg, rgba(255, 247, 237, 0.98), rgba(255, 237, 213, 0.95));
}

.pipeline-graph-node.pipeline-graph-node-skipped::before {
  background: linear-gradient(180deg, #fb923c, #c2410c);
}

.pipeline-graph-node.pipeline-graph-node-idle {
  border-color: #cbd5e1;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
}

.pipeline-graph-node.pipeline-graph-node-idle::before {
  background: linear-gradient(180deg, #cbd5e1, #94a3b8);
}

@keyframes pipeline-graph-node-running-pulse {
  0%,
  100% {
    border-color: #93c5fd;
    box-shadow:
      0 10px 22px rgba(59, 130, 246, 0.12),
      0 0 0 1px rgba(147, 197, 253, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.7);
    filter: brightness(0.99);
  }
  50% {
    border-color: #2563eb;
    box-shadow:
      0 14px 30px rgba(37, 99, 235, 0.18),
      0 0 0 1px rgba(59, 130, 246, 0.28),
      inset 0 1px 0 rgba(255, 255, 255, 0.85);
    filter: brightness(1.03);
  }
}

@keyframes pipeline-graph-node-running-active-pulse {
  0%,
  100% {
    border-color: #ffffff;
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 0.96),
      0 0 0 6px rgba(59, 130, 246, 0.2),
      0 16px 28px rgba(37, 99, 235, 0.16);
    filter: brightness(1);
  }
  50% {
    border-color: #ffffff;
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 1),
      0 0 0 7px rgba(59, 130, 246, 0.28),
      0 20px 34px rgba(37, 99, 235, 0.22);
    filter: brightness(1.03);
  }
}

.pipeline-graph-node-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.pipeline-graph-node-title {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  word-break: break-word;
}

.pipeline-graph-node-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.pipeline-graph-node-state.success {
  background: #dff8ec;
  border-color: #86efac;
  color: #047857;
}

.pipeline-graph-node-state.running {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #2563eb;
}

.pipeline-graph-node-state.queued {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #b45309;
}

.pipeline-graph-node-state.retry {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #7c3aed;
}

.pipeline-graph-node-state.failed {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

.pipeline-graph-node-state.skipped {
  background: #ffedd5;
  border-color: #fdba74;
  color: #c2410c;
}

.pipeline-graph-node-state.idle {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #64748b;
}

.pipeline-graph-node-meta {
  margin-top: 10px;
  display: grid;
  gap: 5px;
  font-size: 10px;
  color: var(--text-secondary);
  font-family: "IBM Plex Mono", monospace;
}

.log-box {
  min-height: 220px;
  max-height: 360px;
  overflow: auto;
  padding: 12px;
  background: #ffffff;
  color: #183a66;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11px;
  font-family: "IBM Plex Mono", monospace;
  white-space: pre-wrap;
  user-select: text;
  -webkit-user-select: text;
}

.code-modal.hidden {
  display: none;
}

.code-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
}

.code-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
}

.code-modal-dialog {
  position: relative;
  width: min(1100px, calc(100vw - 48px));
  height: min(78vh, 900px);
  margin: 6vh auto 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.code-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.code-modal-header h3 {
  margin: 0;
  font-size: 14px;
}

.code-modal-close {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-primary);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
}

.code-modal-close:hover {
  background: #eff6ff;
}

.code-modal-meta {
  padding: 10px 14px 0;
  font-size: 12px;
  color: var(--text-muted);
}

.code-modal-content {
  margin: 10px 14px 14px;
  padding: 14px;
  flex: 1;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0f172a;
  color: #dbeafe;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
  tab-size: 2;
  font-family: "SF Mono", "Consolas", monospace;
}

.config-modal.hidden {
  display: none;
}

.config-modal {
  position: fixed;
  inset: 0;
  z-index: 1210;
}

.config-modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.14), transparent 44%),
    rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(3px);
}

.config-modal-dialog {
  position: relative;
  width: min(680px, calc(100vw - 40px));
  margin: 9vh auto 0;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}

.task-action-modal-dialog {
  width: min(960px, calc(100vw - 40px));
}

.config-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(6, 182, 212, 0.07)),
    var(--surface-2);
}

.config-modal-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.config-modal-meta {
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-muted);
}

.config-modal-close {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-primary);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  flex: 0 0 auto;
}

.config-modal-close:hover {
  background: #eff6ff;
}

.config-modal-body {
  padding: 18px;
  display: grid;
  gap: 14px;
  max-height: min(54vh, 520px);
  overflow: auto;
}

.config-modal-note {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

.config-modal-note strong {
  font-size: 12.5px;
  color: var(--text-primary);
}

.config-modal-note span {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.config-modal-note code {
  font-size: 11px;
  font-family: "IBM Plex Mono", monospace;
  color: var(--text-primary);
  background: rgba(148, 163, 184, 0.16);
  border-radius: 6px;
  padding: 1px 6px;
}

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

.task-action-section {
  display: grid;
  gap: 12px;
}

.task-action-section-head {
  display: grid;
  gap: 4px;
}

.task-action-section-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.task-action-section-sub {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.task-action-scope-btn {
  display: grid;
  gap: 4px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  color: var(--text-primary);
  padding: 14px 15px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.task-action-scope-btn strong {
  font-size: 13px;
  color: var(--text-primary);
}

.task-action-scope-btn span {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-secondary);
  font-weight: 500;
}

.task-action-scope-btn:hover {
  border-color: rgba(59, 130, 246, 0.36);
  transform: translateY(-1px);
}

.task-action-scope-btn.active {
  border-color: rgba(59, 130, 246, 0.44);
  background: rgba(59, 130, 246, 0.09);
  box-shadow: 0 12px 24px rgba(59, 130, 246, 0.12);
}

.task-action-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.task-action-summary {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-secondary);
}

.task-action-graph-shell {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.95)),
    #ffffff;
}

.task-action-graph-copy {
  font-size: 11.5px;
  color: var(--text-muted);
}

.task-action-graph-viewport {
  max-height: 360px;
  overflow: auto;
}

.task-action-graph-node {
  cursor: pointer;
}

.task-action-graph-node.is-action-selected {
  border-color: rgba(59, 130, 246, 0.75);
  box-shadow:
    0 0 0 2px rgba(59, 130, 246, 0.14),
    0 18px 36px rgba(15, 23, 42, 0.14);
}

.task-action-graph-node.is-action-selected::before {
  opacity: 1;
  transform: scale(1.15);
}

.task-action-graph-node.is-action-unavailable {
  cursor: not-allowed;
  opacity: 0.54;
}

.task-action-graph-node.is-action-locked {
  cursor: default;
}

.task-action-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.task-action-option-field {
  height: 100%;
}

.task-action-danger {
  display: grid;
  gap: 5px;
  padding: 14px 15px;
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(254, 242, 242, 0.96), rgba(254, 226, 226, 0.9));
}

.task-action-danger strong {
  font-size: 12.5px;
  color: #991b1b;
}

.task-action-danger span {
  font-size: 11.5px;
  line-height: 1.5;
  color: #7f1d1d;
}

.task-action-danger.is-armed {
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 18px 40px rgba(239, 68, 68, 0.12);
}

.config-field {
  display: grid;
  gap: 10px;
  padding: 15px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.config-field-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.config-field-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-primary);
}

.config-field-key {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: "IBM Plex Mono", monospace;
}

.config-field-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.config-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.1);
  color: #1d4ed8;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.config-field-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.config-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.config-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.config-toggle-track {
  width: 52px;
  height: 30px;
  border-radius: 999px;
  background: #dbe4ef;
  border: 1px solid #cbd5e1;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: all 0.18s ease;
  position: relative;
}

.config-toggle-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.16);
  transition: all 0.18s ease;
}

.config-toggle input:checked + .config-toggle-track {
  background: linear-gradient(135deg, var(--accent), #60a5fa);
  border-color: #2563eb;
}

.config-toggle input:checked + .config-toggle-track::after {
  transform: translateX(22px);
}

.config-toggle input:focus-visible + .config-toggle-track {
  box-shadow:
    inset 0 1px 2px rgba(15, 23, 42, 0.08),
    0 0 0 3px var(--accent-glow);
}

.config-toggle-text {
  display: grid;
  gap: 3px;
}

.config-toggle-state {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary);
}

.config-toggle-help {
  font-size: 11px;
  color: var(--text-muted);
}

.config-field-input,
.config-field-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
  outline: none;
}

.config-field-input:focus,
.config-field-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* An emptied footer must not leave a bare padded strip with a top border. */
.config-modal-footer:empty { display: none; }
.config-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.empty-state {
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  background: var(--surface-2);
  font-size: 12px;
}

.viz-histogram-frame {
  min-height: calc(100vh - 220px);
  padding: 14px;
  align-items: stretch;
}

.viz-histogram-wrap {
  height: 100%;
  align-items: stretch;
}

.viz-histogram-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: calc(100vh - 290px);
  max-height: none;
}

#page-histogram-viewer .viz-side,
#page-visualization [data-visualization-panel="histogram"] .viz-side {
  align-content: start;
  gap: 18px;
}

#page-histogram-viewer .viz-side > .viz-section,
#page-visualization [data-visualization-panel="histogram"] .viz-side > .viz-section {
  min-height: 0;
}

#page-histogram-viewer .viz-side > .viz-section:first-child .viz-section-body,
#page-visualization [data-visualization-panel="histogram"] .viz-side > .viz-section:first-child .viz-section-body {
  min-height: 0;
  gap: 10px;
}

#page-histogram-viewer .viz-side > .viz-section:last-child .viz-section-body,
#page-visualization [data-visualization-panel="histogram"] .viz-side > .viz-section:last-child .viz-section-body {
  min-height: 0;
}

#page-histogram-viewer .viz-feature-list,
#page-visualization [data-visualization-panel="histogram"] .viz-feature-list {
  gap: 10px;
  overflow: visible;
}

#page-histogram-viewer .viz-feature-list .viz-section-head,
#page-visualization [data-visualization-panel="histogram"] .viz-feature-list .viz-section-head {
  padding: 10px 12px;
  font-size: 12px;
}

#page-histogram-viewer .viz-feature-list .viz-section-body,
#page-visualization [data-visualization-panel="histogram"] .viz-feature-list .viz-section-body {
  gap: 8px;
}

#page-histogram-viewer .viz-feature-btn,
#page-visualization [data-visualization-panel="histogram"] .viz-feature-btn {
  min-height: 0;
  font-size: 11.5px;
}

body.dark-mode {
  --sidebar-bg: #07111f;
  --sidebar-hover: #102036;
  --sidebar-active: #173154;
  --bg: #0b1220;
  --surface: #111827;
  --surface-2: #172033;
  --border: #263449;
  --border-light: #1f2a3d;
  --text-primary: #e5eef8;
  --text-secondary: #b6c4d6;
  --text-muted: #7f8ea3;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
}

body.dark-mode .data-table tr:hover td {
  background: #151f31;
}

body.dark-mode .badge-gray {
  background: #172033;
  color: #b6c4d6;
}

body.dark-mode .runtime-item:hover,
body.dark-mode .runtime-item.active {
  background: #142849;
}

body.dark-mode .pipeline-summary-chip,
body.dark-mode .pipeline-metric-tile,
body.dark-mode .pipeline-run-summary,
body.dark-mode .pipeline-task-flow .task-node {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.18);
}

body.dark-mode .pipeline-view-toggle {
  border-color: rgba(71, 85, 105, 0.62);
  background: rgba(9, 15, 26, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.dark-mode .pipeline-view-toggle-btn {
  color: #94a3b8;
}

body.dark-mode .pipeline-view-toggle-btn:hover {
  color: #e2e8f0;
}

body.dark-mode .pipeline-view-toggle-btn.active {
  color: #dbeafe;
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.3), rgba(30, 64, 175, 0.2));
  box-shadow:
    0 10px 18px rgba(2, 8, 23, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body.dark-mode .pipeline-simple-stage {
  border-color: rgba(71, 85, 105, 0.58);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(14, 22, 38, 0.88));
  box-shadow:
    0 14px 30px rgba(2, 8, 23, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body.dark-mode .pipeline-simple-stage::before {
  background: rgba(100, 116, 139, 0.7);
}

body.dark-mode .pipeline-simple-arrow {
  background: rgba(100, 116, 139, 0.62);
}

body.dark-mode .pipeline-simple-arrow::before {
  background: linear-gradient(90deg, rgba(96, 165, 250, 0), rgba(96, 165, 250, 0.95), rgba(191, 219, 254, 0));
}

body.dark-mode .pipeline-simple-arrow::after {
  color: rgba(148, 163, 184, 0.9);
}

body.dark-mode .pipeline-simple-arrow.is-flowing::after {
  color: #93c5fd;
  text-shadow: 0 0 10px rgba(96, 165, 250, 0.3);
}

body.dark-mode .pipeline-simple-stage-title {
  color: #d5dfec;
}

body.dark-mode .pipeline-simple-stage-kicker {
  color: #8ea0b7;
}

body.dark-mode .pipeline-simple-stage-state {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.dark-mode .pipeline-simple-stage.is-clickable:hover {
  transform: translateY(-1px);
}

body.dark-mode .pipeline-simple-stage.is-running {
  border-color: rgba(96, 165, 250, 0.55);
  background: linear-gradient(180deg, rgba(30, 64, 175, 0.26), rgba(15, 23, 42, 0.92));
  animation: pipeline-graph-node-running-pulse-dark 1.6s infinite;
}

body.dark-mode .pipeline-simple-stage.is-success {
  border-color: rgba(52, 211, 153, 0.45);
  background: linear-gradient(180deg, rgba(6, 78, 59, 0.34), rgba(15, 23, 42, 0.92));
}

body.dark-mode .pipeline-simple-stage.is-queued {
  border-color: rgba(251, 191, 36, 0.5);
  background: linear-gradient(180deg, rgba(120, 53, 15, 0.24), rgba(15, 23, 42, 0.92));
}

body.dark-mode .pipeline-simple-stage.is-retry {
  border-color: rgba(167, 139, 250, 0.52);
  background: linear-gradient(180deg, rgba(88, 28, 135, 0.24), rgba(15, 23, 42, 0.92));
}

body.dark-mode .pipeline-simple-stage.is-failed {
  border-color: rgba(248, 113, 113, 0.5);
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.28), rgba(15, 23, 42, 0.92));
}

body.dark-mode .pipeline-simple-stage.is-skipped {
  border-color: rgba(251, 146, 60, 0.52);
  background: linear-gradient(180deg, rgba(124, 45, 18, 0.26), rgba(15, 23, 42, 0.92));
}

body.dark-mode .pipeline-simple-stage.is-idle,
body.dark-mode .pipeline-simple-stage.is-unused {
  border-color: rgba(148, 163, 184, 0.22);
}

body.dark-mode .pipeline-simple-stage.is-running::before {
  background: linear-gradient(180deg, #93c5fd, #3b82f6);
}

body.dark-mode .pipeline-simple-stage.is-queued::before {
  background: linear-gradient(180deg, #fcd34d, #f59e0b);
}

body.dark-mode .pipeline-simple-stage.is-retry::before {
  background: linear-gradient(180deg, #c4b5fd, #8b5cf6);
}

body.dark-mode .pipeline-simple-stage.is-success::before {
  background: linear-gradient(180deg, #6ee7b7, #10b981);
}

body.dark-mode .pipeline-simple-stage.is-failed::before {
  background: linear-gradient(180deg, #fca5a5, #ef4444);
}

body.dark-mode .pipeline-simple-stage.is-skipped::before {
  background: linear-gradient(180deg, #fdba74, #f97316);
}

body.dark-mode .pipeline-simple-stage.is-success .pipeline-simple-stage-state {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.4);
  color: #6ee7b7;
}

body.dark-mode .pipeline-simple-stage.is-running .pipeline-simple-stage-state {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(96, 165, 250, 0.42);
  color: #93c5fd;
}

body.dark-mode .pipeline-simple-stage.is-queued .pipeline-simple-stage-state {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(251, 191, 36, 0.4);
  color: #fcd34d;
}

body.dark-mode .pipeline-simple-stage.is-retry .pipeline-simple-stage-state {
  background: rgba(139, 92, 246, 0.16);
  border-color: rgba(167, 139, 250, 0.4);
  color: #c4b5fd;
}

body.dark-mode .pipeline-simple-stage.is-failed .pipeline-simple-stage-state {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fca5a5;
}

body.dark-mode .pipeline-simple-stage.is-skipped .pipeline-simple-stage-state {
  background: rgba(249, 115, 22, 0.16);
  border-color: rgba(251, 146, 60, 0.4);
  color: #fdba74;
}

body.dark-mode .pipeline-simple-stage.is-idle .pipeline-simple-stage-state,
body.dark-mode .pipeline-simple-stage.is-unused .pipeline-simple-stage-state {
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.28);
  color: #cbd5e1;
}

body.dark-mode .step-box {
  background: #172033;
}

body.dark-mode .step-box.done {
  background: rgba(16, 185, 129, 0.12);
}

body.dark-mode .step-box.running {
  background: rgba(59, 130, 246, 0.12);
}

body.dark-mode .step-box.error {
  background: rgba(239, 68, 68, 0.12);
}

body.dark-mode .log-box {
  background: #0d1a2e;
  color: #c8daf0;
  border-color: var(--border);
}

body.dark-mode .pipeline-log-box {
  background: #08111f;
  color: #dbeafe;
}

body.dark-mode .pipeline-graph-viewport {
  background:
    linear-gradient(180deg, rgba(9, 15, 26, 0.92), rgba(14, 22, 38, 0.98)),
    linear-gradient(90deg, rgba(71, 85, 105, 0.24) 1px, transparent 1px),
    linear-gradient(rgba(71, 85, 105, 0.22) 1px, transparent 1px);
  background-size: auto, 24px 24px, 24px 24px;
}

body.dark-mode .pipeline-graph-node {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(14, 22, 38, 0.88));
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow:
    0 14px 30px rgba(2, 8, 23, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body.dark-mode .pipeline-graph-node::before {
  background: rgba(100, 116, 139, 0.7);
}

body.dark-mode .pipeline-graph-node.pipeline-graph-node-success {
  border-color: rgba(52, 211, 153, 0.45);
  background: linear-gradient(180deg, rgba(6, 78, 59, 0.34), rgba(15, 23, 42, 0.92));
}

body.dark-mode .pipeline-graph-node.pipeline-graph-node-running {
  border-color: rgba(96, 165, 250, 0.55);
  background: linear-gradient(180deg, rgba(30, 64, 175, 0.26), rgba(15, 23, 42, 0.92));
}

body.dark-mode .pipeline-graph-node.pipeline-graph-node-queued {
  border-color: rgba(251, 191, 36, 0.5);
  background: linear-gradient(180deg, rgba(120, 53, 15, 0.24), rgba(15, 23, 42, 0.92));
}

body.dark-mode .pipeline-graph-node.pipeline-graph-node-retry {
  border-color: rgba(167, 139, 250, 0.52);
  background: linear-gradient(180deg, rgba(88, 28, 135, 0.24), rgba(15, 23, 42, 0.92));
}

body.dark-mode .pipeline-graph-node.pipeline-graph-node-failed {
  border-color: rgba(248, 113, 113, 0.5);
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.28), rgba(15, 23, 42, 0.92));
}

body.dark-mode .pipeline-graph-node.pipeline-graph-node-skipped {
  border-color: rgba(251, 146, 60, 0.52);
  background: linear-gradient(180deg, rgba(124, 45, 18, 0.26), rgba(15, 23, 42, 0.92));
}

body.dark-mode .pipeline-graph-node.pipeline-graph-node-idle {
  border-color: rgba(148, 163, 184, 0.22);
}

body.dark-mode .pipeline-graph-node-state {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.dark-mode .pipeline-graph-node-state.success {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.35);
  color: #86efac;
}

body.dark-mode .pipeline-graph-node-state.running {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(96, 165, 250, 0.4);
  color: #93c5fd;
}

body.dark-mode .pipeline-graph-node-state.queued {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(251, 191, 36, 0.38);
  color: #fcd34d;
}

body.dark-mode .pipeline-graph-node-state.retry {
  background: rgba(139, 92, 246, 0.16);
  border-color: rgba(167, 139, 250, 0.36);
  color: #c4b5fd;
}

body.dark-mode .pipeline-graph-node-state.failed {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(248, 113, 113, 0.38);
  color: #fca5a5;
}

body.dark-mode .pipeline-graph-node-state.skipped {
  background: rgba(249, 115, 22, 0.16);
  border-color: rgba(251, 146, 60, 0.4);
  color: #fdba74;
}

body.dark-mode .pipeline-graph-node-state.idle {
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.28);
  color: #cbd5e1;
}

body.dark-mode .pipeline-graph-node.pipeline-graph-node-running::before {
  background: linear-gradient(180deg, #93c5fd, #3b82f6);
}

body.dark-mode .pipeline-graph-node.pipeline-graph-node-queued::before {
  background: linear-gradient(180deg, #fcd34d, #f59e0b);
}

body.dark-mode .pipeline-graph-node.pipeline-graph-node-retry::before {
  background: linear-gradient(180deg, #c4b5fd, #8b5cf6);
}

body.dark-mode .pipeline-graph-node.pipeline-graph-node-success::before {
  background: linear-gradient(180deg, #6ee7b7, #10b981);
}

body.dark-mode .pipeline-graph-node.pipeline-graph-node-failed::before {
  background: linear-gradient(180deg, #fca5a5, #ef4444);
}

body.dark-mode .pipeline-graph-node.pipeline-graph-node-skipped::before {
  background: linear-gradient(180deg, #fdba74, #f97316);
}

body.dark-mode .pipeline-graph-node.pipeline-graph-node-running {
  animation: pipeline-graph-node-running-pulse-dark 1.6s infinite;
}

body.dark-mode .pipeline-graph-node.active {
  border-color: #ffffff;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.98),
    0 0 0 6px rgba(96, 165, 250, 0.24),
    0 18px 34px rgba(2, 8, 23, 0.34);
}

body.dark-mode .pipeline-graph-node.active.pipeline-graph-node-success,
body.dark-mode .pipeline-graph-node.active.pipeline-graph-node-running,
body.dark-mode .pipeline-graph-node.active.pipeline-graph-node-queued,
body.dark-mode .pipeline-graph-node.active.pipeline-graph-node-retry,
body.dark-mode .pipeline-graph-node.active.pipeline-graph-node-failed,
body.dark-mode .pipeline-graph-node.active.pipeline-graph-node-skipped,
body.dark-mode .pipeline-graph-node.active.pipeline-graph-node-idle {
  border-color: #ffffff;
}

body.dark-mode .pipeline-graph-node.active.pipeline-graph-node-running {
  animation: pipeline-graph-node-running-active-pulse-dark 1.6s infinite;
}

@keyframes pipeline-graph-node-running-pulse-dark {
  0%,
  100% {
    border-color: rgba(96, 165, 250, 0.55);
    box-shadow:
      0 14px 30px rgba(2, 8, 23, 0.28),
      0 0 0 1px rgba(96, 165, 250, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.03);
    filter: brightness(0.98);
  }
  50% {
    border-color: rgba(147, 197, 253, 0.95);
    box-shadow:
      0 16px 34px rgba(37, 99, 235, 0.22),
      0 0 0 1px rgba(147, 197, 253, 0.28),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
    filter: brightness(1.04);
  }
}

@keyframes pipeline-graph-node-running-active-pulse-dark {
  0%,
  100% {
    border-color: #ffffff;
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 0.98),
      0 0 0 6px rgba(96, 165, 250, 0.24),
      0 18px 34px rgba(2, 8, 23, 0.34);
    filter: brightness(1);
  }
  50% {
    border-color: #ffffff;
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 1),
      0 0 0 7px rgba(147, 197, 253, 0.32),
      0 22px 38px rgba(37, 99, 235, 0.24);
    filter: brightness(1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pipeline-simple-arrow.is-flowing::before {
    animation: none;
    opacity: 0;
  }

  .pipeline-simple-arrow.is-flowing::after {
    text-shadow: none;
  }

  .dbos-v2-shell .sidebar-item,
  .dbos-v2-shell .sidebar-item:hover,
  .visualization-view-btn,
  .dbos-v2-shell .topbar-btn {
    transition: none;
    transform: none;
  }

  .dbos-v2-shell .topbar-btn.is-loading svg {
    animation-duration: 1800ms;
  }

  .pipeline-graph-node,
  .pipeline-graph-node:hover {
    transition: none;
    transform: none;
  }

  .pipeline-graph-node.pipeline-graph-node-running,
  body.dark-mode .pipeline-graph-node.pipeline-graph-node-running {
    animation: none;
  }
}

body.dark-mode .pipeline-graph-edge {
  stroke: #5f7290;
}

body.dark-mode .pipeline-graph-zoom-btn {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.24);
  color: var(--text-primary);
}

body.dark-mode .pipeline-graph-zoom-btn:hover {
  border-color: rgba(96, 165, 250, 0.7);
  color: #93c5fd;
}

body.dark-mode .code-modal-dialog {
  background: #162540;
  border-color: #1e3860;
}

body.dark-mode .code-modal-header {
  background: #1a2f52;
  border-color: #1e3860;
}

body.dark-mode .code-modal-close {
  background: #162540;
  color: #dce8f8;
  border-color: #2a4d80;
}

body.dark-mode .code-modal-close:hover {
  background: #1e3560;
}

body.dark-mode .code-modal-meta {
  color: #7a9cc4;
}

body.dark-mode .code-modal-content {
  border-color: #1e3860;
  background: #0b1220;
  color: #dce8f8;
}

body.dark-mode .config-modal-dialog {
  background: linear-gradient(180deg, #13233d, #101d33);
  border-color: #224069;
}

body.dark-mode .task-action-scope-btn {
  background: #132742;
  border-color: #224069;
  color: #dce8f8;
}

body.dark-mode .task-action-scope-btn.active {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(96, 165, 250, 0.42);
}

body.dark-mode .task-action-scope-btn span,
body.dark-mode .task-action-section-sub {
  color: #b9cbe3;
}

body.dark-mode .config-modal-header {
  background:
    linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(6, 182, 212, 0.08)),
    #162a47;
  border-color: #224069;
}

body.dark-mode .config-modal-meta,
body.dark-mode .config-toggle-help,
body.dark-mode .config-field-key {
  color: #8aa4c7;
}

body.dark-mode .config-modal-close {
  background: #142746;
  color: #dce8f8;
  border-color: #2a4d80;
}

body.dark-mode .config-modal-close:hover {
  background: #1b3560;
}

body.dark-mode .config-modal-note,
body.dark-mode .config-field {
  background: #132742;
  border-color: #224069;
}

body.dark-mode .task-action-graph-shell,
body.dark-mode .task-action-option-field {
  background: #132742;
  border-color: #224069;
}

body.dark-mode .config-modal-note span,
body.dark-mode .config-field-desc {
  color: #b9cbe3;
}

body.dark-mode .task-action-summary,
body.dark-mode .task-action-graph-copy {
  color: #b9cbe3;
}

body.dark-mode .config-modal-note code {
  color: #dce8f8;
  background: rgba(96, 165, 250, 0.12);
}

body.dark-mode .source-binding-selection,
body.dark-mode .trigger-source-section {
  border-color: #29486c;
  background: rgba(15, 31, 54, 0.86);
}

body.dark-mode .source-binding-dag-option,
body.dark-mode .trigger-source-mode,
body.dark-mode .trigger-source-binding-option {
  border-color: #29486c;
}

body.dark-mode .source-binding-dag-option {
  background: transparent;
}

body.dark-mode .source-binding-dag-toggle {
  background: #475569;
}

body.dark-mode .source-binding-dag-toggle:checked {
  background: #059669;
}

body.dark-mode .trigger-source-mode,
body.dark-mode .trigger-source-binding-option {
  background: #12243e;
}

body.dark-mode .source-binding-dag-option:hover {
  background: rgba(59, 130, 246, 0.12);
}

body.dark-mode .source-select-btn.is-selected {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.22);
}

body.dark-mode .registry-count {
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.2);
}

body.dark-mode .task-action-danger {
  background: linear-gradient(180deg, rgba(69, 10, 10, 0.7), rgba(92, 24, 24, 0.66));
  border-color: rgba(248, 113, 113, 0.3);
}

body.dark-mode .task-action-danger strong {
  color: #fecaca;
}

body.dark-mode .task-action-danger span {
  color: #fca5a5;
}

body.dark-mode .config-pill {
  background: rgba(96, 165, 250, 0.14);
  color: #93c5fd;
}

body.dark-mode .config-toggle-track {
  background: #334155;
  border-color: #475569;
}

body.dark-mode .config-field-input,
body.dark-mode .config-field-select,
body.dark-mode .config-modal-footer {
  background: #101d33;
  border-color: #224069;
  color: #dce8f8;
}

body.dark-mode.dbos-v2-shell {
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 24%),
    linear-gradient(180deg, #08111f 0%, #0b1322 52%, #09111d 100%);
}

body.dark-mode.dbos-v2-shell .sidebar {
  background:
    linear-gradient(180deg, rgba(4, 12, 24, 0.98) 0%, rgba(7, 18, 35, 0.98) 100%);
  box-shadow: 18px 0 50px rgba(0, 0, 0, 0.34);
}

body.dark-mode.dbos-v2-shell .logo-image-wrap {
  background: transparent;
  box-shadow: none;
}

body.dark-mode.dbos-v2-shell .sidebar-user {
  background: rgba(9, 16, 30, 0.72);
  border-color: rgba(148, 163, 184, 0.16);
}

body.dark-mode.dbos-v2-shell .topbar {
  background: rgba(10, 17, 30, 0.78);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}

body.dark-mode.dbos-v2-shell .topbar-kicker {
  color: #93c5fd;
}

body.dark-mode.dbos-v2-shell .context-chip {
  background: rgba(15, 23, 42, 0.92);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.18);
}

body.dark-mode.dbos-v2-shell .context-chip-live {
  background: rgba(6, 78, 59, 0.42);
  color: #bbf7d0;
  border-color: rgba(34, 197, 94, 0.2);
}

body.dark-mode.dbos-v2-shell .context-chip.is-empty {
  background: rgba(30, 41, 59, 0.94);
  color: #94a3b8;
}

body.dark-mode.dbos-v2-shell .context-chip.is-error {
  background: rgba(127, 29, 29, 0.42);
  color: #fecaca;
}

body.dark-mode.dbos-v2-shell .topbar-btn,
body.dark-mode.dbos-v2-shell .notif-btn {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
}

body.dark-mode.dbos-v2-shell .topbar-btn:hover {
  background: rgba(30, 41, 59, 0.94);
  color: #93c5fd;
}

body.dark-mode.dbos-v2-shell .topbar-btn.is-success {
  background: rgba(6, 78, 59, 0.42);
  border-color: rgba(52, 211, 153, 0.26);
  color: #a7f3d0;
}

body.dark-mode.dbos-v2-shell .topbar-btn.is-error {
  background: rgba(127, 29, 29, 0.42);
  border-color: rgba(248, 113, 113, 0.26);
  color: #fecaca;
}

body.dark-mode.dbos-v2-shell .lang-toggle-pill {
  color: #94a3b8;
}

body.dark-mode.dbos-v2-shell .lang-toggle-pill.active {
  background: rgba(30, 64, 175, 0.42);
  color: #dbeafe;
  box-shadow:
    inset 0 0 0 1px rgba(96, 165, 250, 0.24),
    0 2px 10px rgba(37, 99, 235, 0.18);
}

body.dark-mode.dbos-v2-shell .page-hero,
body.dark-mode.dbos-v2-shell .card,
body.dark-mode.dbos-v2-shell .kpi-card,
body.dark-mode.dbos-v2-shell .dashboard-pending-item,
body.dark-mode.dbos-v2-shell .pipeline-run-metric,
body.dark-mode.dbos-v2-shell .empty-state {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.94) 0%, rgba(17, 24, 39, 0.94) 100%);
  border-color: rgba(148, 163, 184, 0.14);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

body.dark-mode.dbos-v2-shell .page-hero-note,
body.dark-mode.dbos-v2-shell .card-header-note,
body.dark-mode.dbos-v2-shell .home-selection-summary-v2 {
  background: rgba(15, 23, 42, 0.74);
  color: #b6c4d6;
  border-color: rgba(148, 163, 184, 0.12);
}

body.dark-mode.dbos-v2-shell .home-topic-card {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(17, 24, 39, 0.96));
  border-color: rgba(51, 65, 85, 0.92);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

body.dark-mode.dbos-v2-shell .home-topic-card.active {
  border-color: rgba(96, 165, 250, 0.34);
  box-shadow:
    0 18px 36px rgba(2, 6, 23, 0.34),
    inset 0 0 0 1px rgba(96, 165, 250, 0.22);
}

body.dark-mode.dbos-v2-shell .home-domain-btn {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(71, 85, 105, 0.84);
  color: #dbe6f5;
}

body.dark-mode.dbos-v2-shell .home-domain-btn.active {
  background: rgba(30, 64, 175, 0.34);
  border-color: rgba(96, 165, 250, 0.34);
  color: #dbeafe;
}

body.dark-mode.dbos-v2-shell .pipeline-flow,
body.dark-mode.dbos-v2-shell .runtime-list,
body.dark-mode.dbos-v2-shell .log-box {
  background: rgba(8, 15, 28, 0.9);
  border-color: rgba(51, 65, 85, 0.86);
}

body.dark-mode.dbos-v2-shell .pipeline-run-metric {
  background: rgba(8, 15, 28, 0.88);
  border-color: rgba(51, 65, 85, 0.86);
}

body.dark-mode.dbos-v2-shell .pipeline-panel-box {
  background: rgba(8, 15, 28, 0.88);
  border-color: rgba(51, 65, 85, 0.86);
}

body.dark-mode.dbos-v2-shell .pipeline-search-bar,
body.dark-mode.dbos-v2-shell .search-bar {
  background: rgba(15, 23, 42, 0.82);
  border-color: rgba(51, 65, 85, 0.86);
}

body.dark-mode.dbos-v2-shell .search-bar input,
body.dark-mode.dbos-v2-shell .viz-field input,
body.dark-mode.dbos-v2-shell .viz-field select,
body.dark-mode.dbos-v2-shell .kpi-inline-field select {
  background: rgba(8, 15, 28, 0.88);
  border-color: rgba(51, 65, 85, 0.82);
  color: #e2e8f0;
}

body.dark-mode.dbos-v2-shell .viz-kpi-placeholder {
  background: rgba(8, 15, 28, 0.88);
  border-color: rgba(51, 65, 85, 0.82);
  color: #cbd5e1;
}

body.dark-mode.dbos-v2-shell .viz-section,
body.dark-mode.dbos-v2-shell .viz-main,
body.dark-mode.dbos-v2-shell .viz-top,
body.dark-mode.dbos-v2-shell .viz-hero,
body.dark-mode.dbos-v2-shell .viz-mini-item {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(17, 24, 39, 0.96));
  border-color: rgba(51, 65, 85, 0.84);
}

body.dark-mode.dbos-v2-shell .viz-section-head {
  background: rgba(30, 41, 59, 0.82);
  color: #e2e8f0;
}

body.dark-mode.dbos-v2-shell .viz-histogram-wrap img {
  border-color: rgba(51, 65, 85, 0.86);
  background: rgba(255, 255, 255, 0.98);
}

body.dark-mode.dbos-v2-shell .viz-preview-table-wrap {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(51, 65, 85, 0.84);
}

body.dark-mode.dbos-v2-shell .dataset-builder-rail,
body.dark-mode.dbos-v2-shell .dataset-builder-preview,
body.dark-mode.dbos-v2-shell .dataset-builder-rail-head,
body.dark-mode.dbos-v2-shell .dataset-builder-section,
body.dark-mode.dbos-v2-shell .dataset-builder-savebar {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(17, 24, 39, 0.96));
  border-color: rgba(51, 65, 85, 0.82);
}

body.dark-mode.dbos-v2-shell .dataset-builder-section select,
body.dark-mode.dbos-v2-shell .dataset-builder-row select,
body.dark-mode.dbos-v2-shell .dataset-builder-row input,
body.dark-mode.dbos-v2-shell .dataset-builder-savebar input {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(71, 85, 105, 0.82);
  color: #e2e8f0;
}

body.dark-mode.dbos-v2-shell .viz-export-format {
  background: rgba(8, 15, 28, 0.88);
  border-color: rgba(51, 65, 85, 0.82);
}

body.dark-mode.dbos-v2-shell .viz-export-format-option {
  color: #94a3b8;
}

body.dark-mode.dbos-v2-shell .viz-export-format-option:hover:not(:disabled),
body.dark-mode.dbos-v2-shell .viz-export-format-option[aria-pressed="true"] {
  color: #5eead4;
}

body.dark-mode.dbos-v2-shell .viz-export-format-option[aria-pressed="true"] {
  background: rgba(30, 41, 59, 0.96);
  box-shadow: none;
}

body.dark-mode.dbos-v2-shell .viz-preview-table th {
  background: rgba(30, 41, 59, 0.96);
  color: #e2e8f0;
}

body.dark-mode.dbos-v2-shell .viz-preview-table td {
  border-bottom-color: rgba(51, 65, 85, 0.72);
  color: #cbd5e1;
}

body.dark-mode.dbos-v2-shell .viz-dashboard-embed-wrap,
body.dark-mode.dbos-v2-shell .viz-dashboard-embed-status {
  border-color: rgba(51, 65, 85, 0.84);
}

body.dark-mode.dbos-v2-shell .viz-dashboard-embed-stage {
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.2), transparent 38%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(17, 24, 39, 0.98));
}

body.dark-mode.dbos-v2-shell .viz-dashboard-embed-status {
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.6);
}

body.dark-mode.dbos-v2-shell .viz-dashboard-embed-status[data-state="info"] {
  color: #5eead4;
}

body.dark-mode.dbos-v2-shell .viz-dashboard-embed-status[data-state="success"] {
  color: #86efac;
}

body.dark-mode.dbos-v2-shell .viz-dashboard-embed-status[data-state="danger"] {
  color: #fda4af;
}

body.dark-mode.dbos-v2-shell .viz-dashboard-embed-status.active {
  color: #5eead4;
}

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

@media (max-width: 1280px) {
  .lakehouse-bucket-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  html,
  body {
    overflow: auto;
  }

  .app {
    min-height: 100vh;
    height: auto;
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-width: 0;
    max-height: 280px;
  }

  .main {
    min-height: 720px;
  }

  .topbar {
    height: 54px;
    padding: 0 16px;
  }

  .topbar-actions {
    gap: 8px;
  }

  .settings-runtime-grid {
    grid-template-columns: 1fr;
  }

  .source-connection-form {
    grid-template-columns: 1fr;
  }

  .source-connection-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .ingest-connection-card .source-connection-form,
  .source-binding-dag-list,
  .trigger-source-mode-grid {
    grid-template-columns: 1fr;
  }

  .source-binding-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .source-browser-head { align-items: flex-start; flex-direction: column; }
  .source-browser-workspace { grid-template-columns: 1fr; }
  .source-browser-tree-pane { border-right: 0; border-bottom: 1px solid var(--border); }

  .home-topic-grid {
    grid-template-columns: 1fr;
  }

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

  .content {
    padding: 14px;
  }

  .visualization-page-head {
    align-items: center;
    flex-direction: row;
    justify-content: flex-end;
  }

  .visualization-view-switch {
    width: 100%;
    overflow-x: auto;
  }

  .dataset-builder-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .dataset-builder-preview {
    min-height: 460px;
  }

  .dataset-builder-row,
  .dataset-builder-join-row,
  .dataset-builder-filter-row {
    grid-template-columns: 1fr 1fr;
  }

  .dataset-builder-remove {
    justify-self: start;
  }

  .runtime-grid {
    grid-template-columns: 1fr;
  }

  .lakehouse-bucket-grid {
    grid-template-columns: 1fr;
  }
  .pipeline-airflow-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pipeline-airflow-workspace,
  .pipeline-run-grid {
    grid-template-columns: 1fr;
  }

  .pipeline-log-box {
    min-height: 360px;
    max-height: 480px;
  }

  .pipeline-builder-head { align-items: flex-start; flex-direction: column; }
  .pipeline-builder-draft-list { max-height: 60vh; }
  .pipeline-builder-project-fields,
  .pipeline-builder-task-fields { grid-template-columns: 1fr; }
  .pipeline-builder-task-top { grid-template-columns: 1fr; }
  .pipeline-builder-task-top .pipeline-builder-task-fields { grid-template-columns: 1fr; }
  .pipeline-builder-code-head { display: grid; }
}

/* ===== INGEST MODAL =======================================================
   Reuses the .config-modal vocabulary from the Pipeline trigger dialog. The
   minimized state docks the dialog to the bottom-right as a header-only bar so a
   running ingest stays visible without blocking the page. */
.ingest-modal-controls { display: flex; gap: 6px; }

.config-modal.is-minimized .config-modal-backdrop { display: none; }
.config-modal.is-minimized { inset: auto; }
.config-modal.is-minimized .config-modal-dialog {
  position: fixed;
  right: 20px;
  bottom: 20px;
  margin: 0;
  width: min(340px, calc(100vw - 40px));
  cursor: pointer;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22);
}
.config-modal.is-minimized .config-modal-body,
.config-modal.is-minimized .config-modal-footer { display: none; }
.config-modal.is-minimized .config-modal-header { border-bottom: 0; }

.ingest-confirm-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ingest-confirm-note { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--text-secondary); }
.ingest-confirm-note code {
  padding: 1px 5px; border-radius: 5px;
  background: rgba(15, 23, 42, 0.07); font-family: "IBM Plex Mono", monospace; font-size: 11.5px;
}

.ingest-job { padding: 9px 10px; border-radius: 8px; }
.ingest-job + .ingest-job { border-top: 1px solid rgba(15, 23, 42, 0.07); }
.ingest-job-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ingest-job-tables {
  font-size: 13px; font-weight: 600; color: #0f172a;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ingest-job-state { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #475569; }
.ingest-job-meta, .ingest-job-error { margin-top: 4px; font-size: 11px; color: #64748b; }
.ingest-job-error { color: #b91c1c; }

.ingest-job-bar {
  margin-top: 7px; height: 4px; border-radius: 999px;
  background: rgba(15, 23, 42, 0.09); overflow: hidden;
}
.ingest-job-bar > span { display: block; height: 100%; border-radius: 999px; background: #0878a8; width: 12%; }
/* Indeterminate: the DAG runs all tables inside one task, so there is no honest
   per-table percentage to show. The bar communicates "working", not progress. */
.ingest-job.is-queued .ingest-job-bar > span { width: 8%; opacity: 0.6; animation: ingest-slide 1.6s ease-in-out infinite; }
.ingest-job.is-running .ingest-job-bar > span { width: 35%; animation: ingest-slide 1.2s ease-in-out infinite; }
.ingest-job.is-success .ingest-job-bar > span { width: 100%; background: #15803d; }
.ingest-job.is-failed .ingest-job-bar > span { width: 100%; background: #b91c1c; }
.ingest-job.is-success .ingest-job-state { color: #15803d; }
.ingest-job.is-failed .ingest-job-state { color: #b91c1c; }

@keyframes ingest-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(320%); }
}

@media (prefers-reduced-motion: reduce) {
  .ingest-job-bar > span { animation: none; }
}

body.dark-mode .ingest-tracker { background: #0b1a2e; border-color: rgba(255, 255, 255, 0.1); }
body.dark-mode .ingest-job-tables { color: #e2e8f0; }
body.dark-mode .ingest-job-state { color: #94a3b8; }
body.dark-mode .ingest-job-meta { color: #94a3b8; }
body.dark-mode .ingest-job + .ingest-job { border-top-color: rgba(255, 255, 255, 0.08); }
body.dark-mode .ingest-job-bar { background: rgba(255, 255, 255, 0.12); }

@media (max-width: 560px) {
  .ingest-tracker { right: 12px; left: 12px; bottom: 12px; width: auto; }
}

/* Per-row table action buttons (Change role / Disable / Delete). Emitted by JS
   across several pages but never defined — rendered as an unspaced run of
   buttons until now. */
.table-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* .empty-state tone modifiers. The JS toggles these to report success/failure
   on forms; without them a failed action looked identical to a successful one. */
.empty-state.is-error {
  border-color: rgba(220, 38, 38, 0.35);
  background: rgba(254, 242, 242, 0.7);
  color: #b91c1c;
  font-weight: 700;
}
.empty-state.is-success {
  border-color: rgba(21, 128, 61, 0.35);
  background: rgba(236, 253, 245, 0.7);
  color: #15803d;
  font-weight: 700;
}
body.dark-mode .empty-state.is-error {
  background: rgba(220, 38, 38, 0.14);
  border-color: rgba(220, 38, 38, 0.4);
  color: #f87171;
}
body.dark-mode .empty-state.is-success {
  background: rgba(21, 128, 61, 0.16);
  border-color: rgba(21, 128, 61, 0.4);
  color: #4ade80;
}

/* Functional guidance inside a card — role legends, safety notes. Distinct from
   .card-sub, which the v2 shell hides outright as decorative filler copy; this
   text tells the operator something they need and therefore must render. */
.card-note {
  margin: 2px 0 12px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}
.card-note strong { color: var(--text-primary); font-weight: 700; }
.table-wrapper + .card-note { margin: 10px 0 0; }
body.dark-mode .card-note { color: #94a3b8; }
body.dark-mode .card-note strong { color: #e2e8f0; }

body.dark-mode .ingest-confirm-note { color: #94a3b8; }
body.dark-mode .ingest-confirm-note code { background: rgba(255, 255, 255, 0.12); }
@media (max-width: 560px) {
  .config-modal.is-minimized .config-modal-dialog { right: 12px; left: 12px; bottom: 12px; width: auto; }
}

/* ---- Licensing page ---------------------------------------------------- */
/* Mirrors .account-page: license.html stacks two cards and needs the same
   explicit gap .account-page declares for its own two-card stack. */
.license-page {
  display: grid;
  gap: 16px;
}

/* Extends the dashed-border "empty/attention" idiom already used by
   .empty-state; there was no file-upload affordance in the system before. */
.license-dropzone {
  border: 1px dashed var(--border);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.8);
  padding: 22px 18px;
  text-align: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.license-dropzone:hover,
.license-dropzone:focus-visible,
.license-dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--text-primary);
}
.license-dropzone code {
  font-size: 12px;
}

/* Dropzone + submit button only (2 items) — .source-connection-form's 3-col
   grid is built for the account-team form (username/password/role) and left
   a dead third column here. A dedicated 2-up row fills the card instead. */
.license-upload-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 12px;
}
.license-upload-form .license-dropzone {
  margin: 0;
}
.license-upload-form .action-btn {
  width: 100%;
  align-self: center;
}

/* Green commit action. .action-btn.primary is the app's blue; validating a
   licence is the one affirmative action on this page, so it gets its own. */
.license-validate-btn {
  background: #15803d;
  border-color: #15803d;
  color: #fff;
  font-weight: 700;
}
.license-validate-btn:hover:not(:disabled) {
  background: #166534;
  border-color: #166534;
  color: #fff;
}
.license-validate-btn:disabled {
  background: rgba(21, 128, 61, 0.35);
  border-color: transparent;
  color: #fff;
  cursor: not-allowed;
}

.license-dropzone.has-file {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--text-primary);
}

/* The product's core promise, on its own line for every denying state. The
   sentence is stripped from the alert text above so it appears exactly once. */
.license-reads-note {
  font-size: 12px;
  font-weight: 700;
  color: #059669;
  margin: 12px 0 0;
}

/* Breathing room for the elements the account page does not have: the alert
   strip, the standing note, and the refresh action all sat flush against the
   facts list. */
#licenseStatusCard #licenseAlert:not([hidden]) {
  margin: 18px 0 0;
}
#licenseRefreshBtn {
  margin-top: 16px;
}

/* .account-facts is reused as-is (see account.html); this card only adds
   wrap-safety because license values ("2026-07-01 (14 days remaining)",
   "2026-07-28 09:36 UTC") run longer than account.html's short values and
   must not overflow at 390px. */
#licenseStatusCard .account-facts div {
  flex-wrap: wrap;
}
/* .account-facts div sets display:flex, which beats the UA [hidden] rule, so a
   hidden row would still render. Rows for fields this host cannot read must
   actually disappear. */
#licenseStatusCard .account-facts div[hidden] {
  display: none;
}
#licenseStatusCard .account-facts dd {
  text-align: right;
  word-break: break-word;
}

/* A long state label ("SIGNATURE INVALID") next to a long title would clip on a
   narrow viewport: .card-header is space-between with no wrap by default. */
#licenseStatusCard .card-header {
  flex-wrap: wrap;
  gap: 8px;
}
@media (max-width: 480px) {
  .license-upload-form {
    grid-template-columns: 1fr;
  }
  #licenseUploadBtn {
    width: 100%;
  }
}

/* Dark theme. The light rules above carry hardcoded surface/ink values, so they
   need explicit overrides exactly like .empty-state does (see body.dark-mode
   .empty-state.is-success): a near-white dropzone would glare on the dark
   canvas, and #059669 has too little contrast against --surface. */
body.dark-mode .license-dropzone {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-muted);
}
body.dark-mode .license-dropzone:hover,
body.dark-mode .license-dropzone:focus-visible,
body.dark-mode .license-dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--text-primary);
}
body.dark-mode .license-reads-note {
  color: #4ade80;
}
