:root {
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
  --bg-page: #e9eff8;
  --bg-canvas: #f1f6fe;
  --bg-grid-line: rgba(64, 95, 145, 0.08);
  --bg-grid-accent: rgba(23, 183, 255, 0.1);
  --canvas-dot: rgba(33, 53, 86, 0.14);
  --text-primary: #0e1a2b;
  --text-secondary: #2f425f;
  --text-tertiary: #5f7393;
  --surface-primary: rgba(255, 255, 255, 0.88);
  --surface-secondary: rgba(244, 249, 255, 0.9);
  --surface-tertiary: rgba(236, 244, 255, 0.95);
  --surface-glass: linear-gradient(155deg, rgba(255, 255, 255, 0.92) 0%, rgba(241, 248, 255, 0.74) 100%);
  --border-light: rgba(149, 173, 209, 0.34);
  --border-mid: rgba(123, 150, 192, 0.46);
  --accent: #15adff;
  --accent-strong: #007dff;
  --accent-mint: #2fe2c3;
  --accent-soft: rgba(21, 173, 255, 0.18);
  --accent-glow: 0 0 0 1px rgba(21, 173, 255, 0.24), 0 16px 36px rgba(0, 125, 255, 0.2);
  --shadow-float: 0 22px 56px rgba(8, 28, 64, 0.16);
  --shadow-card: 0 14px 34px rgba(9, 30, 67, 0.12);
  --shadow-soft: 0 8px 22px rgba(10, 37, 80, 0.12);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --pill: 999px;
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-md: 13px;
  --fs-base: 14px;
  --fs-lg: 15px;
  --fs-xl: 17px;
  --fs-2xl: 18px;
  --fs-3xl: 22px;
  --app-min-width: 1180px;
  --lh-tight: 1.2;
  --lh-base: 1.4;
  --motion-standard: cubic-bezier(0.22, 1, 0.36, 1);
  --motion-emphasized: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 160ms;
  --dur-mid: 260ms;
  --dur-slow: 420ms;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  min-width: var(--app-min-width);
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-page);
  font-size: var(--fs-base);
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

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

textarea {
  font-family: inherit;
  overscroll-behavior: contain;
}

.app-shell {
  position: relative;
  height: 100%;
  min-width: var(--app-min-width);
  overflow: hidden;
  background: var(--bg-page);
}

.app-boot-loader {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  background:
    radial-gradient(560px 300px at 50% 46%, rgba(45, 91, 154, 0.16), transparent 72%),
    linear-gradient(180deg, #111318 0%, #0e1117 100%);
  opacity: 1;
  visibility: visible;
  transition: opacity 240ms var(--motion-standard), visibility 240ms var(--motion-standard);
}

.app-boot-loader.is-leaving {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.app-boot-loader__content {
  display: grid;
  justify-items: center;
  gap: 11px;
  text-align: center;
}

.app-boot-loader__brand {
  margin-bottom: 8px;
  color: rgba(223, 237, 255, 0.92);
  font-size: 20px;
  font-weight: 950;
  letter-spacing: 0.12em;
}

.app-boot-loader__spinner {
  width: 38px;
  height: 38px;
  margin-bottom: 5px;
  border: 2px solid rgba(126, 163, 211, 0.18);
  border-top-color: #72b8ff;
  border-right-color: rgba(103, 177, 255, 0.58);
  border-radius: 50%;
  animation: app-boot-spin 780ms linear infinite;
  box-shadow: 0 0 22px rgba(62, 147, 239, 0.16);
}

.app-boot-loader strong {
  color: #eef6ff;
  font-size: 15px;
  font-weight: 760;
  letter-spacing: -0.01em;
}

.app-boot-loader small {
  color: #71839d;
  font-size: 11px;
  font-weight: 550;
}

@keyframes app-boot-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-boot-loader__spinner {
    animation-duration: 1.8s;
  }
}

.app-shell::before,
.app-shell::after {
  content: "";
  position: absolute;
  inset: -18%;
  pointer-events: none;
  z-index: 0;
}

.app-shell::before {
  display: none;
  background: none;
  filter: none;
  animation: none;
}

.app-shell::after {
  display: none;
  background: none;
  animation: none;
}

.top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-radius: 0 0 18px 18px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-top: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.66) 0%, rgba(245, 250, 255, 0.34) 100%);
  box-shadow: 0 8px 24px rgba(13, 34, 66, 0.1);
  backdrop-filter: saturate(160%) blur(12px);
}

.global-toast-host {
  position: fixed;
  top: 82px;
  left: 50%;
  z-index: 180;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  pointer-events: none;
}

.global-toast {
  min-width: 220px;
  max-width: min(78vw, 480px);
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(136, 177, 232, 0.42);
  background: linear-gradient(180deg, rgba(24, 38, 64, 0.9) 0%, rgba(16, 28, 50, 0.92) 100%);
  color: rgba(236, 245, 255, 0.98);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 10px 28px rgba(4, 14, 32, 0.36), 0 0 0 1px rgba(103, 166, 242, 0.18) inset;
  backdrop-filter: saturate(140%) blur(8px);
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transition: opacity 170ms var(--motion-standard), transform 170ms var(--motion-standard);
}

.global-toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.global-toast--success {
  border-color: rgba(98, 222, 181, 0.48);
  box-shadow: 0 10px 28px rgba(4, 18, 28, 0.34), 0 0 0 1px rgba(107, 228, 188, 0.22) inset;
}

.global-toast--warning {
  border-color: rgba(249, 184, 106, 0.52);
  box-shadow: 0 10px 28px rgba(34, 20, 6, 0.32), 0 0 0 1px rgba(255, 195, 120, 0.23) inset;
}

.global-toast--error {
  border-color: rgba(255, 119, 148, 0.54);
  box-shadow: 0 10px 28px rgba(35, 10, 17, 0.34), 0 0 0 1px rgba(255, 145, 170, 0.2) inset;
}

.brand,
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-actions {
  justify-content: flex-end;
}

.board-save-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(145, 169, 206, 0.42);
  background: rgba(255, 255, 255, 0.62);
  color: #496181;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.board-save-status[data-state="saved"] {
  color: #1f6f43;
  border-color: rgba(92, 196, 145, 0.5);
  background: rgba(236, 255, 247, 0.88);
}

.board-save-status[data-state="warning"] {
  color: #99620f;
  border-color: rgba(245, 189, 114, 0.56);
  background: rgba(255, 247, 233, 0.9);
}

.viewport-controls {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--pill);
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: var(--surface-glass);
  box-shadow: var(--shadow-soft);
  backdrop-filter: saturate(180%) blur(16px);
}

.zoom-slider {
  width: 110px;
  accent-color: var(--accent);
}

.left-dock {
  position: absolute;
  left: 14px;
  top: 50%;
  z-index: 36;
  display: grid;
  gap: 10px;
  transform: translateY(-50%);
}

.quick-add-btn {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  background: var(--surface-glass);
  box-shadow: var(--shadow-soft);
  color: #1f3352;
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--motion-standard), box-shadow var(--dur-mid) var(--motion-standard), border-color var(--dur-fast) var(--motion-standard);
}

.quick-add-btn:hover {
  transform: translateY(-1px) scale(1.02);
  border-color: rgba(21, 173, 255, 0.56);
  box-shadow: var(--accent-glow);
}

.quick-add-btn--ghost {
  font-size: 16px;
  font-weight: 700;
  color: #3f597f;
}

.brand-logo,
.brand-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: conic-gradient(from 210deg at 50% 50%, #2fe2c3 0deg, #4cdfff 110deg, #0f9fff 220deg, #2fe2c3 360deg);
  box-shadow: 0 2px 10px rgba(0, 125, 255, 0.38);
}

.board-title {
  min-width: 170px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  outline: none;
  font-size: var(--fs-xl);
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.012em;
}

.board-title::selection {
  background: var(--accent-soft);
}

.pill-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: var(--pill);
  border: 1px solid rgba(142, 165, 200, 0.56);
  background: var(--surface-glass);
  color: #22385a;
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard), color var(--dur-fast) var(--motion-standard), transform var(--dur-fast) var(--motion-standard), box-shadow var(--dur-mid) var(--motion-standard), filter var(--dur-mid) var(--motion-standard);
}

.pill-btn:hover {
  border-color: rgba(21, 173, 255, 0.56);
  background: rgba(255, 255, 255, 0.94);
  transform: translateY(-1px) scale(1.02);
  box-shadow: var(--accent-glow);
  filter: saturate(112%);
}

.pill-btn:active {
  transform: scale(0.98);
}

.pill-btn:focus-visible,
.upload-icon-btn:focus-visible,
.hint-chip:focus-visible,
.menu-item:focus-visible,
.node-delete-btn:focus-visible,
.node-handle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pill-btn--accent {
  border-color: rgba(21, 173, 255, 0.42);
  background: linear-gradient(135deg, rgba(223, 247, 255, 0.92) 0%, rgba(236, 255, 251, 0.92) 100%);
  color: #0f3158;
  box-shadow: 0 8px 18px rgba(0, 125, 255, 0.14);
}

.pill-btn--accent:hover {
  border-color: rgba(21, 173, 255, 0.68);
  background: linear-gradient(135deg, rgba(232, 250, 255, 0.96) 0%, rgba(243, 255, 252, 0.96) 100%);
}

.canvas {
  position: absolute;
  inset: 0;
  overflow: hidden;
  overflow-anchor: none;
  cursor: default;
  background-color: var(--bg-canvas);
  background-image: radial-gradient(circle, var(--canvas-dot) 1px, transparent 1px), radial-gradient(circle, var(--bg-grid-accent) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: 0 0, 20px 20px;
  --canvas-grid-size: 40px;
  --canvas-grid-half-step: 20px;
  --canvas-grid-offset-x: 0px;
  --canvas-grid-offset-y: 0px;
  --canvas-hover-x: 50%;
  --canvas-hover-y: 50%;
  --canvas-hover-radius: 190px;
  --canvas-hover-strength: 0;
}

.canvas::before {
  display: none;
  content: none;
}

.canvas.canvas--dot-hover-active::before {
  opacity: 0;
  transform: none;
}

.canvas::after {
  display: none;
  content: none;
}

.canvas.canvas--dot-hover-active::after {
  opacity: 0;
}

.canvas.panning {
  cursor: grabbing;
}

.canvas.pan-mode {
  cursor: default;
}

.canvas.pan-assist {
  cursor: grab;
}

.edges-layer,
.nodes-layer {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
}

.edges-layer {
  pointer-events: auto;
  z-index: 2;
}

.nodes-layer {
  z-index: 3;
}

.edge-path {
  fill: none;
  stroke: rgba(52, 79, 122, 0.5);
  stroke-width: 2.8;
  stroke-linecap: round;
  pointer-events: stroke;
  cursor: pointer;
  transition: stroke var(--dur-fast) var(--motion-standard), stroke-width var(--dur-fast) var(--motion-standard), filter var(--dur-fast) var(--motion-standard);
}

.edge-path:hover {
  stroke: rgba(21, 173, 255, 0.76);
}

.edge-path--hover {
  stroke: rgba(21, 173, 255, 0.86);
  stroke-width: 3.1;
}

.edge-path--selected {
  stroke: rgba(0, 125, 255, 0.94);
  stroke-width: 3.5;
  filter: drop-shadow(0 2px 6px rgba(0, 125, 255, 0.28));
}

.edge-path--active {
  stroke: var(--accent);
}

.edge-path--temp {
  stroke: var(--accent);
  stroke-width: 3;
  stroke-dasharray: 9 7;
  pointer-events: none;
}

.edge-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 24;
  pointer-events: all;
  cursor: pointer;
}

.edge-endpoint {
  fill: rgba(252, 255, 255, 0.98);
  stroke: rgba(21, 173, 255, 0.92);
  stroke-width: 2.2;
  cursor: grab;
  filter: drop-shadow(0 3px 8px rgba(0, 125, 255, 0.32));
}

.edge-endpoint:active {
  cursor: grabbing;
}

.edge-delete-control {
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.34));
  transition: opacity var(--dur-fast) var(--motion-standard);
}

.edge-group--hover .edge-delete-control {
  opacity: 1;
  pointer-events: all;
}

.edge-delete-control circle {
  fill: rgba(31, 33, 38, 0.98);
  stroke: rgba(255, 255, 255, 0.42);
  stroke-width: 1.6;
}

.edge-delete-control path {
  fill: none;
  stroke: rgba(240, 243, 248, 0.96);
  stroke-width: 2.2;
  stroke-linecap: round;
}

.edge-delete-control:hover circle {
  fill: rgba(69, 72, 81, 0.98);
  stroke: rgba(255, 255, 255, 0.72);
}

.selection-marquee {
  position: absolute;
  pointer-events: none;
  border: 1.5px solid rgba(21, 173, 255, 0.74);
  background: linear-gradient(135deg, rgba(21, 173, 255, 0.18) 0%, rgba(47, 226, 195, 0.14) 100%);
  border-radius: 8px;
  z-index: 12;
}

.empty-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--text-secondary);
  transition: opacity var(--dur-mid) var(--motion-standard);
  pointer-events: none;
}

.empty-hint.hidden {
  opacity: 0;
}

.empty-hint p {
  margin: 0 0 16px;
  font-size: var(--fs-3xl);
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: var(--lh-tight);
  color: var(--text-primary);
}

.hint-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  pointer-events: auto;
}

.hint-chip {
  height: 36px;
  padding: 0 16px;
  border-radius: var(--pill);
  border: 1px solid var(--border-light);
  background: var(--surface-glass);
  color: var(--text-primary);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform var(--dur-fast) var(--motion-standard), box-shadow var(--dur-mid) var(--motion-standard);
}

.hint-chip:hover {
  border-color: rgba(21, 173, 255, 0.56);
  background: rgba(255, 255, 255, 0.96);
  transform: translateY(-1px) scale(1.02);
  box-shadow: var(--accent-glow);
}

.node {
  position: absolute;
  width: 560px;
  border-radius: 22px;
  border: 1px solid var(--border-mid);
  background: var(--surface-glass);
  color: var(--text-primary);
  box-shadow: none;
  user-select: none;
  z-index: 1;
  isolation: isolate;
  transition: border-color var(--dur-fast) var(--motion-standard), box-shadow var(--dur-mid) var(--motion-standard), transform var(--dur-fast) var(--motion-standard);
}

.node:not(.node--image):hover:not(.dragging):not(.node--selected):not(.node--primary-selected) {
  border-color: rgba(21, 173, 255, 0.46);
  box-shadow: 0 12px 30px rgba(7, 33, 72, 0.16);
}

.node:not(.node--image).node--selected {
  border-color: rgba(21, 173, 255, 0.54);
  box-shadow: 0 0 0 1px rgba(21, 173, 255, 0.36), 0 16px 32px rgba(7, 33, 72, 0.16);
}

.node:not(.node--image).node--primary-selected {
  border-color: rgba(21, 173, 255, 0.72);
  box-shadow: 0 0 0 2px rgba(21, 173, 255, 0.46), 0 18px 34px rgba(7, 33, 72, 0.2);
}

.node.node--image.node--selected,
.node.node--image.node--primary-selected {
  box-shadow: none;
}

.node.node--text:hover:not(.dragging):not(.node--selected):not(.node--primary-selected),
.node.node--edit:hover:not(.dragging):not(.node--selected):not(.node--primary-selected) {
  transform: translateY(-2px);
}

.node.node--text:hover:not(.dragging):not(.node--selected):not(.node--primary-selected) .text-node-panel,
.node.node--text:hover:not(.dragging):not(.node--selected):not(.node--primary-selected) .text-node-params-panel,
.node.node--text:hover:not(.dragging):not(.node--selected):not(.node--primary-selected) .text-preview-wrap .text-output-preview,
.node.node--edit:hover:not(.dragging):not(.node--selected):not(.node--primary-selected) .image-edit-panel {
  border-color: rgba(21, 173, 255, 0.44);
  box-shadow: 0 0 0 1px rgba(21, 173, 255, 0.26), 0 16px 34px rgba(7, 33, 72, 0.15);
}

.node.node--selected .image-preview,
.node.node--selected .generate-composer {
  border-color: rgba(21, 173, 255, 0.44);
  box-shadow: 0 0 0 1px rgba(21, 173, 255, 0.28), 0 14px 28px rgba(7, 33, 72, 0.12);
}

.node.node--primary-selected .image-preview,
.node.node--primary-selected .generate-composer {
  border-color: rgba(21, 173, 255, 0.7);
  box-shadow: 0 0 0 2px rgba(21, 173, 255, 0.34), 0 16px 30px rgba(7, 33, 72, 0.16);
}

.node::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.node.dragging {
  box-shadow: 0 22px 46px rgba(15, 23, 42, 0.18);
}

.node.node--text {
  width: 560px;
  border: none;
  background: transparent;
  box-shadow: none;
}

.node.node--edit {
  width: 560px;
  border: none;
  background: transparent;
  box-shadow: none;
}

.node.node--image {
  width: 560px;
  border: none;
  background: transparent;
  box-shadow: none;
}

.node.node--image::before {
  display: none;
}

.node.node--text::before,
.node.node--edit::before {
  display: none;
}

.node-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(246, 248, 252, 0.92) 100%);
  cursor: grab;
}

.node.node--caption-header .node-header {
  position: absolute;
  right: -14px;
  top: 12px;
  min-height: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  z-index: 15;
  pointer-events: none;
  cursor: default;
}

.node.node--image.node--caption-header .node-header {
  left: auto;
  right: -14px;
  width: auto;
  transform: none;
  justify-content: flex-end;
}

.node.node--caption-header .node-title,
.node.node--caption-header .node-id {
  display: none !important;
}

.node.node--caption-header .node-delete-btn {
  pointer-events: none;
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.95);
  border-color: #d2d8e1;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(2px) scale(0.98);
}

.node:hover:not(.dragging) .node-delete-btn,
.node.node--selected .node-delete-btn,
.node.node--primary-selected .node-delete-btn {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.node-title {
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: var(--lh-tight);
}

.node-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.node-id {
  font-size: var(--fs-sm);
  font-family: var(--font-mono);
  font-weight: 600;
  color: #587199;
  letter-spacing: 0.02em;
}

.node-delete-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(129, 155, 195, 0.52);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(236, 247, 255, 0.88) 100%);
  color: #2d476b;
  font-size: var(--fs-lg);
  line-height: 1;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform var(--dur-fast) var(--motion-standard), box-shadow var(--dur-mid) var(--motion-standard);
}

.node-delete-btn:hover {
  border-color: rgba(21, 173, 255, 0.64);
  color: #007dff;
  background: rgba(255, 255, 255, 0.98);
  transform: translateY(-1px) scale(1.04);
  box-shadow: var(--accent-glow);
}

.node-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.node.node--image .node-body {
  padding: 0;
  gap: 14px;
}

.node.node--text .node-body {
  padding: 0;
  gap: 14px;
}

.node.node--edit .node-body {
  padding: 0;
  gap: 8px;
}

/* Align image-edit node header-to-content spacing with image node */
.node.node--image-edit:not(.node--image-edit-minimized) .node-body {
  gap: 14px;
}

.node-caption {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 2px 12px;
  color: #3d5579;
  font-size: 13px;
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.node.node--image .node-caption {
  width: min(100%, var(--image-content-width, 510px));
  margin: 4px auto 2px;
  padding-left: 12px;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node.node--text .node-caption {
  width: min(100%, var(--text-content-width, 520px));
  margin: 4px auto 2px;
  padding-left: 12px;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node.node--image .node-caption {
  cursor: grab;
  user-select: none;
}

.node.node--image.dragging .node-caption {
  cursor: grabbing;
}

.node-caption::before {
  content: "";
  width: 15px;
  height: 13px;
  border-radius: 4px;
  border: 1.5px solid rgba(122, 149, 190, 0.74);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(234, 246, 255, 0.92) 100%);
  box-shadow: inset 0 -4px 0 rgba(130, 164, 205, 0.2);
}

.text-node-panel,
.text-node-params-panel,
.image-edit-panel {
  border-radius: 22px;
  border: 1px solid var(--border-mid);
  background: var(--surface-glass);
  box-shadow: none;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--dur-fast) var(--motion-standard), box-shadow var(--dur-mid) var(--motion-standard), transform var(--dur-fast) var(--motion-standard);
}

.node.node--selected .text-node-panel,
.node.node--selected .text-node-params-panel,
.node.node--selected .image-edit-panel {
  border-color: rgba(21, 173, 255, 0.44);
  box-shadow: 0 0 0 1px rgba(21, 173, 255, 0.28), 0 12px 28px rgba(7, 33, 72, 0.12);
}

.node.node--primary-selected .text-node-panel,
.node.node--primary-selected .text-node-params-panel,
.node.node--primary-selected .image-edit-panel {
  border-color: rgba(21, 173, 255, 0.66);
  box-shadow: 0 0 0 2px rgba(21, 173, 255, 0.36), 0 14px 30px rgba(7, 33, 72, 0.16);
}

.generate-preview-wrap {
  width: min(100%, var(--image-content-width, 520px));
  margin: 0 auto;
  position: relative;
}

.upload-preview-wrap {
  width: min(100%, var(--image-content-width, 520px));
  margin: 0 auto;
  position: relative;
}

.node-handle {
  position: absolute;
  top: 50%;
  --magnet-x: 0px;
  --magnet-y: 0px;
  transform: translate3d(var(--magnet-x), calc(-50% + var(--magnet-y)), 0);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.84);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.96) 0%, rgba(236, 247, 255, 0.9) 100%);
  box-shadow: 0 0 0 2px rgba(69, 103, 153, 0.32), 0 10px 20px rgba(11, 38, 78, 0.16);
  cursor: pointer;
  z-index: 24;
  display: grid;
  place-items: center;
  transition: transform var(--dur-fast) var(--motion-standard), box-shadow var(--dur-mid) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard);
}

.node-handle::before,
.node-handle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: #466186;
  transition: background-color var(--dur-fast) var(--motion-standard);
}

.node-handle::before {
  width: 16px;
  height: 3px;
}

.node-handle::after {
  width: 3px;
  height: 16px;
}

.node-handle:hover {
  transform: translate3d(var(--magnet-x), calc(-50% + var(--magnet-y)), 0) scale(1.05);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 0 0 2px rgba(21, 173, 255, 0.56), 0 12px 24px rgba(0, 125, 255, 0.24);
}

.node-handle--magnetized {
  box-shadow: 0 0 0 2px rgba(21, 173, 255, 0.4), 0 12px 24px rgba(0, 125, 255, 0.2);
}

.node-handle:hover::before,
.node-handle:hover::after {
  background: #0f86ff;
}

.node-handle--in {
  left: -21px;
}

.node-handle--out {
  right: -21px;
}

.node-handle--in::before {
  width: 12px;
  height: 12px;
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(71, 84, 103, 0.44);
}

.node-handle--in::after {
  display: none;
}

.node-handle--target {
  box-shadow: 0 0 0 3px rgba(21, 173, 255, 0.46), 0 12px 24px rgba(0, 125, 255, 0.34);
}

.input,
.select,
.textarea,
.field input,
.settings-textarea,
.field select {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--dur-fast) var(--motion-standard), box-shadow var(--dur-mid) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard);
}

.prompt-section {
  position: relative;
}

.input,
.select {
  height: 42px;
  padding: 0 12px;
  font-size: var(--fs-md);
  font-weight: 500;
}

.settings-textarea {
  min-height: 84px;
  padding: 10px 12px;
  resize: vertical;
  font-size: var(--fs-sm);
  line-height: 1.45;
}

.textarea {
  min-height: 112px;
  padding: 11px 12px;
  resize: vertical;
  font-size: var(--fs-md);
  line-height: var(--lh-base);
}

.input::placeholder,
.textarea::placeholder,
.field input::placeholder {
  color: #88a0c2;
}

.input:focus,
.select:focus,
.textarea:focus,
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(21, 173, 255, 0.2);
  background: rgba(255, 255, 255, 0.95);
}

.field-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.01em;
}

.field-line {
  display: flex;
  gap: 8px;
}

.settings-panel .field-line {
  gap: 10px;
}

.settings-panel .field-line .field {
  flex: 1;
}

.field-line .select,
.field-line .input {
  min-width: 0;
}

.image-preview {
  min-height: 220px;
  height: auto;
  border-radius: 22px;
  border: 1px solid var(--border-mid);
  background: linear-gradient(180deg, rgba(246, 251, 255, 0.92) 0%, rgba(235, 244, 255, 0.86) 100%);
  box-shadow: none;
  overflow: hidden;
  display: grid;
  place-items: center;
  position: relative;
  transition: border-color var(--dur-fast) var(--motion-standard), box-shadow var(--dur-mid) var(--motion-standard), transform var(--dur-fast) var(--motion-standard);
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-preview video {
  width: 100%;
  height: auto;
  display: block;
  background: #0f172a;
}

.video-preview-wrap .image-preview.video-preview--empty { min-height: 108px; }

.audio-preview {
  min-height: 92px;
  border-radius: 18px;
  border: 1px solid var(--border-light);
  background: rgba(247, 252, 255, 0.82);
  display: grid;
  place-items: center;
  padding: 14px;
}

.audio-preview.audio-preview--has-audio {
  min-height: 0;
  border: none;
  background: transparent;
  display: block;
  padding: 0;
}

.audio-preview audio {
  width: 100%;
  min-width: 0;
}

.media-upload-btn {
  position: static;
  align-self: flex-end;
}

.image-placeholder {
  color: var(--text-tertiary);
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.image-drag-badge {
  position: absolute;
  right: 8px;
  top: 8px;
  border-radius: var(--pill);
  padding: 5px 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, rgba(14, 40, 86, 0.84) 0%, rgba(7, 94, 160, 0.78) 100%);
}

.image-preview--stage {
  min-height: 220px;
  height: auto;
}

.image-preview.image-preview--auto-height.image-preview--has-image {
  min-height: 0;
  display: block;
  height: auto;
}

.image-preview.image-preview--auto-height.image-preview--has-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.upload-preview-wrap .image-preview {
  height: auto;
  min-height: 220px;
}

.generate-composer {
  display: grid;
  align-content: start;
  gap: 10px;
  width: min(100%, var(--image-composer-width, 520px));
  margin: 0 auto;
  border: 1px solid var(--border-mid);
  border-radius: 20px;
  background: var(--surface-glass);
  box-shadow: none;
  padding: 10px 12px 10px;
  transition: border-color var(--dur-fast) var(--motion-standard), box-shadow var(--dur-mid) var(--motion-standard), transform var(--dur-fast) var(--motion-standard);
}

.node.node--image:hover:not(.dragging) .upload-preview-wrap .image-preview,
.node.node--image:hover:not(.dragging) .generate-preview-wrap .image-preview {
  border-color: rgba(21, 173, 255, 0.46);
  box-shadow: 0 0 0 1px rgba(21, 173, 255, 0.28), 0 16px 32px rgba(7, 33, 72, 0.16);
  transform: translateY(-2px);
}

.node.node--image:hover:not(.dragging) .generate-composer {
  border-color: rgba(21, 173, 255, 0.44);
  box-shadow: 0 0 0 1px rgba(21, 173, 255, 0.24), 0 16px 32px rgba(7, 33, 72, 0.15);
  transform: translateY(-2px);
}

.generate-tool-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.generate-tool-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(130, 157, 196, 0.52);
  background: rgba(247, 252, 255, 0.86);
  color: #334d72;
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard), transform var(--dur-fast) var(--motion-standard), box-shadow var(--dur-mid) var(--motion-standard);
}

.generate-tool-btn:hover {
  border-color: rgba(21, 173, 255, 0.6);
  background: rgba(255, 255, 255, 0.96);
  transform: translateY(-1px) scale(1.02);
  box-shadow: var(--accent-glow);
}

.generate-tool-divider {
  width: 1px;
  height: 24px;
  background: rgba(130, 157, 196, 0.48);
}

.composer-textarea {
  min-height: 124px;
  border: none;
  border-radius: 14px;
  background: rgba(241, 248, 255, 0.72);
  box-shadow: none;
  padding: 11px 12px;
}

.composer-textarea:focus {
  border: none;
  box-shadow: 0 0 0 2px rgba(21, 173, 255, 0.24);
  background: rgba(255, 255, 255, 0.94);
}

.generate-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  min-height: 46px;
  padding: 4px 6px;
  border: 1px solid rgba(132, 159, 199, 0.5);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(246, 251, 255, 0.86) 0%, rgba(236, 246, 255, 0.74) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 8px 18px rgba(8, 33, 70, 0.08);
}

.generate-toolbar-left,
.generate-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0;
}

.generate-toolbar-left {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.generate-toolbar-left::-webkit-scrollbar {
  display: none;
}

.generate-toolbar-right {
  flex: 0 0 auto;
  margin-left: 4px;
}

.generate-toolbar-item {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  padding: 0 8px;
}

.generate-toolbar-item--model {
  flex: 1 1 auto;
  min-width: 180px;
  padding-left: 2px;
}

.generate-toolbar-item--ratio,
.generate-toolbar-item--size {
  flex: 0 0 auto;
}

.generate-toolbar-sep {
  width: 1px;
  align-self: stretch;
  margin: 6px 4px;
  background: rgba(130, 157, 196, 0.48);
  border-radius: 999px;
}

.generate-chip {
  height: 32px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid rgba(130, 157, 196, 0.52);
  background: rgba(247, 252, 255, 0.86);
  color: #243c5f;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard), transform var(--dur-fast) var(--motion-standard), box-shadow var(--dur-mid) var(--motion-standard);
}

.generate-chip:hover {
  border-color: rgba(21, 173, 255, 0.56);
  background: rgba(255, 255, 255, 0.94);
  transform: translateY(-1px) scale(1.02);
  box-shadow: var(--accent-glow);
}

.generate-select {
  width: auto;
  min-width: 100px;
  height: 34px;
  padding: 0 26px 0 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: #243c5f;
  box-shadow: none;
}

.generate-select--model {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.generate-select:focus {
  border-color: rgba(21, 173, 255, 0.56);
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(21, 173, 255, 0.2);
}

.generate-chip--small {
  min-width: 44px;
  height: 30px;
  padding: 0 10px;
}

.generate-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(130, 157, 196, 0.52);
  background: rgba(247, 252, 255, 0.86);
  cursor: pointer;
  color: #406087;
  font-size: 12px;
  font-weight: 700;
  transition: border-color var(--dur-fast) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard), transform var(--dur-fast) var(--motion-standard), box-shadow var(--dur-mid) var(--motion-standard);
}

