/* ==================== Design Order Portal — Obsidian True-Black Studio Shell ==================== */
:root {
  --bg-void: #050506;
  --bg-shell: #0B0B0D;
  --bg-surface: #111114;
  --bg-elevated: #18181C;
  --bg-hover: #27272E;
  --border-subtle: #1F1F24;
  --border-default: #27272E;
  --border-strong: #3F3F48;
  --text-primary: #F4F4F6;
  --text-secondary: #9A9AA6;
  --text-tertiary: #63636E;

  --st-running: #3B82F6;
  --st-gate: #F59E0B;
  --st-done: #10B981;
  --st-error: #EF4444;

  --ok-soft: rgba(16, 185, 129, 0.12);
  --ok-border: rgba(16, 185, 129, 0.34);
  --warn-soft: rgba(245, 158, 11, 0.13);
  --warn-border: rgba(245, 158, 11, 0.4);
  --danger-soft: rgba(239, 68, 68, 0.12);
  --danger-border: rgba(239, 68, 68, 0.38);

  --radius: 9px;
  --radius-sm: 6px;
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.82);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%;
  background: var(--bg-void); color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  font-size: 13.5px; line-height: 1.45;
}

.scroll-thin { scrollbar-width: thin; scrollbar-color: #27272E transparent; }
.scroll-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scroll-thin::-webkit-scrollbar-track { background: transparent; }
.scroll-thin::-webkit-scrollbar-thumb { background: #27272E; border-radius: 999px; }
.scroll-thin::-webkit-scrollbar-thumb:hover { background: #3F3F48; }

.hidden { display: none !important; }
.w-full { width: 100%; }
.flex-1 { flex: 1; min-width: 0; }
.mt-12 { margin-top: 12px; }
.tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.muted { color: var(--text-secondary); margin: 0; }
.sm { font-size: 12px; }
.req { color: var(--st-error); }

/* ==================== STATUS DOTS ==================== */
.st-dot { width: 7px; height: 7px; border-radius: 999px; display: inline-block; flex-shrink: 0; }
.dot-running { background: var(--st-running); }
.dot-gate { background: var(--st-gate); }
.dot-done { background: var(--st-done); }
.dot-error { background: var(--st-error); }
@keyframes subtlePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.32; } }
.pulse { animation: subtlePulse 1.6s ease-in-out infinite; }

/* ==================== BUTTONS & CHIPS ==================== */
button { font-family: inherit; }
.btn, .btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-primary);
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background 110ms ease, border-color 110ms ease, color 110ms ease, transform 80ms ease;
}
.btn:hover:not(:disabled), .btn-outline:hover:not(:disabled) {
  background: var(--bg-hover); border-color: #52525C; color: #FFFFFF;
}
.btn:active:not(:disabled), .btn-outline:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled, .btn-outline:disabled { opacity: 0.36; cursor: not-allowed; transform: none; }
.btn-sm { height: 29px; padding: 0 9px; font-size: 12px; }
.btn-icon-sq { width: 32px; height: 32px; padding: 0; }

