/* PartyLabs desktop UI. Source of truth: DESIGN.md (root). */

:root {
  --canvas: #e9e9eb;
  --app-bg: #f4f4f5;
  --surface: #ffffff;
  --surface-muted: #f7f7f8;
  --surface-sunk: #efeff1;
  --border: #ececee;
  --border-strong: #dcdce0;
  --ink: #111111;
  --ink-2: #3f3f46;
  --muted: #71717a;
  --faint: #b4b4bc;
  --on-ink: #ffffff;
  --accent: #f24de9;
  --accent-hover: #e43cdb;
  --accent-soft: #fde6fb;
  --accent-ink: #b0189f;
  --success: #3f9a4b;
  --success-soft: #e3f3e2;
  --warning: #a35f00;
  --warning-soft: #fff1d6;
  --danger: #d9363e;
  --danger-soft: #fdecec;
  --stage: #141416;
  --on-stage: #ffffff;
  --on-stage-muted: rgba(255, 255, 255, 0.64);
  --glass: rgba(255, 255, 255, 0.16);
  --glass-hover: rgba(255, 255, 255, 0.26);
  --glass-border: rgba(255, 255, 255, 0.24);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 24px;

  --shadow-card: 0 1px 2px rgba(17, 17, 17, 0.04);
  --shadow-pop: 0 8px 24px rgba(17, 17, 17, 0.1);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  --col: 360px;
  --rail: 56px;
  --gap: 16px;
}

html.dark {
  --canvas: #0b0b0c;
  --app-bg: #141416;
  --surface: #1c1c1f;
  --surface-muted: #18181b;
  --surface-sunk: #232327;
  --border: #2a2a2e;
  --border-strong: #3a3a40;
  --ink: #f4f4f5;
  --ink-2: #d4d4d8;
  --muted: #9a9aa3;
  --faint: #5c5c64;
  --on-ink: #111111;
  --accent-soft: rgba(242, 77, 233, 0.16);
  --accent-ink: #f78bf1;
  --success-soft: rgba(63, 154, 75, 0.18);
  --warning-soft: rgba(163, 95, 0, 0.2);
  --danger-soft: rgba(217, 54, 62, 0.16);
  --stage: #0e0e10;
  color-scheme: dark;
}

@media (min-width: 1280px) {
  :root { --col: 380px; }
}

@media (min-width: 1600px) {
  :root { --col: 420px; }
}

/* ---------- Base ---------- */

html,
body {
  background: var(--canvas) !important;
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}

.hidden {
  display: none !important;
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

#screen-vision-studio :focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

#screen-vision-studio input,
#screen-vision-studio textarea {
  caret-color: var(--accent);
}

#screen-vision-studio .material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 300, "GRAD" 0, "opsz" 24;
}

.pl-num {
  font-variant-numeric: tabular-nums;
}

.custom-scrollbar::-webkit-scrollbar,
#screen-vision-studio ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track,
#screen-vision-studio ::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb,
#screen-vision-studio ::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover,
#screen-vision-studio ::-webkit-scrollbar-thumb:hover {
  background-color: var(--faint);
}

/* ---------- Shell ---------- */

#app-content {
  padding: 12px;
  background: var(--canvas) !important;
}

#screen-vision-studio.pl-app {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--r-2xl);
  background: var(--app-bg);
  color: var(--ink);
}

.pl-header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
  flex-shrink: 0;
  align-items: center;
  gap: 16px;
  height: 64px;
  padding: 0 16px 0 20px;
}

.pl-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.pl-brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.pl-tabs {
  display: flex;
  gap: 4px;
}

.pl-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 20px;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 20px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}

.pl-tab:hover {
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--ink);
}

.pl-tab.is-active {
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--ink);
  font-weight: 500;
}

.pl-tab.is-active::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.pl-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.pl-credit {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 6px 0 16px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
}

.pl-credit strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.pl-credit #vs-credit-status {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-credit:not(:has(#vs-credit-topup-btn:not(.hidden))) {
  padding-right: 16px;
}

.pl-icon-btn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}

.pl-icon-btn:hover {
  background: var(--surface-sunk);
}

.pl-icon-btn .material-symbols-outlined {
  font-size: 20px;
}

.pl-icon-btn--sm {
  width: 32px;
  height: 32px;
  background: var(--surface-muted);
}

.pl-icon-btn--sm .material-symbols-outlined {
  font-size: 18px;
}

.pl-avatar {
  background: var(--ink);
  color: var(--on-ink);
}

.pl-avatar:hover {
  background: var(--ink-2);
}