.generate-icon-btn:hover {
  border-color: rgba(21, 173, 255, 0.6);
  background: rgba(255, 255, 255, 0.96);
  transform: translateY(-1px) scale(1.02);
  box-shadow: var(--accent-glow);
}

.generate-run-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 5px 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(127, 154, 194, 0.5);
  background: linear-gradient(150deg, rgba(241, 248, 255, 0.9) 0%, rgba(231, 245, 255, 0.76) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 6px 14px rgba(9, 34, 70, 0.08);
}

.generate-quota {
  font-size: 12px;
  color: #475467;
  font-weight: 600;
}

.generate-run-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(126, 154, 197, 0.56);
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.98) 0%, rgba(239, 249, 255, 0.94) 100%);
  color: #214064;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--motion-standard), transform var(--dur-fast) var(--motion-standard), box-shadow var(--dur-mid) var(--motion-standard), color var(--dur-fast) var(--motion-standard);
}

.generate-run-btn:hover {
  border-color: rgba(21, 173, 255, 0.64);
  color: #007dff;
  transform: translateY(-1px) scale(1.06);
  box-shadow: var(--accent-glow);
}

.generate-run-btn:disabled {
  opacity: 0.56;
  cursor: wait;
}

.generate-advanced {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(132, 159, 199, 0.56);
}

.reference-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.reference-role-chip {
  height: 28px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid rgba(130, 157, 196, 0.52);
  background: rgba(247, 252, 255, 0.84);
  color: #334d72;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard), transform var(--dur-fast) var(--motion-standard), box-shadow var(--dur-mid) var(--motion-standard), color var(--dur-fast) var(--motion-standard);
}

.reference-role-chip:hover {
  border-color: rgba(21, 173, 255, 0.56);
  background: rgba(255, 255, 255, 0.96);
  color: #007dff;
  transform: translateY(-1px) scale(1.02);
  box-shadow: var(--accent-glow);
}

.reference-role-chip__thumb {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1px solid rgba(130, 157, 196, 0.46);
  background: rgba(237, 246, 255, 0.9) center / cover no-repeat;
  color: #4b678f;
  font-size: 10px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.reference-role-chip__label {
  line-height: 1;
  white-space: nowrap;
}

.reference-hover-preview {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 140;
  width: 196px;
  padding: 7px;
  border-radius: 12px;
  border: 1px solid rgba(122, 163, 225, 0.62);
  background: linear-gradient(180deg, rgba(11, 20, 42, 0.97) 0%, rgba(8, 15, 33, 0.96) 100%);
  box-shadow: 0 12px 28px rgba(2, 8, 24, 0.46);
  pointer-events: none;
  user-select: none;
}

.reference-hover-preview.hidden {
  display: none;
}

.reference-hover-preview__image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 9px;
  border: 1px solid rgba(156, 190, 245, 0.42);
  background: rgba(16, 28, 52, 0.88);
}

.reference-hover-preview__caption {
  margin-top: 6px;
  padding: 0 2px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  color: rgba(217, 231, 252, 0.94);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reference-hover-preview__caption.hidden {
  display: none;
}

.text-output-card--active,
.text-output-content,
.settings-textarea {
  overscroll-behavior: contain;
}

.image-node-toolbar {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  margin: 2px 0 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.image-node-toolbar--overlay {
  position: absolute;
  left: 50%;
  top: auto;
  bottom: -54px;
  transform: translate(-50%, 8px);
  z-index: 9;
  margin: 0;
  max-width: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--motion-standard), transform var(--dur-mid) var(--motion-emphasized);
}

.image-node-toolbar--overlay.image-node-toolbar--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.image-node-tool-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(128, 154, 194, 0.56);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(239, 249, 255, 0.9) 100%);
  color: #29476e;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard), transform var(--dur-fast) var(--motion-standard), box-shadow var(--dur-mid) var(--motion-standard);
}

.image-node-tool-btn:hover {
  border-color: rgba(21, 173, 255, 0.64);
  background: rgba(255, 255, 255, 0.98);
  transform: translateY(-1px) scale(1.03);
  box-shadow: var(--accent-glow);
}

.upload-icon-btn {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 10;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(126, 154, 197, 0.56);
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.97) 0%, rgba(237, 248, 255, 0.92) 100%);
  color: #224264;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(9, 34, 70, 0.14);
  transition: transform var(--dur-fast) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard), box-shadow var(--dur-mid) var(--motion-standard);
}

.upload-icon-btn:hover {
  border-color: rgba(21, 173, 255, 0.64);
  background: rgba(255, 255, 255, 0.98);
  color: #007dff;
  transform: translateY(-1px) scale(1.05);
  box-shadow: var(--accent-glow);
}

.upload-icon-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.audio-node-panel .media-upload-btn {
  position: static;
  align-self: flex-end;
}

.generate-gallery {
  display: flex;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  padding: 2px 2px 0;
}

.generate-thumb {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(128, 154, 194, 0.48);
  padding: 0;
  background: #ffffff;
  cursor: pointer;
}

.generate-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.generate-thumb--active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(21, 173, 255, 0.24);
}

.action-row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.action-row--download-bottom {
  margin-top: 4px;
}

.action-row .pill-btn {
  height: 36px;
  padding: 0 14px;
}

.action-row .pill-btn:disabled {
  opacity: 0.56;
  cursor: wait;
}

.mention-menu {
  position: absolute;
  left: 0;
  top: 0;
  min-width: 220px;
  max-width: 290px;
  max-height: 220px;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(132, 159, 199, 0.5);
  background: rgba(246, 251, 255, 0.92);
  box-shadow: 0 18px 34px rgba(8, 33, 70, 0.18);
  backdrop-filter: blur(10px) saturate(140%);
  z-index: 30;
  animation: floating-in var(--dur-mid) var(--motion-emphasized);
}

.mention-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  padding: 8px 10px;
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
}

.mention-item:hover {
  background: rgba(21, 173, 255, 0.1);
}

.mention-item--active {
  background: linear-gradient(120deg, rgba(21, 173, 255, 0.18) 0%, rgba(47, 226, 195, 0.14) 100%);
}

.mention-item__thumb {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(130, 157, 196, 0.44);
  background: rgba(233, 243, 255, 0.9) center / cover no-repeat;
  color: #466486;
  font-size: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.mention-item__meta {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.mention-item__title {
  font-size: 12px;
  color: #1a355a;
  font-weight: 700;
  line-height: 1.2;
}

.mention-item__sub {
  font-size: 11px;
  color: #587194;
  line-height: 1.2;
}

.status-line {
  min-height: 18px;
  font-size: var(--fs-sm);
  line-height: var(--lh-base);
  color: var(--text-tertiary);
}

.node.node--image .status-line {
  padding: 0 6px 0 10px;
}

.status-line--success {
  color: #0f8a45;
}

.status-line--warning {
  color: #b54708;
}

.status-line--error {
  color: #d92d20;
}

.status-line--running {
  color: #175cd3;
}

.split-grid {
  display: grid;
  --split-grid-cols: 3;
  --split-tile-ratio: 1;
  grid-template-columns: repeat(var(--split-grid-cols), minmax(0, 1fr));
  gap: 8px;
}

.split-grid-item {
  position: relative;
  padding: 0;
  margin: 0;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
  cursor: grab;
}

.split-grid-item:active {
  cursor: grabbing;
}

.split-grid-item:hover {
  border-color: rgba(21, 173, 255, 0.48);
  box-shadow: 0 0 0 2px rgba(21, 173, 255, 0.16);
}

.split-grid-item img {
  width: 100%;
  aspect-ratio: var(--split-tile-ratio);
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: var(--surface-secondary);
}

.split-grid-item__badge {
  position: absolute;
  right: 6px;
  top: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(16, 24, 40, 0.54);
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.grid-overlay__line {
  stroke: rgba(37, 99, 235, 0.96);
  stroke-width: 3;
  stroke-dasharray: 10 7;
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 4px rgba(37, 99, 235, 0.5));
}

.grid-overlay__line--fallback {
  stroke: rgba(245, 158, 11, 0.95);
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 4px rgba(245, 158, 11, 0.45));
}

.floating-menu {
  z-index: 160;
  position: absolute;
  z-index: 40;
  min-width: 250px;
  padding: 12px 10px 10px;
  border-radius: 18px;
  border: 1px solid rgba(132, 159, 199, 0.52);
  background: rgba(246, 251, 255, 0.92);
  box-shadow: 0 20px 40px rgba(8, 33, 70, 0.2);
  backdrop-filter: saturate(170%) blur(13px);
  animation: floating-in var(--dur-mid) var(--motion-emphasized);
  display: grid;
  gap: 10px;
  align-content: start;
}

.floating-menu h4 {
  margin: 2px 8px 2px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-tertiary);
}

.menu-item {
  width: calc(100% - 6px);
  margin-inline: auto;
  min-height: 56px;
  border: 1px solid rgba(128, 154, 194, 0.56);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(239, 249, 255, 0.9) 100%);
  color: #29476e;
  text-align: left;
  padding: 0 20px;
  font-size: var(--fs-sm);
  font-weight: 650;
  line-height: 1.15;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--motion-standard), transform var(--dur-fast) var(--motion-standard),
    box-shadow var(--dur-mid) var(--motion-standard), color var(--dur-fast) var(--motion-standard),
    filter var(--dur-fast) var(--motion-standard);
}

.menu-item__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  min-width: 20px;
  height: 20px;
  color: rgba(99, 136, 187, 0.92);
  transform: translateY(-0.5px);
}

.menu-item__icon svg {
  width: 17px;
  height: 17px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-item__label {
  min-width: 0;
}

.menu-item:hover {
  border-color: rgba(21, 173, 255, 0.64);
  background: rgba(255, 255, 255, 0.98);
  color: #007dff;
  transform: translateY(-1px) scale(1.006);
  box-shadow: var(--accent-glow);
}

.menu-item:hover .menu-item__icon {
  color: rgba(0, 125, 255, 0.96);
}

.menu-item:disabled {
  cursor: not-allowed;
}

.floating-menu.menu-stagger-in .menu-item {
  animation: menu-item-stagger-in 340ms cubic-bezier(0.2, 0.78, 0.2, 1) both;
  animation-delay: var(--menu-item-stagger, 0ms);
}

.hidden {
  display: none !important;
}

.action-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(9, 20, 38, 0.24);
  backdrop-filter: blur(7px);
  display: grid;
  place-items: center;
  padding: 18px;
}

.action-dialog-card {
  width: min(460px, 100%);
  border: 1px solid rgba(132, 159, 199, 0.5);
  border-radius: 18px;
  background: rgba(247, 252, 255, 0.94);
  box-shadow: 0 24px 54px rgba(8, 33, 70, 0.24);
  padding: 16px;
  display: grid;
  gap: 10px;
}

.action-dialog-title {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.action-dialog-desc {
  margin: 0;
  color: #587194;
  font-size: 12px;
  line-height: 1.45;
}

.action-dialog-field {
  display: grid;
  gap: 6px;
}

.action-dialog-field > span {
  color: #587194;
  font-size: 12px;
  font-weight: 600;
}

.action-dialog-field .textarea {
  min-height: 92px;
}

.action-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}

.board-hub-panel {
  position: fixed;
  inset: 0;
  z-index: 72;
  overflow: auto;
  padding: 28px 36px 34px;
  background:
    radial-gradient(980px 420px at -6% -24%, rgba(66, 99, 152, 0.16) 0%, rgba(66, 99, 152, 0) 68%),
    radial-gradient(760px 340px at 108% -19%, rgba(86, 131, 198, 0.14) 0%, rgba(86, 131, 198, 0) 72%),
    linear-gradient(180deg, #05080f 0%, #04070d 100%);
}

.board-hub-page {
  max-width: 1850px;
  margin: 0 auto;
  min-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
}

.board-hub-current-board {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.board-hub-page-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.board-hub-topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.board-hub-back-icon-btn {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(244, 250, 255, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--motion-standard), border-color var(--dur-fast) var(--motion-standard),
    background-color var(--dur-fast) var(--motion-standard), color var(--dur-fast) var(--motion-standard);
}

.board-hub-back-icon-btn svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.board-hub-back-icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(174, 213, 255, 0.58);
  background: rgba(106, 155, 224, 0.2);
  color: #f6fbff;
}

.board-hub-back-icon-btn:focus-visible {
  outline: 2px solid rgba(160, 214, 255, 0.82);
  outline-offset: 2px;
}

.board-hub-scope-tabs {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  min-width: 180px;
}

.board-hub-scope-tab {
  position: relative;
  border: 0;
  background: transparent;
  color: rgba(243, 247, 255, 0.52);
  font-size: 17px;
  line-height: 1;
  font-weight: 590;
  letter-spacing: -0.01em;
  padding: 4px 2px 12px;
  cursor: pointer;
  transition: color var(--dur-fast) var(--motion-standard);
}

.board-hub-scope-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  opacity: 0;
  transform: scaleX(0.66);
  transition: opacity var(--dur-fast) var(--motion-standard), transform var(--dur-fast) var(--motion-standard);
}

.board-hub-scope-tab:hover {
  color: rgba(245, 249, 255, 0.78);
}

.board-hub-scope-tab.is-active {
  color: #f5f9ff;
}

.board-hub-scope-tab.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.board-hub-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.board-hub-search {
  width: min(28vw, 216px);
  min-width: 164px;
  height: 46px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 13px 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.board-hub-search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(239, 244, 255, 0.54);
}

.board-hub-search-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.95;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.board-hub-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: rgba(246, 251, 255, 0.97);
  font-size: 14px;
  line-height: 1;
}

.board-hub-search input::placeholder {
  color: rgba(235, 242, 255, 0.36);
}

.board-hub-filter-wrap {
  position: relative;
  min-width: 136px;
  height: 46px;
}

.board-hub-filter-wrap select {
  width: 100%;
  height: 100%;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.065);
  color: #eef4ff;
  font-size: 14px;
  line-height: 1;
  padding: 0 36px 0 14px;
  cursor: pointer;
  outline: none;
}

.board-hub-filter-wrap select:focus-visible {
  border-color: rgba(150, 204, 255, 0.72);
  box-shadow: 0 0 0 2px rgba(102, 183, 255, 0.2);
}

.board-hub-filter-caret {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 11px;
  height: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transform: translateY(-50%);
  color: rgba(235, 242, 255, 0.75);
}

.board-hub-filter-caret svg {
  display: block;
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.board-hub-view-toggle {
  height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.055);
}

.board-hub-view-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: rgba(238, 245, 255, 0.62);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--motion-standard), color var(--dur-fast) var(--motion-standard);
}

.board-hub-view-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.board-hub-view-btn.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(246, 251, 255, 0.94);
}

.board-hub-tools-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.12);
}

.board-hub-primary-btn {
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  color: #f2f7ff;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--motion-standard), border-color var(--dur-fast) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard);
}

.board-hub-primary-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(172, 214, 255, 0.54);
  background: rgba(117, 171, 245, 0.2);
}

.board-hub-back-btn {
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.065);
  color: rgba(244, 249, 255, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 570;
  line-height: 1;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--motion-standard), border-color var(--dur-fast) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard);
}

.board-hub-back-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(172, 214, 255, 0.52);
  background: rgba(108, 160, 232, 0.2);
}

.board-hub-back-btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.board-hub-primary-btn {
  min-width: 126px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 14px;
  line-height: 1;
  font-weight: 600;
}

.board-hub-primary-btn span:first-child {
  font-size: 21px;
  font-weight: 400;
}

.board-history-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  align-content: start;
  min-height: 0;
  padding-bottom: 12px;
}

.board-history-list.is-list-view {
  grid-template-columns: 1fr;
  gap: 14px;
}

.board-history-empty {
  min-height: min(46vh, 360px);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: rgba(234, 242, 255, 0.65);
  background: rgba(255, 255, 255, 0.025);
  font-size: 14px;
  text-align: center;
  padding: 24px;
}

.board-history-empty strong,
.board-history-empty span {
  display: block;
}

.board-history-empty strong {
  color: rgba(242, 247, 255, 0.88);
  font-size: 15px;
  font-weight: 650;
}

.board-history-empty span {
  margin-top: 6px;
  color: rgba(224, 234, 250, 0.5);
  font-size: 13px;
}

.board-library-card {
  position: relative;
  border-radius: 16px;
  border: 1px solid rgba(136, 162, 202, 0.26);
  background: linear-gradient(180deg, rgba(33, 37, 47, 0.93) 0%, rgba(26, 30, 39, 0.97) 100%);
  box-shadow: 0 10px 24px rgba(2, 9, 20, 0.22);
  min-height: 284px;
  padding: 8px 8px 11px;
  display: grid;
  grid-template-rows: minmax(142px, 206px) auto;
  gap: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 180ms var(--motion-standard), border-color 180ms var(--motion-standard), box-shadow 220ms var(--motion-standard);
}

.workflow-template-card {
  grid-template-rows: minmax(118px, 148px) minmax(0, 1fr);
}

.workflow-template-card-cover {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
}

.workflow-template-scope,
.workflow-template-category {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(5, 10, 18, 0.58);
  color: rgba(246, 250, 255, 0.88);
  font-size: 11px;
  line-height: 1;
  backdrop-filter: blur(10px);
}

.workflow-template-scope--official {
  border-color: rgba(107, 203, 255, 0.5);
  background: rgba(29, 112, 173, 0.56);
}

.workflow-template-scope--team {
  border-color: rgba(170, 144, 255, 0.46);
  background: rgba(91, 67, 164, 0.58);
}

.workflow-template-card-body {
  grid-template-rows: auto minmax(34px, auto) auto auto;
  gap: 7px;
}

.workflow-template-description {
  margin: 0;
  color: rgba(222, 232, 248, 0.62);
  font-size: 12px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.workflow-template-use-btn {
  width: 100%;
  height: 34px;
  margin-top: 2px;
  border: 1px solid rgba(120, 187, 255, 0.38);
  border-radius: 10px;
  background: rgba(63, 144, 229, 0.16);
  color: rgba(239, 247, 255, 0.94);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard);
}

.workflow-template-use-btn:hover {
  border-color: rgba(143, 207, 255, 0.7);
  background: rgba(67, 151, 238, 0.28);
}

.hint-chip--accent {
  border-color: rgba(83, 211, 255, 0.58);
  background: rgba(83, 211, 255, 0.15);
  color: #dff8ff;
}

.board-library-card:hover {
  transform: translateY(-2px);
  border-color: rgba(146, 193, 255, 0.52);
  box-shadow: 0 14px 30px rgba(3, 11, 26, 0.29);
}

.board-library-card.is-active {
  border-color: rgba(140, 193, 255, 0.72);
  box-shadow: 0 0 0 1px rgba(145, 198, 255, 0.28), 0 12px 28px rgba(4, 13, 30, 0.3);
}

.board-library-card-cover {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--board-cover-bg, linear-gradient(132deg, #7f8fa7 0%, #3c4f70 52%, #202b43 100%));
}

.board-library-card-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(6, 10, 18, 0.17) 100%);
  pointer-events: none;
}

.board-library-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.board-library-card-body {
  display: grid;
  gap: 3px;
  align-content: start;
  min-width: 0;
  padding: 0 4px;
}

.board-library-card-title {
  margin: 0;
  color: rgba(245, 249, 255, 0.96);
  font-size: 20px;
  line-height: 1.24;
  font-weight: 620;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-library-card-meta {
  margin: 0;
  color: rgba(225, 235, 250, 0.42);
  font-size: 14px;
  line-height: 1.28;
}

.board-library-card-delete {
  position: static;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: rgba(6, 11, 18, 0.52);
  color: rgba(239, 245, 255, 0.78);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard), color var(--dur-fast) var(--motion-standard);
}

.board-library-card-delete:hover {
  background: rgba(144, 52, 79, 0.82);
  color: #fff4f7;
}

.board-library-card-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
}

.board-library-card-action {
  min-width: 48px;
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(6, 11, 18, 0.66);
  color: rgba(239, 245, 255, 0.82);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard),
    color var(--dur-fast) var(--motion-standard);
}

.board-library-card-action:hover {
  background: rgba(91, 143, 219, 0.86);
  color: #ffffff;
}

.board-library-card:hover .board-library-card-delete,
.board-library-card:focus-within .board-library-card-delete,
.board-library-card:hover .board-library-card-action,
.board-library-card:focus-within .board-library-card-action {
  opacity: 1;
}

body.is-project-readonly .node,
body.is-project-readonly .edge-hit,
body.is-project-readonly .quick-add-btn {
  pointer-events: none !important;
}

body.is-project-readonly .node {
  cursor: default;
}

body.is-project-readonly .board-title {
  color: rgba(220, 230, 247, 0.72);
}

.board-library-card.board-library-card--create {
  display: grid;
  grid-template-rows: 1fr;
  gap: 0;
  padding-block: 8px;
  align-items: center;
  justify-items: center;
  place-items: center;
  background: linear-gradient(133deg, rgba(38, 41, 49, 0.95) 0%, rgba(30, 33, 40, 0.97) 100%);
}

.board-library-create-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 100%;
  text-align: center;
}

.board-library-create-plus {
  --plus-size: 24px;
  --plus-thickness: 2.2px;
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.93);
  color: rgba(21, 29, 43, 0.95);
  font-size: 0;
  line-height: 0;
}

.board-library-create-plus::before,
.board-library-create-plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 999px;
  background: rgba(21, 29, 43, 0.95);
  transform: translate(-50%, -50%);
}

.board-library-create-plus::before {
  width: var(--plus-size);
  height: var(--plus-thickness);
}

.board-library-create-plus::after {
  width: var(--plus-thickness);
  height: var(--plus-size);
}

.board-library-create-text {
  margin: 0;
  color: rgba(243, 248, 255, 0.92);
  font-size: 17px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0;
}

.board-history-list.is-list-view .board-library-card {
  min-height: 174px;
  padding: 8px;
  grid-template-columns: 250px minmax(0, 1fr);
  grid-template-rows: 1fr;
  align-items: stretch;
}

.board-history-list.is-list-view .board-library-card-cover {
  min-height: 158px;
}

.board-history-list.is-list-view .board-library-card-body {
  align-content: center;
  gap: 6px;
  padding-inline: 10px;
}

.board-history-list.is-list-view .board-library-card-title {
  font-size: 18px;
  white-space: normal;
}

.board-history-list.is-list-view .board-library-card-meta {
  font-size: 13px;
}

.board-history-list.is-list-view .board-library-card--create {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  min-height: 174px;
}

@media (max-width: 1280px) {
  .board-hub-panel {
    padding: 18px 16px 24px;
  }

  .board-hub-page {
    gap: 16px;
  }

  .board-hub-page-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .board-hub-topbar-left {
    width: 100%;
  }

  .board-hub-tools {
    justify-content: flex-start;
  }

  .board-hub-scope-tab {
    font-size: 16px;
    padding-bottom: 10px;
  }

  .board-hub-search {
    width: 100%;
    max-width: none;
  }

  .board-hub-search input,
  .board-hub-filter-wrap select {
    font-size: 13px;
  }

  .board-history-list {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
  }

  .board-library-card {
    min-height: 236px;
    grid-template-rows: minmax(120px, 158px) auto;
    gap: 10px;
    border-radius: 16px;
  }

  .board-library-card-cover {
    border-radius: 12px;
  }

  .board-library-card-title {
    font-size: 16px;
  }

  .board-library-card-meta {
    font-size: 12px;
  }

  .board-library-create-plus {
    --plus-size: 19px;
    --plus-thickness: 2px;
    width: 46px;
    height: 46px;
  }

  .board-library-create-text {
    font-size: 15px;
  }

  .board-history-list.is-list-view .board-library-card {
    grid-template-columns: 1fr;
  }

  .board-history-list.is-list-view .board-library-card-title {
    font-size: 16px;
  }

  .board-history-list.is-list-view .board-library-card-meta {
    font-size: 12px;
  }

  .board-history-empty {
    min-height: 220px;
    font-size: 13px;
  }
}

.settings-panel {
  position: absolute;
  inset: 0;
  z-index: 60;
  background: rgba(8, 18, 34, 0.22);
  backdrop-filter: blur(7px);
  display: grid;
  place-items: center;
  padding: 24px;
}

@keyframes floating-in {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes menu-item-stagger-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
    filter: blur(1.4px);
  }
  to {
    opacity: var(--menu-item-target-opacity, 1);
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .floating-menu.menu-stagger-in .menu-item {
    animation: none;
  }
}

.settings-card {
  width: min(560px, 100%);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(132, 159, 199, 0.56);
  background: rgba(247, 252, 255, 0.95);
  color: var(--text-primary);
  box-shadow: var(--shadow-float), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  padding: 18px;
}

.settings-card h3 {
  margin: 4px 0 14px;
  font-size: var(--fs-2xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: var(--lh-tight);
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field span {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-tertiary);
}

.field input,
.field select {
  height: 42px;
  padding: 0 12px;
  font-size: var(--fs-md);
  font-weight: 500;
}

.field-tip {
  margin: 6px 0 14px;
  font-size: var(--fs-sm);
  line-height: var(--lh-base);
  color: #7d94b7;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.settings-actions .pill-btn {
  border-color: rgba(128, 154, 194, 0.56);
  color: #2a4469;
}

.settings-actions .pill-btn--accent {
  color: #123963;
  border-color: rgba(21, 173, 255, 0.46);
}

@keyframes ambient-drift {
  0% {
    transform: translate3d(-2%, -1%, 0) rotate(0.001deg);
  }
  50% {
    transform: translate3d(2%, 1%, 0) rotate(0.001deg);
  }
  100% {
    transform: translate3d(-2%, -1%, 0) rotate(0.001deg);
  }
}

@keyframes sheen-shift {
  0% {
    opacity: 0.28;
    transform: translateX(-3%);
  }
  50% {
    opacity: 0.6;
    transform: translateX(2%);
  }
  100% {
    opacity: 0.28;
    transform: translateX(-3%);
  }
}

@media (max-width: 1080px) {
  .top-bar {
    top: 0;
    left: 0;
    right: 0;
    border-radius: 0;
    min-height: 60px;
    padding: 10px 12px;
  }

  .top-actions {
    gap: 6px;
  }

  .viewport-controls {
    left: 10px;
    bottom: 10px;
    gap: 6px;
    padding: 6px;
  }

  .left-dock {
    left: 10px;
    gap: 8px;
  }

  .quick-add-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 24px;
  }

  .quick-add-btn--ghost {
    font-size: 14px;
  }

  .board-title {
    min-width: 120px;
    font-size: var(--fs-lg);
  }

  .pill-btn {
    height: 31px;
    padding: 0 10px;
    font-size: var(--fs-xs);
  }

  .generate-preview-wrap {
    width: min(100%, var(--image-content-width, 520px));
  }

  .image-preview--stage {
    min-height: 180px;
    height: auto;
  }

  .upload-preview-wrap .image-preview {
    min-height: 180px;
    height: auto;
  }

  .generate-toolbar {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 4px 5px;
  }

  .generate-toolbar-right {
    justify-content: flex-end;
  }

  .generate-toolbar-item--model {
    min-width: 130px;
  }

  .generate-toolbar-item--ratio .generate-select,
  .generate-toolbar-item--size .generate-select {
    min-width: 86px;
  }

  .empty-hint p {
    font-size: var(--fs-2xl);
  }

  .hint-actions {
    flex-wrap: wrap;
  }
}

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

/* ===== Neo Dark Refinement (TapNow-inspired, interaction-safe) ===== */
:root {
  color-scheme: dark;
  --fs-xs: 14px;
  --fs-sm: 14px;
  --fs-md: 14px;
  --fs-base: 14px;
  --bg-page: #070b14;
  --bg-canvas: #0a1020;
  --bg-grid-line: rgba(111, 144, 196, 0.11);
  --bg-grid-accent: rgba(58, 189, 255, 0.1);
  --canvas-dot: rgba(181, 201, 231, 0.22);
  --text-primary: #edf3ff;
  --text-secondary: #c5d5f3;
  --text-tertiary: #90a6c8;
  --surface-primary: rgba(13, 20, 36, 0.9);
  --surface-secondary: rgba(16, 24, 43, 0.9);
  --surface-tertiary: rgba(20, 30, 54, 0.92);
  --surface-glass: linear-gradient(160deg, rgba(17, 26, 46, 0.92) 0%, rgba(11, 18, 34, 0.86) 100%);
  --border-light: rgba(124, 150, 194, 0.32);
  --border-mid: rgba(134, 162, 209, 0.42);
  --accent: #53d3ff;
  --accent-strong: #36b6ff;
  --accent-soft: rgba(83, 211, 255, 0.2);
  --accent-glow: 0 0 0 1px rgba(83, 211, 255, 0.3), 0 14px 30px rgba(54, 182, 255, 0.2);
  --shadow-float: 0 24px 56px rgba(0, 0, 0, 0.42);
  --shadow-card: 0 14px 34px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 8px 20px rgba(0, 0, 0, 0.3);
}

html,
body {
  background: radial-gradient(circle at 12% -8%, rgba(83, 211, 255, 0.14), transparent 38%),
    radial-gradient(circle at 87% -12%, rgba(95, 145, 255, 0.11), transparent 42%),
    var(--bg-page);
}

.app-shell {
  background: radial-gradient(circle at 8% 0%, rgba(83, 211, 255, 0.16), transparent 34%),
    radial-gradient(circle at 90% 1%, rgba(86, 119, 255, 0.14), transparent 38%),
    radial-gradient(circle at 50% 108%, rgba(58, 189, 255, 0.1), transparent 44%),
    var(--bg-page);
}

.app-shell::before {
  filter: blur(52px) saturate(108%);
  opacity: 0.45;
  animation-duration: 28s;
}

.app-shell::after {
  opacity: 0.2;
  animation-duration: 20s;
}

.top-bar {
  border: 1px solid rgba(121, 151, 201, 0.24);
  border-top: none;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.78) 0%, rgba(11, 18, 33, 0.56) 100%);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.board-title {
  color: var(--text-primary);
}

