/* ============================================================
   AGX WIP Tracker â Step 2 Layout v2
   Two-column: Workspace LEFT, Metrics+Tabs RIGHT
   Job header with inline metrics
   ============================================================ */

/* Metrics strip styles live below in the "Tab + Metrics Row" block. */

/* ââ Two-Column Container ââââââââââââââââââââââââââââââââââ */
.ws-two-col {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  min-height: 600px;
  height: calc(100vh - 260px);
  overflow: hidden;
}

/* ââ Left Column: Workspace ââââââââââââââââââââââââââââââââ */
.ws-col-left {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface, #1a1d27);
  border: 1px solid var(--border, #2e3346);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 0 16px rgba(79, 140, 255, 0.05);
}

.ws-left-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border, #2e3346);
}
.ws-left-logo {
  height: 22px;
  width: auto;
}

.ws-left-sub {
  font-size: 10px;
  color: var(--text-dim, #8b90a5);
}

/* Make workspace grid fill vertical space */
.ws-col-left #wsWorkspaceContainer {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ws-col-left .ws-grid-wrapper {
  flex: 1;
  max-height: none;
  overflow: auto;
}

/* Override workspace grid for portrait layout */
.ws-col-left .ws-toolbar {
  flex-wrap: wrap;
  gap: 4px;
}

.ws-col-left .ws-formula-bar {
  min-width: 0;
  flex: 1 1 150px;
}

.ws-col-left .ws-toolbar-actions {
  flex-wrap: wrap;
  gap: 3px;
}

.ws-col-left .ws-btn {
  padding: 3px 8px;
  font-size: 11px;
}

/* ââ Right Column: Metrics + Tabs ââââââââââââââââââââââââââ */
.ws-col-right {
  flex: 1 1 0;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  gap: 8px;
}

/* ââ Right Tab Buttons âââââââââââââââââââââââââââââââââââââ */
/* Unified tab bar — matches the top-nav .tabs styling so admin sub-tabs,
   job-detail right-column tabs, and the main header tabs all look the same. */