.pl-body {
  display: flex;
  flex: 1;
  min-height: 0;
  gap: 4px;
  padding: 0 var(--gap) var(--gap) 8px;
}

.pl-rail {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  align-items: center;
  gap: 12px;
  width: var(--rail);
  padding-top: 4px;
}

.pl-rail-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pl-rail-group--end {
  margin-top: auto;
}

.pl-rail-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}

.pl-rail-btn .material-symbols-outlined {
  font-size: 20px;
}

.pl-rail-btn:hover {
  background: var(--surface);
  color: var(--ink);
}

.pl-rail-btn.is-active {
  background: var(--ink);
  color: var(--on-ink);
}

.pl-rail-btn.is-active::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 12px;
  width: 3px;
  height: 16px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.pl-rail-btn[data-label]::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  z-index: 50;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--on-ink);
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-4px, -50%);
  transition: opacity 150ms var(--ease), transform 150ms var(--ease);
}

.pl-rail-btn[data-label]:hover::after {
  opacity: 1;
  transform: translate(0, -50%);
  transition-delay: 300ms;
}

.pl-stage {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

/* ---------- View layout ---------- */

.pl-view {
  display: grid;
  flex: 1;
  grid-template-columns: var(--col) minmax(0, 1fr);
  gap: var(--gap);
  min-height: 0;
  animation: pl-view-in 220ms var(--ease);
}

.pl-view--wide {
  grid-template-columns: var(--col) minmax(0, 1fr);
}

@keyframes pl-view-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.pl-column {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
  overscroll-behavior: contain;
}

.pl-column-foot {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-top: auto;
  padding-top: 4px;
  background: linear-gradient(to bottom, transparent, var(--app-bg) 16px);
}

.pl-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.pl-panel-head {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 0;
}

.pl-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 20px;
}

/* Media stage: the photo is the hero */

.pl-media {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--r-xl);
  background: var(--stage);
  color: var(--on-stage);
  isolation: isolate;
}

.pl-media-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 220ms var(--ease);
}

.pl-media::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  height: 120px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), transparent);
  pointer-events: none;
}

.pl-media-bar,
.pl-media-foot {
  position: absolute;
  left: 20px;
  right: 20px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.pl-media-bar { top: 20px; }
.pl-media-foot { bottom: 20px; }

.pl-media-bar > *,
.pl-media-foot > * {
  pointer-events: auto;
}

.pl-media-title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  color: var(--on-stage);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
}

.pl-media-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pl-glass-btn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  min-width: 36px;
  padding: 0 10px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--glass);
  color: var(--on-stage);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color 150ms var(--ease);
}

.pl-glass-btn:hover {
  background: var(--glass-hover);
}

.pl-glass-btn .material-symbols-outlined {
  font-size: 18px;
}

.pl-glass-btn.is-on {
  border-color: transparent;
  background: var(--surface);
  color: var(--ink);
}

.pl-glass-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--glass);
  color: var(--on-stage);
  font-size: 12px;
  line-height: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.pl-media-empty {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px;
  color: var(--on-stage-muted);
  text-align: center;
}

.pl-media-empty .material-symbols-outlined {
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.32);
  font-size: 40px;
}

.pl-media-empty h3 {
  color: var(--on-stage);
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
}

.pl-media-empty p {
  max-width: 300px;
  font-size: 13px;
  line-height: 20px;
}

/* ---------- Cards ---------- */

.pl-card {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.pl-card--dim {
  background: var(--surface-muted);
  box-shadow: none;
  color: var(--faint);
}

.pl-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 28px;
}

.pl-card-title {
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
}

.pl-card-sub {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.pl-card-sub .material-symbols-outlined {
  font-size: 14px;
}

.pl-divider {
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--border);
}

.pl-metric {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.pl-metric-value {
  color: var(--ink);
  font-size: 44px;
  font-weight: 400;
  line-height: 48px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.pl-metric-caption {
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.pl-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pl-stat {
  min-width: 0;
  padding: 0 12px;
}

.pl-stat:first-child { padding-left: 0; }
.pl-stat + .pl-stat { border-left: 1px solid var(--border); }

.pl-stat-label {
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.pl-stat-value {
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pl-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.pl-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

/* ---------- Buttons ---------- */

.pl-btn {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease), color 150ms var(--ease);
}

.pl-btn:hover:not(:disabled) {
  background: var(--surface-muted);
}

.pl-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.pl-btn .material-symbols-outlined {
  font-size: 18px;
}

.pl-btn--primary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--on-ink);
}

.pl-btn--primary:hover:not(:disabled) {
  border-color: var(--ink-2);
  background: var(--ink-2);
}

.pl-btn--hero {
  width: 100%;
  height: 48px;
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
}

.pl-btn--hero:hover:not(:disabled) {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}

.pl-btn--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ink-2);
}

