/* ==========================================================================
   SameFontEdit v2 — Canvas-First Swiss Digital Darkroom Workbench CSS
   ========================================================================== */

.sfe-studio {
  display: grid;
  gap: 12px;
  min-width: 0;
}

/* Compact Top Demo + Action Bar */
.sfe-studio-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.sfe-bar-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.sfe-history-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sfe-demo-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 13px 0 6px;
  border-radius: 999px;
  border: 1px solid var(--sfe-border-strong, rgba(255, 255, 255, 0.16));
  background: var(--sfe-surface, #12151c);
  box-shadow: var(--sfe-specular, inset 0 1px 0 rgba(255, 255, 255, 0.07));
  color: var(--sfe-ink, #f3f5f8);
  font-family: var(--sfe-font-sans, sans-serif);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.sfe-demo-pill:hover {
  border-color: var(--sfe-accent, #3b82f6);
}

.sfe-demo-pill.is-active,
.sfe-demo-pill[aria-pressed="true"] {
  border-color: var(--sfe-accent, #3b82f6);
  background: var(--sfe-accent-soft, rgba(59, 130, 246, 0.16));
  color: var(--sfe-ink, #f3f5f8);
}

.sfe-demo-thumb {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--sfe-border-strong, rgba(255, 255, 255, 0.16));
  display: block;
}

.sfe-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--sfe-radius-sm, 10px);
  border: 1px solid var(--sfe-border-strong, rgba(255, 255, 255, 0.16));
  background: var(--sfe-surface, #12151c);
  color: var(--sfe-ink, #f3f5f8);
  font-family: var(--sfe-font-sans, sans-serif);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 140ms ease, color 140ms ease;
}

.sfe-chip:hover:not(:disabled) {
  border-color: var(--sfe-accent, #3b82f6);
  color: var(--sfe-accent, #3b82f6);
}

.sfe-chip:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.sfe-upload-trigger {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.sfe-mode-badge {
  font-family: var(--sfe-font-mono, monospace);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--sfe-accent-2, #34d399);
  background: var(--sfe-accent-2-soft, rgba(52, 211, 153, 0.14));
  border-radius: 999px;
  padding: 6px 11px;
  white-space: nowrap;
}

/* Main Two-Column Studio Grid */
.sfe-studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 368px;
  gap: 14px;
  align-items: start;
}

/* Left Canvas Card */
.sfe-canvas-card {
  background: var(--sfe-surface, #12151c);
  border: 1px solid var(--sfe-border-strong, rgba(255, 255, 255, 0.16));
  border-radius: var(--sfe-radius, 16px);
  box-shadow: var(--sfe-shadow-md, 0 18px 42px rgba(0, 0, 0, 0.65));
  overflow: hidden;
  display: grid;
  min-width: 0;
}

.sfe-canvas-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--sfe-border, rgba(255, 255, 255, 0.08));
  background: var(--sfe-surface, #12151c);
  flex-wrap: wrap;
}

.sfe-canvas-status-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--sfe-font-mono, monospace);
  font-size: 11.5px;
  color: var(--sfe-muted, #9aa3b2);
}

.sfe-lossless-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--sfe-accent-2-soft, rgba(52, 211, 153, 0.14));
  color: var(--sfe-accent-2, #34d399);
  font-weight: 700;
}

.sfe-dim-label {
  font-family: var(--sfe-font-mono, monospace);
  font-size: 11.5px;
  color: var(--sfe-muted, #9aa3b2);
}

.sfe-stage-tabs {
  display: inline-flex;
  padding: 3px;
  border-radius: 9px;
  background: var(--sfe-surface-subtle, #1a1e28);
  border: 1px solid var(--sfe-border, rgba(255, 255, 255, 0.08));
  gap: 2px;
}

.sfe-stage-tab {
  min-height: 36px;
  padding: 0 12px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--sfe-muted, #9aa3b2);
  font-family: var(--sfe-font-sans, sans-serif);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.sfe-stage-tab[aria-pressed="true"] {
  background: var(--sfe-surface, #12151c);
  color: var(--sfe-ink, #f3f5f8);
  box-shadow: var(--sfe-shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.38));
}

/* Darkroom / Light Studio Dot-Grid Canvas Well */
.sfe-well {
  position: relative;
  background-color: #080a0d;
  background-image: radial-gradient(rgba(243, 245, 248, 0.10) 1px, transparent 1px);
  background-size: 20px 20px;
  padding: 18px 18px 74px;
  min-height: 560px;
  display: grid;
  place-items: center;
  overflow: hidden;
  user-select: none;
}

:root[data-theme="light"] .sfe-well {
  background-color: #e2e5ec;
  background-image: radial-gradient(rgba(15, 20, 25, 0.13) 1px, transparent 1px);
}

.sfe-well.is-dragover::after {
  content: "Drop image to edit text losslessly";
  position: absolute;
  inset: 12px;
  z-index: 40;
  border: 2px dashed #3b82f6;
  border-radius: 12px;
  background: rgba(11, 13, 17, 0.86);
  color: #f3f5f8;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 700;
}

.sfe-zoom-stage {
  width: 100%;
  display: grid;
  place-items: center;
  transform-origin: center center;
  transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.sfe-artboard {
  position: relative;
  width: 100%;
  max-width: 860px;
  max-height: 500px;
  aspect-ratio: 1672 / 941;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.65), 0 0 0 1px var(--sfe-border-strong, rgba(255, 255, 255, 0.16));
  background: #0d1016;
  touch-action: none;
}

.sfe-artboard.is-portrait {
  max-width: 340px;
  max-height: 510px;
}

.sfe-artboard.is-draw-mode {
  cursor: crosshair;
}

.sfe-artboard.is-loupe-mode {
  cursor: none;
}

.sfe-artboard canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.sfe-after-clip {
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 50%);
  pointer-events: none;
}

/* Hover-Reactive Text Anchor Boxes */
.sfe-detected-layer {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.sfe-detected-box {
  position: absolute;
  border: 1.5px dashed rgba(59, 130, 246, 0.88);
  background: rgba(37, 99, 235, 0.08);
  border-radius: 4px;
  pointer-events: auto;
  cursor: pointer;
  padding: 0;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.sfe-detected-box:hover {
  border-style: solid;
  border-width: 2px;
  background: rgba(37, 99, 235, 0.20);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.sfe-detected-tag {
  position: absolute;
  top: -22px;
  left: -1px;
  padding: 2px 7px;
  border-radius: 4px;
  background: #2563eb;
  color: #ffffff;
  font-family: var(--sfe-font-mono, monospace);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}

.sfe-detected-box.is-active .sfe-detected-tag {
  display: none;
}

.sfe-draw-rect {
  position: absolute;
  border: 2px dashed #3b82f6;
  background: rgba(59, 130, 246, 0.22);
  border-radius: 4px;
  pointer-events: none;
  z-index: 14;
}

/* Selected Editable 8-Handle Bounding Box */
.sfe-bbox {
  position: absolute;
  border: 2px solid #3b82f6;
  background: rgba(37, 99, 235, 0.16);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.32), inset 0 0 0 1px rgba(255, 255, 255, 0.65);
  border-radius: 4px;
  cursor: move;
  z-index: 10;
}

.sfe-bbox-tag {
  position: absolute;
  left: -2px;
  top: -25px;
  background: #2563eb;
  color: #ffffff;
  font-family: var(--sfe-font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 5px 5px 0 0;
  white-space: nowrap;
  pointer-events: none;
}

.sfe-handle {
  position: absolute;
  width: 9px;
  height: 9px;
  background: #ffffff;
  border: 2px solid #2563eb;
  border-radius: 2px;
  z-index: 11;
}

.sfe-h-nw { left: -5px; top: -5px; cursor: nwse-resize; }
.sfe-h-n  { left: calc(50% - 4.5px); top: -5px; cursor: ns-resize; }
.sfe-h-ne { right: -5px; top: -5px; cursor: nesw-resize; }
.sfe-h-e  { right: -5px; top: calc(50% - 4.5px); cursor: ew-resize; }
.sfe-h-se { right: -5px; bottom: -5px; cursor: nwse-resize; }
.sfe-h-s  { left: calc(50% - 4.5px); bottom: -5px; cursor: ns-resize; }
.sfe-h-sw { left: -5px; bottom: -5px; cursor: nesw-resize; }
.sfe-h-w  { left: -5px; top: calc(50% - 4.5px); cursor: ew-resize; }

/* Surgical Light-Beam Scan Animation */
.sfe-scan-overlay {
  position: absolute;
  inset: 0;
  z-index: 16;
  background: rgba(4, 120, 87, 0.16);
  pointer-events: none;
}

.sfe-scan-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(11, 13, 17, 0.90);
  border: 1px solid rgba(52, 211, 153, 0.38);
  color: #34d399;
  font-family: var(--sfe-font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
}

.sfe-scan-box {
  position: absolute;
  border: 2px solid #3b82f6;
  background: rgba(59, 130, 246, 0.16);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.48);
}

.sfe-scan-beam {
  position: absolute;
  left: 0;
  right: 0;
  height: 44%;
  background: linear-gradient(180deg, transparent, rgba(96, 165, 250, 0.85), transparent);
  animation: sfeScanBeam 1.1s ease-in-out infinite;
}

@keyframes sfeScanBeam {
  0% { top: -44%; }
  100% { top: 108%; }
}

/* Pixel-Lock Map Overlay */
.sfe-lock-overlay {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  background: repeating-linear-gradient(
    -45deg,
    rgba(52, 211, 153, 0.18) 0 6px,
    rgba(52, 211, 153, 0.06) 6px 14px
  );
}

.sfe-lock-box {
  position: absolute;
  border: 2px solid #3b82f6;
  background: rgba(37, 99, 235, 0.22);
  border-radius: 4px;
}

.sfe-lock-legend {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 20;
  pointer-events: none;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 11px;
  border-radius: 8px;
  background: rgba(11, 13, 17, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-family: var(--sfe-font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
}

.sfe-lock-leg-green { color: #34d399; }
.sfe-lock-leg-blue { color: #60a5fa; }

/* Magnetic Before/After Split Bar & Corner Badges */
.sfe-corner-tag {
  position: absolute;
  top: 12px;
  z-index: 15;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(11, 13, 17, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f3f5f8;
  font-family: var(--sfe-font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.sfe-corner-tag--l { left: 12px; }
.sfe-corner-tag--r { right: 12px; color: #34d399; }

.sfe-peek-banner {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(180, 83, 9, 0.95);
  color: #ffffff;
  font-family: var(--sfe-font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  pointer-events: none;
  white-space: nowrap;
}

.sfe-split-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #ffffff;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.65);
  z-index: 18;
  transform: translateX(-50%);
  cursor: ew-resize;
}

.sfe-split-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: #2563eb;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
  transition: transform 140ms cubic-bezier(0.16, 1, 0.3, 1), opacity 140ms ease;
}

.sfe-artboard.is-loupe-mode .sfe-split-knob {
  opacity: 0.2;
}

.sfe-split-line.is-snapped .sfe-split-knob {
  transform: translate(-50%, -50%) scale(1.07);
}

/* 176x176 Circular 200% Optical Magnifying Loupe */
.sfe-loupe {
  position: absolute;
  width: 176px;
  height: 176px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55), 0 0 0 1.5px #3b82f6;
  overflow: hidden;
  pointer-events: none;
  z-index: 22;
  transform: translate(-50%, -50%);
  background: #080a0d;
}

.sfe-loupe canvas {
  position: static;
  width: 100%;
  height: 100%;
  display: block;
}

.sfe-loupe-cross {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sfe-loupe-cross::before,
.sfe-loupe-cross::after {
  content: "";
  position: absolute;
  background: rgba(59, 130, 246, 0.65);
}

.sfe-loupe-cross::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.sfe-loupe-cross::after { top: 50%; left: 0; right: 0; height: 1px; }

.sfe-loupe-meta {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(11, 13, 17, 0.90);
  color: #34d399;
  font-family: var(--sfe-font-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

/* Figma UI3 Floating Bottom Canvas Pill Dock */
.sfe-float-dock {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 26;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 14px;
  background: rgba(18, 21, 28, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--sfe-border-strong, rgba(255, 255, 255, 0.16));
  box-shadow: var(--sfe-shadow-md, 0 18px 42px rgba(0, 0, 0, 0.65));
  max-width: calc(100% - 20px);
  overflow-x: auto;
}

:root[data-theme="light"] .sfe-float-dock {
  background: rgba(255, 255, 255, 0.90);
}

.sfe-dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--sfe-ink, #f3f5f8);
  font-family: var(--sfe-font-mono, monospace);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.sfe-dock-btn:hover {
  background: var(--sfe-surface-subtle, #1a1e28);
}

.sfe-dock-btn[aria-pressed="true"] {
  background: var(--sfe-accent-soft, rgba(59, 130, 246, 0.16));
  border-color: rgba(59, 130, 246, 0.42);
  color: var(--sfe-accent, #3b82f6);
}

.sfe-dock-btn--lock[aria-pressed="true"] {
  background: var(--sfe-accent-2-soft, rgba(52, 211, 153, 0.14));
  border-color: rgba(52, 211, 153, 0.40);
  color: var(--sfe-accent-2, #34d399);
}

.sfe-dock-sep {
  width: 1px;
  height: 22px;
  background: var(--sfe-border-strong, rgba(255, 255, 255, 0.16));
  flex-shrink: 0;
  margin: 0 2px;
}

.sfe-kbd {
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--sfe-border-strong, rgba(255, 255, 255, 0.16));
  background: var(--sfe-surface-subtle, #1a1e28);
  font-size: 10px;
  color: var(--sfe-muted, #9aa3b2);
}

/* Right Precision Inspector */
.sfe-controls-col {
  background: var(--sfe-surface, #12151c);
  border: 1px solid var(--sfe-border-strong, rgba(255, 255, 255, 0.16));
  border-radius: var(--sfe-radius, 16px);
  box-shadow: var(--sfe-shadow-md, 0 18px 42px rgba(0, 0, 0, 0.65));
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.sfe-panel-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--sfe-border, rgba(255, 255, 255, 0.08));
}

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

.sfe-panel-title {
  font-family: var(--sfe-font-display, sans-serif);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--sfe-ink, #f3f5f8);
}

.sfe-coord-pill {
  font-family: var(--sfe-font-mono, monospace);
  font-size: 10.5px;
  color: var(--sfe-muted, #9aa3b2);
  background: var(--sfe-surface-subtle, #1a1e28);
  padding: 2px 7px;
  border-radius: 6px;
}

.sfe-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  background: var(--sfe-surface-subtle, #1a1e28);
  border-radius: var(--sfe-radius-sm, 10px);
}

.sfe-tab-btn {
  min-height: 32px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--sfe-muted, #9aa3b2);
  font-family: var(--sfe-font-sans, sans-serif);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.sfe-tab-btn.is-active {
  background: var(--sfe-surface, #12151c);
  color: var(--sfe-ink, #f3f5f8);
  box-shadow: var(--sfe-shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.38));
}

.sfe-box-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sfe-box-chip {
  min-height: 28px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid var(--sfe-border-strong, rgba(255, 255, 255, 0.16));
  background: var(--sfe-surface-subtle, #1a1e28);
  color: var(--sfe-ink, #f3f5f8);
  font-family: var(--sfe-font-mono, monospace);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.sfe-box-chip.is-selected {
  border-color: var(--sfe-accent, #3b82f6);
  background: var(--sfe-accent-soft, rgba(59, 130, 246, 0.16));
  color: var(--sfe-accent, #3b82f6);
}

.sfe-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11.5px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--sfe-ink, #f3f5f8);
}

.sfe-label-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sfe-fit-tag {
  font-family: var(--sfe-font-mono, monospace);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--sfe-accent-2, #34d399);
}

.sfe-field input[type="text"],
.sfe-input,
.sfe-field select,
.sfe-format-select {
  width: 100%;
  min-height: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--sfe-border-strong, rgba(255, 255, 255, 0.16));
  border-radius: var(--sfe-radius-sm, 10px);
  background: var(--sfe-surface-subtle, #1a1e28);
  color: var(--sfe-ink, #f3f5f8);
  font-family: var(--sfe-font-sans, sans-serif);
  font-size: 13px;
  font-weight: 500;
}

.sfe-tier-grid,
.sfe-engine-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.sfe-tier-option,
.sfe-engine-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 40px;
  gap: 1px;
  padding: 5px 9px;
  border: 1px solid var(--sfe-border-strong, rgba(255, 255, 255, 0.16));
  border-radius: var(--sfe-radius-sm, 10px);
  cursor: pointer;
  background: var(--sfe-surface-subtle, #1a1e28);
}

.sfe-tier-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sfe-tier-option strong {
  font-size: 12px;
  line-height: 1.2;
  color: var(--sfe-ink, #f3f5f8);
}

.sfe-tier-option span {
  font-family: var(--sfe-font-mono, monospace);
  font-size: 10px;
  line-height: 1.2;
  color: var(--sfe-muted, #9aa3b2);
}

.sfe-tier-option.is-selected {
  border-color: var(--sfe-accent, #3b82f6);
  background: var(--sfe-accent-soft, rgba(59, 130, 246, 0.16));
}

.sfe-tier-pro.is-selected {
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.14);
}

.sfe-tier-pro strong {
  color: #fbbf24;
}

:root[data-theme="light"] .sfe-tier-pro strong {
  color: #b45309;
}

.sfe-advanced-details {
  border: 1px solid var(--sfe-border-strong, rgba(255, 255, 255, 0.16));
  border-radius: var(--sfe-radius-sm, 10px);
  background: var(--sfe-surface-subtle, #1a1e28);
  overflow: hidden;
}

.sfe-advanced-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 30px;
  padding: 4px 10px;
  cursor: pointer;
  list-style: none;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--sfe-muted, #9aa3b2);
}

.sfe-advanced-summary::-webkit-details-marker {
  display: none;
}

.sfe-advanced-val {
  font-family: var(--sfe-font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  color: var(--sfe-accent-2, #34d399);
}

.sfe-composite-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  padding: 7px 10px 9px;
  border-top: 1px solid var(--sfe-border, rgba(255, 255, 255, 0.08));
}

.sfe-action-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sfe-run-btn {
  width: 100%;
  min-height: 44px;
}

.sfe-export-row {
  display: grid;
  grid-template-columns: 142px 1fr;
  gap: 8px;
}

.sfe-export-row .sfe-export-btn {
  width: 100%;
  min-height: 36px;
  height: 36px;
  padding: 0 10px;
  font-size: 13px;
}

.sfe-cta-note {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--sfe-muted, #9aa3b2);
}

.sfe-status-box {
  padding: 7px 10px;
  border-radius: var(--sfe-radius-sm, 10px);
  font-size: 11.5px;
  line-height: 1.38;
  background: var(--sfe-accent-soft, rgba(59, 130, 246, 0.16));
  color: var(--sfe-accent, #3b82f6);
  border: 1px solid var(--sfe-accent, #3b82f6);
}

.sfe-status-box.is-warn {
  background: rgba(251, 113, 133, 0.14);
  color: #fb7185;
  border-color: #fb7185;
}

:root[data-theme="light"] .sfe-status-box.is-warn {
  background: rgba(190, 18, 60, 0.10);
  color: #be123c;
  border-color: #be123c;
}

.sfe-upgrade-prompt {
  padding: 10px 12px;
  border-radius: var(--sfe-radius-sm, 10px);
  background: var(--sfe-surface-subtle, #1a1e28);
  border: 1px solid var(--sfe-border-strong, rgba(255, 255, 255, 0.16));
  font-size: 12px;
}

.sfe-upgrade-prompt p {
  margin: 0 0 8px;
}

.sfe-compliance-shield {
  margin: 0;
  padding: 6px 9px;
  border-radius: var(--sfe-radius-sm, 10px);
  background: var(--sfe-surface-subtle, #1a1e28);
  border: 1px solid var(--sfe-border, rgba(255, 255, 255, 0.08));
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--sfe-muted, #9aa3b2);
}

.sfe-compliance-shield strong {
  color: var(--sfe-ink, #f3f5f8);
}

@media (max-width: 1080px) {
  .sfe-studio-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .sfe-well {
    min-height: 360px;
  }
}

@media (max-width: 640px) {
  .sfe-hide-sm {
    display: none;
  }
  .sfe-samples-group {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .sfe-tools-group {
    width: 100%;
    justify-content: space-between;
  }
  .sfe-tools-group .sfe-upload-trigger {
    width: auto;
  }
  .sfe-history-group.is-empty {
    display: none;
  }
  .sfe-demo-pill {
    padding: 0 10px 0 5px;
    font-size: 12px;
  }
  .sfe-stage-tab,
  .sfe-box-chip,
  .sfe-tab-btn,
  .sfe-advanced-summary {
    min-height: 44px;
  }
  .sfe-field input[type="text"],
  .sfe-input,
  .sfe-field select,
  .sfe-format-select,
  .sfe-export-row .sfe-export-btn {
    min-height: 44px;
    height: 44px;
    font-size: 14px;
  }
  .sfe-well {
    min-height: 250px;
    padding: 10px 10px 64px;
  }
  .sfe-artboard {
    max-height: 265px;
  }
  .sfe-artboard.is-portrait {
    max-width: 205px;
    max-height: 308px;
  }
  .sfe-corner-tag {
    font-size: 10px;
    padding: 3px 7px;
    top: 8px;
  }
  .sfe-corner-tag--l {
    left: 8px;
  }
  .sfe-corner-tag--r {
    right: 8px;
  }
  .sfe-float-dock {
    bottom: 8px;
    padding: 3px 4px;
    gap: 2px;
    max-width: calc(100% - 12px);
  }
  .sfe-dock-btn {
    padding: 0 7px;
    font-size: 11.5px;
    min-height: 44px;
    flex-shrink: 0;
  }
  .sfe-kbd {
    display: none;
  }
  .sfe-controls-col {
    padding: 14px;
  }
  .sfe-export-row {
    grid-template-columns: 1fr;
  }
  .sfe-loupe {
    width: 136px;
    height: 136px;
  }
}