.ws-right-tabs {
  display: flex;
  gap: 0;
  margin-top: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border, #2e3346);
  /* Background was transparent, but once we pin this with position:
     sticky the scrolling content underneath will bleed through. Use
     var(--bg) so the bar reads as an opaque header strip. */
  background: var(--bg, #0f1117);
  border-radius: 0;
  padding: 0;
  flex-wrap: wrap;
  /* Keep the sub-tab switcher visible while the long list / leads /
     workspace content scrolls beneath it. <main> is the scroller, so
     pin to its top edge. */
  position: sticky;
  top: 0;
  z-index: 10;
}

.ws-right-tab {
  flex: 0 0 auto;
  padding: 6px 20px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  border: none;
  background: transparent;
  color: var(--text-dim, #8b90a5);
  cursor: pointer;
  transition: color 0.15s;
  white-space: nowrap;
  border-radius: 0;
  text-align: center;
  position: relative;
}

.ws-right-tab:hover {
  color: var(--text, #e4e6f0);
}

/* Sliding indicator — the visual is a single .agx-tab-slider element
   shared across the whole bar (positioned by tab-slider.js). Per-tab
   styling here is just the text-color change so the active tab reads
   as picked while the slider arrives. */
.ws-right-tab.active {
  color: #5ddb7e;
  font-weight: 600;
}

/* ââ Right Tab Content âââââââââââââââââââââââââââââââââââââ */
.ws-right-content {
  flex: 1;
  background: var(--surface, #1a1d27);
  border: 1px solid var(--border, #2e3346);
  border-radius: 8px;
  padding: 12px;
  overflow-y: auto;
  min-height: 0;
}

.ws-right-panel {
  animation: ws-fadeIn 0.2s ease;
}

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

/* ââ Job Info Collapsible ââââââââââââââââââââââââââââââââââ */
.ws-job-info-details {
  margin-bottom: 8px;
  background: var(--surface2, #242836);
  border: 1px solid var(--border, #2e3346);
  border-radius: 6px;
  overflow: hidden;
}

.ws-job-info-summary {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #e4e6f0);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ws-job-info-summary::before {
  content: '\25B6';
  font-size: 8px;
  color: var(--text-dim, #8b90a5);
  transition: transform 0.2s;
}

.ws-job-info-details[open] .ws-job-info-summary::before {
  transform: rotate(90deg);
}

.ws-job-info-summary::-webkit-details-marker {
  display: none;
}

.ws-job-info-details .ws-accordion-content {
  padding: 8px 12px 12px;
}

.ws-job-info-details .card {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

/* ââ Override cards inside right panels âââââââââââââââââââââ */
.ws-right-panel .card {
  border: none;
  background: transparent;
  box-shadow: none;
  margin: 0;
  padding: 0;
}

.ws-right-panel .table-container {
  overflow-x: auto;
}

/* ââ Hide old elements âââââââââââââââââââââââââââââââââââââ */
.ws-layout-applied > .sub-tabs { display: none !important; }
.ws-layout-applied > .summary-grid { display: none !important; }
.ws-layout-applied > .sub-tab-content-job { display: none !important; }
.ws-layout-applied > .action-buttons { display: none !important; }
.ws-layout-applied > #job-info-card { display: none !important; }

/* ââ Responsive ââââââââââââââââââââââââââââââââââââââââââââ */
@media (max-width: 900px) {
  .ws-two-col {
    flex-direction: column;
  }

  .ws-col-left {
    flex: none;
    max-width: 100%;
    min-width: 0;
    min-height: 350px;
  }

  .ws-col-right {
    flex: none;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
  }

  .ws-right-tab {
    font-size: 10px;
    padding: 5px 4px;
  }

  .jh-metrics-strip {
    gap: 4px;
    padding: 8px 10px;
  }

  .jh-strip-card {
    padding: 4px 6px;
  }

  .jh-strip-value {
    font-size: 12px;
  }

  .jh-strip-label {
    font-size: 8px;
  }
}

@media (max-width: 900px) {
  .jh-strip-card {
    padding: 3px 4px;
  }
  .jh-strip-value {
    font-size: 11px;
  }
  .jh-strip-label {
    font-size: 7px;
  }
  .jh-metrics-strip {
    gap: 3px;
  }
}

/* ââ Job Header Bar (inside sticky green header) ââ */
/* Auto-margin shoves the job-info to the right side of the header,
   adjacent to the user-menu, so the back button + title sit close
   to the user controls instead of hugging the tabs. The sibling
   rule below shrinks the user-menu's auto-margin to a 14px gap when
   jh-job-info is present, keeping a "subtle gap" between them. */
.jh-job-info {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex: 0 1 auto;
  min-width: 0;
}
/* When jh-job-info is in the header, the user-menu loses its default
   margin-left:auto — instead it sits 14px to the right of the
   job-info block. On pages without jh-job-info, user-menu keeps its
   default auto-margin (set in styles.css) and snaps to the far right. */
header .jh-job-info ~ #user-menu {
  margin-left: 14px;
}
.jh-back-btn {
  background: rgba(0,0,0,0.4);
  color: #e4e6f0;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 5px;
  padding: 3px 10px;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.15s;
  flex-shrink: 0;
}
.jh-back-btn:hover { background: rgba(0,0,0,0.6); }
.jh-job-title {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
  min-width: 0;
}
.jh-status-badge {
  background: rgba(27,133,65,0.85);
  color: #fff;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ââ Tab + Metrics Row ââ */
.jh-tab-metrics-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

/* ââ Metrics Strip (13 cards) ââ */
/* Sticky job-detail metrics strip — borrows the watch-node aesthetic from
   the nodegraph (dark gradient cards with a faint diagonal sheen) and adds
   tone-based color coding so income, cost, gain, and amber metrics each
   read at a glance. nowrap + overflow-x:auto keeps everything on one line
   even at 12+ metrics; the strip scrolls horizontally on tight widths. */
.jh-metrics-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 12px 16px;
  margin: 0 0 10px 0;
  background: none;
  border: none;
  box-shadow: none;
  width: 100%;
  min-width: 0;
  /* Cards auto-size to share the strip's width via flex:1 1 0 below.
     overflow stays auto as a safety net on extremely narrow screens. */
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  box-sizing: border-box;
}
/* Strip pins right under the slim 46px header (sticky top:46) so the
   metrics stay visible while the user scrolls long job-detail content.
   Negative margin pulls past main's 30px padding on ALL FOUR sides:
   - Horizontal: gradient bleeds edge-to-edge to the viewport.
   - Top: strip starts flush against the header instead of 30px below.
   The 14px below preserves breathing room before the page content. */
#jh-strip-detached {
  /* The strip is now inserted as a sibling of <main> inside
     .container — flex-column layout puts header → strip → main in
     order so the strip naturally hugs the header's bottom edge with
     no margin tricks or sticky positioning needed. width:100% spans
     the full viewport since .container is also full width. */
  flex: 0 0 auto;
  width: 100%;
  padding: 10px 30px;
  background: linear-gradient(180deg, var(--bg-dark, #0a0c12) 0%, var(--bg, #0f1117) 100%);
  border-top: 1px solid rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  box-sizing: border-box;
}
body.light-mode #jh-strip-detached {
  background: linear-gradient(180deg, var(--surface2, #e8eaef) 0%, var(--bg, #f0f2f5) 100%);
  border-top-color: rgba(0,0,0,0.04);
  border-bottom-color: rgba(0,0,0,0.06);
}
/* The inner strip stays within the 1600px content max-width so the
   cards still align with the rest of the page even though the band
   bleeds full-width. */
#jh-strip-detached .jh-metrics-strip {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0;
}
.jh-metrics-strip::-webkit-scrollbar { height: 4px; }
.jh-metrics-strip::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

/* Card backgrounds tuned to feel raised (not punched-out) against the
   page bg (#0f1117). Old gradient ran #05→#0e→#0a, all DARKER than
   the page, so cards looked like holes. New gradient lifts ~6-12% above
   surface so they read as raised tiles with a subtle vertical sheen. */
.jh-strip-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.015) 100%), var(--surface, #1a1d27);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
  /* Equal flex share so all 12 cards auto-size to fit the strip width.
     min-width 0 lets them shrink below content size when needed. */
  flex: 1 1 0;
  min-width: 0;
  position: relative;
  overflow: hidden;
  /* Soft ambient shadow — softer than before so cards feel embedded
     in the band, not floating on top of it. The inset highlight on
     the top edge picks up overhead light and adds dimension. */
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 1px 3px rgba(0,0,0,0.3);
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
/* Diagonal sheen sweep, lifted from .ng-watch-kpi::before. Toned
   down (5% → 3%) since the brighter card surface needs less help to
   feel alive. */
.jh-strip-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.03) 50%, transparent 70%);
  animation: jh-strip-shine 7s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
.jh-strip-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.16);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 4px 12px rgba(0,0,0,0.45);
}

/* Light-mode metric strip cards: solid white tile with a clear
   border + soft shadow. Label opacity bumped 0.55 → 0.78 so the
   uppercase labels stay readable; tone label colors kept saturated
   instead of washed out. Value text on neutral cards uses --text
   directly for max contrast. */
body.light-mode .jh-strip-card {
  background: #ffffff;
  border-color: rgba(0,0,0,0.10);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.8) inset,
    0 1px 3px rgba(15,23,42,0.06);
}
body.light-mode .jh-strip-card:hover {
  border-color: rgba(0,0,0,0.20);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.9) inset,
    0 4px 12px rgba(15,23,42,0.10);
}
body.light-mode .jh-strip-card::before {
  background: linear-gradient(120deg, transparent 30%, rgba(0,0,0,0.02) 50%, transparent 70%);
}
body.light-mode .jh-strip-label {
  color: rgba(17, 24, 39, 0.78);
}
body.light-mode .jh-strip-card[data-tone="neutral"] .jh-strip-value {
  color: #0a0e15;
}
body.light-mode .jh-metrics-strip::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.20);
}
/* Light-mode tone variants — same colored-tint-over-surface trick as
   dark mode, but tinted onto white. Border + label saturation pushed
   higher so the categories stay distinguishable on a bright page. */