.pl-btn--ghost:hover:not(:disabled) {
  background: var(--surface-muted);
  color: var(--ink);
}

.pl-btn--danger {
  border-color: transparent;
  background: transparent;
  color: var(--danger);
}

.pl-btn--danger:hover:not(:disabled) {
  background: var(--danger-soft);
}

.pl-btn--sm {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.pl-btn--block {
  width: 100%;
}

.pl-btn--square {
  width: 32px;
  padding: 0;
}

.pl-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: pl-spin 700ms linear infinite;
}

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

/* ---------- Segmented control ---------- */

.pl-seg {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 10px;
  background: var(--surface-muted);
}

.pl-seg-btn {
  position: relative;
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}

.pl-seg-btn:hover {
  color: var(--ink);
}

.pl-seg-btn .material-symbols-outlined {
  font-size: 16px;
}

/* ---------- Inputs ---------- */

.pl-input,
.pl-textarea,
.pl-select {
  width: 100%;
  border: 0;
  border-radius: var(--r-md);
  background: var(--surface-muted);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  box-shadow: none;
  outline: 0;
  transition: background-color 150ms var(--ease), box-shadow 150ms var(--ease);
}

.pl-input,
.pl-select {
  height: 44px;
  padding: 0 14px;
}

.pl-textarea {
  min-height: 140px;
  padding: 14px;
  resize: none;
}

.pl-input::placeholder,
.pl-textarea::placeholder {
  color: var(--muted);
}

.pl-input:focus,
.pl-textarea:focus,
.pl-select:focus {
  background: var(--surface);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent);
}

.pl-select-wrap {
  position: relative;
}

.pl-select {
  appearance: none;
  padding-right: 40px;
  cursor: pointer;
}

.pl-select-wrap .material-symbols-outlined {
  position: absolute;
  right: 12px;
  top: 50%;
  color: var(--muted);
  font-size: 20px;
  pointer-events: none;
  transform: translateY(-50%);
}

/* Upload drop zone */

.pl-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  overflow: hidden;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface-muted);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: border-color 150ms var(--ease), background-color 150ms var(--ease);
}

.pl-drop:hover {
  border-color: var(--ink);
  background: var(--surface);
}

.pl-drop:has(img:not(.hidden)) {
  border-style: solid;
  border-color: var(--border);
  background: var(--surface-sunk);
}

.pl-drop .material-symbols-outlined {
  color: var(--ink-2);
  font-size: 24px;
}

.pl-drop-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
}

.pl-drop-hint {
  max-width: 220px;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.pl-drop > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pl-clear {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.72);
  color: #ffffff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.pl-clear:hover {
  background: var(--danger);
}

.pl-clear .material-symbols-outlined {
  color: inherit;
  font-size: 16px;
}

.pl-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 500;
  line-height: 14px;
  white-space: nowrap;
}

.pl-badge .material-symbols-outlined {
  font-size: 14px;
}

.pl-badge--accent {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.pl-badge--success {
  background: var(--success-soft);
  color: var(--success);
}

/* ---------- Modal / dialog ---------- */

.pl-modal {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17, 17, 17, 0.32);
}

.pl-dialog {
  position: relative;
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 24px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  color: var(--ink);
}

.pl-dialog--wide {
  max-width: 880px;
}

.pl-dialog-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: -0.01em;
}

.pl-dialog-text {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

.pl-dialog-close {
  position: absolute;
  right: 16px;
  top: 16px;
}

.pl-menu {
  position: fixed;
  right: 28px;
  top: 76px;
  z-index: 240;
  width: 260px;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}

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

.pl-menu-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 20px;
  text-align: left;
  cursor: pointer;
}

.pl-menu-item:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.pl-menu-item .material-symbols-outlined {
  font-size: 20px;
}

.pl-menu-item--danger,
.pl-menu-item--danger:hover {
  color: var(--danger);
}

/* ---------- Dashboard ---------- */

.pl-hero-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.vs-dashboard-history-thumb {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.08);
}

.vs-dashboard-history-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vs-dashboard-history-thumb > span {
  display: none;
}

.pl-hero-foot {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(360px, 100%);
}

.pl-event-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vs-dashboard-event-card,
.vs-booth-event-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.vs-dashboard-event-card {
  padding: 0 0 16px;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
}

