/**
 * Component Styles
 * Individual UI components like buttons, inputs, and controls
 */

/* ---------- Shared select appearance ---------- */
.device-select,
.toolbar-select,
.record-group select {
  appearance: none;
  font-family: inherit;
  font-weight: 500;
  background-color: var(--input-bg);
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  cursor: pointer;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.device-select,
.toolbar-select {
  border-radius: var(--radius-sm);
  font-size: 14px;
}

.device-select {
  width: 100%;
  padding: 10px 36px 10px 14px;
  background-position: right 14px center;
  background-size: 12px 8px;
}

.toolbar-select {
  width: auto;
  min-width: 120px;
  padding: 8px 28px 8px 12px;
  font-size: 13px;
  background-position: right 12px center;
  background-size: 12px 8px;
}

.record-group select {
  width: 100%;
  border-radius: var(--radius-sm);
  padding: 8px 28px 8px 10px;
  font-size: 13px;
  background-position: right 10px center;
  background-size: 12px 8px;
  text-overflow: ellipsis;
}

.device-select:focus,
.toolbar-select:focus,
.record-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.record-group select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Control Group ---------- */
.control-group {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.control-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ---------- View mode (workspace bar segmented control) ---------- */
.view-mode {
  display: flex;
  align-items: center;
}

.view-mode[hidden] {
  display: none;
}

.view-mode-segment {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius-md);
  background: var(--input-bg);
  border: 1px solid var(--border-strong);
}

.view-mode-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  padding: 7px 12px;
  border-radius: calc(var(--radius-md) - 3px);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.view-mode-btn:hover {
  color: var(--text-primary);
}

.view-mode-btn.is-active {
  background: var(--surface-elevated);
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
}

.view-mode-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
}

/* ---------- Control Actions ---------- */
.control-actions {
  display: grid;
  gap: 10px;
  align-content: start;
}

.screen-dimensions {
  padding: 8px 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-ring);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Upload input is driven by its labelled button; keep the input hidden */
input[type="file"] {
  display: none;
}

/* ---------- Download Actions ---------- */
.download-actions {
  display: flex;
  flex-direction: row;
  gap: 10px;
  flex-wrap: nowrap;
  align-items: stretch;
}

.download-actions > .dropdown {
  flex: 1 1 0;
  min-width: 0;
}

.download-actions .btn-primary,
.download-actions .btn-ghost {
  width: 100%;
}

/* ---------- Buttons — one treatment per variant ---------- */
.btn-primary,
.btn-ghost,
.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

/* Primary — solid accent */
.btn-primary {
  border: none;
  background: var(--accent);
  color: var(--accent-fg);
}

.btn-primary:not(:disabled):hover {
  background: var(--accent-strong);
  box-shadow: var(--shadow-raise-hover);
  transform: translateY(-1px);
}

.btn-primary:not(:disabled):active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-primary:disabled {
  background: var(--accent-soft);
  color: var(--accent);
  cursor: not-allowed;
  box-shadow: none;
}

/* Ghost — outlined secondary */
.btn-ghost {
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-primary);
}

.btn-ghost:not(:disabled):hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 8px 18px var(--accent-ring);
  transform: translateY(-1px);
}

.btn-ghost:not(:disabled):active {
  transform: translateY(0);
}

.btn-ghost:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Danger — recording / destructive */
.btn-danger {
  border: none;
  background: var(--danger);
  color: var(--danger-fg);
  box-shadow: var(--shadow-danger);
}

.btn-danger:not(:disabled):hover {
  background: var(--danger-strong);
  box-shadow: var(--shadow-danger-hover);
  transform: translateY(-1px);
}

.btn-danger:not(:disabled):active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-danger:disabled {
  background: var(--danger-soft);
  color: var(--danger);
  cursor: not-allowed;
  box-shadow: none;
}

/* While recording the same button becomes a neutral "stop" control */
.btn-danger[data-recording="true"],
.btn-danger[data-recording="true"]:hover {
  background: var(--surface-inverse);
  color: var(--surface-inverse-fg);
  box-shadow: var(--shadow-inverse);
  transform: none;
}

/* ---------- Record Group ---------- */
.record-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed var(--accent-ring);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  overflow: hidden;
  min-width: 0;
}

/* All descendants inside the record group must respect the container's
   width. border-box ensures padding + border are included in width:100%.
   The universal min-width: 0 lets grid items shrink below their content's
   intrinsic min-width (CSS grid default is min-width: auto). */