.btn-primary {
  background: #F4F4F6; border-color: #F4F4F6; color: #09090B; font-weight: 600;
}
.btn-primary:hover:not(:disabled) { background: #FFFFFF; border-color: #FFFFFF; color: #050506; }

.btn-ok {
  background: var(--st-done); border-color: var(--st-done); color: #04130D; font-weight: 600;
}
.btn-ok:hover:not(:disabled) { background: #34D399; border-color: #34D399; color: #03110B; }

.btn-warn {
  background: var(--warn-soft); border-color: var(--warn-border); color: #FDE68A; font-weight: 600;
}
.btn-warn:hover:not(:disabled) { background: rgba(245, 158, 11, 0.25); border-color: #F59E0B; color: #FEF3C7; }

.btn-danger-soft {
  background: var(--danger-soft); border-color: var(--danger-border); color: #FCA5A5;
}
.btn-danger-soft:hover:not(:disabled) { background: rgba(239, 68, 68, 0.22); color: #FEE2E2; }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 9px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent; color: var(--text-secondary);
  font-size: 12.5px; font-weight: 500; cursor: pointer;
}
.btn-ghost:hover:not(:disabled) { background: var(--bg-elevated); color: var(--text-primary); }
.btn-icon {
  width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--border-default);
  background: var(--bg-surface); color: var(--text-secondary); cursor: pointer; font-size: 13px;
}
.btn-icon:hover { background: var(--bg-hover); color: #fff; }

.tele-chip {
  display: inline-flex; align-items: center; gap: 7px; height: 31px; padding: 0 11px;
  border-radius: 6px; border: 1px solid var(--border-subtle); background: var(--bg-surface);
  color: var(--text-secondary); font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.tele-chip.clickable { cursor: pointer; color: var(--text-primary); }
.tele-chip.clickable:hover { background: var(--bg-hover); border-color: #52525C; color: #fff; }
.tele-chip.warn { border-color: var(--warn-border); color: #FDE68A; }

.seg-group {
  display: inline-flex; align-items: center; gap: 2px; padding: 2px;
  background: var(--bg-void); border: 1px solid var(--border-subtle); border-radius: 7px;
}
.seg-group.full-grid { display: grid; grid-template-columns: 1fr 1fr; }
.seg-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: 5px; border: 1px solid transparent;
  background: transparent; color: var(--text-secondary); font-size: 12.5px; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: all 100ms ease;
}
.seg-btn:hover { color: var(--text-primary); }
.seg-btn.active { background: var(--bg-elevated); border-color: var(--border-default); color: var(--text-primary); }
.seg-icon { width: 28px; padding: 0; }
.seg-count, .count-chip {
  font-size: 11px; font-weight: 600; padding: 0 6px; border-radius: 999px;
  background: var(--bg-surface); border: 1px solid var(--border-subtle); color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.seg-btn.active .seg-count { background: var(--bg-hover); color: #fff; }

/* ==================== INPUTS ==================== */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field.compact { margin-bottom: 9px; }
.field > span { font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.input, .select-sm {
  width: 100%; border: 1px solid var(--border-default); border-radius: var(--radius-sm);
  padding: 7px 10px; font-size: 13px; background: var(--bg-void); color: var(--text-primary);
  outline: none; font-family: inherit;
}
.select-sm { width: auto; height: 32px; padding: 0 9px; font-size: 12.5px; background: var(--bg-surface); }
.input:focus, .select-sm:focus { border-color: var(--border-strong); }
.input::placeholder { color: var(--text-tertiary); }
select option { background: var(--bg-shell); color: var(--text-primary); }
.textarea-sm { resize: vertical; min-height: 54px; }

.alert-error {
  background: var(--danger-soft); color: #FCA5A5; border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm); padding: 8px 10px; font-size: 12.5px; margin-bottom: 10px;
}
.alert-info {
  background: rgba(59, 130, 246, 0.12); color: #BFDBFE; border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-sm); padding: 9px 12px; font-size: 12.5px;
}

/* ==================== AUTH SCREEN ==================== */
.auth-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(circle at 50% 0%, #141418 0%, var(--bg-void) 60%);
}
.auth-card {
  width: 100%; max-width: 390px; background: var(--bg-shell);
  border: 1px solid var(--border-default); border-radius: 12px; padding: 26px; box-shadow: var(--shadow-lg);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.auth-brand h1 { margin: 0; font-size: 16.5px; font-weight: 600; }
.brand-mark {
  width: 24px; height: 24px; border-radius: 6px; background: #F4F4F6; color: #09090B;
  font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand-mark.lg { width: 34px; height: 34px; font-size: 16px; border-radius: 8px; }

/* ==================== STUDIO SHELL (100vw x 100vh) ==================== */
.studio-shell { width: 100vw; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: 54px; padding: 0 14px; background: var(--bg-shell);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0;
}
.topbar-left, .brand, .pills { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand h1 { margin: 0; font-size: 14.5px; font-weight: 600; letter-spacing: -0.015em; white-space: nowrap; }

.workspace-body { flex: 1; min-height: 0; display: flex; overflow: hidden; }

/* ==================== LEFT RAIL (320px Collapsible) ==================== */
.left-rail {
  width: 320px; flex-shrink: 0; background: var(--bg-shell);
  border-right: 1px solid var(--border-subtle); display: flex; flex-direction: column; overflow: hidden;
  transition: width 160ms ease;
}
.left-rail.collapsed { width: 52px; }
.left-rail .rail-collapsed-only { display: none; padding: 10px 8px; flex-direction: column; align-items: center; gap: 8px; }
.left-rail.collapsed .rail-collapsed-only { display: flex; }
.left-rail.collapsed .rail-expanded-only { display: none; }
.rail-expanded-only { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }

.rail-section { padding: 12px 14px; border-bottom: 1px solid var(--border-subtle); }
.rail-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.rail-sec-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); }
.rail-sec-hint { font-size: 11px; color: var(--text-tertiary); }

.drop-box {
  border: 1.5px dashed var(--border-strong); border-radius: 8px;
  padding: 16px 12px; text-align: center; background: var(--bg-void);
  cursor: pointer; margin-bottom: 10px; transition: border-color 110ms ease, background 110ms ease;
}
.drop-box:hover, .drop-box.dragover { border-color: #F4F4F6; background: var(--bg-surface); }
.drop-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.drop-sub { font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px; }

.upload-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.upload-thumb {
  position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden;
  border: 1px solid var(--border-default); background: var(--bg-void);
}
.upload-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-thumb button {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px;
  border-radius: 50%; border: 0; background: rgba(0,0,0,0.82); color: #fff; cursor: pointer; font-size: 10px;
}

.credit-est-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px; border-radius: 6px; background: var(--bg-surface);
  border: 1px solid var(--border-subtle); margin-bottom: 10px; font-size: 12.5px;
}
.split-mode-box {
  padding: 8px 9px; border-radius: 7px; background: var(--bg-surface);
  border: 1px solid var(--border-default); margin-bottom: 10px;
}
.composer-actions { display: flex; gap: 8px; }

/* Rating stars & Side-by-side compare */
.rating-box {
  border: 1px solid var(--border-default); border-radius: var(--radius);
  padding: 14px 16px; background: var(--bg-shell); margin-bottom: 14px;
}
.star-row { display: inline-flex; gap: 4px; align-items: center; }
.star-btn {
  border: 0; background: transparent; cursor: pointer; font-size: 22px; line-height: 1;
  color: var(--text-tertiary); padding: 2px; transition: transform 100ms ease, color 100ms ease;
}
.star-btn:hover { transform: scale(1.14); color: #F59E0B; }
.star-btn.lit { color: #F59E0B; }
.star-pill {
  display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600;
  color: #FDE68A; background: var(--warn-soft); border: 1px solid var(--warn-border);
  padding: 1px 6px; border-radius: 5px;
}
.compare-strip {
  display: flex; align-items: center; gap: 10px; overflow-x: auto;
  padding: 10px; border-radius: 8px; background: var(--bg-void);
  border: 1px solid var(--border-subtle); margin-bottom: 12px;
}
.compare-strip img {
  height: 92px; width: auto; border-radius: 6px; border: 1px solid var(--border-default); cursor: zoom-in;
}
.scale-slider-wrap {
  display: inline-flex; align-items: center; gap: 6px; padding: 0 8px; height: 29px;
  border-radius: 6px; background: var(--bg-surface); border: 1px solid var(--border-subtle);
}
.scale-slider-wrap input[type="range"] { width: 88px; accent-color: #F4F4F6; cursor: pointer; }
.edit-order-box {
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 14px; background: var(--bg-shell); margin-bottom: 14px;
}

.rail-mini-list { display: flex; flex-direction: column; gap: 6px; }
.rail-mini-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 9px;
  border-radius: 7px; border: 1px solid var(--border-subtle); background: var(--bg-surface);
  cursor: pointer; transition: border-color 100ms ease, background 100ms ease;
}
.rail-mini-item:hover { background: var(--bg-elevated); border-color: var(--warn-border); }
.rail-mini-item img { width: 34px; height: 34px; border-radius: 5px; object-fit: cover; flex-shrink: 0; }
.rail-mini-meta { min-width: 0; flex: 1; }
.rail-mini-title { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ==================== RIGHT WORKSPACE ==================== */
.main-workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--bg-void); }
.workspace-toolbar {
  height: 52px; padding: 0 14px; background: var(--bg-shell);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-shrink: 0;
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.search-wrap { position: relative; }
.search-ico { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); pointer-events: none; }
.search-input { height: 32px; padding-left: 28px !important; width: 210px; background: var(--bg-surface) !important; }

.workspace-canvas { flex: 1; overflow-y: auto; padding: 14px; }
.orders-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(305px, 1fr)); gap: 11px; }
.orders-grid.list-mode { display: flex; flex-direction: column; gap: 7px; }

/* Card View */
.order-card {
  background: var(--bg-shell); border: 1px solid var(--border-subtle); border-radius: var(--radius);
  padding: 13px; display: flex; flex-direction: column; gap: 10px; cursor: pointer;
  transition: border-color 110ms ease, background 110ms ease;
}
.order-card:hover { background: var(--bg-surface); border-color: var(--border-strong); }
.order-card.needs-action { border-color: var(--warn-border); }
.order-card-top { display: flex; gap: 11px; align-items: center; }
.order-thumb {
  width: 60px; height: 60px; border-radius: 7px; object-fit: cover;
  border: 1px solid var(--border-default); background: var(--bg-void); flex-shrink: 0;
}
.order-card-info { min-width: 0; flex: 1; }
.code-pill {
  display: inline-block; font-size: 11px; font-weight: 600; color: var(--text-secondary);
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  padding: 1px 6px; border-radius: 4px; font-family: ui-monospace, Consolas, monospace;
}
.order-title {
  font-weight: 600; font-size: 13.5px; margin: 3px 0 1px; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Compact List Row View */
.order-row {
  background: var(--bg-shell); border: 1px solid var(--border-subtle); border-radius: 8px;
  padding: 8px 12px; display: grid; grid-template-columns: 40px 135px 1fr 165px 95px auto;
  align-items: center; gap: 12px; cursor: pointer;
}
.order-row:hover { background: var(--bg-surface); border-color: var(--border-strong); }
.order-row.needs-action { border-color: var(--warn-border); }
.order-row img { width: 38px; height: 38px; border-radius: 5px; object-fit: cover; border: 1px solid var(--border-default); }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 5px;
  font-size: 11.5px; font-weight: 500; border: 1px solid transparent; white-space: nowrap;
}
.st-received, .st-preparing, .st-producing, .st-packaging {
  background: rgba(59, 130, 246, 0.12); border-color: rgba(59, 130, 246, 0.3); color: #93C5FD;
}
.st-review_crop, .st-review_final, .st-need_more_info {
  background: var(--warn-soft); border-color: var(--warn-border); color: #FDE68A;
}
.st-ready_to_deliver, .st-delivered {
  background: var(--ok-soft); border-color: var(--ok-border); color: #A7F3D0;
}
.st-cancelled { background: var(--bg-elevated); border-color: var(--border-default); color: var(--text-tertiary); }

.progress-track { height: 4px; border-radius: 999px; background: var(--bg-elevated); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--st-running); transition: width 0.25s ease; }
.progress-fill.done { background: var(--st-done); }
.progress-fill.warn { background: var(--st-gate); }
.order-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.empty-state {
  text-align: center; padding: 64px 20px; background: var(--bg-shell);
  border: 1px dashed var(--border-default); border-radius: var(--radius); margin-top: 8px;
}
.empty-icon { font-size: 32px; margin-bottom: 8px; opacity: 0.8; }

/* ==================== CREDIT & PRICING PAGE ==================== */
.credit-page { flex: 1; overflow-y: auto; padding: 20px; background: var(--bg-void); }
.credit-container { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.kpi-card {
  background: var(--bg-shell); border: 1px solid var(--border-subtle); border-radius: var(--radius);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 5px;
}
.kpi-label { font-size: 12px; color: var(--text-secondary); }
.kpi-val { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 11.5px; color: var(--text-tertiary); }

.credit-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.surface-card {
  background: var(--bg-shell); border: 1px solid var(--border-subtle); border-radius: var(--radius); padding: 16px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 600; }

.data-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--border-subtle); font-size: 13px;
}
.data-row:last-child { border-bottom: 0; }
.delta-plus { color: #34D399; font-weight: 600; }
.delta-minus { color: #FCA5A5; font-weight: 600; }

/* ==================== MODALS & EDITORS ==================== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 14px;
}
.modal-dialog {
  width: 100%; max-height: 92vh; background: var(--bg-shell);
  border: 1px solid var(--border-default); border-radius: 12px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-lg { max-width: 920px; }
.modal-xl { max-width: 1100px; }
.modal-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.modal-header h3 { margin: 0; font-size: 15.5px; font-weight: 600; }
.modal-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.modal-body { padding: 16px 18px; overflow-y: auto; flex: 1; background: var(--bg-void); }
.modal-footer {
  padding: 12px 18px; border-top: 1px solid var(--border-subtle);
  display: flex; justify-content: flex-end; gap: 8px; background: var(--bg-shell);
}

.stepper { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 16px; }
.step-item {
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 6px;
  padding: 7px 8px; font-size: 11.5px; font-weight: 500; color: var(--text-tertiary); text-align: center;
}
.step-item.done { background: var(--ok-soft); border-color: var(--ok-border); color: #A7F3D0; }
.step-item.active { background: var(--bg-elevated); border-color: #F4F4F6; color: #fff; font-weight: 600; }

.review-box {
  border: 1px solid var(--border-default); border-radius: var(--radius);
  padding: 15px; background: var(--bg-shell); margin-bottom: 14px;
}
.review-box-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px;
}
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 12px; }
.review-item {
  background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 8px;
  overflow: hidden; display: flex; flex-direction: column;
}
.review-img-wrap {
  aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center;
  overflow: hidden; cursor: zoom-in; border-bottom: 1px solid var(--border-subtle);
}
.review-img-wrap img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.bg-light { background: #F4F4F6; }
.bg-dark { background: #09090B; }
.bg-checker {
  background-color: #18181C;
  background-image:
    linear-gradient(45deg, #27272E 25%, transparent 25%),
    linear-gradient(-45deg, #27272E 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #27272E 75%),
    linear-gradient(-45deg, transparent 75%, #27272E 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.review-item-body { padding: 10px; display: flex; flex-direction: column; gap: 7px; }
.review-item-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-weight: 600; font-size: 12.5px; }
.review-item-tools { display: flex; gap: 5px; flex-wrap: wrap; }
.review-item-note { font-size: 12px; padding: 6px 8px !important; }

.decision-bar { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 9px; }
.decision-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.delivery-box {
  background: var(--ok-soft); border: 1px solid var(--ok-border); border-radius: var(--radius);
  padding: 15px 16px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.delivery-box strong { color: #A7F3D0; }
.delivery-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.editor-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.editor-toolbar.wrap { flex-wrap: wrap; }
.toolbar-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.canvas-stage-wrap {
  width: 100%; max-height: 58vh; overflow: auto; border: 1px solid var(--border-default);
  border-radius: 8px; display: flex; align-items: center; justify-content: center; background: #09090B; padding: 10px;
}
.editor-canvas { max-width: 100%; max-height: 54vh; display: block; cursor: crosshair; touch-action: none; }

.layout-editor-grid { display: grid; grid-template-columns: 1fr 230px; gap: 12px; align-items: start; }
.layout-stage-shell {
  border: 1px solid var(--border-default); border-radius: 8px; min-height: 440px; max-height: 60vh;
  display: flex; align-items: center; justify-content: center; padding: 14px; overflow: hidden;
}
.layout-stage { position: relative; box-shadow: 0 0 0 1px rgba(255,255,255,0.22); overflow: hidden; user-select: none; touch-action: none; }
.layout-layer { position: absolute; cursor: move; box-sizing: border-box; }
.layout-layer.selected { outline: 2px solid #F4F4F6; box-shadow: 0 0 0 1px rgba(59,130,246,0.9); }
.layout-layer img { width: 100%; height: 100%; display: block; pointer-events: none; }
.layout-handle {
  position: absolute; width: 12px; height: 12px; background: #F4F4F6; border: 2px solid #09090B;
  border-radius: 3px; right: -6px; bottom: -6px; cursor: nwse-resize;
}
.layout-sidebar { border: 1px solid var(--border-subtle); border-radius: 8px; padding: 11px; background: var(--bg-shell); }
.sidebar-title { font-size: 12px; font-weight: 600; margin-bottom: 8px; color: var(--text-secondary); }
.layer-list { display: flex; flex-direction: column; gap: 5px; max-height: 52vh; overflow-y: auto; }
.layer-row {
  display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 8px;
  border-radius: 6px; background: var(--bg-surface); border: 1px solid var(--border-subtle);
  cursor: pointer; font-size: 12px; font-weight: 500; color: var(--text-secondary);
}
.layer-row.selected { border-color: var(--border-strong); background: var(--bg-elevated); color: var(--text-primary); }
.layer-row.is-hidden { opacity: 0.42; }

.timeline { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.timeline-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--text-secondary); }

.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,0.92); display: flex; align-items: center; justify-content: center; padding: 24px; }
.lightbox img { max-width: 94vw; max-height: 92vh; object-fit: contain; border-radius: 8px; }
.lightbox-close {
  position: fixed; top: 18px; right: 20px; width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border-default); background: var(--bg-surface); color: #fff; font-size: 15px; cursor: pointer;
}
.toast-root { position: fixed; bottom: 18px; right: 18px; z-index: 95; display: flex; flex-direction: column; gap: 7px; }
.toast {
  background: var(--bg-elevated); border: 1px solid var(--border-strong); color: var(--text-primary);
  padding: 9px 14px; border-radius: 8px; font-size: 12.5px; font-weight: 500; box-shadow: var(--shadow-lg);
}
.toast.ok { border-color: var(--ok-border); color: #A7F3D0; }
.toast.err { border-color: var(--danger-border); color: #FCA5A5; }

@media (max-width: 900px) {
  .studio-shell { height: auto; min-height: 100vh; overflow: auto; }
  .workspace-body { flex-direction: column; overflow: visible; }
  .left-rail { width: 100%; border-right: 0; border-bottom: 1px solid var(--border-subtle); }
  .left-rail.collapsed { width: 100%; }
  .workspace-toolbar { height: auto; padding: 10px 12px; flex-wrap: wrap; }
  .credit-split, .layout-editor-grid { grid-template-columns: 1fr; }
  .order-row { grid-template-columns: 38px 1fr auto; }
  .order-row .hide-sm { display: none; }
}