.vs-dashboard-event-card:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.vs-booth-event-card {
  cursor: pointer;
  transition: box-shadow 150ms var(--ease);
}

.vs-booth-event-card:hover {
  box-shadow: 0 0 0 1px var(--border-strong), var(--shadow-card);
}

.pl-event-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pl-event-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pl-event-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.pl-event-gallery {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.pl-event-gallery .material-symbols-outlined {
  flex-shrink: 0;
  font-size: 16px;
}

.pl-event-gallery.is-online {
  color: var(--ink-2);
}

.pl-event-gallery.is-online > .material-symbols-outlined {
  color: var(--success);
}

.vs-dashboard-gallery-link {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 6px;
}

.vs-dashboard-gallery-link-text {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vs-dashboard-gallery-copy {
  display: inline-flex;
  flex-shrink: 0;
  padding: 2px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.vs-dashboard-gallery-copy:hover {
  background: var(--surface);
  color: var(--ink);
}

.pl-event-actions {
  display: flex;
  gap: 6px;
}

.pl-event-actions .pl-btn {
  flex: 1;
}

.pl-event-actions .pl-btn--square {
  flex: 0 0 32px;
}

/* ---------- Playground ---------- */

.pl-subject {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

#vs-ref-preview {
  min-height: 200px;
}

.vs-subject-extra-rail {
  display: flex;
  gap: 8px;
}

#vs-extra-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 36px;
  padding: 10px 0;
  border: 0;
  border-radius: var(--r-md);
  background: var(--surface-muted);
  color: var(--muted);
  cursor: pointer;
}

#vs-extra-toggle:hover {
  color: var(--ink);
}

#vs-extra-toggle .pl-vertical {
  font-size: 11px;
  line-height: 14px;
  writing-mode: vertical-rl;
}

.vs-extra-panel {
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-width 220ms var(--ease), opacity 150ms var(--ease);
}

.vs-extra-panel.is-open {
  max-width: 72px;
  opacity: 1;
}

#vs-extra-grid {
  display: grid;
  grid-template-columns: 56px;
  gap: 6px;
}

.vs-extra-slot {
  position: relative;
  display: flex;
  width: 56px;
  height: 34px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface-muted);
  color: var(--muted);
  cursor: pointer;
}

.vs-extra-slot:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.vs-extra-slot .material-symbols-outlined {
  font-size: 18px;
}

.vs-extra-slot .vs-extra-clear {
  right: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  font-size: 10px;
}

.pl-prompt-box {
  position: relative;
  border-radius: var(--r-md);
  background: var(--surface-muted);
  transition: background-color 150ms var(--ease), box-shadow 150ms var(--ease);
}

.pl-prompt-box:focus-within {
  background: var(--surface);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent);
}

.pl-prompt-box .pl-textarea,
.pl-prompt-box .pl-textarea:focus {
  height: 168px;
  background: transparent;
  box-shadow: none;
}

#vs-mode-cards {
  display: flex;
  width: 100%;
}

.vs-mode-card {
  position: relative;
}

.vs-mode-card.border-indigo-500 {
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--ink);
}

.vs-mode-card.border-indigo-500 .material-symbols-outlined {
  color: var(--accent-ink);
}

.vs-mode-check {
  display: none !important;
}

.vs-mode-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: 30;
  width: 220px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--on-ink);
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 150ms var(--ease), transform 150ms var(--ease);
}

.vs-mode-card:hover .vs-mode-tooltip,
.vs-mode-card:focus-visible .vs-mode-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
  transition-delay: 300ms;
}

#vs-template-warning {
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 12px;
  line-height: 16px;
}

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

.vs-style-slot {
  min-height: 108px;
}

.vs-style-slot > img {
  object-fit: cover;
}

#vs-overlay-preview {
  min-height: 88px;
}

.vs-style-dropdown-panel {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 220ms var(--ease), opacity 150ms var(--ease);
}

.vs-style-dropdown-panel.is-open {
  max-height: 520px;
  opacity: 1;
}

.pl-collapse-btn {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.pl-collapse-btn .material-symbols-outlined {
  color: var(--muted);
}

/* Output stage */

.pl-output-stage {
  position: absolute;
  inset: 72px 20px 76px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#vs-aspect-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: aspect-ratio 220ms var(--ease);
}

#vs-output-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 24px;
  color: var(--on-stage-muted);
  font-size: 13px;
  line-height: 20px;
  text-align: center;
}

#vs-output-empty .material-symbols-outlined {
  color: rgba(255, 255, 255, 0.3);
  font-size: 40px;
}