body.light-mode .jh-strip-card[data-tone="gain"] {
  background: linear-gradient(180deg, rgba(5,150,105,0.10) 0%, rgba(5,150,105,0.02) 100%), #ffffff;
  border-color: rgba(5,150,105,0.35);
}
body.light-mode .jh-strip-card[data-tone="gain"] .jh-strip-value { color: #047857; text-shadow: none; }
body.light-mode .jh-strip-card[data-tone="gain"] .jh-strip-label { color: #047857; }
body.light-mode .jh-strip-card[data-tone="cost"] {
  background: linear-gradient(180deg, rgba(220,38,38,0.10) 0%, rgba(220,38,38,0.02) 100%), #ffffff;
  border-color: rgba(220,38,38,0.32);
}
body.light-mode .jh-strip-card[data-tone="cost"] .jh-strip-value { color: #b91c1c; text-shadow: none; }
body.light-mode .jh-strip-card[data-tone="cost"] .jh-strip-label { color: #b91c1c; }
body.light-mode .jh-strip-card[data-tone="income"] {
  background: linear-gradient(180deg, rgba(37,99,235,0.10) 0%, rgba(37,99,235,0.02) 100%), #ffffff;
  border-color: rgba(37,99,235,0.32);
}
body.light-mode .jh-strip-card[data-tone="income"] .jh-strip-value { color: #1d4ed8; text-shadow: none; }
body.light-mode .jh-strip-card[data-tone="income"] .jh-strip-label { color: #1d4ed8; }
body.light-mode .jh-strip-card[data-tone="amber"] {
  background: linear-gradient(180deg, rgba(217,119,6,0.10) 0%, rgba(217,119,6,0.02) 100%), #ffffff;
  border-color: rgba(217,119,6,0.36);
}
body.light-mode .jh-strip-card[data-tone="amber"] .jh-strip-value { color: #b45309; text-shadow: none; }
body.light-mode .jh-strip-card[data-tone="amber"] .jh-strip-label { color: #b45309; }

.jh-strip-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.jh-strip-value {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  letter-spacing: -0.3px;
  position: relative;
  z-index: 1;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tone variants — match the nodegraph watch-kpi color palette. Tone
   layers a translucent color tint OVER the surface bg from the base
   .jh-strip-card rule, so each tile reads as a raised surface
   subtly tinted with its category color rather than a dark
   contrasting block. Border + value text glow stay punchy. */
.jh-strip-card[data-tone="gain"] {
  border-color: rgba(52,211,153,0.30);
  background: linear-gradient(180deg, rgba(52,211,153,0.10) 0%, rgba(52,211,153,0.03) 100%), var(--surface, #1a1d27);
}
.jh-strip-card[data-tone="gain"] .jh-strip-value {
  color: #34d399;
  text-shadow: 0 0 10px rgba(52,211,153,0.40);
}
.jh-strip-card[data-tone="gain"] .jh-strip-label { color: rgba(52,211,153,0.70); }

.jh-strip-card[data-tone="cost"] {
  border-color: rgba(248,113,113,0.28);
  background: linear-gradient(180deg, rgba(248,113,113,0.10) 0%, rgba(248,113,113,0.03) 100%), var(--surface, #1a1d27);
}
.jh-strip-card[data-tone="cost"] .jh-strip-value {
  color: #f87171;
  text-shadow: 0 0 10px rgba(248,113,113,0.35);
}
.jh-strip-card[data-tone="cost"] .jh-strip-label { color: rgba(248,113,113,0.65); }

.jh-strip-card[data-tone="income"] {
  border-color: rgba(96,165,250,0.30);
  background: linear-gradient(180deg, rgba(96,165,250,0.10) 0%, rgba(96,165,250,0.03) 100%), var(--surface, #1a1d27);
}
.jh-strip-card[data-tone="income"] .jh-strip-value {
  color: #60a5fa;
  text-shadow: 0 0 10px rgba(96,165,250,0.35);
}
.jh-strip-card[data-tone="income"] .jh-strip-label { color: rgba(96,165,250,0.65); }

.jh-strip-card[data-tone="amber"] {
  border-color: rgba(251,191,36,0.32);
  background: linear-gradient(180deg, rgba(251,191,36,0.10) 0%, rgba(251,191,36,0.03) 100%), var(--surface, #1a1d27);
}
.jh-strip-card[data-tone="amber"] .jh-strip-value {
  color: #fbbf24;
  text-shadow: 0 0 10px rgba(251,191,36,0.45);
}
.jh-strip-card[data-tone="amber"] .jh-strip-label { color: rgba(251,191,36,0.70); }

.jh-strip-card[data-tone="neutral"] .jh-strip-value {
  color: #e4e6f0;
}

@keyframes jh-strip-shine {
  0%, 100% { transform: translateX(-110%); }
  50% { transform: translateX(110%); }
}


/* ===== Viewport-filling ID overrides ===== */
#wsRightContent {
  flex: 1;
  overflow-y: auto;
}
#wsWorkspaceContainer {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#wsGridWrapper {
  flex: 1;
  overflow: auto;
}
.ws-grid-wrapper table {
  width: 100%;
}

/* ===== Draggable resizer ===== */
.ws-resizer {
  width: 8px;
  cursor: col-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
  transition: background 0.15s;
}
.ws-resizer:hover,
.ws-resizer-active {
  background: rgba(59, 130, 246, 0.15);
}
.ws-resizer::before {
  content: '';
  width: 2px;
  height: 40px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  transition: background 0.15s, height 0.15s;
}
.ws-resizer:hover::before,
.ws-resizer-active::before {
  background: rgba(59, 130, 246, 0.7);
  height: 60px;
}

/* ── Single-column main view (Phase: drop two-col) ──────── */
/* When ws-single-col is on, the main column expands full-width and
   the (now-removed) left column / resizer aren't rendered. */
.ws-two-col.ws-single-col {
  grid-template-columns: 1fr;
  display: block;
}
.ws-two-col.ws-single-col > .ws-col-right {
  width: 100%;
  border-left: none;
}

/* Tabs row gets an actions slot on the right edge for the Ask AI
   button, so it lives with the tab strip instead of taking its own row. */
.ws-right-tabs-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 6px;
}

/* ── Workspace canvas backdrop ──────────────────────────── */
/* The "node-graph aesthetic" without running the engine: a dark
   surface with a subtle dotted grid. The floating spreadsheet panel
   hovers above this, draggable + resizable. */
.ws-workspace-canvas {
  position: relative;
  height: calc(100vh - 220px);
  min-height: 540px;
  padding: 0;
  margin: 0;
  border-radius: 6px;
  overflow: hidden;
}
.ws-canvas-backdrop {
  position: absolute;
  inset: 0;
  background-color: var(--surface, #181820);
  /* Dotted grid pattern — small dots every 24px give a node-graph feel
     without competing with cell content. */
  background-image: radial-gradient(circle, rgba(79, 140, 255, 0.10) 1px, transparent 1px);
  background-size: 24px 24px;
  /* Subtle gradient for depth */
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border, #2e3346);
  border-radius: 6px;
}

/* ── Floating workspace panel ──────────────────────────── */
/* Card + node-graph aesthetic: rounded frame, subtle accent border,
   gradient header. Lives at fixed position so the user can drag and
   resize freely within the canvas. */
.ws-floating-panel {
  position: fixed;
  /* Bumped from 50 → 100 so the floating workspace + its bottom
     sheet tabs definitely render above the Node Graph's bottom-
     right help bar (z-index 10) regardless of any nested stacking
     contexts. */
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: var(--surface, #181820);
  border: 1px solid rgba(79, 140, 255, 0.35);
  border-radius: 10px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(79, 140, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  min-width: 420px;
  min-height: 280px;
  overflow: hidden;
}
.ws-floating-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(79, 140, 255, 0.18) 0%, rgba(139, 92, 246, 0.12) 100%);
  border-bottom: 1px solid rgba(79, 140, 255, 0.25);
  cursor: move;
  user-select: none;
}
.ws-floating-header:active { cursor: grabbing; }
.ws-floating-titlewrap {
  display: flex;
  align-items: center;
  gap: 0;
}
.ws-floating-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #fff);
  letter-spacing: 0.3px;
}
.ws-floating-actions {
  display: flex;
  gap: 4px;
}
.ws-floating-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text, #fff);
  border-radius: 4px;
  width: 24px;
  height: 22px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s;
}
.ws-floating-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
.ws-floating-body {
  flex: 1 1 auto;
  overflow: auto;
  padding: 0;
}
.ws-floating-body #wsWorkspaceContainer {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
/* Override the standalone-page 500px ceiling — let the grid eat the
   panel's free vertical space instead of leaving dead area below the
   status bar when the user resizes the panel taller. */
.ws-floating-body .ws-grid-wrapper {
  flex: 1 1 auto;
  max-height: none;
  min-height: 0;
}
.ws-floating-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background:
    linear-gradient(135deg, transparent 0%, transparent 50%, rgba(79, 140, 255, 0.35) 50%, rgba(79, 140, 255, 0.35) 60%, transparent 60%, transparent 70%, rgba(79, 140, 255, 0.35) 70%, rgba(79, 140, 255, 0.35) 80%, transparent 80%);
  z-index: 51;
}

/* Minimized state: collapse to header only */
.ws-floating-panel.ws-floating-minimized {
  min-height: unset;
  height: auto !important;
}
.ws-floating-panel.ws-floating-minimized .ws-floating-body,
.ws-floating-panel.ws-floating-minimized .ws-floating-resize {
  display: none;
}

/* ── Floating panel modes ──────────────────────────────────── */
/* tab-mode: viewport-fixed positioning (default, tab content) */
.ws-floating-panel.ws-floating-tab-mode {
  position: fixed;
}
/* graph-mode: lives inside the transformed .ng-canvas, pans/zooms
   with the graph. Positioning is absolute relative to the canvas. */
.ws-floating-panel.ws-floating-graph-mode {
  position: absolute;
  /* Shadow scales weirdly under transform, so use a simpler ring */
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(79, 140, 255, 0.25);
}
/* Make sure the panel stays above the wire/grid canvases */
.ws-floating-panel.ws-floating-graph-mode {
  z-index: 30;
}

/* ── AGX logo in panel header ────────────────────────────── */
.ws-floating-logo {
  height: 18px;
  width: auto;
  margin-right: 8px;
  display: inline-block;
  vertical-align: middle;
  pointer-events: none;
}

/* ── Maximized: panel fills the visible canvas ─────────── */
.ws-floating-panel.ws-floating-maximized .ws-floating-resize {
  display: none;
}

/* ── Minimized: looks like a real graph node ───────────────
   Matches .ng-node — same surface, 2px var(--ng-border) border,
   10px radius, drop shadow. Header strip uses the same gradient
   the panel header always uses, just compact. The whole card is
   draggable; click without dragging restores. */
.ws-floating-panel.ws-floating-folder {
  overflow: hidden;
  border-radius: 10px;
  background: var(--ng-surface, #12162a);
  border: 2px solid var(--ng-border, #242e50);
  box-shadow: 0 2px 12px var(--ng-shadow, rgba(0, 0, 0, 0.5));
  cursor: move;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
  min-width: 0;
  min-height: 0;
}
.ws-floating-panel.ws-floating-folder:hover {
  border-color: #3350a0;
  box-shadow:
    0 4px 18px var(--ng-shadow, rgba(0, 0, 0, 0.55)),
    0 0 0 1px rgba(79, 140, 255, 0.25);
}
/* Compact header strip — whitish-gray gradient matching the
   subdued tone of the % complete progress label. */
.ws-floating-panel.ws-floating-folder .ws-floating-header {
  cursor: move;
  padding: 5px 8px;
  border-bottom: 1px solid var(--ng-border, #242e50);
  background: linear-gradient(135deg, rgba(180, 188, 208, 0.22) 0%, rgba(120, 128, 150, 0.12) 100%);
}
.ws-floating-panel.ws-floating-folder .ws-floating-title {
  font-size: 10px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--ng-dim, #8b90a5);
}
.ws-floating-panel.ws-floating-folder .ws-floating-logo {
  height: 14px;
  margin-right: 5px;
}
/* Hide the white logo by default; show the colored one in both states */
.ws-floating-logo.ws-logo-white { display: none; }
.ws-floating-panel.ws-floating-folder .ws-floating-actions,
.ws-floating-panel.ws-floating-folder .ws-floating-resize {
  display: none;
}
/* Body shows the mini-spreadsheet SVG */
.ws-floating-panel.ws-floating-folder .ws-floating-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 28px;
  overflow: hidden;
  background: var(--ng-surface, #12162a);
  cursor: move;
}
.ws-floating-panel.ws-floating-folder .ws-floating-body #wsWorkspaceContainer {
  display: none;
}
/* Mini-spreadsheet graphic: hidden in normal panel, fills the body
   when minimized. */
.ws-floating-mini-graphic {
  display: none;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55));
}
.ws-floating-panel.ws-floating-folder .ws-floating-mini-graphic {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── Topbar divider ──────────────────────────────────── */
.ng-topbar-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 6px;
  display: inline-block;
}

/* (Removed: .ws-ribbon tab-strip styling. The Outlook-style ribbon
   moved to .ng-topbar.ng-ribbon — see nodegraph.css. The workspace
   tab strip is back to flat pills.) */