.brand-dot {
  background: conic-gradient(from 215deg at 50% 50%, #73f1df 0deg, #53d3ff 120deg, #4f8dff 230deg, #73f1df 360deg);
  box-shadow: 0 0 0 1px rgba(115, 241, 223, 0.28), 0 0 12px rgba(83, 211, 255, 0.38);
}

.canvas {
  background-color: var(--bg-canvas);
  background-image: radial-gradient(circle, var(--canvas-dot) 1.05px, transparent 1.05px),
    radial-gradient(circle, var(--bg-grid-accent) 1.05px, transparent 1.05px);
}

.viewport-controls,
.quick-add-btn,
.pill-btn,
.hint-chip,
.floating-menu,
.settings-card,
.action-dialog-card,
.mention-menu {
  background: var(--surface-glass);
  border-color: var(--border-light);
  color: var(--text-secondary);
}

button,
input,
select,
textarea {
  color: var(--text-primary);
}

select,
option,
optgroup {
  background-color: #0d1528;
  color: #e9f2ff;
}

.viewport-controls {
  box-shadow: var(--shadow-soft);
}

.pill-btn,
.menu-item,
.image-node-tool-btn,
.generate-chip,
.generate-tool-btn,
.generate-icon-btn,
.node-delete-btn,
.upload-icon-btn {
  color: var(--text-secondary);
  background: linear-gradient(150deg, rgba(22, 33, 58, 0.92) 0%, rgba(15, 24, 44, 0.88) 100%);
  border: 1px solid rgba(130, 160, 210, 0.44);
}

.node.node--caption-header .node-delete-btn {
  background: linear-gradient(150deg, rgba(22, 33, 58, 0.94) 0%, rgba(15, 24, 44, 0.9) 100%);
  border: 1px solid rgba(130, 160, 210, 0.5);
  color: #c8daf8;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.32);
}

.node.node--caption-header .node-delete-btn:hover {
  color: #f1f8ff;
  border-color: rgba(83, 211, 255, 0.68);
  box-shadow: var(--accent-glow);
  background: linear-gradient(150deg, rgba(26, 38, 66, 0.98) 0%, rgba(17, 28, 51, 0.94) 100%);
}

.pill-btn:hover,
.menu-item:hover,
.image-node-tool-btn:hover,
.generate-chip:hover,
.generate-tool-btn:hover,
.generate-icon-btn:hover,
.node-delete-btn:hover,
.upload-icon-btn:hover,
.hint-chip:hover,
.quick-add-btn:hover {
  color: #f1f7ff;
  border-color: rgba(83, 211, 255, 0.68);
  box-shadow: var(--accent-glow);
  background: linear-gradient(150deg, rgba(26, 38, 66, 0.98) 0%, rgba(17, 28, 51, 0.94) 100%);
}

.pill-btn--accent {
  color: #f1f8ff;
  border-color: rgba(83, 211, 255, 0.7);
  background: linear-gradient(130deg, rgba(41, 89, 146, 0.9) 0%, rgba(32, 62, 104, 0.92) 100%);
  box-shadow: 0 8px 20px rgba(28, 74, 131, 0.38);
}

.node {
  border-color: rgba(130, 160, 210, 0.44);
}

.node-caption {
  color: #b2c7ea;
}

.node-caption::before {
  border-color: rgba(136, 166, 218, 0.74);
  background: linear-gradient(180deg, rgba(27, 41, 68, 0.95) 0%, rgba(18, 28, 49, 0.93) 100%);
  box-shadow: inset 0 -4px 0 rgba(98, 133, 188, 0.28);
}

.node-id {
  color: #8eb1e0;
}

.node:not(.node--image):hover:not(.dragging):not(.node--selected):not(.node--primary-selected) {
  border-color: rgba(83, 211, 255, 0.58);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

.node:not(.node--image).node--selected {
  border-color: rgba(83, 211, 255, 0.72);
  box-shadow: 0 0 0 1px rgba(83, 211, 255, 0.48), 0 16px 34px rgba(0, 0, 0, 0.4);
}

.node:not(.node--image).node--primary-selected {
  border-color: rgba(83, 211, 255, 0.88);
  box-shadow: 0 0 0 2px rgba(83, 211, 255, 0.52), 0 18px 38px rgba(0, 0, 0, 0.44);
}

.node.node--text.node--selected,
.node.node--text.node--primary-selected,
.node.node--edit.node--selected,
.node.node--edit.node--primary-selected {
  border-color: transparent;
  box-shadow: none;
}

.text-node-panel,
.text-node-params-panel,
.image-edit-panel,
.image-preview,
.generate-composer,
.generate-toolbar,
.split-grid-item,
.generate-thumb {
  background: var(--surface-glass);
  border-color: rgba(130, 160, 210, 0.42);
}

.node.node--text:hover:not(.dragging):not(.node--selected):not(.node--primary-selected) .text-node-panel,
.node.node--text:hover:not(.dragging):not(.node--selected):not(.node--primary-selected) .text-node-params-panel,
.node.node--text:hover:not(.dragging):not(.node--selected):not(.node--primary-selected) .text-preview-wrap .text-output-preview,
.node.node--edit:hover:not(.dragging):not(.node--selected):not(.node--primary-selected) .image-edit-panel,
.node.node--image:hover:not(.dragging) .upload-preview-wrap .image-preview,
.node.node--image:hover:not(.dragging) .generate-preview-wrap .image-preview,
.node.node--image:hover:not(.dragging) .generate-composer {
  border-color: rgba(83, 211, 255, 0.58);
  box-shadow: 0 0 0 1px rgba(83, 211, 255, 0.32), 0 16px 34px rgba(0, 0, 0, 0.34);
}

.node.node--selected .image-preview,
.node.node--selected .generate-composer {
  border-color: rgba(83, 211, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(83, 211, 255, 0.38), 0 16px 34px rgba(0, 0, 0, 0.36);
}

.node.node--primary-selected .image-preview,
.node.node--primary-selected .generate-composer,
.node.node--selected .text-node-panel,
.node.node--selected .text-node-params-panel,
.node.node--selected .image-edit-panel,
.node.node--primary-selected .text-node-panel,
.node.node--primary-selected .text-node-params-panel,
.node.node--primary-selected .image-edit-panel {
  border-color: rgba(83, 211, 255, 0.82);
  box-shadow: 0 0 0 2px rgba(83, 211, 255, 0.42), 0 18px 38px rgba(0, 0, 0, 0.42);
}

.textarea,
.input,
.select,
.settings-textarea,
.field input,
.field select {
  background: rgba(10, 16, 31, 0.78);
  border-color: rgba(130, 160, 210, 0.4);
  color: #edf3ff;
}

.input::placeholder,
.textarea::placeholder,
.field input::placeholder {
  color: #7894bf;
}

.input:focus,
.select:focus,
.textarea:focus,
.field input:focus {
  border-color: rgba(83, 211, 255, 0.76);
  box-shadow: 0 0 0 3px rgba(83, 211, 255, 0.22);
  background: rgba(14, 22, 40, 0.92);
}

.composer-textarea {
  background: rgba(10, 17, 33, 0.78);
}

.composer-textarea:focus {
  box-shadow: 0 0 0 2px rgba(83, 211, 255, 0.28);
  background: rgba(14, 22, 40, 0.92);
}

.text-node-panel .textarea,
.text-node-params-panel .textarea,
.generate-composer .composer-textarea,
.image-edit-panel .composer-textarea {
  min-height: 124px;
  border: 1px solid rgba(130, 160, 210, 0.4);
  border-radius: 14px;
  padding: 11px 12px;
  line-height: var(--lh-base);
  background: transparent;
  box-shadow: none;
}

.text-node-panel .textarea:focus,
.text-node-params-panel .textarea:focus,
.generate-composer .composer-textarea:focus,
.image-edit-panel .composer-textarea:focus {
  border-color: rgba(83, 211, 255, 0.76);
  box-shadow: 0 0 0 2px rgba(83, 211, 255, 0.28);
  background: transparent;
}

.generate-toolbar-sep,
.generate-tool-divider {
  background: rgba(130, 160, 210, 0.42);
}

.generate-quota,
.status-line,
.field-tip,
.action-dialog-desc,
.action-dialog-field > span,
.mention-item__sub,
.floating-menu h4 {
  color: var(--text-tertiary);
}

.node-caption,
.generate-chip,
.generate-select,
.generate-icon-btn,
.generate-quota,
.reference-role-chip,
.image-node-tool-btn,
.mention-item,
.mention-item__thumb,
.mention-item__title,
.mention-item__sub,
.split-grid-item__badge,
.action-dialog-desc,
.action-dialog-field > span,
.field-tip,
.status-line {
  font-size: 14px;
}

.mention-item__title {
  color: #d8e8ff;
}

.mention-item__thumb {
  border-color: rgba(130, 160, 210, 0.42);
  background-color: rgba(14, 24, 44, 0.86);
  color: #9ab8e6;
}

.image-placeholder {
  color: #9bb5db;
}

.node-handle {
  border-color: rgba(171, 197, 240, 0.74);
  background: linear-gradient(155deg, rgba(26, 38, 63, 0.96) 0%, rgba(16, 25, 45, 0.92) 100%);
  box-shadow: 0 0 0 2px rgba(107, 140, 195, 0.42), 0 10px 20px rgba(0, 0, 0, 0.36);
}

.node-handle::before,
.node-handle::after {
  background: #b8cff4;
}

.node-handle--in::before {
  background: rgba(12, 18, 34, 0.96);
  box-shadow: 0 0 0 2px rgba(180, 207, 245, 0.84);
}

.node-handle:hover,
.node-handle--magnetized {
  box-shadow: 0 0 0 2px rgba(83, 211, 255, 0.6), 0 14px 24px rgba(54, 182, 255, 0.24);
}

.node-handle:hover::before,
.node-handle:hover::after {
  background: #53d3ff;
}

.edge-path {
  stroke: rgba(158, 183, 224, 0.52);
}

.edge-path:hover,
.edge-path--hover {
  stroke: rgba(83, 211, 255, 0.86);
}

.edge-path--selected {
  stroke: rgba(83, 211, 255, 0.98);
}

.edge-endpoint {
  fill: rgba(13, 22, 39, 0.98);
  stroke: rgba(83, 211, 255, 0.96);
}

.floating-menu,
.mention-menu,
.settings-card,
.action-dialog-card {
  backdrop-filter: blur(14px) saturate(145%);
}

.floating-menu h4,
.field span,
.field-label,
.action-dialog-field > span,
.action-dialog-desc,
.field-tip,
.status-line {
  color: var(--text-tertiary);
}

.status-line--success {
  color: #58d995;
}

.status-line--warning {
  color: #f7bd5d;
}

.status-line--error {
  color: #ff788d;
}

.status-line--running {
  color: #7ac9ff;
}

/* ===== TapNow Charcoal Global Restyle (No Interaction Change) ===== */
:root {
  --bg-page: #0f1012;
  --bg-canvas: #141519;
  --bg-grid-line: rgba(255, 255, 255, 0.055);
  --bg-grid-accent: rgba(255, 255, 255, 0.025);
  --canvas-dot: rgba(255, 255, 255, 0.11);
  --text-primary: #f4f5f7;
  --text-secondary: #d3d7df;
  --text-tertiary: #98a0ae;
  --surface-primary: rgba(29, 31, 36, 0.93);
  --surface-secondary: rgba(33, 35, 40, 0.92);
  --surface-tertiary: rgba(39, 41, 46, 0.92);
  --surface-glass: linear-gradient(160deg, rgba(41, 43, 49, 0.95) 0%, rgba(30, 31, 36, 0.92) 100%);
  --border-light: rgba(255, 255, 255, 0.14);
  --border-mid: rgba(255, 255, 255, 0.24);
  --accent: #f0f2f5;
  --accent-strong: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.16);
  --accent-glow: 0 0 0 1px rgba(255, 255, 255, 0.26), 0 12px 28px rgba(0, 0, 0, 0.42);
  --shadow-float: 0 20px 44px rgba(0, 0, 0, 0.44);
  --shadow-card: 0 12px 30px rgba(0, 0, 0, 0.36);
  --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.34);
}

html,
body {
  background: var(--bg-page);
}

.app-shell {
  background: var(--bg-page);
}

.app-shell::before {
  display: none;
  background: none;
  filter: none;
  opacity: 0;
  animation: none;
}

.app-shell::after {
  display: none;
  background: none;
  opacity: 0;
  animation: none;
}

.top-bar {
  border-color: rgba(255, 255, 255, 0.14);
  background: linear-gradient(180deg, rgba(26, 28, 33, 0.8) 0%, rgba(19, 21, 25, 0.58) 100%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
}

.brand-dot {
  background: conic-gradient(from 210deg at 50% 50%, #e8eaee 0deg, #cfd4db 150deg, #abb2bc 280deg, #e8eaee 360deg);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.26), 0 0 14px rgba(255, 255, 255, 0.16);
}

.canvas {
  background-color: var(--bg-canvas);
}

.viewport-controls,
.quick-add-btn,
.pill-btn,
.hint-chip,
.floating-menu,
.settings-card,
.action-dialog-card,
.mention-menu {
  background: var(--surface-glass);
  border-color: var(--border-light);
  color: var(--text-secondary);
}

.pill-btn,
.menu-item,
.image-node-tool-btn,
.generate-chip,
.generate-tool-btn,
.generate-icon-btn,
.node-delete-btn,
.upload-icon-btn {
  color: var(--text-secondary);
  background: linear-gradient(150deg, rgba(55, 58, 66, 0.92) 0%, rgba(35, 37, 43, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.node.node--caption-header .node-delete-btn {
  background: linear-gradient(150deg, rgba(58, 62, 71, 0.95) 0%, rgba(39, 41, 47, 0.92) 100%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #e6e9ef;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
}

.pill-btn:hover,
.menu-item:hover,
.image-node-tool-btn:hover,
.generate-chip:hover,
.generate-tool-btn:hover,
.generate-icon-btn:hover,
.node-delete-btn:hover,
.upload-icon-btn:hover,
.hint-chip:hover,
.quick-add-btn:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: var(--accent-glow);
  background: linear-gradient(150deg, rgba(68, 72, 82, 0.98) 0%, rgba(45, 47, 54, 0.94) 100%);
}

.pill-btn--accent {
  color: #f8f9fb;
  border-color: rgba(255, 255, 255, 0.36);
  background: linear-gradient(130deg, rgba(72, 76, 86, 0.94) 0%, rgba(53, 56, 64, 0.95) 100%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.34);
}

.node {
  border-color: rgba(255, 255, 255, 0.2);
}

.node:not(.node--image):hover:not(.dragging):not(.node--selected):not(.node--primary-selected) {
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

.node:not(.node--image).node--selected {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 12px 26px rgba(0, 0, 0, 0.32);
}

.node:not(.node--image).node--primary-selected {
  border-color: rgba(255, 255, 255, 0.38);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), 0 14px 30px rgba(0, 0, 0, 0.36);
}

.text-node-panel,
.text-node-params-panel,
.image-edit-panel,
.image-preview,
.generate-composer,
.generate-toolbar,
.split-grid-item,
.generate-thumb {
  border-color: rgba(255, 255, 255, 0.18);
}

.node.node--text:hover:not(.dragging):not(.node--selected):not(.node--primary-selected) .text-node-panel,
.node.node--text:hover:not(.dragging):not(.node--selected):not(.node--primary-selected) .text-node-params-panel,
.node.node--text:hover:not(.dragging):not(.node--selected):not(.node--primary-selected) .text-preview-wrap .text-output-preview,
.node.node--edit:hover:not(.dragging):not(.node--selected):not(.node--primary-selected) .image-edit-panel,
.node.node--image:hover:not(.dragging) .upload-preview-wrap .image-preview,
.node.node--image:hover:not(.dragging) .generate-preview-wrap .image-preview,
.node.node--image:hover:not(.dragging) .generate-composer {
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22), 0 16px 34px rgba(0, 0, 0, 0.34);
}

.node.node--selected .image-preview,
.node.node--selected .generate-composer {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 12px 26px rgba(0, 0, 0, 0.32);
}

.node.node--primary-selected .image-preview,
.node.node--primary-selected .generate-composer,
.node.node--selected .text-node-panel,
.node.node--selected .text-node-params-panel,
.node.node--selected .image-edit-panel,
.node.node--primary-selected .text-node-panel,
.node.node--primary-selected .text-node-params-panel,
.node.node--primary-selected .image-edit-panel {
  border-color: rgba(255, 255, 255, 0.36);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), 0 14px 30px rgba(0, 0, 0, 0.34);
}

/* Keep selected visuals stable when hovering selected image nodes.
   Hover selector specificity is higher than selected selector, so we pin selected styles here. */
.node.node--image.node--selected:hover:not(.dragging) .upload-preview-wrap .image-preview,
.node.node--image.node--selected:hover:not(.dragging) .generate-preview-wrap .image-preview,
.node.node--image.node--selected:hover:not(.dragging) .generate-composer {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 12px 26px rgba(0, 0, 0, 0.32);
}

.node.node--image.node--primary-selected:hover:not(.dragging) .upload-preview-wrap .image-preview,
.node.node--image.node--primary-selected:hover:not(.dragging) .generate-preview-wrap .image-preview,
.node.node--image.node--primary-selected:hover:not(.dragging) .generate-composer {
  border-color: rgba(255, 255, 255, 0.36);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), 0 14px 30px rgba(0, 0, 0, 0.34);
}

.input:focus,
.select:focus,
.textarea:focus,
.field input:focus,
.text-node-panel .textarea:focus,
.text-node-params-panel .textarea:focus,
.generate-composer .composer-textarea:focus,
.image-edit-panel .composer-textarea:focus {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.generate-toolbar-sep,
.generate-tool-divider {
  background: rgba(255, 255, 255, 0.2);
}

.mention-item__thumb {
  border-color: rgba(255, 255, 255, 0.22);
  background-color: rgba(53, 56, 63, 0.9);
  color: #d6dbe5;
}

.image-placeholder {
  color: #aeb6c3;
}

.node-handle {
  border-color: rgba(255, 255, 255, 0.42);
  background: linear-gradient(155deg, rgba(60, 63, 71, 0.95) 0%, rgba(39, 41, 47, 0.94) 100%);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2), 0 10px 20px rgba(0, 0, 0, 0.36);
}

.node-handle::before,
.node-handle::after {
  background: #d9dde4;
}

.node-handle--in::before {
  background: rgba(24, 26, 30, 0.96);
  box-shadow: 0 0 0 2px rgba(234, 237, 243, 0.72);
}

.node-handle:hover,
.node-handle--magnetized {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.44), 0 14px 24px rgba(0, 0, 0, 0.3);
}

.node-handle:hover::before,
.node-handle:hover::after {
  background: #ffffff;
}

.edge-path {
  stroke: rgba(212, 218, 229, 0.5);
}

.edge-path:hover,
.edge-path--hover {
  stroke: rgba(243, 246, 252, 0.82);
}

.edge-path--selected {
  stroke: rgba(255, 255, 255, 0.94);
}

.edge-endpoint {
  fill: rgba(31, 33, 38, 0.98);
  stroke: rgba(255, 255, 255, 0.9);
}

select,
option,
optgroup {
  background-color: #181a1f;
  color: #f0f2f6;
}

.viewport-controls {
  left: 16px;
  bottom: 16px;
  z-index: 48;
  gap: 8px;
  padding: 6px 10px;
  min-height: 45px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(180deg, rgba(47, 49, 56, 0.96) 0%, rgba(33, 35, 41, 0.95) 100%);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px) saturate(102%);
}

.viewport-controls > * {
  align-self: center;
}

.viewport-sep {
  display: none;
}

.viewport-btn {
  position: relative;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #d4d9e1;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--motion-standard), border-color var(--dur-fast) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard), box-shadow var(--dur-mid) var(--motion-standard), color var(--dur-fast) var(--motion-standard);
}

.viewport-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.viewport-btn:active {
  transform: translateY(0);
}

.viewport-btn--primary {
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(69, 72, 81, 0.96) 0%, rgba(51, 54, 62, 0.95) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.viewport-btn--icon,
.viewport-btn--locate {
  font-size: 0;
}

.viewport-btn--locate::before,
.viewport-btn--grid::before,
.viewport-btn--fit::before {
  content: "";
  display: block;
}

.viewport-btn--locate::before {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.24);
}

.viewport-btn--locate::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.viewport-btn--grid::before {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  box-shadow:
    -6px -6px 0 currentColor,
    0 -6px 0 currentColor,
    6px -6px 0 currentColor,
    -6px 0 0 currentColor,
    6px 0 0 currentColor,
    -6px 6px 0 currentColor,
    0 6px 0 currentColor,
    6px 6px 0 currentColor;
}

.viewport-btn--fit::before {
  width: 14px;
  height: 14px;
  background:
    linear-gradient(currentColor, currentColor) left top / 5px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left top / 2px 5px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 5px 2px no-repeat,
    linear-gradient(currentColor, currentColor) right top / 2px 5px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 5px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left bottom / 2px 5px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 5px 2px no-repeat,
    linear-gradient(currentColor, currentColor) right bottom / 2px 5px no-repeat;
}

.viewport-btn--meta {
  width: auto;
  min-width: 52px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e6ec;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.viewport-btn--meta:hover {
  background: rgba(255, 255, 255, 0.13);
}

.zoom-slider {
  appearance: none;
  -webkit-appearance: none;
  width: 112px;
  height: 6px;
  margin: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  accent-color: #f5f7fb;
  display: block;
  align-self: center;
}

.zoom-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.28) 100%);
}

.zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  margin-top: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(180deg, #f1f3f7 0%, #dce1e8 100%);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.34);
}

.zoom-slider::-moz-range-track {
  height: 6px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.28) 100%);
}

.zoom-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(180deg, #f1f3f7 0%, #dce1e8 100%);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.34);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1080px) {
  .viewport-controls {
    left: 10px;
    bottom: 10px;
    gap: 7px;
    padding: 5px 8px;
  }

  .viewport-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
  }

  .viewport-btn--meta {
    min-width: 44px;
    height: 27px;
    font-size: 11px;
    padding: 0 8px;
  }

  .zoom-slider {
    width: 92px;
  }
}

.grid-overlay__line {
  stroke: rgba(242, 245, 250, 0.86);
  stroke-width: 3;
  stroke-dasharray: 10 7;
  filter: drop-shadow(0 0 1px rgba(16, 18, 22, 0.9)) drop-shadow(0 0 4px rgba(255, 255, 255, 0.26));
}

.grid-overlay__line--fallback {
  stroke: rgba(198, 205, 216, 0.86);
  filter: drop-shadow(0 0 1px rgba(16, 18, 22, 0.9)) drop-shadow(0 0 4px rgba(255, 255, 255, 0.2));
}

.status-line--running {
  color: #c9cfda;
}

/* ===== Minimal Dark Toolbar (Image Composer Bottom Bar) ===== */
.generate-composer .generate-toolbar {
  border: none !important;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(22, 24, 29, 0.94) 0%, rgba(16, 18, 23, 0.92) 100%);
  box-shadow: none !important;
}

.generate-composer .generate-toolbar-sep,
.generate-composer .generate-tool-divider {
  background: rgba(255, 255, 255, 0.12);
}

.generate-composer .generate-toolbar .generate-select,
.generate-composer .generate-toolbar .generate-chip,
.generate-composer .generate-toolbar .generate-icon-btn {
  border: none !important;
  background: rgba(36, 39, 46, 0.94) !important;
  color: #eef1f6 !important;
  box-shadow: none !important;
}

.generate-composer .generate-toolbar .generate-select:hover,
.generate-composer .generate-toolbar .generate-chip:hover,
.generate-composer .generate-toolbar .generate-icon-btn:hover {
  background: rgba(46, 50, 58, 0.95) !important;
  border: none !important;
  box-shadow: none !important;
}

.generate-composer .generate-toolbar .generate-select:focus,
.generate-composer .generate-toolbar .generate-chip:focus,
.generate-composer .generate-toolbar .generate-icon-btn:focus {
  border: none !important;
  background: rgba(49, 53, 62, 0.96) !important;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2) !important;
}

.generate-composer .generate-toolbar .generate-run-group {
  border: none !important;
  background: rgba(39, 42, 49, 0.96);
  box-shadow: none !important;
}

.generate-composer .generate-quota {
  color: #dce2ec;
}

.generate-composer .generate-toolbar .generate-run-btn {
  border: none !important;
  background: linear-gradient(180deg, rgba(245, 247, 251, 0.95) 0%, rgba(219, 225, 235, 0.92) 100%);
  color: #1a2436;
  box-shadow: none !important;
}

.generate-composer .generate-toolbar .generate-run-btn:hover {
  border: none !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(232, 236, 243, 0.96) 100%);
  color: #111c2f;
  box-shadow: none !important;
}

.generate-composer .reference-meta {
  gap: 8px;
  margin-top: 0;
  margin-bottom: 8px;
}

.generate-composer .reference-role-chip {
  height: 38px;
  padding: 0 14px 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(141, 183, 247, 0.56) !important;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(38, 57, 95, 0.96) 0%, rgba(24, 38, 66, 0.94) 100%) !important;
  color: #f4f8ff !important;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 7px 16px rgba(4, 12, 30, 0.34);
}

.generate-composer .reference-role-chip:hover {
  border-color: rgba(170, 208, 255, 0.78) !important;
  background: linear-gradient(180deg, rgba(47, 72, 118, 0.98) 0%, rgba(30, 49, 83, 0.96) 100%) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 10px 22px rgba(5, 16, 39, 0.38);
}

.generate-composer .reference-role-chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(178, 218, 255, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 10px 22px rgba(5, 16, 39, 0.38);
}

.generate-composer .reference-role-chip__thumb {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border-color: rgba(185, 219, 255, 0.56);
  background-color: rgba(52, 76, 121, 0.9);
  color: #edf5ff;
  font-size: 11px;
}

.generate-composer .reference-role-chip__label {
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.24);
}

.generate-composer .reference-role-chip[data-role="style"] {
  border-color: rgba(198, 169, 255, 0.58) !important;
  background: linear-gradient(180deg, rgba(68, 52, 113, 0.96) 0%, rgba(45, 36, 83, 0.94) 100%) !important;
}

.generate-composer .reference-role-chip[data-role="scene"] {
  border-color: rgba(145, 206, 255, 0.6) !important;
  background: linear-gradient(180deg, rgba(36, 74, 116, 0.96) 0%, rgba(24, 49, 86, 0.94) 100%) !important;
}

.generate-composer .reference-role-chip[data-role="subject"] {
  border-color: rgba(146, 224, 224, 0.62) !important;
  background: linear-gradient(180deg, rgba(33, 88, 93, 0.96) 0%, rgba(24, 58, 64, 0.94) 100%) !important;
}

.generate-composer .grounding-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}

.generate-composer .grounding-meta.hidden {
  display: none;
}

.generate-composer .grounding-meta__title {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(208, 222, 243, 0.9);
  font-size: 12px;
  font-weight: 700;
}

.generate-composer .grounding-meta__link {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid rgba(132, 173, 227, 0.36);
  background: rgba(46, 72, 114, 0.34);
  color: rgba(226, 236, 251, 0.96);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.generate-composer .grounding-meta__link:hover {
  border-color: rgba(167, 201, 244, 0.58);
  background: rgba(63, 94, 143, 0.5);
  color: #f8fbff;
}

.generate-composer .grounding-meta__more {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 8px;
  color: rgba(181, 198, 223, 0.88);
  font-size: 12px;
}

/* ===== Image Composer Bottom Bar Layout Refresh (single row + full model readability) ===== */
.generate-composer .generate-toolbar {
  --toolbar-gap: 10px;
  display: flex;
  align-items: center;
  gap: var(--toolbar-gap);
  padding: 8px 10px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.generate-composer .generate-toolbar-left {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--toolbar-gap);
  overflow: hidden;
}

.generate-composer .generate-toolbar-right {
  flex: 0 0 auto;
  margin-left: var(--toolbar-gap);
}

.generate-composer .generate-toolbar-item {
  padding: 0 !important;
  min-width: 0;
  overflow: hidden;
}

.generate-composer .generate-toolbar-item--model {
  flex: 1 1 auto;
  min-width: 0;
}

.generate-composer .generate-toolbar-item--ratio,
.generate-composer .generate-toolbar-item--size {
  flex: 0 0 132px;
  min-width: 132px;
}

.generate-composer .generate-toolbar-sep,
.generate-composer .generate-tool-divider {
  display: none;
}

.generate-composer .generate-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  height: 54px;
  min-width: 0;
  padding: 0 38px 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M3 5.25L7 9.25L11 5.25' stroke='%23cfd6e3' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"),
    linear-gradient(180deg, rgba(43, 46, 54, 0.94) 0%, rgba(33, 35, 42, 0.94) 100%) !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 14px 14px !important;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  width: 100%;
  max-width: 100%;
  color: #eef2f8 !important;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: none !important;
}

.generate-composer .generate-select--model {
  width: 100%;
  min-width: 0;
}