.record-group *,
.record-group *::before,
.record-group *::after {
  box-sizing: border-box;
  min-width: 0;
}

.record-group[hidden] {
  display: none;
}

.record-group label {
  display: grid;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* Export settings — stacked rows so long option labels never clip in the
   240-360px control pane. */
.record-settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

/* Live readout of the resolution the current settings will produce. */
.record-output {
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.record-hint {
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-secondary);
  margin: 0;
}

.record-progress {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.record-progress[hidden] {
  display: none;
}

.record-progress-bar {
  height: 6px;
  background: var(--track);
  border-radius: 999px;
  overflow: hidden;
}

.record-progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent-gradient);
  transition: width 0.1s linear;
}

/* ---------- Export overlay ---------- */
/* Shown while the encoder drains and the file is muxed. Without it the stop
   click looks like a no-op until the download appears. */
.export-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--scrim);
  backdrop-filter: blur(2px);
  animation: export-fade-in 0.15s ease;
}

.export-overlay[hidden] {
  display: none;
}

.export-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(320px, calc(100vw - 48px));
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-overlay);
  text-align: center;
}

.export-spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid var(--accent-ring);
  border-top-color: var(--accent);
  animation: export-spin 0.8s linear infinite;
}

.export-card[data-state="done"] .export-spinner {
  border-color: var(--success);
  border-top-color: var(--success);
  animation: none;
}

.export-card[data-state="error"] .export-spinner {
  border-color: var(--danger);
  border-top-color: var(--danger);
  animation: none;
}

.export-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.export-detail {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.export-bar {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}

.export-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--accent-gradient);
  transition: width 0.2s linear;
}

/* Indeterminate sweep — used while the remaining work can't be measured. */
.export-bar[data-indeterminate="true"] span {
  width: 40% !important;
  animation: export-sweep 1.1s ease-in-out infinite;
}

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

@keyframes export-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes export-sweep {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(350%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .export-spinner {
    animation-duration: 2.4s;
  }
  .export-bar[data-indeterminate="true"] span {
    animation-duration: 2.4s;
  }
}
/* ---------- Desktop-only gate ---------- */

/*
 * Full-screen notice shown in place of the app when the head gate detects a
 * non-desktop device. Consumes semantic tokens so it follows light/dark theme.
 */
.device-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-page);
  color: var(--text-primary);
}

.device-gate-card {
  max-width: 460px;
  padding: 36px 40px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-overlay);
  text-align: center;
}

.device-gate-card h1 {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

.device-gate-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* ---------- Export / copy dropdown menus ---------- */

.dropdown {
  position: relative;
  flex: 1 1 0;
}

.dropdown-trigger {
  width: 100%;
}

.dropdown-menu {
  position: absolute;
  /* No gap below the trigger: a gap would drop :hover mid-traverse and the
     menu would collapse before the pointer reaches it. Separation comes from
     the menu's own border + padding. Open direction is set dynamically by
     JS (.open-up / .open-down) based on available viewport space. */
  top: 100%;
  left: 0;
  z-index: 30;
  min-width: 100%;
  padding: 6px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-raise);
  display: none;
  flex-direction: column;
  gap: 2px;
  max-height: min(440px, 60vh);
  overflow-y: auto;
}

/* Collapsed by default; JS adds .open on hover / keyboard focus. */
.dropdown-menu.open {
  display: flex;
}

.dropdown-menu.open-up {
  top: auto;
  bottom: 100%;
}

.dropdown-menu.open-down {
  top: 100%;
  bottom: auto;
}

.dropdown-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.dropdown-item:hover,
.dropdown-item:focus-visible {
  background: var(--accent-soft);
  outline: none;
}

.dropdown-item:active {
  background: var(--accent-soft-strong);
}

/* ---------- Export toast ---------- */

.export-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(8px);
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 18px;
  background: var(--surface-inverse);
  color: var(--surface-inverse-fg);
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  box-shadow: var(--shadow-overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9998;
}

.export-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.dropdown-divider {
  height: 1px;
  margin: 4px 6px;
  background: var(--border);
}

/* ---------- Scene composition editor ---------- */

/* .control-group is display:grid, so [hidden] needs an explicit override or
   the group stays visible even when toggled off. */
.control-group[hidden] {
  display: none;
}

.scene-devices-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.scene-add-btn {
  appearance: none;
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.scene-add-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

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

.scene-add-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.scene-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: end;
}

.scene-field {
  display: grid;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  min-width: 0;
}