#vs-output-empty h4 {
  color: var(--on-stage);
  font-size: 15px;
  font-weight: 600;
  line-height: 22px;
}

#vs-output-img {
  object-fit: cover;
}

#vs-before-after-preview {
  background: var(--stage);
}

#vs-output-processing {
  position: absolute;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  background: rgba(20, 20, 22, 0.6);
  transition: opacity 220ms var(--ease);
}

#vs-output-processing-img {
  filter: blur(24px) brightness(0.45);
  transform: scale(1.08);
}

.pl-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.08) 50%, transparent 70%);
  background-size: 220% 100%;
  animation: pl-shimmer 1.6s linear infinite;
}

@keyframes pl-shimmer {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

.pl-processing-copy {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

#vs-output-processing-subtitle {
  max-width: 280px;
  color: var(--on-stage-muted);
  font-size: 12px;
  line-height: 16px;
}

.pl-steps {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.pl-steps span {
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--on-stage);
  font-size: 12px;
  line-height: 16px;
  transition: opacity 220ms var(--ease), background-color 220ms var(--ease);
}

.pl-steps span.text-emerald-400 {
  background: var(--accent);
  color: #ffffff;
  opacity: 1 !important;
}

#vs-output-actions {
  transition: opacity 220ms var(--ease);
}

#vs-btn-compare.vs-before-after-active {
  border-color: transparent;
  background: var(--surface);
  color: var(--ink);
}

#vs-generate-details-panel {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 68px;
  z-index: 25;
  max-height: 50%;
  overflow-y: auto;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  color: var(--ink);
}

#vs-generate-details-status {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
}

#vs-generate-details-vision {
  display: inline-flex;
  margin-top: 8px;
}

#vs-generate-details-prompt {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--surface-muted);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 18px;
  white-space: pre-wrap;
}

/* ---------- History ---------- */

#vs-history-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pl-tile {
  position: relative;
  display: block;
  aspect-ratio: 1;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--r-md);
  background: var(--surface-sunk);
  cursor: pointer;
}

.pl-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms var(--ease);
}

.pl-tile:hover img {
  transform: scale(1.04);
}

.pl-tile.is-selected {
  box-shadow: 0 0 0 2px var(--app-bg), 0 0 0 4px var(--accent);
}

.pl-tile-meta {
  position: absolute;
  left: 6px;
  bottom: 6px;
  display: flex;
  align-items: center;
  gap: 2px;
  max-width: calc(100% - 12px);
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.64);
  color: #ffffff;
  font-size: 10px;
  line-height: 14px;
}

.pl-tile-meta .material-symbols-outlined {
  font-size: 12px;
}

.pl-tile-meta.is-warning { background: rgba(163, 95, 0, 0.88); }
.pl-tile-meta.is-danger { background: rgba(217, 54, 62, 0.9); }

#vs-history-preview {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: var(--stage);
}

#vs-history-preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.pl-history-image {
  position: absolute;
  inset: 72px 20px 168px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pl-history-info {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  color: var(--ink);
}

#vs-history-preview-prompt {
  max-height: 72px;
  overflow-y: auto;
  color: var(--ink-2);
  font-size: 12px;
  line-height: 18px;
  white-space: pre-wrap;
}

#vs-history-preview-retention {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#vs-history-preview-retention .material-symbols-outlined {
  font-size: 14px;
}

/* ---------- Tone utility mapping (JS-applied legacy classes) ---------- */

#screen-vision-studio .text-white\/45,
#screen-vision-studio .text-white\/58 {
  color: var(--muted) !important;
}

#screen-vision-studio .text-rose-200,
#screen-vision-studio .text-rose-200\/85 {
  color: var(--danger) !important;
}

#screen-vision-studio .text-amber-200,
#screen-vision-studio .text-amber-200\/85 {
  color: var(--warning) !important;
}

#screen-vision-studio .text-emerald-200 {
  color: var(--success) !important;
}

/* ---------- Booth: event list ---------- */

#vs-event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

#vs-event-grid .vs-booth-event-card {
  background: var(--surface-muted);
  box-shadow: none;
}

#vs-event-grid .vs-booth-event-card:hover {
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--border-strong);
}

/* ---------- Booth: visual template + configure (legacy markup, themed) ---------- */

#booth-visual-template,
#booth-config {
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--ink);
}

#booth-visual-template {
  padding: 24px;
}

#view-booth .vs-template-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

#view-booth .vs-template-panel {
  padding: 20px;
  border-radius: var(--r-lg);
  background: var(--surface-muted);
}