.generate-composer .generate-toolbar .generate-run-group {
  width: 124px;
  min-width: 124px;
  height: 54px;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.generate-composer .generate-toolbar .generate-chip--small {
  min-width: 64px;
  height: 42px;
  border-radius: 14px;
  font-size: 14px;
  padding: 0 10px;
  flex: 0 0 auto;
}

.generate-composer .generate-toolbar .generate-run-btn {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  max-width: 42px !important;
  max-height: 42px !important;
  aspect-ratio: 1 / 1;
  flex: 0 0 42px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  display: grid;
  place-items: center;
  line-height: 1;
}

/* Keep full border ring for text/image-edit content panels (including top edge). */
.node.node--text .text-node-panel,
.node.node--text .text-node-params-panel,
.node.node--edit .image-edit-panel {
  border-top-width: 1px !important;
  border-top-style: solid !important;
}

/* ===== Handles show on hover only ===== */
.node .node-handle {
  opacity: 0;
  pointer-events: auto;
  transform: translate3d(var(--magnet-x), calc(-50% + var(--magnet-y)), 0) scale(0.88);
  transition:
    opacity var(--dur-fast) var(--motion-standard),
    transform var(--dur-fast) var(--motion-standard),
    box-shadow var(--dur-mid) var(--motion-standard),
    background-color var(--dur-fast) var(--motion-standard);
}

.node:hover .node-handle,
.node:focus-within .node-handle,
.node .node-handle:hover,
.node .node-handle:focus-visible,
.node .node-handle--target,
.node .node-handle--magnetized {
  opacity: 1;
  transform: translate3d(var(--magnet-x), calc(-50% + var(--magnet-y)), 0) scale(1);
}

@media (hover: none) {
  .node .node-handle {
    opacity: 1;
    pointer-events: auto;
    transform: translate3d(var(--magnet-x), calc(-50% + var(--magnet-y)), 0);
  }
}

/* ===== Top Bar: Flat + Compact + Text Actions ===== */
.top-bar {
  min-height: 40px;
  padding: 6px 14px;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.board-title {
  font-size: 16px;
  line-height: 1.2;
}

.top-actions {
  gap: 14px;
}

.top-actions .pill-btn {
  height: auto;
  padding: 0;
  border: none !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: #cfd6e3;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  text-underline-offset: 3px;
  transform: none !important;
  filter: none !important;
}

.top-actions .pill-btn:hover {
  color: #f4f7fc;
  text-decoration: underline;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.top-actions .pill-btn:active {
  opacity: 0.86;
  transform: none !important;
}

.top-actions .pill-btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.42);
  outline-offset: 2px;
}

@media (max-width: 1080px) {
  .top-bar {
    min-height: 36px;
    padding: 5px 10px;
  }

  .board-title {
    font-size: 15px;
  }

  .top-actions {
    gap: 10px;
  }

  .top-actions .pill-btn {
    font-size: 13px;
  }
}

/* ===== Handles: use plus icon on both sides ===== */
.node-handle--in::before {
  width: 16px;
  height: 3px;
  border-radius: 999px;
  background: #d9dde4;
  box-shadow: none;
}

.node-handle--in::after {
  display: block;
  width: 3px;
  height: 16px;
  border-radius: 999px;
  background: #d9dde4;
}

/* ===== Final override: text/image-edit outer shell must stay borderless ===== */
.node.node--text,
.node.node--edit,
.node.node--text:hover,
.node.node--edit:hover,
.node.node--text.node--selected,
.node.node--text.node--primary-selected,
.node.node--edit.node--selected,
.node.node--edit.node--primary-selected {
  border: none !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

.node.node--text::before,
.node.node--edit::before {
  display: none !important;
  box-shadow: none !important;
}

/* ===== Image Edit workflow extensions ===== */
.generate-toolbar-left {
  overflow: visible;
}

.generate-select-shell,
.ux-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.generate-select-trigger,
.ux-select-trigger {
  width: 100%;
  min-width: 0;
  height: 54px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid rgba(95, 127, 177, 0.48);
  background: linear-gradient(180deg, rgba(12, 23, 48, 0.94) 0%, rgba(9, 17, 36, 0.92) 100%);
  color: #eef4ff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border-color var(--dur-fast) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard),
    box-shadow var(--dur-fast) var(--motion-standard), transform var(--dur-fast) var(--motion-standard);
}

.generate-select-trigger:hover,
.ux-select-trigger:hover {
  border-color: rgba(120, 162, 222, 0.72);
  background: linear-gradient(180deg, rgba(15, 29, 58, 0.96) 0%, rgba(11, 22, 45, 0.94) 100%);
  box-shadow: 0 10px 20px rgba(2, 8, 24, 0.34);
}

.generate-select-trigger:focus-visible,
.ux-select-trigger:focus-visible {
  outline: none;
  border-color: rgba(142, 195, 255, 0.92);
  box-shadow: 0 0 0 2px rgba(142, 195, 255, 0.28);
}

.ux-select.is-open .generate-select-trigger,
.ux-select.is-open .ux-select-trigger {
  border-color: rgba(142, 195, 255, 0.88);
  box-shadow: 0 0 0 2px rgba(142, 195, 255, 0.22);
}

.ux-select.is-disabled .generate-select-trigger,
.ux-select.is-disabled .ux-select-trigger {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.ux-select-trigger-text {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.ux-select-trigger-label {
  color: #eef4ff;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}

.ux-select-trigger-hint {
  color: rgba(168, 189, 223, 0.82);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ux-select-trigger-caret {
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(206, 220, 246, 0.9);
  border-bottom: 2px solid rgba(206, 220, 246, 0.9);
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--dur-fast) var(--motion-standard);
  flex: 0 0 auto;
}

.ux-select.is-open .ux-select-trigger-caret {
  transform: rotate(-135deg) translateY(0);
}

.generate-select-menu,
.ux-select-menu {
  position: fixed;
  left: 0;
  right: auto;
  top: 0;
  z-index: 140;
  width: max-content;
  min-width: 0;
  max-width: min(88vw, 720px);
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(115, 149, 203, 0.5);
  background: linear-gradient(180deg, rgba(10, 19, 40, 0.98) 0%, rgba(9, 15, 31, 0.96) 100%);
  box-shadow: 0 20px 34px rgba(2, 6, 18, 0.56);
  display: grid;
  gap: 6px;
  max-height: 240px;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.ux-select--drop-up .generate-select-menu,
.ux-select--drop-up .ux-select-menu {
  top: 0;
  bottom: auto;
}

.ux-select-option {
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(19, 31, 58, 0.7);
  color: #ebf3ff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  transition: border-color var(--dur-fast) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard),
    transform var(--dur-fast) var(--motion-standard);
}

.ux-select-option:hover {
  border-color: rgba(137, 186, 255, 0.62);
  background: rgba(27, 43, 78, 0.86);
  transform: none;
}

.ux-select-option.is-active {
  border-color: rgba(150, 202, 255, 0.8);
  background: rgba(31, 52, 92, 0.94);
}

.ux-select-option-main {
  display: inline-flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.ux-select-option-meta {
  display: grid;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.ux-select-option-label {
  font-size: 13px;
  font-weight: 700;
  color: #edf4ff;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ux-select-option-hint {
  font-size: 11px;
  color: rgba(171, 194, 231, 0.82);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ux-select-option--ratio .ux-select-option-label,
.ux-select-option--ratio .ux-select-option-hint {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  word-break: keep-all;
}

.ux-select-option-check {
  opacity: 0;
  color: rgba(182, 221, 255, 0.98);
  font-size: 13px;
  font-weight: 700;
}

.ux-select-option.is-active .ux-select-option-check {
  opacity: 1;
}

.ux-select-option-ratio {
  border-radius: 7px;
  border: 1px solid rgba(151, 184, 241, 0.66);
  background: linear-gradient(180deg, rgba(172, 200, 247, 0.28) 0%, rgba(111, 147, 210, 0.22) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  flex: 0 0 auto;
}

.image-edit-config-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  width: 100%;
  box-sizing: border-box;
  padding: 4px 8px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(10, 16, 29, 0.56) 0%, rgba(7, 12, 22, 0.64) 100%);
}

.image-edit-config-row .generate-select-shell {
  width: 100%;
  min-width: 0;
}

.video-mode-config-row {
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr) minmax(76px, 0.9fr);
}

.video-scenario-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.video-scenario-header > span { color: #9eabc0; font-size: 12px; }
.video-scenario-header .generate-select-shell { width: 170px; flex: none; }
.video-scenario-help { margin: 0; color: #9eabc0; font-size: 12px; line-height: 1.65; }
.video-materials { display: grid; gap: 10px; min-width: 0; }
.video-materials:empty { display: none; }
.video-input-slots { display: flex; gap: 10px; }
.video-input-slot { flex: 1; min-width: 0; display: grid; gap: 8px; padding: 10px; border: 1px solid #394458; border-radius: 14px; background: #141b26; }
.video-input-slot strong { font-size: 12px; font-weight: 600; color: #cfdaec; }
.video-input-slot__preview { width: 100%; height: 96px; object-fit: contain; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: #0d121b; color: #8290a5; font-size: 12px; }
.video-source-select { width: 100%; min-width: 0; }
.video-source-select button { max-width: 100%; font-size: 12px; }
.video-material-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.video-material-action { border: 1px solid #354158; background: #1a2434; color: #b9cdeb; padding: 7px 10px; border-radius: 8px; font-size: 12px; cursor: pointer; }
.video-material-action:hover:not(:disabled) { background: #273d5c; border-color: #739dd6; }
.video-material-action:focus-visible, .video-reference-choice:focus-visible { outline: 2px solid #8bbdff; outline-offset: 2px; }
.video-materials small { color: #8290a5; font-size: 11px; line-height: 1.5; }
.video-materials-heading { color: #bdcce0; font-size: 12px; }
.video-reference-tray { display: flex; flex-wrap: wrap; gap: 6px; }
.video-reference-choice { display: flex; align-items: center; gap: 7px; border: 1px solid #394458; border-radius: 8px; background: #151c29; color: #9aa9be; padding: 5px 8px; font-size: 12px; cursor: pointer; }
.video-reference-choice[aria-pressed="true"] { border-color: #6088b8; background: #22344c; color: #d7e7fa; }
.video-reference-choice img { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; }
.reference-meta__summary { flex-basis: 100%; color: #8796ab; font-size: 11px; line-height: 1.4; }
.reference-role-chip.reference-role-chip--inactive { opacity: .48; cursor: default; filter: saturate(.55); }
.reference-role-chip.reference-role-chip--inactive:hover { transform: none; box-shadow: none; }
.video-input-validation { color: #d8b384; font-size: 12px; line-height: 1.5; }
.video-input-validation.is-ready { color: #8d9db3; }
.video-advanced-options { color: #9eabc0; font-size: 12px; }
.video-advanced-options summary { cursor: pointer; padding: 5px 0; }
.video-advanced-fields { display: grid; gap: 10px; padding: 10px; border: 1px solid #354158; border-radius: 10px; }
.video-advanced-fields label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.video-advanced-fields input[type="number"] { width: 140px; color: #d7e7fa; background: #131c2a; border: 1px solid #354158; border-radius: 6px; padding: 6px; }
.video-advanced-fields small { color: #8290a5; line-height: 1.5; }
.video-composer button:disabled { opacity: .5; cursor: not-allowed; }
.video-composer .video-mode-config-row { grid-template-columns: 1fr 1fr; }

.video-option-toggle {
  height: 27px;
  min-width: 0;
  border: 0;
  border-radius: 9px;
  color: rgba(162, 177, 201, 0.82);
  background: transparent;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.video-option-toggle:hover,
.video-option-toggle.is-active {
  color: #d9e9ff;
  background: rgba(76, 137, 226, 0.18);
}

.image-edit-config-row.is-disabled {
  opacity: 0.68;
  filter: grayscale(0.88) saturate(0.18) brightness(0.82);
  pointer-events: none;
}

.image-edit-config-row .generate-select-trigger,
.image-edit-config-row .ux-select-trigger,
.image-edit-config-row .generate-select-trigger:hover,
.image-edit-config-row .ux-select-trigger:hover,
.image-edit-config-row .generate-select-trigger:focus-visible,
.image-edit-config-row .ux-select-trigger:focus-visible,
.image-edit-config-row .ux-select.is-open .generate-select-trigger,
.image-edit-config-row .ux-select.is-open .ux-select-trigger {
  height: 27px;
  min-height: 27px;
  border-radius: 10px;
  padding: 0 10px;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

.image-edit-config-row.is-disabled .generate-select-trigger,
.image-edit-config-row.is-disabled .ux-select-trigger,
.image-edit-config-row.is-disabled .generate-select-trigger:hover,
.image-edit-config-row.is-disabled .ux-select-trigger:hover,
.image-edit-config-row.is-disabled .generate-select-trigger:focus-visible,
.image-edit-config-row.is-disabled .ux-select-trigger:focus-visible,
.image-edit-config-row.is-disabled .ux-select.is-open .generate-select-trigger,
.image-edit-config-row.is-disabled .ux-select.is-open .ux-select-trigger {
  background: rgba(94, 104, 120, 0.28) !important;
  color: rgba(161, 170, 186, 0.9) !important;
  border-color: rgba(129, 141, 161, 0.26) !important;
}

.image-edit-config-row.is-disabled .ux-select-trigger-label,
.image-edit-config-row.is-disabled .ux-select-trigger-hint {
  color: rgba(161, 170, 186, 0.9) !important;
}

.image-edit-config-row.is-disabled .ux-select-trigger-caret {
  border-right-color: rgba(151, 161, 180, 0.68);
  border-bottom-color: rgba(151, 161, 180, 0.68);
}

.prompt-template-config-row {
  grid-template-columns: minmax(0, 1fr);
}

.prompt-template-config-row.prompt-template-config-row--has-clear {
  grid-template-columns: 28px minmax(0, 1fr);
}

.prompt-template-config-row .image-prompt-preset-select-shell,
.prompt-template-config-row .text-node-prompt-template-select-shell {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
}

.prompt-template-config-row .image-prompt-template-clear-btn {
  width: 28px;
  height: 27px;
  border-radius: 10px;
  color: rgba(176, 201, 236, 0.86);
}

.prompt-template-config-row .image-prompt-template-clear-btn:hover,
.prompt-template-config-row .image-prompt-template-clear-btn:focus-visible {
  color: #c8e5ff;
  background: rgba(112, 156, 220, 0.12);
}

.image-prompt-preset-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  box-sizing: border-box;
  padding: 4px 8px;
  border-radius: 0;
  background: transparent;
}

.image-upstream-text-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 66%;
  color: rgba(200, 219, 246, 0.9);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
}

.image-upstream-text-toggle.is-disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

.image-upstream-text-toggle__checkbox {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #78bbff;
  cursor: inherit;
  flex: 0 0 auto;
}

.image-upstream-text-toggle__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-prompt-preset-label {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: rgba(194, 214, 243, 0.9);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.image-prompt-preset-select-shell {
  width: fit-content;
  max-width: min(100%, 340px);
  min-width: 0;
  margin-left: auto;
  margin-right: 0;
}

.image-prompt-template-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.image-prompt-template-actions .image-prompt-preset-select-shell {
  margin-left: 0;
}

.image-prompt-template-clear-btn {
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: rgba(176, 201, 236, 0.9);
  display: inline-grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  transition: color var(--dur-fast) var(--motion-standard), opacity var(--dur-fast) var(--motion-standard), transform var(--dur-fast) var(--motion-standard);
}

.image-prompt-template-clear-btn svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.image-prompt-template-clear-btn:hover {
  color: #9fd4ff;
  transform: translateY(-0.5px);
}

.image-prompt-template-clear-btn:focus-visible {
  outline: none;
  color: #b9e0ff;
}

.image-prompt-template-clear-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.image-prompt-preset-row .generate-select-trigger,
.image-prompt-preset-row .ux-select-trigger,
.image-prompt-preset-row .generate-select-trigger:hover,
.image-prompt-preset-row .ux-select-trigger:hover,
.image-prompt-preset-row .generate-select-trigger:focus-visible,
.image-prompt-preset-row .ux-select-trigger:focus-visible,
.image-prompt-preset-row .ux-select.is-open .generate-select-trigger,
.image-prompt-preset-row .ux-select.is-open .ux-select-trigger {
  height: 27px;
  min-height: 27px;
  border-radius: 10px;
  padding: 0 10px;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  justify-content: flex-start;
}

.image-prompt-preset-row .ux-select-trigger-text {
  flex: 1 1 auto;
  text-align: left;
  justify-items: start;
}

.image-prompt-preset-row .ux-select-trigger-label,
.image-prompt-preset-row .ux-select-trigger-hint {
  text-align: left;
}

.image-edit-config-row .ux-select-trigger-text {
  flex: 1 1 auto;
  text-align: center;
  justify-items: center;
}

.image-edit-config-row .ux-select-trigger-label,
.image-edit-config-row .ux-select-trigger-hint {
  text-align: center;
}

.image-generate-advanced-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0 2px;
}

.generate-composer .image-generate-advanced-row .generate-chip,
.image-edit-panel .image-generate-advanced-row .generate-chip {
  min-width: auto;
  height: 28px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(228, 236, 249, 0.94);
  font-size: 12px;
  font-weight: 600;
  box-shadow: none;
  transform: none;
  white-space: nowrap;
  word-break: keep-all;
  line-height: 1;
  flex: 0 0 auto;
}

.generate-composer .image-generate-advanced-row .generate-chip--icon-toggle,
.image-edit-panel .image-generate-advanced-row .generate-chip--icon-toggle {
  width: 30px;
  min-width: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  color: rgba(170, 186, 210, 0.9);
}

.generate-composer .image-generate-advanced-row .generate-chip--icon-toggle .generate-chip__icon,
.image-edit-panel .image-generate-advanced-row .generate-chip--icon-toggle .generate-chip__icon {
  width: 15px;
  height: 15px;
  display: block;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.generate-composer .image-generate-advanced-row .generate-chip--icon-toggle[data-toggle-icon="search"] .generate-chip__icon,
.image-edit-panel .image-generate-advanced-row .generate-chip--icon-toggle[data-toggle-icon="search"] .generate-chip__icon {
  width: 14px;
  height: 14px;
}

.generate-composer .image-generate-advanced-row .generate-chip:hover,
.image-edit-panel .image-generate-advanced-row .generate-chip:hover {
  border-color: rgba(136, 176, 229, 0.56);
  background: rgba(68, 93, 133, 0.34);
  color: #f2f7ff;
  box-shadow: 0 0 0 1px rgba(88, 142, 218, 0.16) inset;
  transform: none;
}

.generate-composer .image-generate-advanced-row .generate-chip--icon-toggle:hover,
.image-edit-panel .image-generate-advanced-row .generate-chip--icon-toggle:hover {
  color: rgba(225, 238, 255, 0.98);
}

.generate-composer .image-generate-advanced-row .generate-chip.is-active,
.image-edit-panel .image-generate-advanced-row .generate-chip.is-active {
  border-color: rgba(148, 197, 255, 0.78);
  background: linear-gradient(180deg, rgba(52, 89, 147, 0.58) 0%, rgba(34, 63, 108, 0.62) 100%);
  color: #f3f8ff;
  box-shadow: 0 0 0 1px rgba(150, 206, 255, 0.24) inset;
}

.generate-composer .image-generate-advanced-row .generate-chip--icon-toggle.is-active,
.image-edit-panel .image-generate-advanced-row .generate-chip--icon-toggle.is-active {
  border-color: rgba(114, 187, 255, 0.84);
  background: linear-gradient(180deg, rgba(40, 81, 136, 0.6) 0%, rgba(30, 63, 108, 0.64) 100%);
  color: #65b9ff;
  box-shadow: 0 0 0 1px rgba(111, 178, 255, 0.28) inset;
}

.generate-composer .image-generate-advanced-row .generate-chip:disabled,
.image-edit-panel .image-generate-advanced-row .generate-chip:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  color: rgba(180, 194, 216, 0.64);
}

.generate-composer .image-generate-advanced-row .generate-chip--icon-toggle:disabled,
.image-edit-panel .image-generate-advanced-row .generate-chip--icon-toggle:disabled {
  color: rgba(151, 167, 190, 0.58);
}

.image-edit-run-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.image-edit-run-row .image-generate-advanced-row {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  padding: 0 2px;
  flex-wrap: nowrap;
}

.image-edit-run-row .generate-run-group {
  margin: 0;
  margin-left: auto;
  padding: 0;
  gap: 6px;
  border: none;
  background: transparent;
  box-shadow: none;
}

.image-edit-run-row .generate-run-group .generate-chip {
  width: 56px;
  min-width: 56px;
  height: auto;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  border: none !important;
  background: transparent !important;
  color: rgba(205, 220, 245, 0.9);
  box-shadow: none !important;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.image-edit-run-row .generate-run-group .generate-chip:hover {
  border: none !important;
  background: transparent !important;
  color: rgba(228, 239, 255, 0.96);
  box-shadow: none !important;
  transform: none;
}

.image-edit-run-row .generate-run-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  width: 34px;
  height: 34px;
  border-color: rgba(139, 176, 230, 0.58);
  background: linear-gradient(150deg, rgba(62, 87, 130, 0.94) 0%, rgba(44, 66, 103, 0.94) 100%);
  color: #d9e9ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.image-edit-run-row .generate-run-btn::before {
  content: "";
  position: absolute;
  inset: -35%;
  border-radius: 999px;
  background: radial-gradient(
    circle at 32% 30%,
    rgba(146, 236, 255, 0.44) 0%,
    rgba(122, 204, 255, 0.22) 34%,
    rgba(107, 155, 255, 0) 72%
  );
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
  z-index: 0;
}

.image-edit-run-row .generate-run-btn::after {
  content: "";
  position: absolute;
  top: -40%;
  left: -125%;
  width: 170%;
  height: 185%;
  border-radius: 999px;
  background: linear-gradient(
    112deg,
    rgba(255, 255, 255, 0) 28%,
    rgba(199, 246, 255, 0.82) 47%,
    rgba(126, 213, 255, 0.55) 53%,
    rgba(255, 255, 255, 0) 72%
  );
  filter: blur(1.6px);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.image-edit-run-row .generate-run-btn:hover {
  border-color: rgba(152, 205, 255, 0.78);
  background: linear-gradient(150deg, rgba(66, 95, 142, 0.95) 0%, rgba(44, 70, 113, 0.95) 100%);
  color: #ecf5ff;
  box-shadow:
    0 0 0 2px rgba(124, 176, 245, 0.22),
    0 0 18px rgba(96, 210, 255, 0.24),
    0 0 30px rgba(91, 155, 255, 0.2);
  transform: none;
}

.image-edit-run-row .generate-run-btn:hover::before {
  opacity: 1;
}

.image-edit-run-row .generate-run-btn:hover::after {
  opacity: 0.95;
  animation: run-btn-shimmer-sweep 1.08s linear infinite;
}

.image-edit-run-row .generate-run-btn:focus-visible::before {
  opacity: 0.82;
}

.image-edit-run-row .generate-run-btn:focus-visible::after {
  opacity: 0.75;
  animation: run-btn-shimmer-sweep 1.08s linear infinite;
}

.image-edit-run-row .generate-run-group .generate-chip:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

@keyframes run-btn-shimmer-sweep {
  from {
    transform: translateX(0) rotate(8deg);
  }
  to {
    transform: translateX(150%) rotate(8deg);
  }
}

.node.node--image .generate-composer > .status-line {
  padding: 0;
}

.image-edit-action-panel {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 0;
  border-radius: 0;
  border: none;
  background: transparent;
}

.image-edit-action-label {
  margin-bottom: 2px;
}

.image-edit-action-strip {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  overflow: visible;
  padding: 2px 1px 2px;
}

.image-edit-service-panel {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(21, 28, 42, 0.76) 0%, rgba(15, 21, 33, 0.72) 100%);
}

.image-edit-service-textarea {
  min-height: 52px;
  max-height: 150px;
  overflow-y: auto;
  overscroll-behavior: contain;
  resize: none;
}

.image-edit-local-selection-panel {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(21, 28, 42, 0.76) 0%, rgba(15, 21, 33, 0.72) 100%);
}

.image-edit-local-selection-preview {
  min-height: 146px;
}

.manual-grid-editor-panel {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(125, 200, 255, 0.16);
  background:
    radial-gradient(circle at 15% 10%, rgba(83, 157, 255, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(21, 28, 42, 0.82) 0%, rgba(13, 20, 32, 0.78) 100%);
}

.manual-grid-editor-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.manual-grid-editor-title {
  color: rgba(237, 244, 255, 0.96);
  font-size: 13px;
  font-weight: 800;
}

.manual-grid-editor-hint {
  max-width: 240px;
  color: rgba(151, 174, 210, 0.86);
  font-size: 11px;
  line-height: 1.4;
  text-align: right;
}

.manual-grid-editor-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.manual-grid-editor-btn {
  height: 28px;
  min-width: 44px;
  padding: 0 10px;
  border: 1px solid rgba(166, 194, 232, 0.2);
  border-radius: 999px;
  background: rgba(13, 20, 33, 0.72);
  color: rgba(225, 236, 255, 0.92);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.manual-grid-editor-btn:hover {
  border-color: rgba(135, 199, 255, 0.58);
  background: rgba(30, 54, 94, 0.72);
}

.manual-grid-editor-btn--accent {
  margin-left: auto;
  min-width: 88px;
  border-color: rgba(126, 194, 255, 0.72);
  background: linear-gradient(180deg, rgba(49, 93, 161, 0.94) 0%, rgba(31, 61, 112, 0.94) 100%);
  color: #ffffff;
}

.manual-grid-editor-preview {
  min-height: 190px;
  cursor: default;
}

.manual-grid-editor__line {
  position: absolute;
  z-index: 4;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: auto;
  touch-action: none;
}

.manual-grid-editor__line--x {
  transform: translateX(-50%);
  cursor: ew-resize;
}

.manual-grid-editor__line--y {
  transform: translateY(-50%);
  cursor: ns-resize;
}

.manual-grid-editor__line::before {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(111, 199, 255, 0.94);
  box-shadow:
    0 0 0 1px rgba(9, 18, 34, 0.66),
    0 0 10px rgba(74, 167, 255, 0.5);
}

.manual-grid-editor__line--x::before {
  left: calc(50% - 1px);
  top: 0;
  width: 2px;
  height: 100%;
}

.manual-grid-editor__line--y::before {
  left: 0;
  top: calc(50% - 1px);
  width: 100%;
  height: 2px;
}

.manual-grid-editor__handle {
  position: absolute;
  display: block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(203, 233, 255, 0.96);
  border-radius: 50%;
  background: rgba(25, 88, 165, 0.96);
  box-shadow:
    0 0 0 2px rgba(10, 18, 34, 0.8),
    0 0 14px rgba(93, 183, 255, 0.58);
}

.manual-grid-editor__line--x .manual-grid-editor__handle {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.manual-grid-editor__line--y .manual-grid-editor__handle {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.manual-grid-editor__line:hover::before,
.manual-grid-editor__line:focus-visible::before {
  background: rgba(152, 220, 255, 1);
  box-shadow:
    0 0 0 1px rgba(9, 18, 34, 0.76),
    0 0 16px rgba(104, 191, 255, 0.72);
}

.generate-run-btn--wide {
  width: auto;
  min-width: 104px;
  border-radius: 999px;
  padding: 0 16px;
  font-size: 13px;
}

.image-edit-service-current {
  font-size: 12px;
  color: rgba(184, 206, 237, 0.9);
  line-height: 1.4;
}

.image-edit-service-tip {
  font-size: 11px;
  color: rgba(151, 174, 210, 0.86);
  line-height: 1.4;
}

.image-edit-service-actions {
  margin-top: 0;
  justify-content: flex-start;
}

.image-edit-service-actions .pill-btn {
  min-width: 94px;
}

.image-edit-action-pill {
  min-height: 62px;
}

.image-edit-tool-pill {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  border-radius: 14px;
  border: 1px solid rgba(166, 194, 232, 0.18);
  background: linear-gradient(180deg, rgba(28, 33, 44, 0.94) 0%, rgba(20, 24, 33, 0.92) 100%);
  color: #e6f0ff;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 12px;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard),
    transform var(--dur-fast) var(--motion-standard), box-shadow var(--dur-fast) var(--motion-standard);
}

.image-edit-tool-pill:hover {
  border-color: rgba(165, 199, 244, 0.38);
  background: linear-gradient(180deg, rgba(26, 40, 72, 0.94) 0%, rgba(16, 29, 52, 0.92) 100%);
  transform: translateY(-1px);
}

.image-edit-tool-pill.is-active {
  border: 1px solid rgba(168, 216, 255, 0.88);
  border-color: rgba(168, 216, 255, 0.88);
  background: linear-gradient(180deg, rgba(39, 63, 106, 0.94) 0%, rgba(25, 44, 79, 0.94) 100%);
  box-shadow: 0 0 0 1px rgba(168, 216, 255, 0.28);
}

.image-edit-tool-pill:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.image-edit-service-pill {
  width: 100%;
}

.image-edit-action-pill-title {
  font-size: 14px;
  font-weight: 700;
  color: #edf4ff;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.image-edit-action-pill-content {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
  white-space: nowrap;
}

.image-edit-action-pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1em;
  flex: 0 0 auto;
  font-size: 14px;
  color: rgba(188, 214, 249, 0.9);
}

.image-edit-tool-pill.is-active .image-edit-action-pill-icon {
  color: rgba(224, 240, 255, 0.98);
}

.generate-toolbar--task {
  width: 100%;
}

.node.node--image-grid .image-edit-panel {
  gap: 10px;
}

.image-edit-panel {
  position: relative;
}

.node.node--busy .node-handle {
  pointer-events: none;
  opacity: 0.45;
}

.node.node--busy .node-delete-btn {
  pointer-events: none;
  opacity: 0.45;
}

@property --ai-activity-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.node.node--busy .text-output-preview,
.node.node--busy .generate-preview-wrap .image-preview,
.node.node--busy .upload-preview-wrap .image-preview,
.node.node--busy .image-edit-panel {
  --ai-activity-opacity: 1;
  --ai-activity-speed: 2.45s;
  --ai-surface-speed: 3.6s;
  isolation: isolate;
  border-color: rgba(118, 215, 255, 0.72);
  background:
    radial-gradient(circle at 18% 18%, rgba(94, 214, 255, 0.2), transparent 40%),
    radial-gradient(circle at 82% 80%, rgba(255, 118, 220, 0.18), transparent 46%),
    linear-gradient(145deg, rgba(22, 72, 128, 0.48), rgba(14, 34, 70, 0.42) 46%, rgba(45, 26, 82, 0.34));
  background-size: 150% 150%, 170% 170%, 220% 220%;
  box-shadow:
    0 0 0 1px rgba(118, 215, 255, 0.42),
    0 0 24px rgba(87, 190, 255, 0.28),
    0 0 56px rgba(214, 119, 255, 0.2),
    inset 0 -34px 64px rgba(91, 185, 255, 0.2);
  animation: aiActivitySurfaceWash var(--ai-surface-speed) ease-in-out infinite alternate;
}

.node.node--busy .text-output-preview::before,
.node.node--busy .generate-preview-wrap .image-preview::before,
.node.node--busy .upload-preview-wrap .image-preview::before,
.node.node--busy .image-edit-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 12;
  border-radius: inherit;
  padding: 2px;
  pointer-events: none;
  opacity: var(--ai-activity-opacity);
  background:
    conic-gradient(
      from var(--ai-activity-angle),
      rgba(110, 214, 255, 0.3) 0deg,
      rgba(98, 216, 255, 1) 42deg,
      rgba(137, 128, 255, 0.98) 104deg,
      rgba(255, 120, 220, 0.96) 160deg,
      rgba(255, 216, 118, 0.92) 220deg,
      rgba(83, 255, 210, 1) 292deg,
      rgba(110, 214, 255, 0.3) 360deg
    );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation:
    aiActivityBorderSpin var(--ai-activity-speed) linear infinite,
    aiActivityBorderPulse 1.7s ease-in-out infinite alternate;
}

.node.node--busy .node-loading-mask {
  background:
    radial-gradient(circle at 26% 18%, rgba(119, 220, 255, 0.28), transparent 38%),
    radial-gradient(circle at 78% 78%, rgba(255, 132, 214, 0.24), transparent 44%),
    linear-gradient(180deg, rgba(12, 24, 46, 0.28) 0%, rgba(10, 23, 45, 0.54) 58%, rgba(12, 35, 72, 0.72) 100%);
  backdrop-filter: blur(7px) saturate(1.35);
}

.node.node--busy .node-loading-mask::before {
  content: "";
  position: absolute;
  inset: auto -18% -32% -18%;
  height: 72%;
  border-radius: 999px;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 28% 58%, rgba(93, 218, 255, 0.42), transparent 58%),
    radial-gradient(ellipse at 72% 44%, rgba(255, 130, 220, 0.34), transparent 56%),
    radial-gradient(ellipse at 50% 70%, rgba(255, 222, 128, 0.24), transparent 60%);
  filter: blur(30px) saturate(1.45);
  opacity: 0.86;
  animation: aiActivityMaskBloom 2.4s ease-in-out infinite alternate;
}

.node.node--busy .text-output-preview::after,
.node.node--busy .generate-preview-wrap .image-preview::after,
.node.node--busy .upload-preview-wrap .image-preview::after,
.node.node--busy .image-edit-panel::after {
  content: "";
  position: absolute;
  inset: -22px -18px -34px;
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 22%, rgba(102, 221, 255, 0.32), transparent 40%),
    radial-gradient(circle at 82% 78%, rgba(255, 139, 217, 0.28), transparent 44%),
    radial-gradient(circle at 52% 102%, rgba(94, 202, 255, 0.38), transparent 48%),
    radial-gradient(circle at 58% 8%, rgba(255, 217, 125, 0.2), transparent 36%);
  filter: blur(22px) saturate(1.45);
  opacity: 0.88;
  animation: aiActivityGlow 1.9s ease-in-out infinite alternate;
}

.node-loading-mask {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: inherit;
  background: rgba(7, 12, 22, 0.48);
  backdrop-filter: blur(1.5px);
  pointer-events: none;
  z-index: 9;
  overflow: hidden;
}

.node-loading-spinner {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.36);
  border-top-color: rgba(255, 255, 255, 0.95);
  animation: nodeSpin 0.8s linear infinite;
}

.node-loading-label {
  position: relative;
  z-index: 1;
  color: rgba(238, 245, 255, 0.92);
  font-size: 13px;
  font-weight: 600;
}

.generate-preview-wrap.is-locked .node-loading-mask,
.upload-preview-wrap.is-locked .node-loading-mask {
  border-radius: 18px;
}

@keyframes nodeSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes aiActivityBorderSpin {
  to {
    --ai-activity-angle: 360deg;
  }
}

@keyframes aiActivityBorderPulse {
  from {
    filter: saturate(1.05) brightness(0.96);
  }
  to {
    filter: saturate(1.28) brightness(1.16);
  }
}

@keyframes aiActivityGlow {
  from {
    opacity: 0.48;
    transform: scale(0.985) translate3d(-1%, -1%, 0);
  }
  to {
    opacity: 0.94;
    transform: scale(1.018) translate3d(1%, 1%, 0);
  }
}

@keyframes aiActivitySurfaceWash {
  from {
    background-position: 0% 8%, 100% 90%, 0% 50%;
  }
  to {
    background-position: 76% 28%, 18% 58%, 100% 50%;
  }
}

@keyframes aiActivityMaskBloom {
  from {
    opacity: 0.62;
    transform: translate3d(-2%, 4%, 0) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate3d(2%, -2%, 0) scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .node.node--busy .text-output-preview::before,
  .node.node--busy .generate-preview-wrap .image-preview::before,
  .node.node--busy .upload-preview-wrap .image-preview::before,
  .node.node--busy .image-edit-panel::before,
  .node.node--busy .text-output-preview::after,
  .node.node--busy .generate-preview-wrap .image-preview::after,
  .node.node--busy .upload-preview-wrap .image-preview::after,
  .node.node--busy .image-edit-panel::after,
  .node.node--busy .node-loading-mask::before {
    animation: none;
  }

  .node.node--busy .text-output-preview,
  .node.node--busy .generate-preview-wrap .image-preview,
  .node.node--busy .upload-preview-wrap .image-preview,
  .node.node--busy .image-edit-panel {
    animation: none;
  }
}

.image-crop-panel {
  gap: 10px;
}

.image-crop-preview {
  position: relative;
  width: 100%;
  min-height: 170px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(120, 142, 184, 0.42);
  background: rgba(7, 14, 28, 0.3);
  cursor: crosshair;
}

.image-crop-preview img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.image-crop-overlay {
  position: absolute;
  border: 1.5px solid rgba(125, 200, 255, 0.94);
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(3, 9, 19, 0.42), 0 0 0 1px rgba(125, 200, 255, 0.2);
  pointer-events: none;
}

/* ===== Settings Panel V2 ===== */
.settings-panel {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 8, 14, 0.52);
  backdrop-filter: blur(8px);
}

body[data-app-mode="settings"] {
  min-height: 100%;
  background:
    radial-gradient(980px 420px at -6% -24%, rgba(66, 99, 152, 0.16) 0%, rgba(66, 99, 152, 0) 68%),
    radial-gradient(760px 340px at 108% -19%, rgba(86, 131, 198, 0.14) 0%, rgba(86, 131, 198, 0) 72%),
    linear-gradient(180deg, #05080f 0%, #04070d 100%);
  color: #edf3ff;
}

.settings-page-root {
  min-height: 100vh;
}

.settings-panel--standalone {
  position: relative;
  inset: auto;
  min-height: 100vh;
  padding: 22px;
  background: transparent;
  backdrop-filter: none;
  place-items: stretch;
}

.settings-shell {
  width: min(1140px, calc(100vw - 48px));
  height: min(760px, calc(100vh - 56px));
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: linear-gradient(155deg, rgba(30, 32, 38, 0.96) 0%, rgba(19, 20, 25, 0.95) 100%);
  box-shadow: 0 26px 66px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

.settings-shell--standalone {
  width: min(1820px, calc(100vw - 44px));
  height: min(1080px, calc(100vh - 44px));
  border-radius: 30px;
  grid-template-columns: 360px minmax(0, 1fr);
  background: linear-gradient(155deg, rgba(31, 34, 41, 0.97) 0%, rgba(18, 20, 26, 0.96) 100%);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.settings-nav {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 18px 14px;
  display: grid;
  align-content: start;
  gap: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0) 100%);
}

.settings-nav-btn {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: transparent;
  color: #a6afbd;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: left;
  cursor: pointer;
  transition: color var(--dur-fast) var(--motion-standard), border-color var(--dur-fast) var(--motion-standard),
    background-color var(--dur-fast) var(--motion-standard), transform var(--dur-fast) var(--motion-standard);
}

.settings-nav-btn:hover {
  color: #f5f8ff;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.05);
  transform: none;
}

.settings-nav-btn.is-active {
  color: #fbfdff;
  border-color: rgba(255, 255, 255, 0.32);
  background: linear-gradient(150deg, rgba(72, 76, 86, 0.42) 0%, rgba(47, 50, 58, 0.4) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.settings-nav-subtabs {
  display: grid;
  gap: 6px;
  margin: -2px 0 6px 12px;
  padding: 8px 0 0 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-nav-sub-btn {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #98a6bb;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: left;
  cursor: pointer;
  transition: color var(--dur-fast) var(--motion-standard), border-color var(--dur-fast) var(--motion-standard),
    background-color var(--dur-fast) var(--motion-standard);
}

.settings-nav-sub-btn:hover {
  color: #ebf4ff;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

.settings-nav-sub-btn.is-active {
  color: #f8fbff;
  border-color: rgba(147, 198, 255, 0.56);
  background: linear-gradient(145deg, rgba(70, 112, 176, 0.32) 0%, rgba(39, 73, 122, 0.28) 100%);
  box-shadow: inset 0 1px 0 rgba(184, 220, 255, 0.2);
}

.settings-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.settings-main-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-main-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.settings-main-heading {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.settings-main-header h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.24;
  letter-spacing: -0.01em;
  color: #f7f9ff;
}

.settings-close-btn {
  width: 34px;
  min-width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.02);
  color: #cfd6e2;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--dur-fast) var(--motion-standard), border-color var(--dur-fast) var(--motion-standard),
    background-color var(--dur-fast) var(--motion-standard), transform var(--dur-fast) var(--motion-standard);
}

.settings-close-btn:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.08);
  transform: none;
}

.settings-back-btn {
  min-width: 108px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.03);
  color: #d7deeb;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: color var(--dur-fast) var(--motion-standard), border-color var(--dur-fast) var(--motion-standard),
    background-color var(--dur-fast) var(--motion-standard);
}

.settings-back-btn:hover {
  color: #f7fbff;
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.08);
}

.settings-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.settings-tabs--top {
  padding: 12px 20px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-tabs--sub {
  padding-bottom: 4px;
}

.settings-tabs--level {
  padding: 0;
  border-bottom: none;
  min-width: 0;
}

.settings-tab-hierarchy {
  display: grid;
  gap: 9px;
  padding: 10px;
  margin-bottom: 2px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.015) 100%);
}

.settings-tab-hierarchy--compact {
  margin-bottom: 4px;
}

.settings-tab-level-row {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.settings-tab-level-label {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.settings-tab-level-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(147, 172, 206, 0.38);
  background: rgba(101, 130, 170, 0.18);
  color: #dcecff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.settings-tab-level-title {
  color: #9eacbf;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.settings-tab-hierarchy .settings-provider-tabs-row,
.settings-tab-hierarchy .settings-model-profile-row {
  align-items: flex-end;
  gap: 8px;
}

.settings-tab-hierarchy .settings-tabs--sub,
.settings-tab-hierarchy .settings-tabs--model {
  gap: 2px;
  padding-bottom: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  scrollbar-width: thin;
}

.settings-tab-hierarchy .settings-tabs--sub .settings-tab,
.settings-tab-hierarchy .settings-tabs--model .settings-tab {
  height: 38px;
  margin-bottom: -1px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-bottom-color: transparent;
  border-radius: 11px 11px 0 0;
  background: transparent;
  color: #9fadc2;
  box-shadow: none;
}

.settings-tab-hierarchy .settings-tabs--sub .settings-tab:hover,
.settings-tab-hierarchy .settings-tabs--model .settings-tab:hover {
  color: #eaf4ff;
  border-color: rgba(255, 255, 255, 0.22);
  border-bottom-color: transparent;
  background: rgba(255, 255, 255, 0.05);
}

.settings-tab-hierarchy .settings-tabs--sub .settings-tab.is-active,
.settings-tab-hierarchy .settings-tabs--model .settings-tab.is-active {
  color: #f6fbff;
  border-color: rgba(148, 204, 255, 0.62);
  border-bottom-color: rgba(25, 30, 40, 0.96);
  background: linear-gradient(175deg, rgba(62, 108, 170, 0.34) 0%, rgba(34, 63, 105, 0.28) 100%);
  box-shadow: inset 0 1px 0 rgba(196, 226, 255, 0.2);
}

.settings-tab-hierarchy .settings-inline-icon-btn {
  margin-bottom: 4px;
}

.settings-provider-stack {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.settings-model-profile-row {
  padding-left: 22px;
}

.settings-tab-level-row--model-only {
  align-items: center;
}

.settings-model-profile-row--single {
  padding-left: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.settings-model-profile-row--single .settings-tabs--model {
  flex: 1 1 auto;
  min-width: 0;
}

.settings-tab-hierarchy .settings-tab--model-profile .settings-model-default-badge {
  min-width: 28px;
  height: 16px;
  font-size: 9px;
  background: rgba(205, 226, 251, 0.18);
  border-color: rgba(195, 220, 250, 0.42);
}

.settings-provider-tabs-row,
.settings-model-profile-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.settings-provider-tabs-row .settings-tabs--sub,
.settings-model-profile-row .settings-tabs--model {
  flex: 1 1 auto;
  min-width: 0;
}

.settings-model-profiles {
  display: grid;
  gap: 10px;
  padding: 4px 0 2px;
}

.settings-tabs--model {
  gap: 7px;
  padding-bottom: 2px;
}

.settings-model-profile-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-width: 0;
}

.settings-tab--model-profile {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 280px;
  padding-right: 16px;
}

.settings-model-profile-label {
  display: inline-block;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-model-profile-delete {
  position: absolute;
  top: 50%;
  right: -8px;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(15, 20, 30, 0.92);
  color: #c9d7ea;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scale(0.86);
  cursor: pointer;
  transition: opacity var(--dur-fast) var(--motion-standard), transform var(--dur-fast) var(--motion-standard),
    border-color var(--dur-fast) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard),
    color var(--dur-fast) var(--motion-standard);
}

.settings-model-profile-delete svg {
  width: 12px;
  height: 12px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

.settings-model-profile-item:hover .settings-model-profile-delete,
.settings-model-profile-item:focus-within .settings-model-profile-delete {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

.settings-model-profile-delete:hover {
  color: #ffffff;
  border-color: rgba(255, 128, 148, 0.58);
  background: rgba(150, 44, 62, 0.82);
}

.settings-model-profile-delete:focus-visible {
  opacity: 1;
  pointer-events: auto;
  outline: 2px solid rgba(148, 205, 255, 0.72);
  outline-offset: 2px;
}

.settings-tab--model-profile .settings-model-default-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #f7faff;
  background: rgba(255, 255, 255, 0.14);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.settings-model-profile-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.settings-inline-icon-btn {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #95a8c4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: color var(--dur-fast) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard);
}

.settings-inline-icon-btn svg {
  width: 15px;
  height: 15px;
  display: block;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.settings-inline-icon-btn:hover {
  color: #dcedff;
  background: rgba(255, 255, 255, 0.08);
}

.settings-inline-icon-btn:focus-visible {
  outline: 2px solid rgba(148, 205, 255, 0.72);
  outline-offset: 2px;
}

.settings-inline-icon-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.settings-model-profile-actions .pill-btn {
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

.settings-model-profile-actions .pill-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.settings-tab {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.03);
  color: #b6bfcd;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--dur-fast) var(--motion-standard), border-color var(--dur-fast) var(--motion-standard),
    background-color var(--dur-fast) var(--motion-standard), transform var(--dur-fast) var(--motion-standard);
}

.settings-tab:hover {
  color: #f7fbff;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  transform: none;
}

.settings-panel .pill-btn:hover,
.settings-panel .pill-btn:active {
  transform: none;
}

.settings-tab.is-active {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
  background: linear-gradient(145deg, rgba(86, 90, 101, 0.52) 0%, rgba(58, 61, 70, 0.5) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.settings-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px;
}

.settings-panel--standalone .settings-nav {
  padding: 26px 18px;
  gap: 10px;
}

.settings-panel--standalone .settings-nav-back-btn {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  margin: 0 0 14px;
}

.settings-panel--standalone .settings-nav-btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 13px;
  font-size: 15px;
}

.settings-panel--standalone .settings-nav-subtabs {
  margin: 0;
  padding: 0;
  gap: 10px;
  border-left: none;
}

.settings-panel--standalone .settings-nav-sub-btn {
  min-height: 44px;
  font-size: 15px;
  padding: 0 16px;
  border-radius: 13px;
}

.settings-panel--standalone .settings-main-header {
  padding: 28px 32px 20px;
  justify-content: flex-start;
}

.settings-panel--standalone .settings-main-header h3 {
  font-size: 26px;
  letter-spacing: -0.02em;
}

.settings-panel--standalone .settings-tabs--top {
  padding: 14px 32px 12px;
}

.settings-panel--standalone .settings-content {
  padding: 22px 32px 24px;
}

.settings-panel--standalone .settings-tab-hierarchy {
  padding: 18px 18px 14px;
  border-radius: 18px;
}

.settings-panel--standalone .settings-tab-level-row {
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
}

.settings-panel--standalone .settings-tab-level-index {
  width: 26px;
  height: 26px;
  font-size: 11px;
}

.settings-panel--standalone .settings-tab-level-title {
  font-size: 14px;
}

.settings-panel--standalone .settings-tab-hierarchy .settings-tabs--sub .settings-tab,
.settings-panel--standalone .settings-tab-hierarchy .settings-tabs--model .settings-tab {
  height: 44px;
  padding: 0 18px;
  border-radius: 12px 12px 0 0;
  font-size: 14px;
}

.settings-panel--standalone .settings-tab-hierarchy .settings-inline-icon-btn {
  width: 30px;
  height: 30px;
  margin-bottom: 5px;
}

.settings-panel--standalone .settings-tab-hierarchy .settings-inline-icon-btn svg {
  width: 18px;
  height: 18px;
}

.settings-panel--standalone .settings-model-profile-actions .pill-btn {
  min-height: 34px;
  font-size: 13px;
  border-radius: 999px;
  padding: 0 14px;
}

.settings-panel--standalone .settings-pane {
  gap: 16px;
}

.settings-panel--standalone .field {
  gap: 9px;
}

.settings-panel--standalone .field span {
  font-size: 12px;
}

.settings-panel--standalone .field input,
.settings-panel--standalone .field select,
.settings-panel--standalone .settings-textarea {
  min-height: 44px;
  border-radius: 14px;
  padding: 0 16px;
  font-size: 14px;
}

.settings-panel--standalone .field select {
  height: 44px;
}

.settings-panel--standalone .settings-textarea {
  min-height: 130px;
  padding: 14px 16px;
}

.settings-panel--standalone .settings-field-grid--dual .settings-textarea {
  min-height: 88px;
}

.settings-panel--standalone .settings-textarea--model-list {
  min-height: 76px;
}

.settings-panel--standalone .settings-save-row {
  min-height: 72px;
  padding: 0 32px;
}

.settings-panel--standalone .settings-save-status {
  font-size: 14px;
}

.settings-pane {
  display: grid;
  align-content: start;
  gap: 12px;
}

.settings-provider-pane {
  display: grid;
  gap: 12px;
}

.settings-field-grid {
  display: grid;
  gap: 12px;
}

.settings-field-grid--dual {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.settings-panel .field {
  margin-bottom: 0;
  gap: 7px;
}

.settings-panel .field span {
  color: #a2adbe;
  font-size: 12px;
  font-weight: 600;
}

.settings-field-hint {
  color: #71819a;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.45;
}

.settings-model-select-row,
.settings-model-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.settings-model-add-row {
  margin-top: 1px;
}

.settings-model-catalog-btn {
  min-width: 86px;
  min-height: 38px;
  border: 1px solid rgba(112, 186, 255, 0.34);
  border-radius: 10px;
  background: rgba(38, 117, 209, 0.14);
  color: #dcecff;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard),
    color var(--dur-fast) var(--motion-standard), opacity var(--dur-fast) var(--motion-standard);
}

.settings-model-catalog-btn:hover {
  border-color: rgba(139, 207, 255, 0.66);
  background: rgba(38, 117, 209, 0.24);
}

.settings-model-catalog-btn--danger {
  border-color: rgba(255, 112, 128, 0.3);
  background: rgba(255, 76, 99, 0.08);
  color: #ffb0ba;
}

.settings-model-catalog-btn--danger:hover {
  border-color: rgba(255, 132, 146, 0.58);
  background: rgba(255, 76, 99, 0.16);
}

.settings-model-catalog-btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.settings-panel .field input,
.settings-panel .field select,
.settings-panel .settings-textarea {
  width: 100%;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  background: rgba(255, 255, 255, 0.03);
  color: #edf3ff;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 500;
  transition: border-color var(--dur-fast) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard),
    box-shadow var(--dur-fast) var(--motion-standard);
}

.settings-key-input-wrap {
  position: relative;
  width: 100%;
}

.settings-key-input-wrap > input {
  padding-right: 38px !important;
}

.settings-secret-input:not(.is-visible) {
  -webkit-text-security: disc;
  text-security: disc;
}

.settings-key-visibility-btn {
  position: absolute;
  top: 50%;
  right: 9px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #94a6c0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transform: translateY(-50%);
  cursor: pointer;
  transition: color var(--dur-fast) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard);
}

.settings-key-visibility-btn svg {
  width: 15px;
  height: 15px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.settings-key-visibility-btn .icon-eye-off {
  opacity: 0;
  transition: opacity var(--dur-fast) var(--motion-standard);
}

.settings-key-visibility-btn.is-visible .icon-eye-off {
  opacity: 1;
}

.settings-key-visibility-btn:hover {
  color: #dff0ff;
  background: rgba(255, 255, 255, 0.09);
}

.settings-key-visibility-btn:focus-visible {
  outline: 2px solid rgba(148, 205, 255, 0.72);
  outline-offset: 1px;
}

.settings-model-test-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 2px 0 4px;
}

.settings-model-test-btn {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid rgba(120, 192, 255, 0.32);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(29, 131, 255, 0.2), rgba(25, 216, 203, 0.14));
  color: #dff3ff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 22px rgba(0, 18, 42, 0.18);
  transition: border-color var(--dur-fast) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard),
    transform var(--dur-fast) var(--motion-standard), box-shadow var(--dur-fast) var(--motion-standard);
}

.settings-model-test-btn:hover {
  border-color: rgba(151, 220, 255, 0.6);
  background: linear-gradient(135deg, rgba(44, 150, 255, 0.3), rgba(36, 232, 216, 0.2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 14px 28px rgba(0, 27, 66, 0.24);
  transform: translateY(-1px);
}

.settings-model-test-btn:focus-visible {
  outline: 2px solid rgba(148, 205, 255, 0.72);
  outline-offset: 2px;
}

.settings-model-test-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  max-width: min(100%, 560px);
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #95a6bd;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.settings-model-test-status[data-state="running"] {
  border-color: rgba(122, 188, 255, 0.42);
  background: rgba(58, 139, 255, 0.12);
  color: #dcecff;
}

.settings-model-test-status[data-state="success"] {
  border-color: rgba(111, 231, 162, 0.42);
  background: rgba(82, 222, 143, 0.12);
  color: #9ff0bc;
}

.settings-model-test-status[data-state="warning"] {
  border-color: rgba(255, 190, 105, 0.42);
  background: rgba(255, 173, 62, 0.12);
  color: #ffd391;
}

.settings-model-test-status[data-state="error"] {
  border-color: rgba(255, 104, 121, 0.46);
  background: rgba(255, 65, 86, 0.13);
  color: #ff9aa6;
}

.settings-panel .field select {
  height: 38px;
  cursor: pointer;
}

.settings-panel .field select option,
.settings-panel .field select optgroup {
  background: #0b1220;
  color: #edf3ff;
}

.settings-panel .settings-textarea {
  min-height: 88px;
  resize: vertical;
  padding: 10px 11px;
  line-height: 1.5;
}

.settings-panel .field input::placeholder,
.settings-panel .settings-textarea::placeholder {
  color: #7d889a;
}

.settings-panel .field input:focus,
.settings-panel .field select:focus,
.settings-panel .settings-textarea:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.13);
}

.settings-panel .field-line {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.settings-template-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.settings-template-toolbar .pill-btn {
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

.settings-prompt-template-list {
  display: grid;
  gap: 10px;
}

.settings-prompt-template-empty {
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  min-height: 72px;
  display: grid;
  place-items: center;
  color: #98a6bb;
  font-size: 12px;
}

.settings-prompt-template-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.settings-prompt-template-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-prompt-template-title {
  flex: 1 1 auto;
  min-width: 0;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  background: rgba(255, 255, 255, 0.03);
  color: #edf3ff;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 500;
}

.settings-prompt-template-title::placeholder {
  color: #7d889a;
}

.settings-prompt-template-title:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.13);
}

.settings-prompt-template-delete {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.02);
  color: #c9d3e2;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.settings-prompt-template-delete:hover {
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(255, 255, 255, 0.08);
  color: #f6fbff;
}

.settings-prompt-template-content {
  min-height: 110px !important;
}

.settings-prompt-template-mode {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #bac7da;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.settings-save-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 56px;
  padding: 0 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.settings-save-status {
  font-size: 12px;
  font-weight: 600;
  color: #93a0b4;
}

.settings-save-status[data-state="saving"] {
  color: #dce6f7;
}

.settings-save-status[data-state="saved"] {
  color: #8fe2ac;
}

.settings-save-status[data-state="warning"] {
  color: #f5bf76;
}

@media (max-width: 1080px) {
  .settings-panel {
    padding: 12px;
  }

  .settings-shell {
    width: min(100%, calc(100vw - 24px));
    height: min(100%, calc(100vh - 24px));
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .settings-nav {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    gap: 8px;
    padding: 10px;
    overflow-x: auto;
  }

  .settings-nav-btn {
    min-width: fit-content;
    white-space: nowrap;
    text-align: center;
  }

  .settings-nav-subtabs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    border-left: none;
  }

  .settings-nav-sub-btn {
    min-width: fit-content;
    white-space: nowrap;
    text-align: center;
  }

  .settings-main-header {
    padding: 14px 14px 10px;
  }

  .settings-tabs--top,
  .settings-content,
  .settings-save-row {
    padding-left: 14px;
    padding-right: 14px;
  }

  .settings-panel .field-line {
    grid-template-columns: 1fr;
  }

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

  .settings-tab-level-row {
    grid-template-columns: 1fr;
    gap: 6px;
    align-items: start;
  }

  .settings-tab-level-label {
    min-height: 0;
  }

  .settings-tab-hierarchy {
    padding: 10px 9px;
  }
}

/* ===== Handle Hover Contrast Fix ===== */
.node-handle:hover::before,
.node-handle:hover::after,
.node-handle:focus-visible::before,
.node-handle:focus-visible::after {
  background: #2f3744;
}

/* ===== Disable Node Hover Lift Globally ===== */
.node:hover:not(.dragging),
.node.node--text:hover:not(.dragging):not(.node--selected):not(.node--primary-selected),
.node.node--edit:hover:not(.dragging):not(.node--selected):not(.node--primary-selected),
.node.node--image:hover:not(.dragging),
.node.node--text:hover:not(.dragging):not(.node--selected):not(.node--primary-selected) .text-node-panel,
.node.node--text:hover:not(.dragging):not(.node--selected):not(.node--primary-selected) .text-node-params-panel,
.node.node--edit:hover:not(.dragging):not(.node--selected):not(.node--primary-selected) .image-edit-panel,
.node.node--image:hover:not(.dragging) .upload-preview-wrap .image-preview,
.node.node--image:hover:not(.dragging) .generate-preview-wrap .image-preview,
.node.node--image:hover:not(.dragging) .generate-composer {
  transform: none !important;
}

/* ===== Text Node Input Border Removed ===== */
.text-node-panel .textarea,
.text-node-params-panel .textarea,
.text-node-panel .textarea:hover,
.text-node-params-panel .textarea:hover,
.text-node-panel .textarea:focus,
.text-node-params-panel .textarea:focus {
  border: none !important;
  box-shadow: none !important;
}

/* ===== Image Composer Prompt Matches Model Bar ===== */
.generate-composer .composer-textarea,
.generate-composer .composer-textarea:hover,
.generate-composer .composer-textarea:focus,
.image-edit-panel .composer-textarea,
.image-edit-panel .composer-textarea:hover,
.image-edit-panel .composer-textarea:focus {
  border: none !important;
  background: linear-gradient(180deg, rgba(10, 16, 29, 0.56) 0%, rgba(7, 12, 22, 0.64) 100%) !important;
  box-shadow: none !important;
  min-height: 52px;
  max-height: 150px;
  overflow-y: auto;
  overscroll-behavior: contain;
  resize: none;
}

/* ===== Node Delete Icon Centering (final override) ===== */
.node-delete-btn {
  position: relative;
  display: grid !important;
  place-items: center;
  padding: 0 !important;
  font-size: 0 !important;
  line-height: 0 !important;
}

.node-delete-btn::before,
.node-delete-btn::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform-origin: center;
}

.node-delete-btn::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.node-delete-btn::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* ===== Text Node Generation Layout ===== */
.text-preview-wrap,
.text-params-wrap {
  width: min(100%, var(--text-content-width, 520px));
  margin: 0 auto;
  position: relative;
}

.text-node-panel--generator {
  gap: 10px;
}

.text-node-panel--output {
  min-height: 220px;
}

.text-node-panel--params {
  position: relative;
}

.text-node-section {
  display: grid;
  gap: 6px;
}

.text-node-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.text-node-template-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.text-node-template-clear-btn {
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: rgba(176, 201, 236, 0.9);
  display: inline-grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  transition: color var(--dur-fast) var(--motion-standard), opacity var(--dur-fast) var(--motion-standard), transform var(--dur-fast) var(--motion-standard);
}

.text-node-template-clear-btn svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.text-node-template-clear-btn:hover {
  color: #9fd4ff;
  transform: translateY(-0.5px);
}

.text-node-template-clear-btn:focus-visible {
  outline: none;
  color: #b9e0ff;
}

.text-node-template-clear-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.text-node-section--output {
  min-height: 0;
  align-content: start;
}

.text-node-section-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: rgba(197, 214, 240, 0.92);
  letter-spacing: 0.01em;
}

.text-node-section-title--params {
  font-size: 12px;
  color: rgba(168, 190, 224, 0.86);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.text-node-prompt-template-select-shell {
  width: fit-content;
  max-width: min(100%, 340px);
  min-width: 0;
  margin-left: auto;
  margin-right: 0;
}

.text-node-template-actions .text-node-prompt-template-select-shell {
  margin-left: 0;
}

.text-node-section-head .generate-select-trigger,
.text-node-section-head .ux-select-trigger,
.text-node-section-head .generate-select-trigger:hover,
.text-node-section-head .ux-select-trigger:hover,
.text-node-section-head .generate-select-trigger:focus-visible,
.text-node-section-head .ux-select-trigger:focus-visible,
.text-node-section-head .ux-select.is-open .generate-select-trigger,
.text-node-section-head .ux-select.is-open .ux-select-trigger {
  height: 27px;
  min-height: 27px;
  border-radius: 10px;
  padding: 0 10px;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  justify-content: flex-start;
}

.text-node-section-head .ux-select-trigger-text {
  flex: 1 1 auto;
  text-align: left;
  justify-items: start;
}

.text-node-panel--generator .text-node-output,
.text-node-panel--generator .text-node-input {
  border: none !important;
  box-shadow: none !important;
  border-radius: 14px;
  padding: 12px;
  line-height: 1.45;
  color: #edf4ff;
  background: linear-gradient(180deg, rgba(10, 16, 29, 0.56) 0%, rgba(7, 12, 22, 0.64) 100%) !important;
  max-height: 150px;
  overflow-y: auto;
  overscroll-behavior: contain;
  resize: none;
}

.text-node-panel--generator .text-node-output {
  min-height: 120px;
}

.text-node-panel--output .text-node-output {
  min-height: 168px;
}

.text-node-panel--generator .text-node-input {
  min-height: 52px;
}

.text-node-panel--generator .text-node-output[readonly] {
  cursor: text;
}

.text-node-panel--generator .text-node-output:focus,
.text-node-panel--generator .text-node-input:focus {
  box-shadow: 0 0 0 2px rgba(142, 195, 255, 0.24) !important;
}

.text-node-config-row {
  grid-template-columns: minmax(0, 1fr);
}

.text-node-config-row .ux-select-trigger-text {
  text-align: center;
  justify-items: center;
}

.text-node-run-row {
  justify-content: flex-end;
}

.text-node-run-row .generate-run-group {
  margin-left: 0;
}

.node.node--text .text-preview-wrap .node-loading-mask {
  border-radius: 22px;
}

.text-node-panel--params > .status-line {
  padding: 0;
}

.text-output-preview {
  min-height: 220px;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  box-sizing: border-box;
  position: relative;
}

.text-output-preview.text-output-preview--has-text {
  display: block;
  min-height: 0;
}

.text-output-preview.text-output-preview--multi {
  padding-bottom: 16px;
}

.text-output-stack {
  position: relative;
  width: 100%;
  min-height: 0;
}

.text-output-preview--multi .text-output-stack {
  padding-bottom: 44px;
}

.text-output-card {
  border-radius: 16px;
  border: none;
  background: transparent;
}

.text-output-card--active {
  position: relative;
  z-index: 3;
  min-height: 0;
  max-height: 150px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 12px 14px;
}

.text-output-content {
  width: 100%;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
  font-size: 14px;
  color: var(--text-primary);
}

.text-output-card-controls {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.text-output-card-page {
  font-size: 12px;
  font-weight: 600;
  color: rgba(162, 189, 220, 0.9);
  letter-spacing: 0.01em;
}

.text-output-next-btn {
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(130, 189, 255, 0.54);
  background: linear-gradient(180deg, rgba(48, 85, 143, 0.94) 0%, rgba(33, 62, 108, 0.94) 100%);
  color: #ecf5ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0 12px;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--motion-standard), transform var(--dur-fast) var(--motion-standard),
    filter var(--dur-fast) var(--motion-standard);
}

.text-output-next-btn:hover {
  border-color: rgba(164, 216, 255, 0.86);
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.text-output-next-btn:focus-visible {
  outline: 2px solid rgba(160, 214, 255, 0.9);
  outline-offset: 1px;
}

.text-output-next-btn:active {
  transform: translateY(0);
}

/* ===== Image Edit Compact Mode ===== */
.node.node--image-edit-minimized .node-body {
  padding: 0;
  gap: 0;
}

.image-edit-compact-panel {
  width: 100%;
  min-height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(180deg, rgba(15, 21, 34, 0.9) 0%, rgba(10, 15, 26, 0.92) 100%);
  box-shadow: 0 8px 20px rgba(3, 10, 22, 0.3);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-edit-compact-trigger {
  width: 100%;
  height: 38px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(33, 52, 86, 0.94) 0%, rgba(24, 40, 68, 0.94) 100%);
  color: #eaf3ff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  padding: 0 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background-color var(--dur-fast) var(--motion-standard), box-shadow var(--dur-mid) var(--motion-standard),
    transform var(--dur-fast) var(--motion-standard);
}

.image-edit-compact-trigger:hover {
  transform: none;
  background: linear-gradient(180deg, rgba(40, 63, 103, 0.95) 0%, rgba(30, 49, 82, 0.95) 100%);
  box-shadow: 0 0 0 1px rgba(164, 212, 255, 0.36);
}

.image-edit-compact-trigger:focus-visible {
  outline: 2px solid rgba(166, 214, 255, 0.84);
  outline-offset: 1px;
}

.node.node--image-edit-transition-collapse .image-edit-compact-panel {
  animation: image-edit-compact-enter 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.node.node--image-edit-transition-expand .image-edit-panel {
  animation: image-edit-panel-enter 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes image-edit-compact-enter {
  0% {
    opacity: 0.42;
    transform: scale(1.08);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes image-edit-panel-enter {
  0% {
    opacity: 0.24;
    transform: scale(0.92);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===== Node Corner Resize ===== */
.node-resize-handle {
  position: absolute;
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  box-shadow: none;
  opacity: 0;
  transform: none;
  pointer-events: none;
  transition: none;
  z-index: 18;
  touch-action: none;
}

.node-resize-handle--nw {
  left: 0;
  top: 0;
  cursor: nwse-resize;
}

.node-resize-handle--ne {
  right: 0;
  top: 0;
  cursor: nesw-resize;
}

.node-resize-handle--sw {
  left: 0;
  bottom: 0;
  cursor: nesw-resize;
}

.node-resize-handle--se {
  right: 0;
  bottom: 0;
  cursor: nwse-resize;
}

.node.node--image:hover:not(.dragging) .node-resize-handle,
.node.node--image.node--selected .node-resize-handle,
.node.node--image.node--primary-selected .node-resize-handle,
.node.node--resizing .node-resize-handle {
  pointer-events: auto;
}

.node.node--resizing {
  transition: none !important;
}

/* ===== Drag Snap Guides ===== */
.edge-snap-guide {
  stroke: rgba(154, 210, 255, 0.72);
  stroke-width: 1.2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 5 5;
  pointer-events: none;
}

.edge-snap-guide--x,
.edge-snap-guide--y {
  filter: drop-shadow(0 0 6px rgba(120, 198, 255, 0.22));
}

/* ===== Settings / Header Polish Overrides ===== */
.top-bar {
  min-height: 70px;
  padding: 0 18px;
  align-items: center;
  border-radius: 0;
  border: none;
  background:
    linear-gradient(
      180deg,
      rgba(20, 31, 50, 0.78) 0%,
      rgba(17, 26, 43, 0.5) 46%,
      rgba(14, 19, 30, 0.16) 74%,
      rgba(14, 19, 30, 0) 100%
    );
  box-shadow: none;
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
}

.brand {
  min-height: 34px;
  align-items: center;
  gap: 0;
}

.brand-logo {
  width: 27px;
  height: 27px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.98) 0 10%, rgba(255, 255, 255, 0) 11%),
    linear-gradient(145deg, rgba(92, 170, 255, 0.98) 0%, rgba(48, 111, 238, 0.98) 54%, rgba(33, 223, 199, 0.92) 100%);
  box-shadow: 0 0 0 1px rgba(178, 211, 255, 0.24), 0 8px 22px rgba(21, 122, 255, 0.26);
  color: rgba(255, 255, 255, 0.96);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.brand-name {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  color: rgba(236, 244, 255, 0.96);
  font-size: 20px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
}

.top-actions {
  min-height: 34px;
  align-items: center;
  gap: 9px;
}

.top-actions .board-title {
  align-self: center;
  width: 180px;
  min-width: 120px;
  height: 32px;
  margin-right: 4px;
  padding: 0 10px;
  border-radius: 10px;
  color: rgba(231, 238, 249, 0.96);
  font-size: 15px;
  letter-spacing: 0;
  text-align: right;
}

.top-actions .board-title:hover,
.top-actions .board-title:focus {
  background: rgba(255, 255, 255, 0.055);
}

.top-actions .board-title::selection {
  background: rgba(68, 149, 255, 0.42);
}

.top-actions .pill-btn.top-icon-btn {
  align-self: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border: none !important;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045) !important;
  color: #cbd6e8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none !important;
  text-decoration: none;
}

.top-actions .pill-btn.top-icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.top-actions .pill-btn.top-icon-btn:hover {
  color: #f5f8ff;
  background: rgba(143, 176, 232, 0.14) !important;
  text-decoration: none;
}

.top-actions .pill-btn.top-icon-btn:active {
  opacity: 0.92;
  transform: translateY(1px) !important;
}

@media (max-width: 1080px) {
  .top-bar {
    min-height: 64px;
    padding: 0 12px;
  }

  .brand-name {
    font-size: 17px;
  }

  .top-actions .board-title {
    width: 130px;
    font-size: 14px;
  }

  .top-actions .pill-btn.top-icon-btn {
    width: 31px;
    min-width: 31px;
    height: 31px;
  }
}

.settings-panel--standalone {
  padding: 0;
}

.settings-shell--standalone {
  width: 100vw;
  height: 100vh;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: linear-gradient(155deg, rgba(25, 28, 35, 0.98) 0%, rgba(13, 15, 21, 0.98) 100%);
}

.settings-panel--standalone .settings-main-header {
  display: none;
}

.settings-panel--standalone .settings-content {
  padding: 42px 32px 28px;
}

.settings-panel--standalone .settings-nav {
  padding-top: 26px;
}

.settings-tab-hierarchy.settings-model-tab-strip,
.settings-panel--standalone .settings-tab-hierarchy.settings-model-tab-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 18px;
  margin: 0 0 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.settings-model-tab-strip .settings-tabs--model {
  flex: 1 1 auto;
  min-width: 0;
  gap: 4px;
  padding-bottom: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.settings-model-tab-strip .settings-model-add-btn,
.settings-panel--standalone .settings-model-tab-strip .settings-model-add-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  margin: 0;
  border: 1px solid rgba(145, 169, 206, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.settings-model-tab-strip .settings-model-add-btn:hover {
  color: #f4f9ff;
  border-color: rgba(145, 197, 255, 0.46);
  background: rgba(92, 139, 206, 0.16);
}

.settings-model-default-badge {
  display: none !important;
}

.settings-model-tab-strip .settings-tab--model-profile {
  max-width: 260px;
  padding-right: 18px;
}

.settings-model-tab-strip .settings-model-profile-label {
  max-width: 220px;
}

.node.node--text:not(.node--busy) .text-preview-wrap .text-output-preview.text-output-preview--has-text,
.node.node--text.node--selected:not(.node--busy) .text-preview-wrap .text-output-preview.text-output-preview--has-text,
.node.node--text.node--primary-selected:not(.node--busy) .text-preview-wrap .text-output-preview.text-output-preview--has-text,
.node.node--text:hover:not(.dragging):not(.node--busy) .text-preview-wrap .text-output-preview.text-output-preview--has-text {
  border-color: rgba(255, 255, 255, 0.18);
  background: var(--surface-glass);
  box-shadow: none;
}

.node.node--text.node--selected:not(.node--busy) .text-preview-wrap .text-output-preview.text-output-preview--has-text {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16), 0 12px 26px rgba(0, 0, 0, 0.32);
}

.node.node--text.node--primary-selected:not(.node--busy) .text-preview-wrap .text-output-preview.text-output-preview--has-text {
  border-color: rgba(255, 255, 255, 0.36);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), 0 14px 30px rgba(0, 0, 0, 0.34);
}

.node.node--text:not(.node--busy) .text-output-preview.text-output-preview--has-text .text-output-card--active {
  border: none;
  background: transparent;
  box-shadow: none;
}

.current-user-badge {
  max-width: 190px;
  overflow: hidden;
  color: #c8d8f3;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-app-mode="auth"],
body[data-app-mode="admin"],
body[data-app-mode="workspace-settings"] {
  min-height: 100vh;
  color: #eaf2ff;
  background:
    radial-gradient(circle at 24% 0%, rgba(64, 125, 216, 0.28), transparent 32%),
    radial-gradient(circle at 86% 10%, rgba(30, 184, 184, 0.14), transparent 30%),
    #0c1119;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-card {
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid rgba(145, 169, 206, 0.24);
  border-radius: 8px;
  background: rgba(18, 24, 35, 0.82);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(22px);
}

.auth-brand,
.admin-brand,
.admin-topbar-left,
.admin-user,
.admin-panel-head,
.auth-captcha-row,
.auth-code-row {
  display: flex;
  align-items: center;
}

.auth-brand {
  gap: 12px;
  margin-bottom: 26px;
}

.auth-brand-name,
.admin-brand strong {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0;
}

.auth-context-badge {
  padding: 4px 9px;
  border: 1px solid rgba(145, 169, 206, 0.22);
  border-radius: 999px;
  color: #9eb8dc;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.18;
}

.auth-copy {
  margin: 0 0 26px;
  color: #9eb0c8;
  line-height: 1.7;
}

.auth-form,
.admin-form {
  display: grid;
  gap: 16px;
}

.auth-field,
.admin-form label {
  display: grid;
  gap: 8px;
  color: #aebbd0;
  font-size: 13px;
  font-weight: 700;
}

.auth-field input,
.admin-form input,
.admin-form select,
.admin-settings-json {
  width: 100%;
  border: 1px solid rgba(145, 169, 206, 0.18);
  border-radius: 8px;
  color: #eef6ff;
  background: rgba(7, 12, 22, 0.72);
  outline: none;
}

.auth-field input,
.admin-form input {
  height: 46px;
  padding: 0 13px;
  font: inherit;
}

.admin-form select {
  height: 46px;
  padding: 0 38px 0 13px;
  font: inherit;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #8fa3c2 50%), linear-gradient(135deg, #8fa3c2 50%, transparent 50%);
  background-position: calc(100% - 18px) 19px, calc(100% - 12px) 19px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.auth-field input:focus,
.admin-form input:focus,
.admin-form select:focus,
.admin-settings-json:focus {
  border-color: rgba(99, 164, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(51, 127, 225, 0.18);
}

.auth-captcha-row,
.auth-code-row {
  gap: 12px;
}

.auth-field--captcha {
  flex: 1 1 auto;
}

.auth-captcha-box {
  align-self: end;
  width: 132px;
  height: 48px;
  overflow: hidden;
  border: 1px solid rgba(145, 169, 206, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.auth-captcha-box svg {
  width: 132px;
  height: 48px;
  display: block;
}

.auth-secondary-btn,
.auth-primary-btn,
.admin-primary-btn,
.admin-secondary-btn,
.admin-ghost-btn,
.admin-row-btn {
  height: 44px;
  border: 0;
  border-radius: 8px;
  color: #edf6ff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.auth-secondary-btn,
.admin-secondary-btn,
.admin-row-btn,
.admin-ghost-btn {
  border: 1px solid rgba(145, 169, 206, 0.2);
  background: rgba(255, 255, 255, 0.06);
}

.auth-secondary-btn {
  align-self: end;
  width: 118px;
}

.auth-primary-btn,
.admin-primary-btn {
  background: linear-gradient(135deg, #3578ff, #1bbec4);
  box-shadow: 0 12px 32px rgba(35, 118, 255, 0.28);
}

.auth-secondary-btn:disabled,
.auth-primary-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.auth-status,
.admin-status {
  min-height: 22px;
  margin: 18px 0 0;
  color: #9eb0c8;
  font-size: 13px;
}

.auth-status[data-state="warning"],
.admin-status[data-state="warning"] {
  color: #ffbf86;
}

.auth-status[data-state="saved"],
.admin-status[data-state="saved"] {
  color: #5ff0a5;
}

.admin-console {
  min-height: 100vh;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid rgba(145, 169, 206, 0.14);
  background: rgba(13, 18, 27, 0.78);
  backdrop-filter: blur(22px);
}

.admin-brand {
  gap: 12px;
}

.admin-topbar-left {
  gap: 18px;
}

.admin-back-btn {
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid rgba(145, 169, 206, 0.24);
  border-radius: 8px;
  color: #dce9fb;
  background: rgba(255, 255, 255, 0.06);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard),
    color var(--dur-fast) var(--motion-standard);
}

.admin-back-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-back-btn:hover {
  border-color: rgba(99, 164, 255, 0.56);
  color: #ffffff;
  background: rgba(72, 130, 218, 0.16);
}

.admin-back-btn:focus-visible {
  outline: 2px solid rgba(99, 164, 255, 0.8);
  outline-offset: 3px;
}

.admin-brand span,
.admin-user {
  color: #aebbd0;
}

.admin-user {
  gap: 14px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: 18px;
  padding: 24px;
}

.admin-panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid rgba(145, 169, 206, 0.18);
  border-radius: 8px;
  background: rgba(18, 24, 35, 0.72);
  backdrop-filter: blur(18px);
}

.admin-panel--users,
.admin-panel--settings {
  grid-column: span 1;
}

.admin-panel--settings {
  grid-column: 1 / -1;
}

.admin-layout--platform {
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
}

.admin-panel--wide {
  grid-column: 1 / -1;
}

.admin-form--tenant {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  margin-bottom: 20px;
}

.admin-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-cell-sub {
  color: #8293ae;
  font-size: 11px;
}

.admin-panel--configuration {
  align-self: start;
}

.admin-config-link {
  width: fit-content;
  text-decoration: none;
}

.workspace-settings-layout {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 48px;
  display: grid;
  gap: 18px;
}

.workspace-account-list {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(145, 169, 206, 0.14);
  border-radius: 8px;
  background: rgba(145, 169, 206, 0.14);
}

.workspace-account-list > div {
  min-width: 0;
  padding: 16px;
  background: rgba(10, 16, 26, 0.9);
}

.workspace-account-list dt {
  margin-bottom: 8px;
  color: #8293ae;
  font-size: 12px;
}

.workspace-account-list dd {
  margin: 0;
  overflow: hidden;
  color: #edf5ff;
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-panel-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-panel h1,
.admin-panel h2 {
  margin: 0;
  font-size: 20px;
}

.admin-panel p {
  margin: 6px 0 0;
  color: #91a1bb;
  line-height: 1.55;
}

.admin-table {
  overflow-x: auto;
}

.admin-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  padding: 13px 10px;
  border-bottom: 1px solid rgba(145, 169, 206, 0.12);
  text-align: left;
  white-space: nowrap;
}

.admin-table th {
  color: #8ea1bd;
  font-size: 12px;
}

.admin-status-pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: #69f0aa;
  background: rgba(37, 220, 125, 0.1);
}

.admin-status-pill[data-state="disabled"],
.admin-status-pill[data-state="revoked"] {
  color: #ffab8f;
  background: rgba(255, 121, 83, 0.12);
}

.admin-invite-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.admin-invite-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid rgba(145, 169, 206, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.admin-invite-item div {
  display: grid;
  gap: 5px;
}

.admin-invite-item span {
  color: #90a1bc;
  font-size: 12px;
}

.admin-settings-json {
  min-height: 430px;
  padding: 14px;
  resize: vertical;
  font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-panel--settings {
    grid-column: auto;
  }

  .admin-form--tenant,
  .workspace-account-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .auth-card {
    padding: 24px;
  }

  .auth-captcha-row,
  .auth-code-row,
  .admin-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .auth-captcha-box,
  .auth-secondary-btn {
    width: 100%;
  }

  .admin-topbar {
    height: auto;
    padding: 16px;
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .admin-topbar-left {
    width: 100%;
    justify-content: space-between;
  }
}

/* Fixed work-area rhythm for the canvas app and standalone management pages. */
.top-bar,
.board-hub-panel,
.settings-page-root,
.settings-panel--standalone,
.settings-shell--standalone {
  min-width: var(--app-min-width);
}

.top-bar {
  padding: 0 18px;
}

.brand-name {
  font-size: 20px;
  font-weight: 950;
}

.board-hub-panel {
  padding: 24px 28px 30px;
}

.board-hub-page {
  width: var(--app-min-width);
  max-width: none;
  gap: 16px;
}

.board-hub-page-topbar {
  flex-direction: row;
  align-items: center;
}

.board-hub-topbar-left {
  width: auto;
  gap: 14px;
}

.board-hub-back-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.board-hub-scope-tabs {
  gap: 18px;
  min-width: 230px;
}

.board-hub-scope-tab {
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0;
  padding: 3px 2px 10px;
}

.board-hub-tools {
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 8px;
}

.board-hub-search {
  width: 220px;
  min-width: 220px;
  height: 40px;
  border-radius: 12px;
}

.board-hub-filter-wrap {
  min-width: 128px;
  height: 40px;
}

.board-hub-filter-wrap select,
.board-hub-search input {
  font-size: 13px;
}

.board-hub-primary-btn,
.board-hub-back-btn {
  height: 40px;
  border-radius: 12px;
  font-size: 13px;
}

.board-history-list {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.board-library-card {
  min-height: 244px;
  grid-template-rows: minmax(132px, 172px) auto;
  border-radius: 14px;
}

.board-library-card-title,
.board-history-list.is-list-view .board-library-card-title {
  font-size: 16px;
  letter-spacing: 0;
}

.board-library-card-meta,
.board-history-list.is-list-view .board-library-card-meta {
  font-size: 12px;
}

.board-library-create-plus {
  --plus-size: 19px;
  --plus-thickness: 2px;
  width: 46px;
  height: 46px;
}

.board-library-create-text {
  font-size: 15px;
}

body[data-app-mode="settings"] {
  overflow: auto;
}

.settings-page-root {
  width: var(--app-min-width);
  margin: 0 auto;
}

.settings-panel--standalone {
  width: var(--app-min-width);
  min-height: 100vh;
  padding: 0;
  place-items: stretch;
  overflow: visible;
}

.settings-shell--standalone {
  width: var(--app-min-width);
  height: 100vh;
  max-width: none;
  max-height: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  grid-template-columns: 220px minmax(0, 1fr);
  background: linear-gradient(155deg, rgba(25, 28, 35, 0.98) 0%, rgba(13, 15, 21, 0.98) 100%);
}

.settings-panel--standalone .settings-content {
  padding: 26px 28px 24px;
}

.settings-panel--standalone .settings-nav {
  padding: 22px 14px;
  gap: 8px;
}

.settings-panel--standalone .settings-nav-btn,
.settings-panel--standalone .settings-nav-sub-btn {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 11px;
  font-size: 14px;
}

.settings-panel--standalone .settings-nav-back-btn {
  width: 40px;
  height: 40px;
  margin: 0 0 12px;
}

.settings-panel--standalone .settings-tab-hierarchy .settings-tabs--model .settings-tab {
  height: 38px;
  padding: 0 14px;
  font-size: 13px;
}

.settings-panel--standalone .field input,
.settings-panel--standalone .field select,
.settings-panel--standalone .settings-textarea {
  min-height: 40px;
  border-radius: 12px;
  padding: 0 14px;
  font-size: 13px;
}

.settings-panel--standalone .settings-textarea {
  padding: 12px 14px;
}

/* ===== AIS platform console dashboard ===== */
body[data-app-mode="admin"] {
  min-width: 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(52, 111, 205, 0.2), transparent 28%),
    radial-gradient(circle at 92% 16%, rgba(21, 179, 187, 0.1), transparent 24%),
    #0a0f17;
}

.admin-console--dashboard {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 18px 22px;
  border-right: 1px solid rgba(145, 169, 206, 0.13);
  background: rgba(10, 15, 24, 0.9);
  backdrop-filter: blur(24px);
}

.admin-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px 26px;
  color: #9eb0c8;
  font-size: 13px;
  font-weight: 700;
}

.admin-sidebar-logo {
  color: #f1f6ff;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.admin-sidebar-nav {
  display: grid;
  gap: 7px;
}

.admin-nav-item {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #8899b3;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition:
    color var(--dur-fast) var(--motion-standard),
    border-color var(--dur-fast) var(--motion-standard),
    background-color var(--dur-fast) var(--motion-standard);
}

.admin-nav-item:hover {
  color: #dce7f7;
  background: rgba(255, 255, 255, 0.04);
}

.admin-nav-item.is-active {
  border-color: rgba(89, 151, 238, 0.26);
  color: #f4f8ff;
  background: linear-gradient(90deg, rgba(55, 116, 209, 0.18), rgba(32, 164, 177, 0.08));
}

.admin-nav-index {
  color: #5d718f;
  font: 10px/1 var(--font-mono);
}

.admin-nav-item.is-active .admin-nav-index {
  color: #62b9ff;
}

.admin-dashboard {
  min-width: 0;
}

.admin-dashboard-topbar {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 32px;
  border-bottom: 1px solid rgba(145, 169, 206, 0.12);
  background: rgba(11, 16, 25, 0.56);
  backdrop-filter: blur(18px);
}

.admin-dashboard-topbar h1 {
  margin: 4px 0 0;
  color: #f0f6ff;
  font-size: 24px;
  letter-spacing: -0.025em;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-current-admin {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 8px 14px;
  border: 1px solid rgba(145, 169, 206, 0.15);
  border-radius: 10px;
  background: rgba(17, 25, 39, 0.72);
}

.admin-current-admin span {
  color: #667a98;
  font: 9px/1.2 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-current-admin strong {
  max-width: 240px;
  overflow: hidden;
  color: #dce9fb;
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-eyebrow,
.admin-feature-kicker {
  margin: 0;
  color: #627693;
  font: 10px/1.2 var(--font-mono);
  letter-spacing: 0.15em;
}

.admin-dashboard-main {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 26px 30px 56px;
}

.admin-module {
  display: none;
}

.admin-module.is-active {
  display: grid;
  gap: 18px;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.admin-metric-card,
.admin-summary-card {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid rgba(145, 169, 206, 0.14);
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(20, 28, 42, 0.86), rgba(14, 21, 32, 0.72));
}

.admin-metric-card span,
.admin-summary-card span {
  display: block;
  color: #7f91ad;
  font-size: 12px;
  font-weight: 700;
}

.admin-metric-card strong,
.admin-summary-card strong {
  display: block;
  margin-top: 12px;
  color: #eef6ff;
  font-size: 27px;
  letter-spacing: -0.035em;
}

.admin-console--dashboard .admin-panel {
  padding: 22px;
  border-color: rgba(145, 169, 206, 0.14);
  border-radius: 9px;
  background: rgba(17, 24, 36, 0.76);
}

.admin-console--dashboard .admin-panel h2 {
  font-size: 18px;
}

.admin-form--tenant-create {
  grid-template-columns: 1.1fr 1.2fr 0.85fr 0.8fr 0.7fr auto;
  align-items: end;
}

.admin-config-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 142px;
  padding: 0 18px;
}

.admin-embedded-settings {
  position: relative;
  inset: auto;
  z-index: auto;
  display: block;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
}

.admin-embedded-settings-shell {
  width: 100%;
  height: auto;
  min-height: 560px;
  display: block;
  overflow: visible;
  border-color: rgba(145, 169, 206, 0.16);
  border-radius: 12px;
  background:
    linear-gradient(155deg, rgba(22, 31, 46, 0.96) 0%, rgba(13, 20, 31, 0.96) 100%);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.admin-embedded-settings .settings-main {
  min-height: 560px;
}

.admin-settings-toolbar {
  min-height: 84px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 17px 22px;
  border-bottom: 1px solid rgba(145, 169, 206, 0.12);
}

.admin-settings-toolbar > div:first-child {
  min-width: 172px;
}

.admin-settings-toolbar-label {
  display: block;
  margin-bottom: 5px;
  color: #657a99;
  font: 9px/1.2 var(--font-mono);
  letter-spacing: 0.12em;
}

.admin-settings-toolbar h3 {
  margin: 0;
  color: #eef5ff;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.admin-embedded-settings .settings-tabs--top {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
}

.admin-embedded-settings .settings-tab {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 9px;
  color: #92a4be;
  background: rgba(255, 255, 255, 0.018);
}

.admin-embedded-settings .settings-tab:hover {
  color: #eaf3ff;
  border-color: rgba(113, 170, 245, 0.3);
  background: rgba(68, 126, 205, 0.1);
}

.admin-embedded-settings .settings-tab.is-active {
  color: #f5f9ff;
  border-color: rgba(91, 159, 251, 0.42);
  background: linear-gradient(135deg, rgba(55, 120, 214, 0.28), rgba(30, 168, 177, 0.13));
  box-shadow: inset 0 1px 0 rgba(188, 220, 255, 0.09);
}

.admin-embedded-settings .settings-content {
  min-height: 410px;
  overflow: visible;
  padding: 24px 26px 28px;
}

.admin-embedded-settings .settings-pane {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.admin-embedded-settings .settings-tab-hierarchy,
.admin-embedded-settings .settings-template-toolbar,
.admin-embedded-settings .settings-prompt-template-list,
.admin-embedded-settings [data-settings-pane="other:general"] > .field {
  grid-column: 1 / -1;
}

.admin-embedded-settings .settings-provider-pane {
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.admin-embedded-settings .settings-provider-pane .settings-field-grid {
  grid-column: 1 / -1;
}

.admin-embedded-settings .settings-model-tab-strip {
  margin-bottom: 2px;
  padding-bottom: 16px;
}

.admin-embedded-settings .settings-model-tab-strip .settings-tab {
  min-height: 40px;
  border-radius: 10px 10px 0 0;
}

.admin-embedded-settings .settings-model-tab-strip .settings-model-add-btn {
  width: 38px;
  height: 38px;
  border-color: rgba(145, 169, 206, 0.2);
  border-radius: 10px;
}

.admin-embedded-settings .field {
  min-width: 0;
  gap: 9px;
}

.admin-embedded-settings .field span {
  color: #99aac2;
  font-size: 12px;
}

.admin-embedded-settings .field input,
.admin-embedded-settings .field select,
.admin-embedded-settings .settings-textarea {
  min-height: 44px;
  padding: 0 14px;
  border-color: rgba(145, 169, 206, 0.18);
  border-radius: 10px;
  background: rgba(7, 12, 22, 0.54);
  font-size: 13px;
}

.admin-embedded-settings .settings-textarea {
  min-height: 108px;
  padding: 12px 14px;
}

.admin-embedded-settings .field input:focus,
.admin-embedded-settings .field select:focus,
.admin-embedded-settings .settings-textarea:focus {
  border-color: rgba(82, 156, 255, 0.72);
  background: rgba(9, 16, 29, 0.78);
  box-shadow: 0 0 0 3px rgba(48, 126, 230, 0.16);
}

.admin-embedded-settings .settings-prompt-template-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-embedded-settings .settings-prompt-template-item {
  padding: 14px;
  border-color: rgba(145, 169, 206, 0.15);
  background: rgba(7, 12, 22, 0.38);
}

.admin-embedded-settings .settings-save-row {
  min-height: 62px;
  justify-content: space-between;
  padding: 0 24px;
  border-top-color: rgba(145, 169, 206, 0.12);
  background: rgba(8, 13, 22, 0.38);
}

.admin-autosave-hint {
  color: #61738f;
  font-size: 11px;
}

.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.admin-summary-card small {
  display: block;
  margin-top: 5px;
  color: #637590;
  font-size: 11px;
}

.admin-console--dashboard .admin-table th,
.admin-console--dashboard .admin-table td {
  padding: 14px 11px;
}

.admin-console--dashboard .admin-table tbody tr {
  transition: background-color var(--dur-fast) var(--motion-standard);
}

.admin-console--dashboard .admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.admin-compute-switch {
  min-width: 104px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 6px;
  border: 1px solid rgba(91, 167, 255, 0.28);
  border-radius: 999px;
  color: #b9d7ff;
  background: rgba(40, 112, 202, 0.12);
  cursor: pointer;
}

.admin-compute-switch > span {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4b9cff;
  box-shadow: 0 0 14px rgba(75, 156, 255, 0.42);
}

.admin-compute-switch strong {
  font-size: 11px;
}

.admin-compute-switch.is-private {
  border-color: rgba(51, 208, 181, 0.28);
  color: #9cebd9;
  background: rgba(34, 161, 139, 0.1);
}

.admin-compute-switch.is-private > span {
  background: #36d7b4;
  box-shadow: 0 0 14px rgba(54, 215, 180, 0.36);
}

.admin-inline-warning {
  margin-top: 5px;
  color: #e6a66f;
  font-size: 10px;
}

.admin-inline-editor {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.admin-inline-editor input {
  width: 78px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid rgba(145, 169, 206, 0.18);
  border-radius: 7px;
  color: #eef6ff;
  background: rgba(7, 12, 22, 0.72);
  outline: none;
}

.admin-pricing-form {
  grid-template-columns: 0.7fr 1.2fr 1fr 1fr 1fr auto;
  align-items: end;
  margin-bottom: 22px;
}

.admin-form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-status-pill[data-state="pending"] {
  color: #8fc5ff;
  background: rgba(67, 142, 232, 0.12);
}

.admin-current-badge {
  display: inline-flex;
  margin-left: 8px;
  padding: 3px 6px;
  border-radius: 999px;
  color: #7ec7ff;
  background: rgba(65, 148, 240, 0.12);
  font-size: 9px;
  vertical-align: middle;
}

.admin-row-btn--danger {
  color: #ffb09e;
}

.admin-row-btn:disabled {
  opacity: 0.36;
  cursor: not-allowed;
}

.admin-empty-state {
  padding: 36px;
  color: #72839d;
  text-align: center;
}

.admin-status--floating {
  position: fixed;
  right: 26px;
  bottom: 22px;
  z-index: 30;
  min-height: 0;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid rgba(145, 169, 206, 0.18);
  border-radius: 8px;
  background: rgba(15, 22, 34, 0.94);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity var(--dur-fast) var(--motion-standard),
    transform var(--dur-fast) var(--motion-standard);
}

.admin-status--floating.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1120px) {
  .admin-console--dashboard {
    grid-template-columns: 210px minmax(0, 1fr);
  }

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

  .admin-form--tenant-create {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-form--tenant-create .admin-primary-btn {
    width: fit-content;
  }

  .admin-settings-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .admin-settings-toolbar > div:first-child {
    min-width: 0;
  }

  .admin-embedded-settings .settings-pane,
  .admin-embedded-settings .settings-provider-pane {
    grid-template-columns: 1fr;
  }

  .admin-embedded-settings .settings-prompt-template-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .admin-console--dashboard {
    display: block;
  }

  .admin-sidebar {
    position: relative;
    width: 100%;
    height: auto;
    padding: 18px;
  }

  .admin-sidebar-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-dashboard-topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .admin-user {
    width: 100%;
    flex-wrap: wrap;
  }

  .admin-current-admin {
    flex: 1 1 100%;
  }

  .admin-dashboard-main {
    padding: 18px;
  }

  .admin-summary-grid,
  .admin-form--tenant-create {
    grid-template-columns: 1fr;
  }

  .admin-settings-toolbar {
    padding: 16px;
  }

  .admin-embedded-settings .settings-content {
    padding: 18px 16px 22px;
  }

  .admin-embedded-settings .settings-tabs--top {
    width: 100%;
  }

  .admin-embedded-settings .settings-tab {
    min-height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .admin-nav-item,
  .admin-embedded-settings .settings-tab,
  .admin-status--floating {
    transition: none;
  }
}

/* Product Design refinement: operation-first admin console. */
.admin-document,
body[data-app-mode="admin"] {
  min-width: 0;
}

body[data-app-mode="admin"] {
  --admin-bg: #080d15;
  --admin-surface: rgba(15, 22, 34, 0.92);
  --admin-surface-soft: rgba(18, 27, 42, 0.72);
  --admin-line: rgba(148, 169, 202, 0.13);
  --admin-line-strong: rgba(128, 166, 224, 0.24);
  --admin-text: #edf4ff;
  --admin-muted: #8799b4;
  --admin-blue: #6aa8ff;
  --admin-cyan: #59d5cf;
  color: var(--admin-text);
  background:
    radial-gradient(circle at 75% -10%, rgba(60, 118, 205, 0.13), transparent 32%),
    radial-gradient(circle at 35% 115%, rgba(42, 178, 169, 0.07), transparent 34%),
    var(--admin-bg);
}

.admin-console--dashboard {
  grid-template-columns: 256px minmax(0, 1fr);
}

.admin-sidebar {
  padding: 24px 16px;
  border-right-color: var(--admin-line);
  background: rgba(8, 13, 21, 0.94);
}

.admin-sidebar-brand {
  gap: 12px;
  min-height: 56px;
  padding: 0 10px 22px;
  border-bottom: 1px solid var(--admin-line);
}

.admin-sidebar-logo {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(113, 168, 248, 0.28);
  border-radius: 12px;
  color: #f7faff;
  background: linear-gradient(145deg, rgba(57, 111, 194, 0.32), rgba(26, 50, 82, 0.2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-size: 16px;
  letter-spacing: -0.035em;
}

.admin-sidebar-brand-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.admin-sidebar-brand-copy strong {
  color: #e9f1fd;
  font-size: 14px;
  font-weight: 760;
}

.admin-sidebar-brand-copy small {
  color: #536681;
  font: 8px/1 var(--font-mono);
  letter-spacing: 0.13em;
}

.admin-sidebar-nav {
  gap: 5px;
  padding-top: 20px;
}

.admin-nav-item {
  position: relative;
  min-height: 46px;
  gap: 11px;
  padding: 0 12px;
  border-radius: 10px;
  color: #8091ab;
  font-size: 13px;
  font-weight: 690;
}

.admin-nav-item::before {
  content: "";
  position: absolute;
  left: -16px;
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: transparent;
}

.admin-nav-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.82;
}

.admin-nav-badge {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 999px;
  color: #fff4f2;
  background: linear-gradient(135deg, #e95c54, #e8a05e);
  box-shadow: 0 0 16px rgba(232, 93, 84, 0.28);
  font-size: 10px;
  font-weight: 820;
}

.admin-nav-badge.hidden {
  display: none;
}

.admin-nav-item:hover {
  color: #dce7f7;
  background: rgba(255, 255, 255, 0.035);
}

.admin-nav-item.is-active {
  border-color: rgba(105, 166, 255, 0.2);
  color: #f5f8fe;
  background: rgba(61, 113, 189, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.admin-nav-item.is-active::before {
  background: linear-gradient(180deg, var(--admin-blue), var(--admin-cyan));
  box-shadow: 0 0 12px rgba(91, 170, 255, 0.32);
}

.admin-nav-item.is-active svg {
  color: #72b6ff;
  opacity: 1;
}

.admin-dashboard-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 78px;
  padding: 15px 30px;
  border-bottom-color: var(--admin-line);
  background: rgba(8, 13, 21, 0.82);
  backdrop-filter: blur(24px) saturate(1.2);
}

.admin-dashboard-topbar h1 {
  margin-top: 3px;
  font-size: 22px;
  font-weight: 720;
}

.admin-eyebrow {
  color: #536984;
  font-size: 9px;
}

.admin-user {
  gap: 8px;
}

.admin-current-admin {
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 7px;
  border-color: var(--admin-line);
  border-radius: 12px;
  background: rgba(16, 24, 37, 0.72);
}

.admin-current-admin-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(111, 174, 255, 0.28);
  border-radius: 9px;
  color: #ddecff;
  background: rgba(65, 124, 205, 0.2);
  font-size: 12px;
  font-weight: 850;
}

.admin-current-admin-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.admin-current-admin-copy small {
  color: #667b99;
  font-size: 9px;
  line-height: 1;
}

.admin-current-admin-copy strong {
  max-width: 220px;
  overflow: hidden;
  color: #dce8f8;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-secondary-btn,
.admin-ghost-btn {
  height: 42px;
  padding: 0 14px;
  border-color: var(--admin-line);
  border-radius: 10px;
  color: #aebed3;
  background: rgba(255, 255, 255, 0.035);
  font-size: 12px;
  transition:
    color var(--dur-fast) var(--motion-standard),
    border-color var(--dur-fast) var(--motion-standard),
    background-color var(--dur-fast) var(--motion-standard);
}

.admin-secondary-btn:hover,
.admin-ghost-btn:hover {
  border-color: rgba(115, 170, 244, 0.34);
  color: #edf5ff;
  background: rgba(78, 130, 201, 0.1);
}

.admin-dashboard-main {
  width: min(1540px, 100%);
  padding: 26px 30px 64px;
}

.admin-module.is-active {
  gap: 16px;
}

.admin-metrics {
  gap: 12px;
}

.admin-metric-card {
  position: relative;
  min-height: 112px;
  padding: 18px 19px;
  overflow: hidden;
  border-color: var(--admin-line);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(18, 27, 42, 0.88), rgba(12, 19, 30, 0.84));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.admin-metric-card::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -34px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: rgba(84, 147, 233, 0.08);
  filter: blur(2px);
}

.admin-metric-card:nth-child(2)::after {
  background: rgba(62, 210, 155, 0.08);
}

.admin-metric-card:nth-child(3)::after {
  background: rgba(118, 105, 232, 0.1);
}

.admin-metric-card:nth-child(4)::after {
  background: rgba(52, 198, 211, 0.08);
}

.admin-metric-card span {
  color: #778aa6;
  font-size: 11px;
}

.admin-metric-card strong {
  position: relative;
  z-index: 1;
  margin-top: 17px;
  font-size: 29px;
  font-weight: 730;
}

.admin-console--dashboard .admin-panel {
  padding: 22px;
  border-color: var(--admin-line);
  border-radius: 12px;
  background: var(--admin-surface-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025), 0 18px 44px rgba(0, 0, 0, 0.09);
}

.admin-panel-head {
  margin-bottom: 20px;
}

.admin-console--dashboard .admin-panel h2 {
  color: #edf4ff;
  font-size: 17px;
  font-weight: 720;
}

.admin-console--dashboard .admin-panel p {
  margin-top: 7px;
  color: #788ba6;
  font-size: 12px;
}

.admin-form {
  gap: 12px;
}

.admin-form--tenant-create {
  grid-template-columns: 1.15fr 1.35fr 0.9fr 0.85fr 0.72fr auto;
}

.admin-form--invite {
  grid-template-columns: minmax(280px, 520px) max-content;
  align-items: end;
}

.admin-form label {
  gap: 7px;
  color: #8496b0;
  font-size: 11px;
}

.admin-form input,
.admin-form select {
  height: 44px;
  border-color: var(--admin-line);
  border-radius: 9px;
  color: #edf5ff;
  background-color: rgba(6, 11, 19, 0.6);
}

.admin-form input:hover,
.admin-form select:hover {
  border-color: rgba(132, 168, 219, 0.26);
}

.admin-form input:focus,
.admin-form select:focus {
  border-color: rgba(101, 165, 255, 0.62);
  box-shadow: 0 0 0 3px rgba(65, 135, 228, 0.12);
}

.admin-primary-btn {
  height: 44px;
  padding: 0 17px;
  border: 1px solid rgba(130, 187, 255, 0.25);
  border-radius: 9px;
  background: linear-gradient(135deg, #3979d6, #2b9fa7);
  box-shadow: 0 10px 26px rgba(33, 104, 183, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  font-size: 12px;
}

.admin-primary-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.admin-table {
  border: 1px solid var(--admin-line);
  border-radius: 10px;
  background: rgba(7, 12, 20, 0.32);
}

.admin-console--dashboard .admin-table th,
.admin-console--dashboard .admin-table td {
  padding: 14px 13px;
  border-bottom-color: rgba(145, 169, 206, 0.09);
}

.admin-console--dashboard .admin-table th {
  color: #6f829e;
  background: rgba(20, 29, 44, 0.62);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.04em;
}

.admin-console--dashboard .admin-table td {
  color: #b8c6d9;
  font-size: 12px;
}

.admin-console--dashboard .admin-table td strong {
  color: #e3edf9;
  font-weight: 680;
}

.admin-console--dashboard .admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-console--dashboard .admin-table tbody tr:hover {
  background: rgba(80, 132, 204, 0.045);
}

.admin-row-btn {
  height: 32px;
  padding: 0 10px;
  border-color: var(--admin-line);
  border-radius: 7px;
  color: #9fb2ca;
  background: rgba(255, 255, 255, 0.035);
  font-size: 10px;
}

.admin-row-btn:hover:not(:disabled) {
  border-color: rgba(103, 166, 251, 0.34);
  color: #edf5ff;
  background: rgba(62, 126, 214, 0.1);
}

.admin-row-btn--danger:hover:not(:disabled) {
  border-color: rgba(238, 111, 92, 0.32);
  color: #ffc0b2;
  background: rgba(199, 71, 49, 0.09);
}

.admin-status-pill {
  height: 23px;
  padding: 0 8px;
  font-size: 10px;
}

.admin-status-pill[data-state="approved"] {
  color: #b9f4dd;
  background: rgba(53, 170, 119, 0.13);
}

.admin-status-pill[data-state="rejected"] {
  color: #ffc4ba;
  background: rgba(208, 82, 64, 0.13);
}

.admin-cell-sub {
  color: #637590;
  font-size: 10px;
}

.admin-inline-editor input {
  border-color: var(--admin-line);
  background: rgba(6, 11, 19, 0.62);
}

.admin-pricing-form {
  grid-template-columns: 0.7fr 1.15fr 1fr 1fr 1fr auto;
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--admin-line);
}

.admin-embedded-settings-shell {
  min-height: 620px;
  border-color: var(--admin-line);
  border-radius: 12px;
  background: var(--admin-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 22px 52px rgba(0, 0, 0, 0.12);
}

/* ===== AIS operations console ===== */
.admin-sidebar {
  overflow-y: auto;
}

.admin-operations-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 16px;
}

.admin-metric-card--danger::after {
  background: rgba(238, 88, 77, 0.12);
}

.admin-toolbar {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-toolbar input,
.admin-toolbar select {
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  color: var(--admin-text);
  background: rgba(6, 11, 19, 0.62);
  outline: none;
}

.admin-toolbar input {
  width: min(260px, 32vw);
}

.admin-toolbar select {
  min-width: 112px;
}

.admin-toolbar--trial input[type="date"] {
  width: 142px;
}

.admin-toolbar input:focus,
.admin-toolbar select:focus {
  border-color: rgba(101, 165, 255, 0.62);
  box-shadow: 0 0 0 3px rgba(65, 135, 228, 0.12);
}

.admin-alert-list,
.admin-health-list {
  display: grid;
  gap: 9px;
}

.admin-alert-item,
.admin-health-item {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--admin-line);
  border-radius: 10px;
  background: rgba(6, 11, 19, 0.42);
}

.admin-alert-item {
  justify-content: space-between;
  border-left: 3px solid #e5a05f;
}

.admin-alert-item[data-severity="critical"] {
  border-left-color: #ef6f65;
  background: rgba(107, 34, 31, 0.14);
}

.admin-alert-item > div,
.admin-health-item > div {
  min-width: 0;
  flex: 1 1 auto;
}

.admin-alert-item span {
  display: block;
  margin-bottom: 5px;
  color: #e7a96d;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.admin-alert-item strong,
.admin-health-item strong {
  display: block;
  overflow: hidden;
  color: #e8f1fd;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-alert-item p,
.admin-health-item p {
  margin: 5px 0 0;
  color: #7488a5;
  font-size: 10px;
  line-height: 1.5;
}

.admin-health-item time {
  flex: 0 0 auto;
  color: #5f718b;
  font-size: 9px;
}

.admin-health-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #65738a;
  box-shadow: 0 0 0 4px rgba(101, 115, 138, 0.1);
}

.admin-health-dot[data-state="success"] {
  background: #54d3a1;
  box-shadow: 0 0 0 4px rgba(84, 211, 161, 0.1);
}

.admin-health-dot[data-state="error"] {
  background: #ef7169;
  box-shadow: 0 0 0 4px rgba(239, 113, 105, 0.1);
}

.admin-empty-state--compact {
  padding: 24px 12px;
}

.admin-bulk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: -4px 0 16px;
  padding: 10px;
  border: 1px solid var(--admin-line);
  border-radius: 10px;
  background: rgba(6, 11, 19, 0.36);
}

.admin-bulk-bar span {
  margin-right: auto;
  color: #8397b1;
  font-size: 11px;
}

.admin-bulk-bar select {
  height: 38px;
  min-width: 150px;
  padding: 0 11px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  color: var(--admin-text);
  background: rgba(6, 11, 19, 0.62);
}

.admin-table tbody tr.is-unread {
  background: rgba(92, 153, 237, 0.055);
}

.admin-table input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #5fa8ff;
}

.admin-link-btn {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.admin-link-btn:hover strong {
  color: #79b9ff;
}

.admin-budget-meter {
  min-width: 92px;
  display: grid;
  gap: 5px;
}

.admin-budget-meter > span {
  width: 100%;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.admin-budget-meter i {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #4e8fe5, #57cbc1);
}

.admin-budget-meter[data-state="warning"] i {
  background: #e4a15f;
}

.admin-budget-meter[data-state="critical"] i {
  background: #eb6e65;
}

.admin-budget-meter strong {
  color: #8ea1ba !important;
  font-size: 10px;
}

.admin-settings-history-panel {
  margin-top: 16px;
}

.admin-detail-open {
  overflow: hidden;
}

.admin-detail-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: flex-end;
}

.admin-detail-dialog.hidden {
  display: none;
}

.admin-detail-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 6, 12, 0.66);
  backdrop-filter: blur(5px);
}

.admin-detail-sheet {
  position: relative;
  width: min(880px, 92vw);
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--admin-line-strong);
  background: #0c131f;
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.38);
}

.admin-detail-sheet--compact {
  width: min(680px, 92vw);
}

.admin-detail-head {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 22px;
  border-bottom: 1px solid var(--admin-line);
}

.admin-detail-head span {
  color: #5f7593;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.admin-detail-head h2 {
  margin: 5px 0 0;
  color: var(--admin-text);
  font-size: 19px;
}

.admin-detail-close {
  width: 38px;
  height: 38px;
  border: 1px solid var(--admin-line);
  border-radius: 9px;
  color: #9cb0c9;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  font-size: 22px;
}

.admin-detail-content {
  overflow-y: auto;
  padding: 20px 22px 52px;
}

.admin-detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.admin-detail-metrics article {
  padding: 15px;
  border: 1px solid var(--admin-line);
  border-radius: 10px;
  background: rgba(18, 27, 42, 0.72);
}

.admin-detail-metrics span {
  color: #7286a2;
  font-size: 10px;
}

.admin-detail-metrics strong {
  display: block;
  margin-top: 8px;
  color: #e8f1fd;
  font-size: 18px;
}

.admin-detail-section {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--admin-line);
  border-radius: 11px;
  background: rgba(15, 23, 36, 0.7);
}

.admin-detail-section h3 {
  margin: 0;
  color: #e7f0fc;
  font-size: 15px;
}

.admin-budget-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 10px;
}

.admin-budget-form label {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: #8194ae;
  font-size: 10px;
}

.admin-budget-form input,
.admin-budget-form select {
  width: 100%;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  color: var(--admin-text);
  background: rgba(6, 11, 19, 0.62);
  outline: none;
}

.admin-trial-approve-form {
  display: block;
}

.admin-trial-applicant-summary {
  display: grid;
  gap: 6px;
}

.admin-trial-applicant-summary strong {
  color: #eaf3ff;
  font-size: 18px;
}

.admin-trial-applicant-summary span,
.admin-trial-applicant-summary small {
  color: #7e92ad;
  font-size: 12px;
}

.admin-choice-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.admin-choice-tabs label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--admin-line);
  border-radius: 10px;
  color: #b8c8dc;
  background: rgba(6, 11, 19, 0.42);
  cursor: pointer;
  font-size: 12px;
}

.admin-trial-approve-pane {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-trial-approve-pane.hidden {
  display: none;
}

.admin-trial-approve-pane label {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: #8194ae;
  font-size: 10px;
}

.admin-trial-approve-pane input,
.admin-trial-approve-pane select {
  width: 100%;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  color: var(--admin-text);
  background: rgba(6, 11, 19, 0.62);
  outline: none;
}

.admin-trial-approve-form .admin-form-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 18px -22px -52px;
  padding: 16px 22px;
  border-top: 1px solid var(--admin-line);
  background: rgba(12, 19, 31, 0.96);
}

@media (max-width: 1120px) {
  .admin-operations-grid {
    grid-template-columns: 1fr;
  }

  .admin-panel-head {
    align-items: flex-start;
  }

  .admin-budget-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .admin-toolbar {
    width: 100%;
    justify-content: flex-start;
  }

  .admin-toolbar input {
    width: 100%;
  }

  .admin-detail-sheet {
    width: 100vw;
  }

  .admin-detail-metrics,
  .admin-budget-form,
  .admin-trial-approve-pane {
    grid-template-columns: 1fr;
  }
}

.admin-embedded-settings .settings-main {
  min-height: 620px;
}

.admin-settings-toolbar {
  position: sticky;
  top: 78px;
  z-index: 8;
  min-height: 76px;
  padding: 15px 20px;
  border-bottom-color: var(--admin-line);
  background: rgba(15, 22, 34, 0.94);
  backdrop-filter: blur(18px);
}

.admin-settings-toolbar > div:first-child {
  min-width: 160px;
}

.admin-settings-toolbar-label {
  color: #526783;
}

.admin-settings-toolbar h3 {
  font-size: 16px;
}

.admin-embedded-settings .settings-tabs--top {
  gap: 6px;
}

.admin-embedded-settings .settings-tab {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 12px;
}

.admin-embedded-settings .settings-tab.is-active {
  border-color: rgba(102, 166, 255, 0.34);
  background: rgba(65, 125, 207, 0.16);
  box-shadow: none;
}

.admin-embedded-settings .settings-content {
  min-height: 468px;
  padding: 24px;
}

.admin-embedded-settings .field span {
  color: #8496af;
  font-size: 11px;
}

.admin-embedded-settings .field input,
.admin-embedded-settings .field select,
.admin-embedded-settings .settings-textarea {
  border-color: var(--admin-line);
  border-radius: 9px;
  background: rgba(6, 11, 19, 0.55);
}

.admin-embedded-settings .settings-model-tab-strip {
  border-bottom-color: var(--admin-line);
}

.admin-embedded-settings .settings-model-tab-strip .settings-tab {
  border-radius: 8px;
}

.admin-embedded-settings .settings-prompt-template-item {
  border-radius: 10px;
  background: rgba(7, 12, 20, 0.5);
}

.admin-embedded-settings .settings-save-row {
  min-height: 58px;
  border-top-color: var(--admin-line);
  background: rgba(8, 13, 21, 0.46);
}

.admin-status--floating {
  border-color: var(--admin-line-strong);
  border-radius: 10px;
  background: rgba(13, 20, 31, 0.96);
}

@media (max-width: 1260px) {
  .admin-console--dashboard {
    grid-template-columns: 224px minmax(0, 1fr);
  }

  .admin-form--tenant-create,
  .admin-pricing-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-form--tenant-create .admin-primary-btn,
  .admin-pricing-form .admin-form-actions {
    width: fit-content;
  }
}

@media (max-width: 900px) {
  .admin-console--dashboard {
    display: block;
  }

  .admin-sidebar {
    position: relative;
    width: 100%;
    height: auto;
    padding: 16px;
  }

  .admin-sidebar-brand {
    padding-bottom: 16px;
  }

  .admin-sidebar-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-nav-item::before {
    display: none;
  }

  .admin-dashboard-topbar {
    position: relative;
  }

  .admin-settings-toolbar {
    top: 0;
  }
}

@media (max-width: 680px) {
  .admin-sidebar-nav {
    grid-template-columns: 1fr 1fr;
  }

  .admin-dashboard-topbar,
  .admin-dashboard-main {
    padding-right: 16px;
    padding-left: 16px;
  }

  .admin-metrics,
  .admin-form--tenant-create,
  .admin-pricing-form,
  .admin-form--invite {
    grid-template-columns: 1fr;
  }

  .admin-current-admin {
    min-width: 0;
    flex: 1 1 100%;
  }

  .admin-current-admin-copy strong {
    max-width: calc(100vw - 120px);
  }

  .admin-form--tenant-create .admin-primary-btn,
  .admin-pricing-form .admin-form-actions,
  .admin-form--invite .admin-primary-btn {
    width: 100%;
  }
}

/* ===== Immersive auth surface ===== */
.auth-document,
body[data-app-mode="auth"] {
  min-width: 0;
}

body[data-app-mode="auth"] {
  overflow: hidden;
  background: #02050b;
}

.auth-fluid-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  display: block;
  opacity: 0;
  filter: blur(1px) saturate(0.78) brightness(0.78);
  transform: scale(1.015);
  pointer-events: none;
  transition: opacity 900ms ease;
}

.auth-fluid-ready .auth-fluid-canvas {
  opacity: 0.74;
}

body[data-auth-context="admin"].auth-fluid-ready .auth-fluid-canvas {
  opacity: 0.96;
  filter: blur(0.35px) saturate(1.18) contrast(1.34) brightness(0.82);
}

.auth-fluid-fallback .auth-fluid-canvas {
  display: none;
}

.auth-ambient-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(1, 4, 10, 0.68) 0%, rgba(1, 4, 10, 0.24) 48%, rgba(1, 4, 10, 0.32) 74%, rgba(1, 4, 10, 0.52) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.08) 0%, rgba(1, 5, 12, 0.01) 54%, rgba(0, 0, 0, 0.4) 100%),
    radial-gradient(circle at 72% 52%, rgba(32, 96, 168, 0.06), transparent 38%);
}

body[data-auth-context="admin"] .auth-ambient-overlay {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.82) 0%, rgba(15, 0, 0, 0.28) 46%, rgba(11, 0, 0, 0.36) 72%, rgba(0, 0, 0, 0.74) 100%),
    radial-gradient(ellipse at 22% 28%, rgba(255, 0, 0, 0.14), transparent 34%),
    radial-gradient(ellipse at 78% 70%, rgba(142, 0, 0, 0.22), transparent 42%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.62));
}

.auth-fluid-fallback .auth-ambient-overlay {
  background:
    radial-gradient(ellipse at 72% 84%, rgba(38, 102, 179, 0.34), transparent 42%),
    radial-gradient(ellipse at 86% 72%, rgba(97, 48, 148, 0.2), transparent 34%),
    linear-gradient(135deg, #02050b 0%, #07101e 56%, #02040a 100%);
}

.auth-page {
  position: relative;
  z-index: 3;
  width: 100%;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  place-items: stretch;
  gap: 24px;
  padding: clamp(22px, 3vw, 42px) clamp(22px, 4.5vw, 72px) 26px;
}

.auth-topbar,
.auth-footer {
  width: min(1480px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-topbar {
  min-height: 42px;
}

.auth-brand {
  gap: 12px;
  margin: 0;
}

.auth-brand-name {
  color: #f5f8ff;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.045em;
}

.auth-context-badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(185, 210, 242, 0.18);
  border-radius: 999px;
  color: #b9c9df;
  background: rgba(13, 21, 33, 0.38);
  backdrop-filter: blur(12px);
}

body[data-auth-context="admin"] .auth-topbar {
  justify-content: flex-end;
}

body[data-auth-context="admin"] .auth-brand,
body[data-auth-context="admin"] .auth-intro--app,
body[data-auth-context="app"] .auth-intro--admin {
  display: none;
}

.auth-topbar-note,
.auth-footer {
  color: rgba(181, 199, 222, 0.54);
  font: 10px/1.2 var(--font-mono);
  letter-spacing: 0.14em;
}

.auth-layout {
  width: min(1480px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(400px, 520px);
  align-items: center;
  gap: clamp(56px, 10vw, 168px);
}

.auth-intro {
  max-width: 710px;
  align-self: center;
  padding-bottom: 4vh;
}

.auth-intro--admin h1 {
  max-width: 720px;
  margin: 0 0 24px;
  color: #f5f8ff;
  font-size: clamp(52px, 5.6vw, 86px);
  font-weight: 520;
  line-height: 1.02;
  letter-spacing: -0.06em;
  text-wrap: balance;
  text-shadow: 0 10px 44px rgba(63, 132, 222, 0.16);
}

.auth-admin-tagline {
  margin: 0;
  color: rgba(214, 226, 242, 0.72);
  font-size: clamp(17px, 1.4vw, 21px);
  line-height: 1.7;
  letter-spacing: 0.08em;
}

.auth-eyebrow,
.auth-step {
  margin: 0;
  color: rgba(166, 193, 225, 0.68);
  font: 10px/1.3 var(--font-mono);
  letter-spacing: 0.16em;
}

.auth-intro--app h1 {
  max-width: 700px;
  margin: 22px 0 24px;
  color: #f5f8ff;
  font-size: clamp(52px, 6.2vw, 92px);
  font-weight: 520;
  line-height: 0.98;
  letter-spacing: -0.065em;
  text-wrap: balance;
  text-shadow: 0 10px 44px rgba(63, 132, 222, 0.16);
}

.auth-intro-copy {
  max-width: 580px;
  margin: 0;
  color: rgba(214, 226, 242, 0.72);
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.85;
}

.auth-capabilities {
  max-width: 700px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: clamp(44px, 8vh, 84px);
  border-top: 1px solid rgba(177, 204, 237, 0.16);
}

.auth-capabilities span {
  min-height: 54px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-right: 1px solid rgba(177, 204, 237, 0.12);
  color: rgba(218, 230, 246, 0.75);
  font-size: 12px;
  font-weight: 650;
}

.auth-capabilities span:first-child {
  padding-left: 0;
}

.auth-capabilities span:last-child {
  border-right: 0;
}

.auth-card {
  width: min(520px, 100%);
  padding: 18px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.auth-card-heading {
  margin-bottom: 30px;
}

.auth-card h2 {
  margin: 12px 0 10px;
  color: #f3f7ff;
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 560;
  line-height: 1.1;
  letter-spacing: -0.045em;
}

.auth-copy {
  max-width: 420px;
  margin: 0;
  color: rgba(176, 195, 220, 0.68);
  font-size: 13px;
  line-height: 1.7;
}

.auth-form {
  gap: 18px;
}

.auth-field {
  gap: 9px;
  color: rgba(194, 210, 230, 0.78);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.auth-field input {
  height: 50px;
  padding: 0 15px;
  border-color: rgba(171, 199, 234, 0.16);
  border-radius: 7px;
  color: #f2f7ff;
  background: rgba(5, 10, 18, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(12px);
  transition:
    border-color var(--dur-fast) var(--motion-standard),
    background-color var(--dur-fast) var(--motion-standard),
    box-shadow var(--dur-fast) var(--motion-standard);
}

.auth-field input::placeholder {
  color: rgba(136, 155, 181, 0.52);
}

.auth-field input:hover {
  border-color: rgba(172, 204, 243, 0.28);
  background: rgba(7, 14, 25, 0.62);
}

.auth-field input:focus {
  border-color: rgba(116, 182, 255, 0.68);
  background: rgba(7, 14, 25, 0.76);
  box-shadow: 0 0 0 3px rgba(55, 137, 230, 0.14), 0 14px 34px rgba(0, 0, 0, 0.16);
}

.auth-captcha-row,
.auth-code-row {
  display: grid;
  align-items: end;
  gap: 12px;
}

.auth-captcha-row {
  grid-template-columns: minmax(0, 1fr) 142px;
}

.auth-code-row {
  grid-template-columns: minmax(0, 1fr) 126px;
}

.auth-captcha-box {
  width: 142px;
  height: 50px;
  border-color: rgba(171, 199, 234, 0.2);
  border-radius: 7px;
  background: rgba(6, 12, 22, 0.58);
  backdrop-filter: blur(12px);
  transition:
    border-color var(--dur-fast) var(--motion-standard),
    background-color var(--dur-fast) var(--motion-standard);
}

.auth-captcha-box:hover {
  border-color: rgba(116, 182, 255, 0.5);
  background: rgba(13, 25, 42, 0.76);
}

.auth-captcha-box:focus-visible,
.auth-secondary-btn:focus-visible,
.auth-primary-btn:focus-visible {
  outline: 2px solid rgba(133, 194, 255, 0.88);
  outline-offset: 3px;
}

.auth-captcha-box svg {
  width: 140px;
  height: 48px;
}

body[data-auth-context="admin"] .auth-captcha-box {
  overflow: hidden;
  border-color: rgba(255, 255, 255, 0.72);
  background: #f8fafc;
  box-shadow: 0 8px 24px rgba(2, 0, 12, 0.28), 0 0 0 1px rgba(255, 65, 154, 0.12);
  transition: border-color var(--dur-fast) var(--motion-standard);
}

body[data-auth-context="admin"] .auth-captcha-box:hover {
  border-color: #ffffff;
  background: #ffffff;
}

body[data-auth-context="admin"] .auth-captcha-box:disabled {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.72);
  background: #f8fafc;
  cursor: progress;
}

body[data-auth-context="admin"] .auth-captcha-box svg {
  display: block;
  filter: contrast(1.45);
}

.auth-secondary-btn,
.auth-primary-btn {
  height: 50px;
  border-radius: 7px;
}

.auth-secondary-btn {
  width: 126px;
  border-color: rgba(171, 199, 234, 0.2);
  color: rgba(225, 236, 250, 0.86);
  background: rgba(8, 15, 26, 0.58);
  backdrop-filter: blur(12px);
  transition:
    border-color var(--dur-fast) var(--motion-standard),
    background-color var(--dur-fast) var(--motion-standard),
    color var(--dur-fast) var(--motion-standard);
}

.auth-secondary-btn:hover:not(:disabled) {
  border-color: rgba(116, 182, 255, 0.48);
  color: #ffffff;
  background: rgba(17, 35, 58, 0.74);
}

.auth-primary-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding: 0 18px;
  border: 1px solid rgba(160, 207, 255, 0.28);
  color: #f8fbff;
  background: linear-gradient(100deg, rgba(38, 105, 197, 0.88), rgba(28, 154, 176, 0.8));
  box-shadow: 0 16px 44px rgba(20, 93, 182, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition:
    filter var(--dur-fast) var(--motion-standard),
    transform var(--dur-fast) var(--motion-standard),
    box-shadow var(--dur-fast) var(--motion-standard);
}

.auth-primary-btn:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 20px 50px rgba(20, 105, 194, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.auth-primary-btn:active:not(:disabled) {
  transform: translateY(0);
}

body[data-auth-context="app"] .auth-captcha-row {
  grid-template-columns: minmax(0, 1fr) 154px;
}

body[data-auth-context="app"] .auth-captcha-box {
  width: 154px;
  height: 54px;
  padding: 0;
  overflow: hidden;
  border-color: rgba(204, 220, 239, 0.78);
  background: #f8fafc;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.9);
}

body[data-auth-context="app"] .auth-captcha-box:hover {
  border-color: rgba(116, 182, 255, 0.9);
  background: #ffffff;
  box-shadow:
    0 10px 30px rgba(17, 84, 159, 0.24),
    inset 0 0 0 1px #ffffff;
}

body[data-auth-context="app"] .auth-captcha-box:disabled {
  opacity: 1;
  background: #f8fafc;
  cursor: progress;
}

body[data-auth-context="app"] .auth-captcha-box svg {
  width: 152px;
  height: 52px;
  display: block;
}

body[data-auth-context="app"] .auth-captcha-box svg rect {
  fill: #f8fafc !important;
}

body[data-auth-context="app"] .auth-captcha-box svg path[fill="none"] {
  stroke: #93a6bc !important;
  opacity: 0.5;
}

body[data-auth-context="app"] .auth-captcha-box svg path:not([fill="none"]) {
  fill: #122b4d !important;
}

body[data-auth-context="app"] .auth-secondary-btn {
  border-color: rgba(171, 199, 234, 0.2);
  color: rgba(225, 236, 250, 0.86);
  background: rgba(8, 15, 26, 0.58);
  box-shadow: none;
  animation: none;
}

body[data-auth-context="app"] .auth-secondary-btn:hover:not(:disabled) {
  border-color: rgba(116, 182, 255, 0.48);
  color: #ffffff;
  background: rgba(17, 35, 58, 0.74);
  filter: none;
}

body[data-auth-context="app"] .auth-primary-btn {
  border-color: rgba(160, 207, 255, 0.34);
  background: linear-gradient(105deg, #2d65df, #7148da, #16a7bd, #286ce4, #2d65df);
  background-size: 320% 100%;
  box-shadow:
    0 16px 44px rgba(20, 93, 182, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  animation: auth-workstation-gradient 8s linear infinite;
}

body[data-auth-context="app"] .auth-primary-btn:disabled {
  animation-play-state: paused;
}

@keyframes auth-workstation-gradient {
  to {
    background-position: 320% 50%;
  }
}

body[data-auth-context="admin"] .auth-primary-btn {
  border-color: rgba(255, 80, 80, 0.42);
  background:
    linear-gradient(105deg, #2a0000, #8b0000, #ff1a12, #bd0000, #3b0000, #2a0000);
  background-size: 320% 100%;
  box-shadow:
    0 18px 48px rgba(185, 0, 0, 0.34),
    0 8px 24px rgba(255, 24, 12, 0.18),
    inset 0 1px 0 rgba(255, 170, 160, 0.2);
  animation: auth-admin-gradient 7s linear infinite;
}

body[data-auth-context="admin"] .auth-primary-btn:hover:not(:disabled) {
  filter: saturate(1.12) brightness(1.12);
  box-shadow:
    0 22px 58px rgba(205, 0, 0, 0.42),
    0 10px 30px rgba(255, 40, 24, 0.22),
    inset 0 1px 0 rgba(255, 190, 180, 0.26);
}

@keyframes auth-admin-gradient {
  to {
    background-position: 320% 50%;
  }
}

.auth-status {
  min-height: 20px;
  margin: 16px 0 0;
  font-size: 12px;
}

.trial-dialog-open {
  overflow: hidden;
}

.trial-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.trial-dialog.hidden {
  display: none;
}

.trial-dialog-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(1, 1, 1, 0.72);
  backdrop-filter: blur(18px);
}

.trial-dialog-card {
  position: relative;
  width: min(100%, 520px);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(16, 18, 23, 0.98), rgba(7, 8, 11, 0.98)), #07080b;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.52);
  padding: 26px;
}

.trial-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.trial-dialog-head h2 {
  margin: 6px 0 0;
  font-size: 24px;
  line-height: 1.2;
  color: #f7f8fb;
}

.trial-dialog-close {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #f7f8fb;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.trial-form {
  gap: 14px;
}

.trial-fallback {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 20px;
  color: rgba(241, 247, 255, 0.58);
}

.trial-fallback a {
  color: #ff8585;
  text-decoration: none;
}

.auth-footer {
  min-height: 24px;
  padding-top: 14px;
  border-top: 1px solid rgba(177, 204, 237, 0.1);
  letter-spacing: 0.1em;
}

@media (max-width: 980px) {
  body[data-app-mode="auth"] {
    overflow: auto;
  }

  .auth-page {
    min-height: 100svh;
  }

  .auth-layout {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 46px;
    padding: 42px 0;
  }

  .auth-intro {
    max-width: 680px;
    padding-bottom: 0;
  }

  .auth-intro--admin h1,
  .auth-intro--app h1 {
    max-width: 620px;
    font-size: clamp(48px, 10vw, 76px);
  }

  .auth-capabilities {
    margin-top: 38px;
  }

  .auth-card {
    max-width: 620px;
    padding: 34px 0 0;
    border-top: 1px solid rgba(177, 204, 237, 0.18);
  }
}

@media (max-width: 560px) {
  .auth-page {
    gap: 16px;
    padding: 18px 18px 20px;
  }

  .auth-topbar-note,
  .auth-footer span:last-child {
    display: none;
  }

  .auth-layout {
    gap: 34px;
    padding: 30px 0;
  }

  .auth-intro--admin h1,
  .auth-intro--app h1 {
    margin-bottom: 16px;
    font-size: 44px;
  }

  .auth-admin-tagline {
    font-size: 15px;
  }

  .auth-intro-copy {
    font-size: 14px;
    line-height: 1.7;
  }

  .auth-capabilities {
    grid-template-columns: 1fr;
    margin-top: 30px;
  }

  .auth-capabilities span {
    min-height: 38px;
    padding: 0;
    border-right: 0;
    border-bottom: 1px solid rgba(177, 204, 237, 0.08);
  }

  .auth-card {
    padding: 28px 0 0;
  }

  .auth-card-heading {
    margin-bottom: 24px;
  }

  .auth-captcha-row,
  .auth-code-row {
    grid-template-columns: 1fr;
  }

  .auth-captcha-box,
  .auth-secondary-btn {
    width: 100%;
  }

  .auth-captcha-box svg {
    width: 100%;
  }

  body[data-auth-context="app"] .auth-captcha-box {
    width: 100%;
  }

  body[data-auth-context="app"] .auth-captcha-box svg {
    width: 100%;
  }

  .auth-footer {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-fluid-canvas,
  .auth-primary-btn,
  .auth-field input {
    transition: none;
  }

  body[data-auth-context="app"] .auth-primary-btn,
  body[data-auth-context="admin"] .auth-primary-btn {
    animation: none;
  }
}

.workspace-account-list {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.workspace-private-api-form {
  display: grid;
  gap: 14px;
}

.workspace-private-api-form fieldset {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 18px;
  border: 1px solid rgba(145, 169, 206, 0.13);
  border-radius: 9px;
  background: rgba(7, 12, 22, 0.34);
}

.workspace-private-api-form legend {
  padding: 0 8px;
  color: #dce8f8;
  font-size: 13px;
  font-weight: 800;
}

.workspace-private-api-form label {
  min-width: 0;
  display: grid;
  gap: 8px;
  color: #8fa0bb;
  font-size: 12px;
  font-weight: 700;
}

.workspace-private-api-form input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(145, 169, 206, 0.18);
  border-radius: 8px;
  color: #eef6ff;
  background: rgba(7, 12, 22, 0.72);
  outline: none;
}

.workspace-private-api-form input:focus {
  border-color: rgba(99, 164, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(51, 127, 225, 0.18);
}

.workspace-private-api-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.workspace-private-api-actions span {
  color: #72839d;
  font-size: 12px;
}

.workspace-usage-filter {
  grid-template-columns: repeat(2, minmax(0, 220px)) auto;
  align-items: end;
  margin-bottom: 18px;
}

.workspace-usage-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.workspace-usage-metrics article {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(145, 169, 206, 0.13);
  border-radius: 8px;
  background: rgba(7, 12, 22, 0.42);
}

.workspace-usage-metrics span {
  display: block;
  color: #8293ae;
  font-size: 11px;
}

.workspace-usage-metrics strong {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  color: #eef6ff;
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-usage-detail-head {
  margin-top: 28px;
}

.workspace-usage-detail-head h3 {
  margin: 0;
  color: #edf5ff;
  font-size: 16px;
}

@media (max-width: 900px) {
  .workspace-account-list,
  .workspace-private-api-form fieldset,
  .admin-pricing-form,
  .workspace-usage-filter {
    grid-template-columns: 1fr;
  }

  .workspace-usage-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Refined canvas node picker */
.floating-menu {
  width: min(380px, calc(100vw - 32px));
  min-width: 0;
  padding: 14px;
  gap: 13px;
  border: 1px solid rgba(157, 181, 219, 0.2);
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% 4%, rgba(64, 142, 234, 0.16), transparent 34%),
    linear-gradient(155deg, #1a2230, #10151e);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(22px) saturate(135%);
}

.floating-menu__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 3px 5px 1px;
}

.floating-menu__eyebrow {
  display: block;
  margin-bottom: 6px;
  color: #6382aa;
  font: 9px/1.2 var(--font-mono);
  letter-spacing: 0.16em;
}

.floating-menu .floating-menu__head h4 {
  margin: 0;
  color: #f3f7fd;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.floating-menu__head p {
  margin: 5px 0 0;
  color: #7f8fa7;
  font-size: 11px;
}

.floating-menu__head kbd {
  min-width: 34px;
  height: 23px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(154, 176, 208, 0.18);
  border-radius: 6px;
  color: #6f819b;
  background: rgba(255, 255, 255, 0.035);
  font: 8px/1 var(--font-mono);
  letter-spacing: 0.08em;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}

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

.floating-menu .menu-item {
  width: 100%;
  min-height: 76px;
  margin: 0;
  padding: 12px;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(150, 174, 210, 0.14);
  border-radius: 12px;
  color: #dce7f7;
  background: linear-gradient(145deg, rgba(47, 57, 73, 0.52), rgba(29, 35, 46, 0.56));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.floating-menu .menu-item[data-type="image-edit"] {
  grid-column: 1 / -1;
}

.floating-menu .menu-item__icon {
  width: 30px;
  min-width: 30px;
  height: 30px;
  border: 1px solid rgba(102, 166, 246, 0.22);
  border-radius: 9px;
  color: #7eb8ff;
  background: rgba(54, 121, 207, 0.13);
}

.floating-menu .menu-item__icon svg {
  width: 16px;
  height: 16px;
}

.menu-item__copy {
  min-width: 0;
  display: grid;
  gap: 5px;
  align-content: center;
}

.floating-menu .menu-item__label {
  color: inherit;
  font-size: 12px;
  font-weight: 800;
}

.floating-menu .menu-item small {
  overflow: hidden;
  color: #7889a1;
  font-size: 9px;
  font-weight: 550;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-menu .menu-item:hover:not(:disabled) {
  border-color: rgba(97, 163, 249, 0.42);
  color: #f7fbff;
  background: linear-gradient(145deg, rgba(57, 92, 139, 0.44), rgba(31, 51, 78, 0.52));
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(166, 207, 255, 0.08);
  transform: translateY(-1px);
}

.floating-menu .menu-item:hover:not(:disabled) .menu-item__icon {
  color: #c5e1ff;
  border-color: rgba(111, 179, 255, 0.46);
  background: rgba(62, 133, 224, 0.22);
}

.floating-menu .menu-item:disabled {
  filter: grayscale(0.45);
}

/* Workspace organization and member usage refinements */
.workspace-account-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workspace-compute-mode {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.workspace-compute-mode__icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid rgba(87, 157, 247, 0.3);
  border-radius: 10px;
  color: #83bcff;
  background: rgba(49, 116, 205, 0.12);
}

.workspace-compute-mode[data-mode="private"] .workspace-compute-mode__icon {
  border-color: rgba(54, 211, 180, 0.3);
  color: #79dec9;
  background: rgba(38, 158, 135, 0.12);
}

.workspace-compute-mode svg,
.admin-compute-switch svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace-compute-mode > span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.workspace-compute-mode strong {
  color: #eaf3ff;
  font-size: 12px;
}

.workspace-compute-mode small {
  color: #71839e;
  font-size: 9px;
  white-space: nowrap;
}

.workspace-invite-form {
  grid-template-columns: 1fr 1.25fr 0.85fr auto;
  align-items: end;
}

.workspace-usage-filter {
  grid-template-columns: minmax(180px, 1fr) repeat(2, minmax(0, 220px)) auto;
}

.workspace-member-name-editor,
.workspace-member-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.workspace-member-name-editor input {
  width: 156px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid rgba(145, 169, 206, 0.18);
  border-radius: 7px;
  color: #eef6ff;
  background: rgba(7, 12, 22, 0.72);
  outline: none;
}

.workspace-member-name-editor input:focus {
  border-color: rgba(82, 156, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(48, 126, 230, 0.14);
}

.admin-compute-switch {
  min-width: 142px;
  height: 36px;
  padding: 0 11px 0 7px;
}

.admin-compute-switch > span {
  width: 25px;
  height: 25px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #84bdff;
  background: rgba(74, 156, 255, 0.12);
  box-shadow: none;
}

.admin-compute-switch.is-private > span {
  color: #79dec9;
  background: rgba(54, 215, 180, 0.12);
  box-shadow: none;
}

.admin-compute-switch strong {
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .workspace-account-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workspace-invite-form,
  .workspace-usage-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .floating-menu__grid,
  .workspace-account-list,
  .workspace-invite-form,
  .workspace-usage-filter {
    grid-template-columns: 1fr;
  }

  .floating-menu .menu-item[data-type="image-edit"] {
    grid-column: auto;
  }
}

/* First-run onboarding */
.onboarding-entry-btn {
  min-height: 36px;
  padding: 0 14px;
  border-color: rgba(102, 174, 255, 0.26);
  color: #cfe5ff;
  background: rgba(71, 138, 226, 0.1);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.onboarding-entry-btn:hover {
  border-color: rgba(116, 188, 255, 0.52);
  background: rgba(72, 145, 236, 0.18);
}

.onboarding-panel {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: grid;
  place-items: center;
  padding: 34px;
  background: rgba(2, 6, 13, 0.78);
  backdrop-filter: blur(16px) saturate(120%);
}

.onboarding-welcome {
  width: min(960px, calc(100vw - 68px));
  border: 1px solid rgba(136, 176, 229, 0.26);
  border-radius: 24px;
  padding: 24px;
  color: #eef6ff;
  background:
    radial-gradient(720px 300px at 8% -18%, rgba(65, 136, 229, 0.2), transparent 68%),
    linear-gradient(155deg, rgba(24, 31, 44, 0.98), rgba(12, 17, 27, 0.99));
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.52);
}

.onboarding-welcome__header,
.onboarding-welcome__footer,
.onboarding-coach__header,
.onboarding-coach__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.onboarding-eyebrow {
  color: #83bdff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.onboarding-welcome__header p {
  margin: 5px 0 0;
  color: #71849e;
  font-size: 11px;
}

.onboarding-text-btn {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  color: #8fa2bd;
  background: transparent;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.onboarding-text-btn:hover {
  color: #e7f2ff;
}

.onboarding-welcome__intro {
  max-width: 660px;
  margin-top: 30px;
}

.onboarding-welcome__intro h2 {
  margin: 0;
  color: #f7fbff;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.onboarding-welcome__intro p {
  margin: 10px 0 0;
  color: #8ea0b9;
  font-size: 13px;
  line-height: 1.6;
}

.onboarding-scenario-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.onboarding-scenario {
  min-height: 212px;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  align-content: start;
  gap: 10px;
  padding: 18px;
  text-align: left;
  border: 1px solid rgba(139, 164, 201, 0.18);
  border-radius: 17px;
  color: #e9f2ff;
  background: linear-gradient(150deg, rgba(42, 51, 66, 0.72), rgba(23, 29, 40, 0.84));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--motion-standard), border-color var(--dur-fast) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard);
}

.onboarding-scenario:hover {
  transform: translateY(-2px);
  border-color: rgba(112, 176, 255, 0.42);
}

.onboarding-scenario.is-selected {
  border-color: rgba(103, 179, 255, 0.78);
  background: linear-gradient(150deg, rgba(49, 91, 144, 0.58), rgba(23, 40, 65, 0.88));
  box-shadow: 0 0 0 1px rgba(100, 178, 255, 0.2), 0 18px 34px rgba(0, 8, 20, 0.24);
}

.onboarding-scenario__index {
  color: #70b4ff;
  font: 700 11px/1 var(--font-mono);
  letter-spacing: 0.08em;
}

.onboarding-scenario strong {
  color: #f4f8ff;
  font-size: 17px;
  line-height: 1.3;
}

.onboarding-scenario small {
  color: #97a8bf;
  font-size: 12px;
  line-height: 1.55;
}

.onboarding-scenario__meta {
  align-self: end;
  color: #6f829d;
  font-size: 10px;
}

.onboarding-welcome__footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(145, 169, 205, 0.14);
}

.onboarding-welcome__footer p {
  margin: 0;
  color: #778aa4;
  font-size: 11px;
}

.onboarding-primary-btn,
.onboarding-secondary-btn {
  min-height: 40px;
  padding: 0 17px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--motion-standard), border-color var(--dur-fast) var(--motion-standard), background-color var(--dur-fast) var(--motion-standard);
}

.onboarding-primary-btn {
  border: 1px solid rgba(133, 195, 255, 0.68);
  color: #f8fbff;
  background: linear-gradient(135deg, #277fdc, #4a9aee);
  box-shadow: 0 10px 24px rgba(31, 116, 211, 0.28);
}

.onboarding-primary-btn:hover:not(:disabled),
.onboarding-secondary-btn:hover {
  transform: translateY(-1px);
}

.onboarding-primary-btn:disabled {
  cursor: wait;
  opacity: 0.66;
}

.onboarding-secondary-btn {
  border: 1px solid rgba(142, 168, 205, 0.2);
  color: #a9bad0;
  background: rgba(255, 255, 255, 0.045);
}

.onboarding-coach {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 190;
  width: 370px;
  padding: 18px;
  border: 1px solid rgba(112, 176, 255, 0.38);
  border-radius: 17px;
  color: #edf6ff;
  background: linear-gradient(155deg, rgba(24, 32, 46, 0.98), rgba(11, 17, 28, 0.99));
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(92, 165, 251, 0.08) inset;
  backdrop-filter: blur(14px);
}

.onboarding-coach__header > span {
  color: #7eb7f8;
  font-size: 11px;
  font-weight: 800;
}

.onboarding-coach__bar {
  height: 3px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(135, 164, 202, 0.14);
}

.onboarding-coach__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #43a1f1, #73c4ff);
  transition: width 260ms var(--motion-standard);
}

.onboarding-coach h3 {
  margin: 18px 0 0;
  color: #f5f9ff;
  font-size: 19px;
  letter-spacing: -0.025em;
}

.onboarding-coach > p {
  margin: 8px 0 0;
  color: #91a3bc;
  font-size: 12px;
  line-height: 1.65;
}

.onboarding-coach__footer {
  margin-top: 18px;
}

.onboarding-focus-target {
  outline: 2px solid rgba(78, 171, 255, 0.92) !important;
  outline-offset: 6px;
  filter: drop-shadow(0 0 18px rgba(55, 151, 247, 0.42));
}

.edges-layer.onboarding-focus-target {
  outline: 0 !important;
}

.edges-layer.onboarding-focus-target .edge-path {
  stroke: rgba(78, 176, 255, 0.96);
  stroke-width: 4;
  filter: drop-shadow(0 0 8px rgba(61, 161, 255, 0.68));
}

.onboarding-focus-control {
  box-shadow: 0 0 0 3px rgba(92, 183, 255, 0.32), 0 0 22px rgba(47, 150, 245, 0.62) !important;
}

@media (max-width: 900px) {
  .onboarding-panel {
    padding: 18px;
  }

  .onboarding-welcome {
    width: min(680px, calc(100vw - 36px));
  }

  .onboarding-scenario-list {
    grid-template-columns: 1fr;
  }

  .onboarding-scenario {
    min-height: 132px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .onboarding-scenario,
  .onboarding-primary-btn,
  .onboarding-secondary-btn,
  .onboarding-coach__bar span {
    transition: none;
  }
}

/* ===== Workspace Header Information Architecture ===== */
.top-bar {
  min-height: 56px;
  height: 56px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(280px, 520px) minmax(180px, 1fr);
  align-items: center;
  gap: 16px;
  overflow: visible;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(17, 24, 38, 0.92), rgba(13, 19, 31, 0.76));
}

.top-bar__start,
.top-actions,
.top-project-context {
  min-width: 0;
  display: flex;
  align-items: center;
}

.top-bar__start {
  gap: 14px;
  justify-self: start;
}

.top-actions {
  justify-self: end;
  gap: 8px;
}

.top-project-context {
  justify-self: stretch;
  justify-content: center;
  gap: 10px;
}

.top-projects-btn,
.top-save-btn,
.top-action-btn,
.top-account-btn {
  border: 1px solid transparent;
  color: #cbd6e8;
  background: transparent;
  cursor: pointer;
  transition:
    color 160ms var(--motion-standard),
    background-color 160ms var(--motion-standard),
    border-color 160ms var(--motion-standard);
}

.top-projects-btn {
  height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}

.top-projects-btn svg,
.top-save-btn svg,
.top-action-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.top-projects-btn:hover,
.top-save-btn:hover,
.top-action-btn:hover,
.top-account-btn:hover,
.top-action-btn[aria-expanded="true"],
.top-account-btn[aria-expanded="true"] {
  color: #f5f8ff;
  border-color: rgba(150, 187, 235, 0.14);
  background: rgba(143, 176, 232, 0.1);
}

.top-actions .board-title,
.top-project-context .board-title {
  width: min(260px, 40vw);
  min-width: 80px;
  height: 34px;
  margin: 0;
  padding: 0 9px;
  text-align: left;
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  border: 1px solid transparent;
  background: transparent;
}

.top-project-context .board-title:hover,
.top-project-context .board-title:focus {
  border-color: rgba(145, 174, 216, 0.14);
  background: rgba(255, 255, 255, 0.045);
}

.top-project-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.top-save-btn {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
}

.top-save-btn:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.top-save-btn svg {
  width: 16px;
  height: 16px;
}

.top-project-scope,
.board-save-status {
  padding: 0;
  border: 0;
  background: transparent;
  white-space: nowrap;
}

.top-project-scope {
  color: #7f90aa;
  font-size: 11px;
  font-weight: 650;
}

.top-project-scope::after {
  content: "";
  display: inline-block;
  width: 3px;
  height: 3px;
  margin-left: 8px;
  vertical-align: middle;
  border-radius: 50%;
  background: rgba(137, 158, 191, 0.55);
}

.board-save-status {
  min-height: 0;
  color: #7f90aa;
  font-size: 11px;
  font-weight: 600;
}

.top-menu-wrap {
  position: relative;
}

.top-action-btn,
.top-account-btn {
  position: relative;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 11px;
}

.top-account-btn {
  border-radius: 50%;
}

.top-account-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #edf5ff;
  background: linear-gradient(145deg, #397bd5, #2456a3);
  box-shadow: inset 0 0 0 1px rgba(188, 218, 255, 0.24);
  font-size: 12px;
  font-weight: 800;
}

.top-action-notice {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  border: 1px solid #131c2b;
  border-radius: 50%;
  background: #65b7ff;
}

.top-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 240;
  width: 248px;
  padding: 8px;
  border: 1px solid rgba(133, 164, 208, 0.2);
  border-radius: 14px;
  color: #e8f0fc;
  background: rgba(17, 24, 37, 0.98);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(18px) saturate(130%);
}

.top-menu--account {
  width: 264px;
}

.top-menu__heading {
  padding: 8px 10px 6px;
  color: #778ba8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.top-menu__item,
.top-menu__shortcut {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: 9px;
  color: #d9e4f4;
  background: transparent;
  text-align: left;
}

.top-menu__item {
  cursor: pointer;
}

.top-menu__item:hover,
.top-menu__item:focus-visible {
  outline: none;
  color: #fff;
  background: rgba(111, 158, 220, 0.11);
}

.top-menu__item > span {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 13px;
  font-weight: 700;
}

.top-menu__item small {
  color: #8395af;
  font-size: 10px;
  font-weight: 500;
}

.top-menu__item--single {
  min-height: 38px;
}

.top-menu__item--danger {
  color: #f19aa8;
}

.top-menu__item--danger:hover,
.top-menu__item--danger:focus-visible {
  color: #ffb4bf;
  background: rgba(216, 79, 100, 0.1);
}

.top-menu__shortcut {
  min-height: 34px;
  color: #8fa1bb;
  font-size: 11px;
}

.top-menu__shortcut kbd {
  min-width: 42px;
  padding: 3px 6px;
  border: 1px solid rgba(142, 167, 202, 0.16);
  border-radius: 6px;
  color: #9dafc8;
  background: rgba(255, 255, 255, 0.035);
  font: inherit;
  text-align: center;
}

.top-account-summary {
  padding: 9px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.top-account-summary strong {
  overflow: hidden;
  color: #f2f6fc;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-account-summary .current-user-badge {
  max-width: 100%;
  overflow: hidden;
  color: #f2f6fc;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-account-summary small {
  max-width: 100%;
  overflow: hidden;
  color: #8496b0;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-menu__separator {
  height: 1px;
  margin: 5px 4px;
  background: rgba(143, 165, 197, 0.12);
}

@media (max-width: 1080px) {
  .top-bar {
    min-height: 56px;
    height: 56px;
    grid-template-columns: minmax(130px, 0.8fr) minmax(220px, 1.4fr) minmax(88px, 0.8fr);
    padding: 0 12px;
    gap: 10px;
  }

  .top-project-context .board-title {
    width: min(220px, 34vw);
  }

  .top-project-scope {
    display: none;
  }
}

@media (max-width: 760px) {
  .top-bar {
    grid-template-columns: auto minmax(120px, 1fr) auto;
  }

  .top-projects-btn span,
  .top-project-scope {
    display: none;
  }

  .top-projects-btn {
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .top-project-context .board-title {
    width: 100%;
    text-align: center;
  }
}