.scene-field select {
  width: 100%;
  appearance: none;
  font-family: inherit;
  font-weight: 500;
  background-color: var(--input-bg);
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 8px;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 28px 8px 10px;
  font-size: 13px;
  text-overflow: ellipsis;
  cursor: pointer;
}

.scene-field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.scene-field input[type="color"] {
  width: 100%;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  cursor: pointer;
}

.scene-field input[type="color"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.scene-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  padding-bottom: 8px;
}

.scene-slots {
  display: grid;
  gap: 6px;
}

.scene-slot-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.scene-slot-row.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.scene-slot-label {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--input-bg);
  border: 1px solid var(--border-strong);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

.scene-slot-row.is-selected .scene-slot-label {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.scene-slot-row select {
  width: 100%;
  min-width: 0;
  appearance: none;
  font-family: inherit;
  font-weight: 500;
  background-color: var(--input-bg);
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 8px;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 7px 26px 7px 9px;
  font-size: 12px;
  text-overflow: ellipsis;
  cursor: pointer;
}

.scene-slot-row select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.scene-remove-btn {
  appearance: none;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-strong);
  background: var(--input-bg);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.scene-remove-btn:hover:not(:disabled) {
  color: var(--danger);
  border-color: var(--danger);
}

.scene-remove-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.scene-remove-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-ring);
}

/* ---------- Billing (Pro upgrade) ---------- */

.billing-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  margin-right: 8px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--input-bg);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease,
    background-color 0.15s ease;
}

.billing-status-badge:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.billing-status-badge.is-pro {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.billing-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.billing-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 20px;
  font-family: inherit;
}

.billing-modal[hidden] {
  display: none;
}

.billing-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 17, 21, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: billing-fade-in 0.18s ease-out;
}

:root[data-theme="dark"] .billing-modal-backdrop {
  background: rgba(0, 0, 0, 0.7);
}

.billing-modal-card {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--surface-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  box-shadow: var(--shadow-elevated);
  animation: billing-pop-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}

@keyframes billing-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes billing-pop-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.billing-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.billing-modal-close:hover {
  background: var(--input-bg);
  color: var(--text-primary);
}

.billing-modal-pro-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.billing-modal-header {
  margin-top: 14px;
  margin-bottom: 18px;
}

.billing-modal-title {
  font-size: 22px;
  font-weight: 700;
  margin: 8px 0 6px;
  line-height: 1.2;
}

.billing-modal-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.billing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.billing-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-primary);
}

.billing-check {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.billing-plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.billing-plan {
  position: relative;
  text-align: left;
  padding: 16px 14px 14px;
  border: 1px solid var(--border-strong);
  background: var(--input-bg);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease,
    background-color 0.15s ease;
  color: inherit;
  font: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.billing-plan:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.billing-plan-recommended {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.billing-plan-recommended-tag {
  position: absolute;
  top: -8px;
  right: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.billing-plan-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.billing-plan-price {
  font-size: 26px;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.billing-plan-period {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.billing-plan-cta {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-top: 4px;
}

.billing-manage {
  text-align: center;
  margin: 6px 0 14px;
}

.billing-manage-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  text-decoration: underline;
  cursor: pointer;
  font-size: 13px;
  padding: 4px 8px;
}

.billing-manage-btn:hover {
  color: var(--text-primary);
}

.billing-license {
  border-top: 1px solid var(--border-strong);
  padding-top: 14px;
  margin-top: 4px;
}

.billing-license-details summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  list-style: none;
  user-select: none;
}

.billing-license-details summary::-webkit-details-marker {
  display: none;
}

.billing-license-details summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s ease;
}

.billing-license-details[open] summary::before {
  content: "▾ ";
}

.billing-license-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.billing-license-row input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.billing-license-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.billing-license-status {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.billing-license-status[data-kind="error"] {
  color: var(--danger);
}

.billing-license-status[data-kind="ok"] {
  color: var(--accent);
}

.billing-secure {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  margin: 14px 0 0;
}

.billing-gate-card {
  width: min(420px, 100%);
  text-align: center;
}

.billing-gate-card .billing-modal-title {
  margin-top: 12px;
}

.billing-gate-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}

.billing-gate-actions .btn-primary,
.billing-gate-actions .btn-ghost {
  padding: 10px 18px;
  font-size: 14px;
}

.feature-locked {
  position: relative;
  pointer-events: none;
  opacity: 0.55;
}

.feature-locked::after {
  content: "PRO";
  position: absolute;
  top: 6px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  pointer-events: none;
}