#view-booth .vs-template-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

#view-booth .vs-template-upload,
#view-booth .vs-template-style-slot,
#view-booth .vs-template-overlay {
  position: relative;
  display: flex;
  min-height: 96px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

#view-booth .vs-template-upload { min-height: 180px; }

#view-booth .vs-template-upload:hover,
#view-booth .vs-template-style-slot:hover,
#view-booth .vs-template-overlay:hover {
  border-color: var(--ink);
}

#view-booth .vs-template-upload img,
#view-booth .vs-template-style-slot img,
#view-booth .vs-template-overlay img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#view-booth .vs-template-overlay img { object-fit: contain; }

#view-booth .vs-template-style-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

#view-booth .vs-template-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 2px;
  border-radius: 10px;
  background: var(--surface-sunk);
}

#view-booth .vs-template-mode-card {
  height: 40px !important;
  border-radius: var(--r-sm) !important;
  background: transparent;
  color: var(--muted);
  font-weight: 500 !important;
}

#view-booth .vs-template-mode-card.is-active {
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--ink);
}

#view-booth .vs-template-list-item {
  background: var(--surface);
  color: var(--ink);
}

#view-booth .vs-template-list-item:hover {
  background: var(--surface-sunk);
}

#view-booth .vs-template-list-item.is-active {
  background: var(--ink);
  color: var(--on-ink);
}

#view-booth .vs-template-input {
  width: 100%;
  border: 0;
  background: var(--surface);
  color: var(--ink);
  outline: 0;
}

#view-booth .vs-template-input:focus {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent);
}

#view-booth .vs-template-primary {
  border: 0;
  background: var(--ink);
  color: var(--on-ink);
}

#view-booth .vs-template-primary:hover { background: var(--ink-2); }

#view-booth .vs-template-ghost {
  border: 0;
  background: var(--surface-muted);
  color: var(--ink-2);
}

#view-booth .vs-template-ghost:hover { background: var(--surface-sunk); color: var(--ink); }

#view-booth .vs-template-clear {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 5;
  display: none;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.72);
  color: #ffffff;
}

#view-booth .vs-template-has-image .vs-template-clear { display: flex; }
#view-booth .vs-template-has-image .vs-template-placeholder { display: none; }

#booth-visual-template [class*="text-white"],
#booth-visual-template h2,
#booth-visual-template h3 {
  color: var(--ink);
}

#booth-visual-template [class*="text-white/"] {
  color: var(--muted);
}

#booth-visual-template .text-rose-100 {
  color: var(--danger);
}

#booth-config {
  overflow: hidden;
}

#booth-config .vs-config-header {
  border-bottom: 1px solid var(--border) !important;
  border-radius: 0 !important;
  background: var(--surface) !important;
  box-shadow: none !important;
}

#booth-config .vs-config-tabs {
  border-color: var(--border) !important;
  background: var(--surface-muted);
}

#booth-config .vs-config-tab {
  color: var(--ink-2);
  font-weight: 500;
}

#booth-config .vs-config-tab.bg-indigo-500\/10 {
  background: var(--surface) !important;
  box-shadow: var(--shadow-card);
  color: var(--ink) !important;
}

#booth-config .vs-config-tab.bg-indigo-500\/10 .material-symbols-outlined {
  color: var(--accent-ink);
}

#view-booth .silk-card {
  border: 0;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

#view-booth .silk-inset {
  border: 0;
  border-radius: var(--r-md);
  background: var(--surface-muted);
  box-shadow: none;
}

#view-booth .silk-btn,
#view-booth .silk-btn-secondary {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
  transition: background-color 150ms var(--ease);
}

#view-booth .silk-btn:hover,
#view-booth .silk-btn-secondary:hover {
  background: var(--surface-muted);
}

#view-booth .silk-btn-primary {
  border: 0;
  background: var(--ink);
  color: var(--on-ink);
  box-shadow: none;
}

#view-booth .silk-btn-primary:hover {
  background: var(--ink-2);
}

#view-booth .text-indigo-400,
#view-booth .text-indigo-500,
#view-booth .text-indigo-600,
#view-booth .text-indigo-700 {
  color: var(--accent-ink) !important;
}

#view-booth .bg-indigo-500 {
  background-color: var(--ink) !important;
}

#view-booth .bg-indigo-50,
#view-booth .bg-indigo-500\/10 {
  background-color: var(--accent-soft) !important;
}

