    :root {
      --bg: #f4f6f8;
      --panel: #fff;
      --panel-2: #f8fafc;
      --border: #d7dde5;
      --text: #18202a;
      --muted: #64748b;
      --accent: #2563eb;
      --success: #16803c;
      --warning: #b45309;
      --danger: #b91c1c;
      --source: #dbeafe;
      --shape: #ecfeff;
      --clean: #dcfce7;
      --transform: #fef3c7;
      --split: #fae8ff;
      --model: #ede9fe;
      --eval: #ffe4e6;
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      height: 100vh;
      display: grid;
      grid-template-columns: 260px minmax(520px, 1fr) 380px;
      grid-template-rows: 1fr minmax(300px, 45vh);
      background: var(--bg);
      color: var(--text);
      font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      overflow: hidden;
    }

    button,
    input,
    select,
    textarea {
      font: inherit;
    }

    button {
      border: 1px solid var(--border);
      background: var(--panel);
      color: var(--text);
      border-radius: 6px;
      padding: 7px 10px;
      cursor: pointer;
    }

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

    button.danger {
      border-color: #fecaca;
      color: var(--danger);
      background: #fff1f2;
    }

    button:disabled {
      opacity: .55;
      cursor: not-allowed;
    }

    input,
    select,
    textarea {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 7px 10px;
      background: #fff;
      color: var(--text);
    }

    textarea {
      min-height: 88px;
      resize: vertical;
    }

    label {
      display: block;
      font-size: 12px;
      color: var(--muted);
      margin: 12px 0 5px;
    }

    .sidebar {
      grid-row: 1 / span 2;
      background: var(--panel);
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      min-height: 0;
      position: relative;
    }

    .sidebar-resize-handle {
      position: absolute;
      top: 0;
      right: -5px;
      bottom: 0;
      width: 10px;
      cursor: col-resize;
      z-index: 30;
    }

    .sidebar-resize-handle::before {
      content: "";
      position: absolute;
      top: 0;
      bottom: 0;
      left: 4px;
      width: 1px;
      background: transparent;
      transition: background .12s ease, width .12s ease;
    }

    .sidebar-resize-handle:hover::before,
    body.sidebar-resizing .sidebar-resize-handle::before {
      width: 2px;
      background: var(--accent);
    }

    .inspector-resize-handle {
      position: absolute;
      top: 0;
      left: -5px;
      bottom: 0;
      width: 10px;
      cursor: col-resize;
      z-index: 30;
    }

    .inspector-resize-handle::before {
      content: "";
      position: absolute;
      top: 0;
      bottom: 0;
      left: 4px;
      width: 1px;
      background: transparent;
      transition: background .12s ease, width .12s ease;
    }

    .inspector-resize-handle:hover::before,
    body.inspector-resizing .inspector-resize-handle::before {
      width: 2px;
      background: var(--accent);
    }

    .brand {
      padding: 16px;
      border-bottom: 1px solid var(--border);
    }

    .brand h1 {
      font-size: 16px;
      line-height: 1.2;
      margin: 0 0 4px;
    }

    .brand p {
      margin: 0;
      color: var(--muted);
      font-size: 12px;
    }

    .project-box {
      padding: 12px;
      border-bottom: 1px solid var(--border);
      display: grid;
      gap: 8px;
    }

    .account-box {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 10px 12px;
      background: #f8fafc;
      border: 1px solid var(--border);
      border-radius: 8px;
    }

    .account-user {
      flex: 1;
      min-width: 0;
      font-size: 12px;
      color: var(--text);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .account-box #logoutBtn {
      font-size: 12px;
    }

    .login-box {
      display: grid;
      gap: 12px;
      justify-items: center;
      padding: 16px 14px;
      background: #fff7ed;
      border: 1px solid #fed7aa;
      border-radius: 8px;
    }

    .login-form-fields,
    .login-sso-fields {
      width: 100%;
      max-width: 260px;
      margin: 0 auto;
    }

    .login-form-fields {
      display: grid;
      gap: 10px;
    }

    .login-msg {
      min-height: 16px;
      font-size: 11px;
      color: var(--danger);
      line-height: 1.4;
    }

    .login-sso-fields {
      display: flex;
      flex-direction: column;
      gap: 10px;
      align-items: stretch;
    }

    .login-sso-msg {
      font-size: 12px;
      line-height: 1.6;
      color: var(--muted);
      text-align: left;
    }

    .login-sso-link {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      text-decoration: none;
    }

    .new-project-box,
    .new-dag-box {
      display: grid;
      gap: 6px;
      padding: 10px;
      background: #f0fdf4;
      border: 1px solid #bbf7d0;
      border-radius: 8px;
    }

    .hidden {
      display: none !important;
    }

    .library {
      padding: 12px;
      overflow: auto;
    }

    .kit-select {
      margin-bottom: 8px;
      width: 100%;
      padding: 6px 8px;
      border: 1px solid var(--border);
      border-radius: 6px;
      background: #fff;
      color: var(--text);
      font-size: 13px;
      letter-spacing: 0.5px;
      line-height: 1.4;
    }

    .library-search {
      margin-bottom: 10px;
      padding: 6px 12px;
      font-size: 13px;
      letter-spacing: 0.5px;
      line-height: 1.4;
    }

    .tool-groups-frame {
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fff;
      padding: 6px;
    }

    .tool-groups-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 2px 0 8px;
    }

    .tool-groups-title {
      min-width: 0;
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-size: 14px;
      font-weight: 650;
      color: var(--text);
    }

    .icon-button {
      width: 26px;
      height: 24px;
      display: inline-grid;
      place-items: center;
      padding: 0;
      font-size: 15px;
      line-height: 1;
      color: var(--muted);
      background: var(--panel-2);
    }

    .icon-button:hover {
      color: var(--text);
      border-color: #b8c2d1;
    }

    .collapse-all-icon {
      width: 15px;
      height: 15px;
    }

    details.group {
      border: 1px solid var(--border);
      border-radius: 8px;
      margin-bottom: 8px;
      background: #fff;
    }

    details.group[open] {
      box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
    }

    summary {
      list-style: none;
      cursor: pointer;
      padding: 9px 10px;
      font-size: 13px;
      font-weight: 650;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    summary::-webkit-details-marker {
      display: none;
    }

    .tool-list {
      display: grid;
      gap: 6px;
      padding: 0 8px 8px;
    }

    .tool {
      display: grid;
      grid-template-columns: 12px 1fr;
      gap: 8px;
      align-items: center;
      padding: 8px;
      border: 1px solid #e5e7eb;
      border-radius: 6px;
      background: var(--panel-2);
      cursor: grab;
      user-select: none;
    }

    .tool strong {
      display: block;
      font-size: 13px;
    }

    .tool span:last-child {
      color: var(--muted);
      font-size: 11px;
    }

    .dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      border: 2px solid rgba(15, 23, 42, .22);
    }

    .canvas-shell {
      position: relative;
      min-width: 0;
      min-height: 0;
    }

    .topbar {
      position: absolute;
      top: 12px;
      left: 12px;
      right: 12px;
      z-index: 5;
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px;
      background: rgba(255, 255, 255, .92);
      border: 1px solid var(--border);
      border-radius: 8px;
      backdrop-filter: blur(10px);
      box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
    }

    .topbar #dagName {
      max-width: 150px;
    }

    .status {
      font-size: 12px;
      color: var(--muted);
      margin-left: auto;
    }

    .badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 3px 8px;
      border-radius: 999px;
      font-size: 12px;
      border: 1px solid var(--border);
      background: #fff;
    }

    .badge.completed {
      color: var(--success);
      background: #f0fdf4;
      border-color: #bbf7d0;
    }

    .badge.running {
      color: #1d4ed8;
      background: #eff6ff;
      border-color: #bfdbfe;
    }

    .badge.failed {
      color: var(--danger);
      background: #fff1f2;
      border-color: #fecdd3;
    }

    .badge.stale {
      color: var(--warning);
      background: #fffbeb;
      border-color: #fde68a;
    }

    #canvas {
      width: 100%;
      height: 100%;
      display: block;
      cursor: grab;
      user-select: none;
      -webkit-user-select: none;
    }

    #canvas circle[data-port] {
      cursor: crosshair;
    }

    #canvas text {
      user-select: none;
      -webkit-user-select: none;
      pointer-events: none;
    }

    body.canvas-pointer-active,
    body.canvas-pointer-active * {
      user-select: none !important;
      -webkit-user-select: none !important;
    }

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

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

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

    .inspector {
      background: var(--panel);
      border-left: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      min-height: 0;
      position: relative;
    }

    .inspector-head {
      padding: 14px;
      border-bottom: 1px solid var(--border);
    }

    .inspector-head h2 {
      margin: 0 0 6px;
      font-size: 16px;
    }

    .inspector-head p {
      margin: 0;
      color: var(--muted);
      font-size: 12px;
    }

    .tabs {
      display: flex;
      gap: 4px;
      padding: 8px;
      border-bottom: 1px solid var(--border);
      background: var(--panel-2);
    }

    .tab {
      flex: 1;
      padding: 7px 6px;
      font-size: 12px;
      border-radius: 6px;
    }

    .tab.active {
      background: var(--text);
      color: #fff;
      border-color: var(--text);
    }

    .inspector-body {
      padding: 14px;
      overflow: auto;
      min-height: 0;
    }

    .empty {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.5;
      padding: 16px;
    }

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

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

    .metric {
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 10px;
      background: var(--panel-2);
    }

    .metric span {
      display: block;
      color: var(--muted);
      font-size: 11px;
    }

    .metric strong {
      display: block;
      font-size: 18px;
      margin-top: 4px;
    }

    .schema-list {
      display: grid;
      gap: 8px;
    }

    .schema-row {
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 9px;
      background: #fff;
    }

    .schema-row strong {
      display: block;
      font-size: 13px;
    }

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

    /* Schema table sortable headers */
    th.sortable {
      cursor: pointer;
      user-select: none;
    }

    th.sortable:hover {
      background: #e2e8f0;
    }

    /* Schema table tag chips */
    .tag-chip {
      display: inline-flex;
      align-items: center;
      gap: 2px;
      padding: 1px 6px;
      margin: 1px;
      background: #eef2ff;
      border: 1px solid #c7d2fe;
      border-radius: 999px;
      font-size: 11px;
      line-height: 1.4;
    }

    .tag-chip .tag-remove {
      cursor: pointer;
      color: #ef4444;
      font-size: 12px;
      line-height: 1;
      margin-left: 2px;
      opacity: 0.6;
    }

    .tag-chip .tag-remove:hover {
      opacity: 1;
    }

    .tag-edit-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 18px;
      height: 18px;
      margin-left: 2px;
      background: #e2e8f0;
      border: 1px solid #cbd5e1;
      border-radius: 50%;
      cursor: pointer;
      font-size: 12px;
      color: #64748b;
      line-height: 1;
      vertical-align: middle;
    }

    .tag-edit-btn:hover {
      background: #cbd5e1;
    }

    .tag-edit-inline {
      display: none;
      margin-left: 4px;
      vertical-align: middle;
    }

    .tag-edit-inline input {
      width: 80px;
      padding: 2px 6px;
      border: 1px solid #cbd5e1;
      border-radius: 4px;
      font-size: 11px;
    }

    .tag-edit-inline button {
      padding: 2px 8px;
      margin-left: 2px;
      background: #6366f1;
      color: #fff;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      font-size: 11px;
    }

    .check-row {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 3px 0;
      font-size: 13px;
      cursor: pointer;
    }

    .check-row input[type="checkbox"] {
      width: auto;
      accent-color: var(--accent);
    }

    .check-row small {
      color: var(--muted);
      font-size: 11px;
    }

    .checkbox-grid {
      max-height: 220px;
      overflow-y: auto;
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 6px 8px;
      background: #fff;
    }

    .column-toolbar {
      display: flex;
      gap: 6px;
      margin-bottom: 4px;
    }

    .column-toolbar button {
      font-size: 11px;
      padding: 2px 8px;
    }

    .rename-list {
      max-height: 260px;
      overflow-y: auto;
      border: 1px solid var(--border);
      border-radius: 6px;
      background: #fff;
    }

    .rename-row {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 5px 8px;
      border-bottom: 1px solid #f1f5f9;
    }

    .rename-row:last-child {
      border-bottom: none;
    }

    .rename-from {
      font-size: 13px;
      min-width: 110px;
      color: var(--text);
    }

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

    .rename-row input {
      flex: 1;
      font-size: 13px;
      padding: 4px 6px;
    }

    .filter-builder {
      border: 1px solid var(--border);
      border-radius: 12px;
      background: linear-gradient(180deg, #fcfdff 0%, #f8fafc 100%);
      padding: 10px;
    }

    .filter-row {
      position: relative;
      display: grid;
      grid-template-columns: minmax(0, 2.8fr) minmax(150px, 1fr) minmax(0, 1.6fr) auto;
      gap: 8px;
      align-items: start;
      padding: 10px;
      background: rgba(255, 255, 255, .92);
      border: 1px solid #e2e8f0;
      border-radius: 12px;
      margin-bottom: 8px;
      box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    }

    .filter-row.with-handle {
      grid-template-columns: auto minmax(0, 1fr) auto;
      gap: 10px;
    }

    .filter-col {
      min-width: 160px;
      padding: 8px 10px;
      border: 1px solid #d7dde5;
      border-radius: 8px;
      font-size: 13px;
      background: #fff;
    }

    .filter-op {
      min-width: 90px;
      padding: 8px 10px;
      border: 1px solid #d7dde5;
      border-radius: 8px;
      font-size: 13px;
      background: #fff;
    }

    .filter-val {
      min-width: 0;
      padding: 9px 10px;
      border: 1px solid #d7dde5;
      border-radius: 8px;
      font-size: 13px;
      background: #fff;
    }

    .filter-row button {
      flex-shrink: 0;
      font-size: 12px;
      line-height: 1;
    }

    .filter-remove {
      width: 34px;
      height: 34px;
      padding: 0;
      border-radius: 10px;
      border-color: #fecdd3;
      color: #ef4444;
      background: transparent;
      font-size: 16px;
    }

    .filter-remove:hover {
      background: #fff1f2;
    }

    .filter-rule-content {
      min-width: 0;
      display: grid;
      gap: 6px;
      align-self: stretch;
    }

    .filter-rule-main {
      min-width: 0;
      display: grid;
      grid-template-columns: minmax(0, 2.1fr) minmax(180px, .9fr) minmax(0, 1.2fr);
      gap: 10px;
      align-items: center;
    }

    .filter-rule-main .filter-op {
      width: 100%;
      align-self: center;
    }

    .filter-rule-meta {
      min-width: 0;
    }

    .filter-rule-extra {
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: nowrap;
      justify-content: flex-start;
    }

    .filter-rule-extra.filter-rule-extra-empty {
      visibility: hidden;
    }

    .fo-null-op-group {
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
    }

    .fo-drop-missing-tag {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      color: var(--muted);
      white-space: nowrap;
    }

    .fo-drop-missing-tag select {
      width: auto;
    }

    .fo-extra-select {
      width: 100%;
      min-width: 0;
      font-size: 13px;
      padding: 8px 10px;
      border-radius: 8px;
    }

    .fo-range {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      flex-wrap: nowrap;
      width: 100%;
    }

    .fo-range input,
    .filter-rule-extra .filter-val {
      min-width: 0;
      width: 100%;
      max-width: none;
    }

    .filter-remove {
      align-self: start;
      margin-top: 2px;
    }

    .filter-actions {
      display: flex;
      gap: 10px;
      align-items: center;
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px solid #e5e7eb;
      font-size: 12px;
    }

    .filter-actions select {
      width: auto;
    }

    .fo-drag-handle {
      cursor: grab;
      color: #94a3b8;
      font-size: 14px;
      letter-spacing: -2px;
      user-select: none;
      padding: 0 2px;
      line-height: 1;
    }

    .fo-drag-handle:active {
      cursor: grabbing;
    }

    .filter-row.drag-over {
      border-color: #6366f1;
      background: #eef2ff;
    }

    .filter-col option {
      padding: 4px 6px;
    }

    .tag-pill {
      display: inline-block;
      font-size: 9px;
      padding: 1px 5px;
      border-radius: 8px;
      margin-left: 3px;
      font-weight: 550;
      line-height: 1.5;
      vertical-align: middle;
    }

    .col-type-badge {
      display: inline-block;
      font-size: 9px;
      padding: 1px 5px;
      border-radius: 8px;
      background: #f1f5f9;
      color: #64748b;
      margin-left: 2px;
      font-weight: 500;
      vertical-align: middle;
    }

    .filter-preview {
      font-size: 11px;
      color: var(--muted);
      margin-top: 8px;
      padding: 8px 10px;
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    }

    .filter-col-shell {
      position: relative;
      min-width: 0;
    }

    .filter-col-trigger {
      width: 100%;
      min-height: 56px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 8px 10px;
      border: 1px solid #cbd5e1;
      border-radius: 10px;
      background: #fff;
      text-align: left;
    }

    .filter-col-trigger:hover,
    .filter-col-trigger.active {
      border-color: #93c5fd;
      box-shadow: 0 0 0 3px rgba(37, 99, 235, .10);
    }

    .filter-col-main {
      min-width: 0;
      display: grid;
      gap: 5px;
    }

    .filter-col-name {
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .filter-col-name-row {
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 8px;
      width: 100%;
    }

    .filter-col-name-row .filter-col-name {
      min-width: 0;
      flex: 1;
    }

    .filter-col-missing-inline {
      flex-shrink: 0;
      margin-left: auto;
      font-size: 11px;
      color: #64748b;
      white-space: nowrap;
      text-align: right;
    }

    .filter-col-meta {
      min-width: 0;
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 6px;
    }

    .filter-col-caret {
      flex-shrink: 0;
      color: #64748b;
      font-size: 12px;
    }

    .filter-col-selected-summary {
      font-size: 11px;
      line-height: 1.45;
      color: #64748b;
      display: grid;
      gap: 6px;
      justify-items: start;
    }

    .filter-col-selected-summary-line {
      min-width: 0;
      display: flex;
      align-items: flex-start;
      gap: 8px;
    }

    .filter-col-selected-summary-text {
      min-width: 0;
      flex: 1;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .filter-col-selected-summary-line.expanded .filter-col-selected-summary-text {
      white-space: normal;
      overflow: visible;
      text-overflow: clip;
      word-break: break-word;
    }

    .filter-col-selected-summary-label {
      flex-shrink: 0;
      font-size: 10px;
      font-weight: 700;
      letter-spacing: .02em;
      text-transform: uppercase;
      color: #94a3b8;
      padding-top: 1px;
    }

    .filter-col-selected-summary-pillrow {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      min-width: 0;
    }

    .filter-col-selected-summary-pill {
      display: inline-flex;
      align-items: center;
      max-width: 100%;
      padding: 2px 7px;
      border-radius: 999px;
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      color: #475569;
      white-space: nowrap;
    }

    .filter-col-summary-toggle {
      flex-shrink: 0;
      width: 18px;
      height: 18px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 999px;
      border: 1px solid #cbd5e1;
      color: #64748b;
      background: #fff;
      font-size: 10px;
      cursor: pointer;
    }

    .filter-rule-summary-line {
      min-width: 0;
      display: flex;
      align-items: flex-start;
      gap: 6px;
      flex-wrap: wrap;
    }

    .filter-rule-summary-line .filter-col-selected-summary-pillrow {
      flex: 1;
    }

    .filter-type-badge,
    .filter-tag-chip,
    .filter-tag-more {
      display: inline-flex;
      align-items: center;
      height: 22px;
      padding: 0 8px;
      border-radius: 999px;
      font-size: 11px;
      white-space: nowrap;
    }

    .filter-type-badge {
      background: #eff6ff;
      border: 1px solid #bfdbfe;
      color: #1d4ed8;
    }

    .filter-tag-chip {
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      color: #334155;
      max-width: 110px;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .filter-tag-more {
      background: #fef3c7;
      border: 1px solid #fcd34d;
      color: #92400e;
    }

    .filter-col-panel {
      position: absolute;
      left: 0;
      right: 0;
      top: calc(100% + 8px);
      z-index: 20;
      padding: 10px;
      border: 1px solid #cbd5e1;
      border-radius: 14px;
      background: rgba(255, 255, 255, .98);
      box-shadow: 0 24px 50px rgba(15, 23, 42, .18);
      backdrop-filter: blur(8px);
    }

    .filter-col-panel-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 8px;
    }

    .filter-col-panel-title {
      font-size: 13px;
      font-weight: 700;
    }

    .filter-col-panel-count {
      font-size: 11px;
      color: var(--muted);
    }

    .filter-col-toolbar {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      margin-bottom: 8px;
    }

    .filter-col-toolbar input {
      padding: 8px 10px;
    }

    .filter-tag-filter-row {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-bottom: 8px;
    }

    .filter-tag-filter {
      padding: 4px 9px;
      border-radius: 999px;
      border: 1px solid #dbeafe;
      background: #eff6ff;
      color: #1d4ed8;
      font-size: 11px;
    }

    .filter-tag-filter.active {
      background: #2563eb;
      border-color: #2563eb;
      color: #fff;
    }

    .filter-col-list {
      max-height: 260px;
      overflow-y: auto;
      display: grid;
      gap: 8px;
      padding-right: 2px;
    }

    .filter-col-option {
      display: grid;
      gap: 6px;
      padding: 10px;
      border: 1px solid #e2e8f0;
      border-radius: 12px;
      background: #fff;
      text-align: left;
    }

    .filter-col-option:hover {
      border-color: #93c5fd;
      background: #f8fbff;
    }

    .filter-col-option.selected {
      border-color: #60a5fa;
      background: linear-gradient(180deg, #eff6ff 0%, #f8fbff 100%);
      box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .22);
    }

    .filter-col-option-top {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      align-items: start;
    }

    .filter-col-option-main {
      width: 100%;
      display: grid;
      gap: 6px;
      background: transparent;
      border: none;
      padding: 0;
      text-align: left;
    }

    .filter-col-option-head {
      display: flex;
      align-items: start;
      justify-content: space-between;
      gap: 10px;
    }

    .filter-col-option-name {
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
    }

    .filter-col-option-tags {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      min-width: 0;
    }

    .filter-col-stats-toggle {
      width: 24px;
      height: 24px;
      border-radius: 999px;
      border: 1px solid #cbd5e1;
      background: #fff;
      color: #64748b;
      font-size: 12px;
      font-weight: 700;
      flex-shrink: 0;
    }

    .filter-col-stats-toggle.active {
      border-color: #93c5fd;
      background: #eff6ff;
      color: #1d4ed8;
    }

    .filter-col-option-stats {
      display: none;
      flex-wrap: wrap;
      gap: 10px;
      padding-top: 2px;
      font-size: 11px;
      color: #64748b;
      line-height: 1.45;
    }

    .filter-col-option:hover .filter-col-option-stats,
    .filter-col-option.selected .filter-col-option-stats,
    .filter-col-option.stats-open .filter-col-option-stats {
      display: flex;
    }

    .filter-col-helper {
      margin-bottom: 8px;
      padding: 8px 10px;
      border-radius: 10px;
      background: #f8fafc;
      border: 1px dashed #cbd5e1;
      color: #64748b;
      font-size: 11px;
    }

    .filter-col-empty {
      padding: 18px 10px;
      text-align: center;
      color: var(--muted);
      font-size: 12px;
    }

    .drawer {
      grid-column: 2 / span 2;
      grid-row: 2;
      position: relative;
      background: var(--panel);
      border-top: 1px solid var(--border);
      display: grid;
      grid-template-rows: auto 1fr;
      min-height: 0;
    }

    .drawer-resize-handle {
      position: absolute;
      top: -5px;
      left: 0;
      right: 0;
      height: 10px;
      cursor: row-resize;
      z-index: 20;
    }

    .drawer-resize-handle::before {
      content: "";
      position: absolute;
      top: 4px;
      left: 0;
      right: 0;
      height: 1px;
      background: var(--border);
      transition: background .12s ease, height .12s ease;
    }

    .drawer-resize-handle:hover::before,
    body.drawer-resizing .drawer-resize-handle::before {
      height: 2px;
      background: var(--accent);
    }

    .drawer-head {
      padding: 10px 14px;
      display: flex;
      align-items: center;
      gap: 10px;
      border-bottom: 1px solid var(--border);
      background: var(--panel-2);
    }

    .drawer-head strong {
      font-size: 14px;
      font-weight: 700;
    }

    .drawer-tabs button.active {
      background: var(--accent);
      color: #fff;
    }

    .drawer-head .drawer-tabs {
      margin-left: auto;
      display: flex;
      gap: 6px;
    }

    .drawer-body {
      overflow: auto;
      min-height: 0;
      padding: 0;
    }

    .drawer-body .empty {
      padding: 40px 20px;
      text-align: center;
      color: var(--muted);
      font-size: 13px;
    }

    table {
      width: 100%;
      border-collapse: collapse;
      font-size: 12px;
    }

    th,
    td {
      border-bottom: 1px solid #e5e7eb;
      padding: 7px 8px;
      text-align: left;
      white-space: nowrap;
    }

    th {
      position: sticky;
      top: 0;
      background: #f8fafc;
      z-index: 1;
      color: #334155;
    }

    tr:hover td {
      background: #f8fafc;
    }

    .log {
      white-space: pre-wrap;
      font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
      font-size: 12px;
      color: #334155;
    }

    /* === Column Tagging System === */
    .tag-section {
      margin-top: 12px;
      border-top: 1px solid var(--border);
      padding-top: 10px;
    }

    .tag-section-title {
      font-size: 12px;
      font-weight: 600;
      color: var(--muted);
      margin: 0 0 6px;
    }

    .tag-list {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
      margin: 6px 0;
    }

    .tag-item {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px 8px;
      background: #eef2ff;
      border: 1px solid #c7d2fe;
      border-radius: 999px;
      font-size: 12px;
      cursor: pointer;
    }

    .tag-item .tag-del {
      cursor: pointer;
      color: var(--danger);
      font-size: 14px;
      line-height: 1;
      margin-left: 2px;
      opacity: 0.6;
    }

    .tag-item .tag-del:hover {
      opacity: 1;
    }

    .tag-edit-area {
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 8px;
      background: #fff;
      margin: 6px 0;
      max-height: 200px;
      overflow-y: auto;
    }

    .tag-edit-area .check-row {
      padding: 2px 0;
    }

    .tag-create-row {
      display: flex;
      gap: 6px;
      margin: 6px 0;
    }

    .tag-create-row input {
      flex: 1;
    }

    .tag-create-row button {
      flex-shrink: 0;
    }

    .auto-tag-buttons {
      display: flex;
      gap: 4px;
      flex-wrap: wrap;
      margin: 4px 0;
    }

    .auto-tag-buttons button {
      font-size: 11px;
      padding: 3px 8px;
    }

    .tag-quick-select {
      margin-top: 8px;
      padding: 6px;
      border: 1px dashed var(--border);
      border-radius: 6px;
      background: #fafbfc;
    }

    .tag-quick-select-title {
      font-size: 11px;
      color: var(--muted);
      font-weight: 600;
      margin: 0 0 4px;
    }

    .tag-qsel-group {
      margin: 4px 0;
    }

    .tag-qsel-group-label {
      font-size: 11px;
      color: var(--muted);
      margin: 0 0 2px;
    }

    .tag-qsel-btns {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
    }

    .tag-qsel-chip {
      display: inline-flex;
      align-items: stretch;
      border-radius: 999px;
      overflow: hidden;
      border: 1px solid #c7d2fe;
      background: #eef2ff;
    }

    .tag-qsel-chip.active {
      background: #4f46e5;
      border-color: #4f46e5;
    }

    .tag-qsel-btn {
      font-size: 11px;
      padding: 2px 8px;
      border-radius: 0;
      background: transparent;
      border: none;
      cursor: pointer;
    }

    .tag-qsel-btn:hover {
      background: #dbeafe;
    }

    .tag-qsel-chip.active .tag-qsel-btn {
      color: #fff;
    }

    .tag-qsel-chip.active .tag-qsel-btn:hover {
      background: rgba(255, 255, 255, 0.12);
    }

    .tag-qsel-del {
      font-size: 11px;
      padding: 2px 7px 2px 6px;
      border: none;
      border-left: 1px solid rgba(99, 102, 241, 0.25);
      border-radius: 0;
      background: transparent;
      color: #475569;
      cursor: pointer;
    }

    .tag-qsel-del:hover {
      background: #fee2e2;
      color: #b91c1c;
    }

    .tag-qsel-chip.active .tag-qsel-del {
      color: rgba(255, 255, 255, 0.92);
      border-left-color: rgba(255, 255, 255, 0.22);
    }

    .tag-qsel-chip.active .tag-qsel-del:hover {
      background: rgba(185, 28, 28, 0.24);
      color: #fff;
    }


    /* Baseline Config Drawer */
    .bl-config-overlay {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 680px;
      max-height: 80vh;
      background: #fff;
      border-radius: 10px;
      box-shadow: 0 8px 40px rgba(15, 23, 42, .25);
      z-index: 9999;
      display: none;
      grid-template-rows: auto 1fr;
      overflow: hidden;
    }

    .bl-config-overlay.show {
      display: grid;
    }

    .bl-config-overlay-header {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 16px;
      background: #f8fafc;
      border-bottom: 1px solid #e2e8f0;
      user-select: none;
    }

    .bl-config-overlay-header h2 {
      font-size: 15px;
      margin: 0;
      flex: 1;
    }

    .bl-config-overlay-close {
      width: 28px;
      height: 28px;
      border: none;
      background: transparent;
      cursor: pointer;
      font-size: 20px;
      color: #64748b;
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .bl-config-overlay-close:hover {
      background: #fee2e2;
      color: #b91c1c;
    }

    .bl-config-overlay-body {
      overflow: auto;
      padding: 16px;
      min-height: 0;
    }

    .bl-config-overlay-body .config-section {
      margin-bottom: 18px;
    }

    .bl-config-overlay-body .config-section:last-child {
      margin-bottom: 0;
    }

    .bl-config-overlay-body .config-section>label {
      display: block;
      font-size: 12px;
      font-weight: 600;
      color: var(--muted);
      margin-bottom: 6px;
    }

    .bl-var-group {
      border: 1px solid var(--border);
      border-radius: 8px;
      overflow: hidden;
      margin-bottom: 12px;
    }

    .bl-var-group:last-child {
      margin-bottom: 0;
    }

    .bl-var-group-header {
      padding: 10px 14px;
      background: #f8fafc;
      border-bottom: 1px solid var(--border);
      font-size: 13px;
      font-weight: 650;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .bl-var-icon {
      font-size: 15px;
    }

    .bl-var-group-body {
      padding: 12px 14px;
      display: grid;
      gap: 10px;
      background: #fff;
    }

    .bl-var-row {
      display: grid;
      gap: 4px;
    }

    .bl-var-row label {
      font-size: 11px;
      font-weight: 600;
      color: var(--muted);
    }

    .bl-config-overlay-footer {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
      padding: 12px 16px;
      border-top: 1px solid var(--border);
      background: #f8fafc;
    }

    /* Profile overlay */
    .profile-overlay-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, .35);
      z-index: 9998;
      display: none;
    }

    .profile-overlay-backdrop.show {
      display: block;
    }

    .profile-overlay {
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 1100px;
      height: 750px;
      min-width: 600px;
      min-height: 400px;
      background: #fff;
      border-radius: 10px;
      box-shadow: 0 8px 40px rgba(15, 23, 42, .25);
      z-index: 9999;
      display: none;
      grid-template-rows: auto 1fr;
      overflow: hidden;
    }

    .profile-overlay.show {
      display: grid;
    }

    .profile-overlay-header {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 10px 14px;
      background: #f8fafc;
      border-bottom: 1px solid #e2e8f0;
      cursor: move;
      user-select: none;
    }

    .profile-overlay-header h2 {
      font-size: 15px;
      margin: 0;
      flex: 1;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .profile-overlay-header .po-metrics {
      display: flex;
      gap: 16px;
    }

    .profile-overlay-header .po-metric {
      text-align: center;
    }

    .profile-overlay-header .po-metric span {
      font-size: 10px;
      color: #64748b;
      display: block;
    }

    .profile-overlay-header .po-metric strong {
      font-size: 16px;
    }

    .po-quick-tag-row {
      display: flex;
      gap: 6px;
      margin: 8px 0 4px;
    }

    .po-quick-tag-btn {
      font-size: 11px;
      padding: 2px 8px;
      background: #f59e0b;
      color: #fff;
      border: none;
      border-radius: 3px;
      cursor: pointer;
      line-height: 1.4;
    }

    .po-quick-tag-btn:hover {
      background: #d97706;
    }

    .profile-overlay-close {
      width: 28px;
      height: 28px;
      border: none;
      background: transparent;
      cursor: pointer;
      font-size: 18px;
      color: #64748b;
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .profile-overlay-close:hover {
      background: #fee2e2;
      color: #b91c1c;
    }

    .profile-overlay-body {
      display: grid;
      grid-template-columns: 280px minmax(0, 1fr);
      grid-template-rows: minmax(0, 1fr);
      height: 100%;
      overflow: hidden;
      min-height: 0;
    }

    .profile-overlay-body .sidebar {
      display: flex;
      flex-direction: column;
      border-right: 1px solid #e2e8f0;
      background: #fff;
      min-height: 0;
      min-width: 0;
      overflow: hidden;
    }

    .profile-overlay-body .sidebar-search {
      flex: 0 0 auto;
      padding: 8px;
      background: #fff;
      border-bottom: 1px solid #e2e8f0;
      z-index: 1;
    }

    .profile-overlay-body #poColList {
      flex: 1 1 auto;
      min-height: 0;
      overflow-y: auto;
    }

    .profile-overlay-body .sidebar-search input {
      width: 100%;
      padding: 6px 10px;
      border: 1px solid #e2e8f0;
      border-radius: 6px;
      font-size: 13px;
    }

    .profile-overlay-body .sidebar-sort-bar {
      flex: 0 0 auto;
      display: flex;
      gap: 2px;
      padding: 6px 8px;
      background: #f8fafc;
      border-bottom: 1px solid #e2e8f0;
    }

    .profile-overlay-body .sidebar-sort-bar .sort-btn {
      flex: 1;
      padding: 4px 6px;
      border: 1px solid #e2e8f0;
      border-radius: 4px;
      background: #fff;
      font-size: 11px;
      font-weight: 500;
      color: #64748b;
      cursor: pointer;
      text-align: center;
      white-space: nowrap;
      transition: all 0.15s;
    }

    .profile-overlay-body .sidebar-sort-bar .sort-btn:hover {
      background: #eef2ff;
      border-color: #c7d2fe;
    }

    .profile-overlay-body .sidebar-sort-bar .sort-btn.active {
      background: #4f46e5;
      border-color: #4f46e5;
      color: #fff;
    }

    .profile-overlay-body .col-missing-badge {
      font-size: 10px;
      padding: 1px 5px;
      border-radius: 999px;
      margin-left: auto;
      flex-shrink: 0;
      font-weight: 500;
    }

    .profile-overlay-body .col-missing-badge.zero {
      background: #dcfce7;
      color: #15803d;
    }

    .profile-overlay-body .col-missing-badge.low {
      background: #fef3c7;
      color: #92400e;
    }

    .profile-overlay-body .col-missing-badge.high {
      background: #fee2e2;
      color: #991b1b;
    }

    .profile-overlay-body .batch-bar {
      flex: 0 0 auto;
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 8px;
      background: #f0f9ff;
      border-top: 1px solid #bae6fd;
      font-size: 12px;
      z-index: 2;
    }

    .profile-overlay-body .batch-bar #poBatchCount {
      font-weight: 600;
      color: #0369a1;
      white-space: nowrap;
      margin-right: 4px;
    }

    .profile-overlay-body .batch-bar .po-quick-tag-btn {
      padding: 3px 8px;
      border: 1px solid #e2e8f0;
      border-radius: 4px;
      background: #fff;
      font-size: 11px;
      font-weight: 500;
      cursor: pointer;
      white-space: nowrap;
    }

    .profile-overlay-body .batch-bar .po-quick-tag-btn:hover {
      background: #f1f5f9;
    }

    .profile-overlay-body .batch-bar input {
      flex: 1;
      min-width: 0;
      padding: 3px 6px;
      border: 1px solid #e2e8f0;
      border-radius: 4px;
      font-size: 11px;
    }

    .profile-overlay-body .batch-bar #poBatchTagBtn {
      padding: 3px 8px;
      border: 1px solid #4f46e5;
      border-radius: 4px;
      background: #4f46e5;
      color: #fff;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      flex-shrink: 0;
    }



    .profile-overlay-body .col-group {
      padding: 4px 0;
    }



    .profile-overlay-body .col-group-title {
      font-size: 11px;
      font-weight: 600;
      color: #64748b;
      text-transform: uppercase;
      padding: 6px 12px 2px;
    }

    .profile-overlay-body .col-item {
      padding: 6px 12px;
      cursor: pointer;
      font-size: 13px;
      display: flex;
      align-items: center;
      gap: 6px;
      border-left: 3px solid transparent;
    }

    .profile-overlay-body .col-item:hover {
      background: #f1f5f9;
    }

    .profile-overlay-body .col-item.active {
      background: #eef2ff;
      border-left-color: #4f46e5;
    }

    .profile-overlay-body .col-item.selected {
      background: #eef2ff;
    }

    .profile-overlay-body .col-item.selected::before {
      content: "\2611";
      font-size: 12px;
      margin-right: 2px;
      flex-shrink: 0;
      color: #4f46e5;
    }

    .profile-overlay-body .col-item:not(.selected)::before {
      content: "\25C9";
      font-size: 10px;
      margin-right: 2px;
      flex-shrink: 0;
      color: #94a3b8;
    }

    .profile-overlay-body .col-item.active.selected {
      background: #eef2ff;
      border-left-color: #4f46e5;
    }

    .profile-overlay-body .col-item .col-name {
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .profile-overlay-body .col-item .col-delete-btn {
      display: none;
      flex-shrink: 0;
      width: 18px;
      height: 18px;
      line-height: 16px;
      text-align: center;
      font-size: 14px;
      font-weight: 700;
      color: #94a3b8;
      border-radius: 3px;
      cursor: pointer;
      margin-left: 2px;
      user-select: none;
    }

    .profile-overlay-body .col-item:hover .col-delete-btn {
      display: block;
    }

    .profile-overlay-body .col-item .col-delete-btn:hover {
      background: #fee2e2;
      color: #ef4444;
    }

    .profile-overlay-body .col-item.confirm-delete {
      background: #fef2f2 !important;
      border-left-color: #ef4444 !important;
      animation: confirmPulse 0.6s ease-in-out infinite alternate;
    }

    @keyframes confirmPulse {
      from {
        background: #fef2f2;
      }

      to {
        background: #fee2e2;
      }
    }

    .profile-overlay-body .col-item.confirm-delete .col-delete-btn {
      display: block;
      color: #ef4444;
      font-size: 11px;
      width: auto;
      padding: 0 6px;
      border-radius: 4px;
      background: #fecaca;
    }

    .profile-overlay-body .col-item.confirm-delete .col-delete-btn:hover {
      background: #fca5a5;
    }


    .profile-overlay-body .col-item .col-badge {
      font-size: 10px;
      padding: 1px 6px;
      border-radius: 999px;
    }

    .profile-overlay-body .detail {
      display: flex;
      flex-direction: column;
      overflow: hidden;
      padding: 16px;
      min-height: 0;
      min-width: 0;
    }

    .profile-overlay-body #poDetailContent {
      display: block;
      flex: 1 1 auto;
      min-height: 0;
      min-width: 0;
      overflow-y: auto;
      padding-right: 4px;
    }

    .profile-overlay-body .detail-main-content {
      display: block;
      flex: none;
    }

    .profile-overlay-body .detail-header {
      display: flex;
      align-items: center;
      gap: 10px;
      margin: 0 0 16px;
      padding: 0;
      border-top: none;
    }

    .profile-overlay-body .detail-header h3 {
      font-size: 20px;
      margin: 0;
    }

    .profile-overlay-body .stats-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
      gap: 8px;
      margin-bottom: 16px;
    }

    .profile-overlay-body .stat-card {
      background: #fff;
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      padding: 10px;
    }

    .profile-overlay-body .stat-card .stat-label {
      font-size: 11px;
      color: #64748b;
    }

    .profile-overlay-body .stat-card .stat-value {
      font-size: 16px;
      font-weight: 600;
      margin-top: 2px;
    }

    .profile-overlay-body .missing-bar {
      margin: 8px 0;
    }

    .profile-overlay-body .missing-bar .bar-track {
      background: #f1f5f9;
      border-radius: 4px;
      height: 8px;
      overflow: hidden;
    }

    .profile-overlay-body .missing-bar .bar-fill {
      background: #f87171;
      height: 100%;
      border-radius: 4px;
    }

    .profile-overlay-body .missing-bar .bar-label {
      font-size: 11px;
      color: #64748b;
      margin-top: 2px;
    }

    .profile-overlay-body .histogram {
      display: flex;
      align-items: flex-end;
      gap: 2px;
      height: 80px;
      margin: 8px 0;
    }

    .profile-overlay-body .histogram .bar {
      flex: 1;
      background: #3b82f6;
      border-radius: 2px 2px 0 0;
      min-height: 2px;
    }

    .profile-overlay-body .histogram .bar:hover {
      background: #2563eb;
    }

    .profile-overlay-body .value-counts {
      font-size: 13px;
      margin: 8px 0;
    }

    .profile-overlay-body .value-counts .vc-row {
      display: flex;
      align-items: center;
      gap: 8px;
      margin: 3px 0;
    }

    .profile-overlay-body .value-counts .vc-label {
      width: 160px;
      flex-shrink: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .profile-overlay-body .value-counts .vc-track {
      flex: 1;
      background: #f1f5f9;
      border-radius: 3px;
      height: 18px;
      overflow: hidden;
    }

    .profile-overlay-body .value-counts .vc-fill {
      background: #8b5cf6;
      height: 100%;
      border-radius: 3px;
    }

    .profile-overlay-body .value-counts .vc-count {
      font-size: 11px;
      color: #64748b;
      min-width: 40px;
      text-align: right;
    }

    .profile-overlay-body .tag-section {
      margin-top: 16px;
      padding-top: 12px;
      border-top: 1px solid #e2e8f0;
    }

    .profile-overlay-body .tag-section h4 {
      font-size: 13px;
      margin-bottom: 8px;
    }

    .profile-overlay-body .tag-chips {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-bottom: 8px;
    }

    .profile-overlay-body .tag-chip {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 3px 10px;
      border-radius: 999px;
      font-size: 12px;
      background: #eef2ff;
      border: 1px solid #c7d2fe;
    }

    .profile-overlay-body .tag-chip .tag-del {
      cursor: pointer;
      color: #ef4444;
      font-size: 14px;
    }

    .profile-overlay-body .add-tag-row {
      display: flex;
      gap: 6px;
    }

    .profile-overlay-body .add-tag-row input {
      flex: 1;
      padding: 4px 8px;
      border: 1px solid #e2e8f0;
      border-radius: 6px;
      font-size: 12px;
    }

    .profile-overlay-body .add-tag-row button {
      padding: 4px 12px;
      font-size: 12px;
      border-radius: 6px;
      border: none;
      background: #4f46e5;
      color: #fff;
      cursor: pointer;
    }

    .profile-overlay-body .detail-fill-section {
      margin-top: 16px;
      padding-top: 12px;
      border-top: 1px dashed #dbe3ef;
      display: block;
      min-height: 0;
      flex: none;
    }

    .profile-overlay-body .detail-fill-section h4 {
      font-size: 13px;
      margin: 0 0 10px;
    }

    .profile-overlay-body .detail-fill-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 12px;
      align-content: start;
    }

    .profile-overlay-body .detail-fill-card {
      border: 1px solid #e2e8f0;
      border-radius: 10px;
      background: #fff;
      padding: 10px 12px;
      height: 100%;
      display: flex;
      flex-direction: column;
      min-height: 0;
    }

    .profile-overlay-body .detail-fill-card h5 {
      margin: 0 0 8px;
      font-size: 12px;
      color: #475569;
    }

    .profile-overlay-body .detail-kv {
      display: grid;
      grid-template-columns: auto 1fr;
      gap: 6px 10px;
      align-items: baseline;
      font-size: 12px;
    }

    .profile-overlay-body .detail-kv dt {
      color: #64748b;
      margin: 0;
    }

    .profile-overlay-body .detail-kv dd {
      margin: 0;
      color: #0f172a;
      font-weight: 500;
      word-break: break-word;
    }

    .profile-overlay-body .detail-token-list {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      align-content: flex-start;
    }

    .profile-overlay-body .detail-token {
      display: inline-flex;
      align-items: center;
      padding: 3px 8px;
      border-radius: 999px;
      font-size: 11px;
      background: #f8fafc;
      border: 1px solid #dbe3ef;
      color: #334155;
      max-width: 100%;
    }

    .profile-overlay-body .detail-level-list {
      display: grid;
      gap: 6px;
      align-content: start;
    }

    .profile-overlay-body .detail-level-row {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      align-items: center;
      font-size: 12px;
    }

    .profile-overlay-body .detail-level-name {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      color: #0f172a;
    }

    .profile-overlay-body .detail-level-count {
      color: #64748b;
      font-variant-numeric: tabular-nums;
    }

    @media (max-width: 1200px) {
      .profile-overlay-body .detail-fill-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
      }
    }

    .chart-tab-btn:hover {
      background: var(--panel-2) !important;
    }

    .profile-overlay-resize {
      position: absolute;
      right: 0;
      bottom: 0;
      width: 16px;
      height: 16px;
      cursor: nwse-resize;
      background: linear-gradient(135deg, transparent 50%, #cbd5e1 50%, transparent 60%);
    }

    .profile-overlay-body .col-badge.numeric {
      background: #dbeafe;
      color: #1e40af;
    }

    .profile-overlay-body .col-badge.categorical {
      background: #fae8ff;
      color: #86198f;
    }

    .profile-overlay-body .col-badge.binary {
      background: #fef3c7;
      color: #92400e;
    }

    .profile-overlay-body .col-badge.datetime {
      background: #d1fae5;
      color: #065f46;
    }

    .profile-overlay-body .col-badge.text,
    .profile-overlay-body .col-badge.identifier,
    .profile-overlay-body .col-badge.other {
      background: #f1f5f9;
      color: #475569;
    }

    .profile-overlay-body .tag-badges {
      display: flex;
      gap: 3px;
      flex-wrap: wrap;
    }

    .profile-overlay-body .tag-badge {
      font-size: 10px;
      padding: 1px 6px;
      border-radius: 999px;
      background: #eef2ff;
      color: #4338ca;
      border: 1px solid #c7d2fe;
    }

    .profile-overlay-body .empty-state {
      padding: 40px;
      text-align: center;
      color: #94a3b8;
    }

    /* ── 图表设置 Modal 侧边栏 ──────────────────── */
    .chart-modal-sidebar {
      width: 200px;
      min-width: 160px;
      border-right: 1px solid var(--border);
      overflow-y: auto;
      background: #f8fafc;
      display: flex;
      flex-direction: column;
    }

    .chart-modal-sidebar-header {
      padding: 10px 14px;
      font-size: 11px;
      font-weight: 600;
      color: #64748b;
      text-transform: uppercase;
      letter-spacing: 0.6px;
      border-bottom: 1px solid var(--border);
      background: #f1f5f9;
      position: sticky;
      top: 0;
      z-index: 2;
      font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    .chart-modal-item {
      padding: 10px 14px;
      font-size: 13px;
      font-weight: 500;
      color: #334155;
      border-bottom: 1px solid #f1f5f9;
      cursor: pointer;
      transition: background 0.15s, color 0.15s, border-color 0.15s;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      border-left: 3px solid transparent;
    }

    .chart-modal-item:hover {
      background: #eef2ff;
      color: #3730a3;
      border-left-color: #a5b4fc;
    }

    .chart-modal-item.active {
      background: #dbeafe;
      color: #1e40af;
      font-weight: 600;
      border-left: 3px solid #2563eb;
    }

    .chart-modal-check {
      display: flex;
      align-items: center;
      gap: 8px;
      cursor: pointer;
      font-weight: inherit;
      color: inherit;
      margin: 0;
      font-size: inherit;
    }

    .chart-modal-check input[type="checkbox"] {
      width: 15px;
      height: 15px;
      accent-color: #2563eb;
      cursor: pointer;
      flex-shrink: 0;
    }

    .chart-modal-name {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .chart-modal-item-empty {
      padding: 24px 14px;
      font-size: 12px;
      color: #94a3b8;
      text-align: center;
      line-height: 1.7;
      font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    /* ── Chart Settings Modal ──────────────────── */
    .chart-modal-layout {
      flex: 1;
      display: flex;
      min-height: 0;
      overflow: hidden;
    }

    .chart-modal-picker {
      width: 240px;
      min-width: 200px;
      border-right: 1px solid var(--border);
      overflow-y: auto;
      background: #f8fafc;
    }

    .chart-modal-picker-header {
      padding: 10px 14px;
      font-size: 11px;
      font-weight: 600;
      color: #64748b;
      text-transform: uppercase;
      letter-spacing: 0.6px;
      border-bottom: 1px solid var(--border);
      background: #f1f5f9;
      position: sticky;
      top: 0;
      z-index: 2;
    }

    .chart-modal-pick-row {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 9px 14px;
      font-size: 13px;
      font-weight: 500;
      color: #334155;
      border-bottom: 1px solid #f1f5f9;
      cursor: pointer;
      transition: background 0.12s;
      border-left: 3px solid transparent;
    }

    .chart-modal-pick-row:hover {
      background: #eef2ff;
    }

    .chart-modal-pick-row.active {
      background: #dbeafe;
      color: #1e40af;
      font-weight: 600;
      border-left-color: #2563eb;
    }

    .chart-modal-pick-row input[type="checkbox"] {
      width: 15px;
      height: 15px;
      accent-color: #2563eb;
      cursor: pointer;
      flex-shrink: 0;
      margin: 0;
    }

    .chart-modal-pick-row .pick-label {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .chart-modal-body {
      flex: 1;
      overflow-y: auto;
      padding: 20px 24px;
      min-width: 0;
    }

    .chart-modal-body h3 {
      margin: 0 0 4px;
      font-size: 15px;
      font-weight: 650;
    }

    .chart-modal-body .chart-desc {
      color: var(--muted);
      font-size: 12px;
      margin: 0 0 16px;
      line-height: 1.4;
    }

    .chart-modal-body .section-header {
      margin: 18px 0 8px;
      padding: 8px 12px;
      border-radius: 6px;
      font-size: 12px;
      font-weight: 650;
      letter-spacing: 0.3px;
      text-transform: uppercase;
    }

    .chart-modal-body .section-header.compute {
      background: #dbeafe;
      color: #1e40af;
      border-left: 3px solid #2563eb;
    }

    .chart-modal-body .section-header.display {
      background: #ede9fe;
      color: #6d28d9;
      border-left: 3px solid #7c3aed;
    }

    .chart-modal-body .section-header.global {
      background: #f1f5f9;
      color: #475569;
      border-left: 3px solid #94a3b8;
    }

    .chart-modal-body .section-title {
      margin: 20px 0 8px;
      padding-top: 16px;
      border-top: 1px solid var(--border);
      font-size: 13px;
      font-weight: 650;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.3px;
    }

    .chart-modal-body .field-grid {
      display: grid;
      gap: 10px;
    }

    .chart-modal-footer {
      padding: 12px 16px;
      border-top: 1px solid var(--border);
      display: flex;
      gap: 8px;
      justify-content: flex-end;
      background: #fafbfc;
    }

    .chart-modal-empty {
      padding: 40px 24px;
      text-align: center;
      color: #94a3b8;
      font-size: 13px;
      line-height: 1.6;
    }



    /* ── Impute Missing overlay ── */

    .profile-overlay .im-overlay-body {
      grid-template-columns: 1fr;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      min-height: 0;
    }

    .profile-overlay .im-overlay-scroll {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      padding: 16px;
      display: flex;
      flex-direction: column;
    }

    .profile-overlay .im-overlay-footer {
      border-top: 1px solid var(--border);
      padding: 12px 16px;
      display: flex;
      gap: 8px;
      background: #fff;
      flex-shrink: 0;
    }

    .profile-overlay .im-overlay-apply {
      flex: 1;
      padding: 10px;
    }

    .profile-overlay .im-overlay-cancel {
      padding: 10px 16px;
    }

    .profile-overlay-body .im-layout {
      display: grid;
      gap: 12px;
      min-width: 0;
    }

    .profile-overlay-body .im-rules-list {
      display: grid;
      gap: 12px;
      min-width: 0;
    }

    .profile-overlay-body .im-node-option {
      display: grid;
      grid-template-columns: 16px minmax(0, 1fr);
      align-items: start;
      column-gap: 10px;
      width: 100%;
      min-width: 0;
      padding: 0 2px 4px;
      font-size: 13px;
      line-height: 1.5;
      color: #334155;
    }

    .profile-overlay-body .im-node-option input[type="checkbox"] {
      margin: 0;
      flex-shrink: 0;
      align-self: center;
    }

    .profile-overlay-body .im-node-option span {
      display: block;
      min-width: 0;
      white-space: normal;
      word-break: break-word;
    }

    .profile-overlay-body .im-rule-card {
      border: 1px solid #e2e8f0;
      border-radius: 12px;
      background: #fff;
      overflow: hidden;
      min-width: 0;
      box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    }

    .profile-overlay-body .im-rule-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      padding: 12px 14px;
      background: #f8fafc;
      border-bottom: 1px solid #e2e8f0;
      font-size: 13px;
      min-width: 0;
    }

    .profile-overlay-body .im-rule-header-main {
      min-width: 0;
      flex: 1;
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
    }

    .profile-overlay-body .im-rule-title {
      font-weight: 650;
      color: #1e293b;
      min-width: 0;
      max-width: 100%;
    }

    .profile-overlay-body .im-rule-count {
      font-size: 11px;
      color: #64748b;
      background: #e2e8f0;
      padding: 1px 8px;
      border-radius: 999px;
      flex-shrink: 0;
    }

    .profile-overlay-body .im-rule-preview {
      flex: 1;
      min-width: 120px;
      font-size: 11px;
      color: #94a3b8;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .profile-overlay-body .im-rule-preview-empty,
    .profile-overlay-body .im-rule-preview.muted {
      color: #94a3b8;
    }

    .profile-overlay-body .im-rule-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-shrink: 0;
    }

    .profile-overlay-body .im-rule-toggle {
      font-size: 12px;
      padding: 6px 10px;
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      background: #fff;
      cursor: pointer;
      color: #4f46e5;
      flex-shrink: 0;
      min-width: 56px;
    }

    .profile-overlay-body .im-rule-toggle:hover {
      background: #eef2ff;
    }

    .profile-overlay-body .im-rule-body {
      padding: 14px;
      display: grid;
      gap: 12px;
      min-width: 0;
    }

    .profile-overlay-body .im-rule-body.is-collapsed {
      display: none;
    }

    .profile-overlay-body .im-rule-section {
      display: grid;
      gap: 10px;
      min-width: 0;
    }

    .profile-overlay-body .im-section-label {
      font-size: 11px;
      font-weight: 700;
      letter-spacing: .05em;
      text-transform: uppercase;
      color: #64748b;
    }

    .profile-overlay-body .im-params-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
      gap: 10px;
      font-size: 12px;
      min-width: 0;
    }

    .profile-overlay-body .im-params-grid label {
      display: grid;
      gap: 6px;
      color: #475569;
      min-width: 0;
    }

    .profile-overlay-body .im-params-grid label span {
      font-size: 11px;
      font-weight: 600;
      color: #64748b;
    }

    .profile-overlay-body .im-params-grid input,
    .profile-overlay-body .im-params-grid select {
      width: 100%;
      min-width: 0;
      padding: 8px 10px;
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      font-size: 12px;
      background: #fff;
    }

    .profile-overlay-body .im-params-advanced {
      display: none;
      grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
      gap: 10px;
      padding-top: 10px;
      border-top: 1px dashed #e2e8f0;
      margin-top: 2px;
    }

    .profile-overlay-body .im-params-advanced.is-open {
      display: grid;
    }

    .profile-overlay-body .im-col-picker {
      border: 1px solid #e2e8f0;
      border-radius: 10px;
      padding: 10px;
      display: grid;
      gap: 10px;
      min-width: 0;
      background: linear-gradient(180deg, #fcfdff 0%, #f8fafc 100%);
    }

    .profile-overlay-body .im-col-picker-toolbar {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      min-width: 0;
    }

    .profile-overlay-body .im-search-input {
      min-width: 0;
      padding: 8px 10px;
      border: 1px solid var(--border);
      border-radius: 8px;
      background: #fff;
      font-size: 13px;
    }

    .profile-overlay-body .im-clear-filter-btn {
      padding: 8px 10px;
      border: 1px solid #d7dde5;
      border-radius: 8px;
      background: #fff;
      font-size: 12px;
      color: #475569;
      white-space: nowrap;
    }

    .profile-overlay-body .im-clear-filter-btn:disabled {
      opacity: .55;
      cursor: default;
    }

    .profile-overlay-body .im-filter-row {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
      min-width: 0;
    }

    .profile-overlay-body .im-filter-row-tags {
      padding-top: 2px;
    }

    .profile-overlay-body .im-filter-label {
      font-size: 11px;
      color: #94a3b8;
      font-weight: 600;
      flex-shrink: 0;
    }

    .profile-overlay-body .im-col-picker-list {
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      background: #fff;
      max-height: 260px;
      overflow-y: auto;
      min-width: 0;
    }

    .profile-overlay-body .im-col-picker-row {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      align-items: center;
      gap: 8px;
      padding: 8px 10px;
      border-radius: 4px;
      font-size: 12px;
      min-width: 0;
      border-bottom: 1px solid #f1f5f9;
      width: 100%;
      box-sizing: border-box;
    }

    .profile-overlay-body .im-col-picker-row:last-child {
      border-bottom: none;
    }

    .profile-overlay-body .im-col-picker-row:hover {
      background: #f8fafc;
    }

    .profile-overlay-body .im-col-picker-row input[type="checkbox"] {
      flex-shrink: 0;
      accent-color: #4f46e5;
    }

    .profile-overlay-body .im-col-picker-main {
      min-width: 0;
      width: 100%;
      display: flex;
      align-items: center;
      gap: 10px;
      justify-content: space-between;
    }

    .profile-overlay-body .im-col-picker-name {
      display: block;
      flex: 1;
      width: auto;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      color: #0f172a;
      font-size: 13px;
      font-weight: 500;
    }

    .profile-overlay-body .im-col-picker-meta {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      flex-shrink: 0;
      margin-left: auto;
    }

    .profile-overlay-body .im-col-picker-row .col-badge {
      display: inline-flex;
      align-items: center;
      font-size: 10px;
      padding: 1px 6px;
      border-radius: 999px;
      flex-shrink: 0;
    }

    .profile-overlay-body .im-col-picker-empty {
      font-size: 12px;
      color: #94a3b8;
      padding: 18px 12px;
      text-align: center;
      line-height: 1.6;
    }

    .profile-overlay-body .im-filter-btn {
      padding: 4px 10px;
      border: 1px solid #e2e8f0;
      border-radius: 6px;
      background: #fff;
      font-size: 11px;
      cursor: pointer;
      white-space: nowrap;
      color: #64748b;
      transition: all 0.12s;
    }

    .profile-overlay-body .im-filter-btn:hover {
      background: #f1f5f9;
      border-color: #cbd5e1;
    }

    .profile-overlay-body .im-filter-btn.active {
      background: #eef2ff;
      border-color: #818cf8;
      color: #4338ca;
      font-weight: 600;
    }

    .profile-overlay-body .im-batch-row {
      display: flex;
      gap: 8px;
      padding-top: 2px;
      border-top: 1px solid #e2e8f0;
    }

    .profile-overlay-body .im-batch-btn {
      padding: 7px 10px;
      border: 1px solid #e2e8f0;
      border-radius: 8px;
      background: #fff;
      font-size: 12px;
      cursor: pointer;
      color: #475569;
    }

    .profile-overlay-body .im-batch-btn:hover {
      background: #f1f5f9;
    }

    /* Advanced toggle button inside params */
    .profile-overlay-body .im-advanced-toggle {
      grid-column: 1 / -1;
      justify-self: start;
      font-size: 11px;
      padding: 4px 10px;
      border: 1px solid #e2e8f0;
      border-radius: 999px;
      background: #fff;
      cursor: pointer;
      color: #6366f1;
    }

    .profile-overlay-body .im-advanced-toggle:hover {
      background: #eef2ff;
    }

    .profile-overlay-body .im-rule-add {
      display: flex;
      gap: 8px;
    }

    .profile-overlay-body .im-add-rule-select {
      flex: 1;
    }

    @media (max-width: 900px) {
      .profile-overlay-body .im-rule-header {
        flex-direction: column;
        align-items: stretch;
      }

      .profile-overlay-body .im-rule-actions {
        justify-content: space-between;
      }

      .profile-overlay-body .im-col-picker-toolbar {
        grid-template-columns: 1fr;
      }
    }