#view-booth .border-indigo-500,
#view-booth .border-indigo-200,
#view-booth .ring-indigo-500 {
  border-color: var(--accent) !important;
  --tw-ring-color: var(--accent) !important;
}

#view-booth .accent-indigo-500,
#view-booth input[type="checkbox"],
#view-booth input[type="radio"],
#view-booth input[type="range"] {
  accent-color: var(--accent);
}

#view-booth .focus\:ring-indigo-500:focus {
  --tw-ring-color: color-mix(in srgb, var(--accent) 45%, transparent) !important;
}

#view-booth .hover\:text-indigo-500:hover,
#view-booth .hover\:text-indigo-600:hover {
  color: var(--accent-ink) !important;
}

#view-booth .hover\:bg-indigo-50:hover {
  background-color: var(--accent-soft) !important;
}

#view-booth .text-slate-400 { color: var(--muted) !important; }
#view-booth .text-slate-500,
#view-booth .text-slate-600 { color: var(--ink-2) !important; }
#view-booth .text-slate-700,
#view-booth .text-slate-800 { color: var(--ink) !important; }
#view-booth .border-slate-200 { border-color: var(--border) !important; }

#view-booth .tracking-widest,
#view-booth .tracking-wider {
  letter-spacing: 0.02em !important;
}

.processing-overlay {
  background: none !important;
  backdrop-filter: none !important;
}

/* ---------- Login ---------- */

#vs-auth-gate.vs-auth-split {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, 1fr);
  gap: 12px;
  padding: 12px;
  overflow: auto;
  background: var(--canvas);
  color: var(--ink);
}

#vs-auth-gate .vs-auth-hero-panel {
  position: relative;
  display: flex;
  min-height: 560px;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 32px;
  border-radius: var(--r-2xl);
  background: var(--accent);
  color: #ffffff;
}

#vs-auth-gate .vs-auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
}

#vs-auth-gate .vs-auth-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

#vs-auth-gate .vs-auth-mark {
  position: absolute;
  right: -12%;
  bottom: -18%;
  width: 78%;
  max-width: 640px;
  opacity: 0.16;
  pointer-events: none;
}

#vs-auth-gate .vs-auth-hero-copy {
  position: relative;
  max-width: 520px;
}

#vs-auth-gate .vs-auth-hero-copy h1 {
  margin: 0;
  font-size: clamp(40px, 4.6vw, 64px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

#vs-auth-gate .vs-auth-brand-caption {
  margin-top: 16px;
  max-width: 380px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 16px;
  line-height: 24px;
}

#vs-auth-gate .vs-auth-form-pane {
  display: grid;
  min-height: 560px;
  place-items: center;
  padding: 40px 32px;
  border-radius: var(--r-2xl);
  background: var(--surface);
}

#vs-auth-form.vs-auth-form {
  display: flex;
  width: min(380px, 100%);
  flex-direction: column;
  gap: 24px;
}

#vs-auth-form .vs-auth-title {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 28px;
  font-weight: 600;
  line-height: 34px;
  letter-spacing: -0.02em;
}

#vs-auth-message {
  min-height: 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
}

#vs-auth-message[data-tone="error"] { color: var(--danger); }
#vs-auth-message[data-tone="success"] { color: var(--success); }

#vs-auth-form .vs-auth-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#vs-auth-form .vs-auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

#vs-auth-form .vs-auth-field {
  display: flex;
  height: 48px;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-radius: var(--r-md);
  background: var(--surface-muted);
  color: var(--muted);
  transition: background-color 150ms var(--ease), box-shadow 150ms var(--ease);
}

#vs-auth-form .vs-auth-field:focus-within {
  background: var(--surface);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--ink);
}

#vs-auth-form .vs-auth-field .material-symbols-outlined {
  flex-shrink: 0;
  font-size: 20px;
}

#vs-auth-email,
#vs-auth-password,
#vs-auth-confirm-password,
#vs-auth-otp {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  box-shadow: none;
}

#vs-auth-email::placeholder,
#vs-auth-password::placeholder,
#vs-auth-confirm-password::placeholder,
#vs-auth-otp::placeholder {
  color: var(--muted);
}

#vs-auth-gate input:-webkit-autofill,
#vs-auth-gate input:-webkit-autofill:hover,
#vs-auth-gate input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--surface-muted) inset;
  -webkit-text-fill-color: var(--ink);
}

#vs-auth-password-toggle {
  display: inline-flex;
  width: 32px;
  height: 32px;
  margin-right: -6px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

#vs-auth-password-toggle:hover {
  background: var(--surface-sunk);
  color: var(--ink);
}

#vs-auth-form .vs-auth-remember {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 18px;
  cursor: pointer;
}

#vs-auth-remember {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

#vs-auth-form .vs-auth-check-box { display: none; }

#vs-auth-login-btn.vs-auth-submit {
  display: flex;
  height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms var(--ease);
}

#vs-auth-login-btn.vs-auth-submit:hover:not(:disabled) {
  background: var(--accent-hover);
}

#vs-auth-login-btn.vs-auth-submit:disabled {
  opacity: 0.6;
  cursor: wait;
}

#vs-auth-login-btn .material-symbols-outlined { font-size: 20px; }

#vs-auth-form .vs-auth-mode-switch {
  display: flex;
  justify-content: center;
  margin-top: -8px;
}

#vs-auth-form .vs-auth-tab {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

#vs-auth-form .vs-auth-tab:hover {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

#vs-auth-form .vs-auth-tab.is-active { display: none; }

#vs-auth-form .vs-auth-legal {
  margin: -8px auto 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

#vs-auth-resend-code {
  align-self: center;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
}

#vs-auth-resend-code:hover:not(:disabled) {
  color: var(--accent-ink);
  text-decoration: underline;
}

#vs-auth-gate button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---------- Plans (subscription / credits) ---------- */

.pl-plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.pl-plans--single {
  grid-template-columns: 1fr;
}

.vs-subscription-plan {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px;
  border-radius: var(--r-lg);
  background: var(--surface-muted);
}

.pl-plan-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.pl-plan-price {
  margin-top: 8px;
  color: var(--ink);
  font-size: 28px;
  font-weight: 500;
  line-height: 34px;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.pl-plan-period {
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
}

.vs-subscription-plan .pl-btn {
  margin-top: 16px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1440px) {
  #vs-header-subscribe > span:not(.material-symbols-outlined) { display: none; }
}

@media (max-width: 1200px) {
  .pl-tab { padding: 0 14px; }
  .pl-credit #vs-credit-status { display: none; }
}

@media (max-width: 960px) {
  .pl-tabs { display: none; }
  .pl-header { grid-template-columns: 1fr auto; }
  .pl-view { display: flex; flex-direction: column; overflow-y: auto; }
  .pl-view > .pl-media { flex: 0 0 auto; min-height: 420px; aspect-ratio: 4 / 3; }
  .pl-view > .pl-column { flex-shrink: 0; overflow: visible; }
  .pl-column-foot { position: static; background: none; }
  .pl-view--media-last > .pl-media { order: 2; }
  #view-booth .vs-template-shell { grid-template-columns: 1fr; }
  #vs-auth-gate.vs-auth-split { grid-template-columns: 1fr; }
  #vs-auth-gate .vs-auth-hero-panel { min-height: 280px; }
  .pl-plans { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  #app-content { padding: 0; }
  #screen-vision-studio.pl-app { border-radius: 0; }
  .pl-body { flex-direction: column-reverse; padding: 0 12px; gap: 12px; }
  .pl-rail {
    flex-direction: row;
    justify-content: space-around;
    width: 100%;
    height: 56px;
    padding: 0;
  }
  .pl-rail-group { flex-direction: row; }
  .pl-rail-group--end { margin: 0; }
  .pl-rail-btn.is-active::before { left: 12px; top: auto; bottom: -8px; width: 16px; height: 3px; border-radius: 3px 3px 0 0; }
  .pl-rail-btn[data-label]::after { display: none; }
  .pl-header { padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .pl-view,
  .pl-shimmer,
  .pl-spinner {
    animation: none;
  }

  .pl-tile:hover img {
    transform: none;
  }
}

/* ---------- Settings ---------- */

.pl-settings-panel {
  display: flex;
  min-width: 0;
  min-height: 0;
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.pl-settings-queue {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  padding: 20px;
}

.pl-settings-queue-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.pl-queue-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.pl-queue-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.pl-queue-title {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pl-queue-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  text-transform: capitalize;
  white-space: nowrap;
}

.pl-queue-state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--faint);
}

.pl-queue-state[data-tone="ok"]::before { background: var(--success); }
.pl-queue-state[data-tone="busy"]::before { background: var(--accent); }
.pl-queue-state[data-tone="warn"]::before { background: var(--warning); }
.pl-queue-state[data-tone="error"]::before { background: var(--danger); }

.pl-queue-meta {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
  word-break: break-all;
}

.pl-queue-actions {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

/* Subscription dialog: title block full width, actions underneath */
.pl-subscription-head {
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: 16px;
  padding-right: 40px;
}
