/* Species Editor — Linear-styled review panel
   ─────────────────────────────────────────────
   Design system reuse: --aq-text*, --aq-line*, --aq-surface*, --aq-accent*
   Local prefix: .se-
*/

.se-screen {
  display: grid;
  grid-template-columns: 1fr 460px;
  /* No column gap — the preview and form sit on one continuous surface
     split by the form's left divider line, not separated by a gutter. */
  gap: 0;
  width: 100%;
  height: 100%;
  padding: 8px;
  /* Transparent so the editor canvas shows the main window's own
     surface (.aq-main's --aq-main-grad) continuously with the
     breadcrumb/topbar above it. Both columns share that surface; the
     form is divided off by a single left rule rather than a card box. */
  background: transparent;
  color: var(--aq-text-muted);
  font-family: var(--aq-ff-sans);
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
  box-sizing: border-box;
}

/* ── Mock left preview (placeholder — represents the existing live preview) */
.se-preview {
  position: relative;
  /* No stage surface of its own — transparent so it sits on the page
     background (the same near-black the breadcrumb/topbar use), reading
     as the canvas rather than a separate window. Only the right form is
     a panel. The kiosk render keeps its own dark screen + shadow. */
  background: transparent;
  overflow: hidden;
}
.se-preview-art {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 50% 45%, rgba(80,140,200,0.18), transparent 70%),
    radial-gradient(ellipse 90% 70% at 50% 100%, rgba(60,80,130,0.10), transparent 60%),
    #04060a;
}
.se-preview-glow {
  position: absolute;
  left: 50%; top: 45%;
  transform: translate(-50%, -50%);
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(180,210,240,0.18), rgba(180,210,240,0.04) 50%, transparent 70%);
  filter: blur(2px);
}
.se-preview-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black, transparent 80%);
}
.se-preview-jelly {
  position: absolute;
  left: 50%; top: 45%;
  transform: translate(-50%, -50%);
  width: 240px; height: 200px;
  background:
    radial-gradient(ellipse 80% 50% at 50% 30%, rgba(220,235,250,0.55), transparent 60%),
    radial-gradient(ellipse 50% 35% at 50% 30%, rgba(255,255,255,0.35), transparent 70%);
  filter: blur(1px);
}
.se-preview-foot {
  position: absolute;
  left: 28px; bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.se-preview-name {
  font-family: var(--aq-ff-display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #f0f1f4;
}
.se-preview-latin {
  font-style: italic;
  font-size: 13px;
  color: var(--aq-text-faint);
}
.se-preview-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--aq-text-faint);
  margin-top: 8px;
}
.se-preview-tab {
  position: absolute;
  left: 16px; bottom: 16px;
  font-size: 11px;
  padding: 4px 9px;
  border: 1px solid var(--aq-line);
  border-radius: 5px;
  background: rgba(255,255,255,0.03);
  color: var(--aq-text-dim);
  display: none; /* mocked label, hidden — real preview already has its own */
}

/* ── Right panel shell ───────────────────────────────────────────── */

/* Right form panel — uses token surfaces so it flips with theme.
   The radial gradient on top reads as a faint top-right highlight in
   dark and is invisible on white in light. */
.se-panel {
  /* No card box of its own — the form shares the main window surface
     with the preview and is separated by a single left divider line. */
  background: transparent;
  border-left: 1px solid var(--aq-line);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.se-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ── Header ──────────────────────────────────────────────────────── */
.se-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 10px;
  flex-shrink: 0;
}
.se-header h2 {
  margin: 0;
  font-family: var(--aq-ff-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--aq-text);
  letter-spacing: -0.005em;
}
.se-header-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--aq-text-faint);
}
.se-sep { color: var(--aq-text-faint); opacity: 0.6; }
.se-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--aq-text-dim);
  flex-shrink: 0;
}
.se-status-dot.is-warn { background: var(--aq-warn); box-shadow: 0 0 8px color-mix(in srgb, var(--aq-warn) 60%, transparent); }
.se-status-dot.is-faint { background: var(--aq-text-faint); }

.se-icon-btn {
  width: 26px; height: 26px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: var(--aq-text-dim);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background var(--aq-d-1) var(--aq-ease), color var(--aq-d-1) var(--aq-ease);
}
.se-icon-btn:hover { background: rgba(255,255,255,0.05); color: var(--aq-text); }

/* ── Body / scroll area ──────────────────────────────────────────── */
.se-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}
.se-body-scroll { padding: 4px 0; }
.se-body-tight { padding: 0; }

/* ── Section (single-panel + tabbed) ─────────────────────────────── */
.se-section {
  padding: 16px 22px 20px;
}
.se-section + .se-section {
  border-top: 1px solid var(--aq-line);
}
.se-section.is-flush {
  padding: 18px 22px 22px;
}
.se-section.is-flush + .se-section.is-flush { border-top: 0; }

.se-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.085em;
  color: var(--aq-text-faint);
  margin-bottom: 14px;
  font-weight: 500;
}
.se-section-hint { font-size: 11px; text-transform: none; letter-spacing: 0; color: var(--aq-text-faint); }

.se-section-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Field ───────────────────────────────────────────────────────── */
.se-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.se-field-label {
  font-size: 11.5px;
  color: var(--aq-text-faint);
  font-weight: 500;
  display: inline-flex;
  align-items: baseline;
  gap: 0;
}
.se-field-hint {
  color: var(--aq-text-faint);
  opacity: 0.7;
  font-weight: 400;
}
.se-field-control { display: flex; min-width: 0; }

/* Borderless-until-focus inputs (Linear style) */
.se-input,
.se-textarea {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  color: var(--aq-text);
  font: inherit;
  font-size: 13px;
  padding: 4px 0 5px;
  outline: 0;
  resize: none;
  font-family: inherit;
  line-height: 1.5;
  transition: border-color var(--aq-d-1) var(--aq-ease), background var(--aq-d-1) var(--aq-ease);
}
.se-input.is-mono { font-family: var(--aq-ff-mono); font-size: 12px; color: var(--aq-text-muted); }
/* SE_Input renders as a 1-row textarea so long values wrap to a second
   line instead of overflowing horizontally. field-sizing grows the box;
   white-space pre-wrap is required for the wrap to actually happen
   inside a textarea. */
.se-input {
  field-sizing: content;
  overflow: hidden;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.se-textarea {
  padding: 6px 0;
  text-wrap: pretty;
  /* Auto-grow to fit content — no inner scrollbar. The `rows` attr
     still defines the minimum height. Supported in Chromium 123+,
     which covers the CMS target browsers. */
  field-sizing: content;
  overflow: hidden;
}
.se-input::placeholder,
.se-textarea::placeholder { color: var(--aq-text-faint); }
.se-input:hover,
.se-textarea:hover { border-bottom-color: var(--aq-line); }
.se-input:focus,
.se-textarea:focus {
  border-bottom-color: var(--aq-text);
}

/* Select wraps native <select> */
.se-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 100%;
  border-bottom: 1px solid transparent;
  transition: border-color var(--aq-d-1) var(--aq-ease);
}
.se-select:hover { border-bottom-color: var(--aq-line); }
.se-select:focus-within { border-bottom-color: var(--aq-text); }
.se-select select {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--aq-text);
  font: inherit;
  font-size: 13px;
  padding: 4px 22px 5px 0;
  cursor: pointer;
}
.se-select select option { background: #1a1c20; color: var(--aq-text); }
.se-select svg {
  position: absolute;
  right: 2px;
  pointer-events: none;
  color: var(--aq-text-faint);
}

/* Layout helpers */
.se-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.se-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px 18px; }

/* Inline button row at bottom of a section */
.se-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.se-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: 6px;
  border: 1px solid var(--aq-line);
  background: rgba(255,255,255,0.03);
  color: var(--aq-text);
  cursor: pointer;
  transition: background var(--aq-d-1) var(--aq-ease), border-color var(--aq-d-1) var(--aq-ease);
}
.se-btn:hover { background: rgba(255,255,255,0.06); border-color: var(--aq-line-bright); }
.se-btn.is-primary {
  background: rgba(255,255,255,0.92);
  color: #0c1119;
  border-color: transparent;
  box-shadow: none;
}
.se-btn.is-primary:hover { background: #fff; }
.se-btn.is-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--aq-text-dim);
}
.se-btn.is-ghost:hover { background: rgba(255,255,255,0.04); color: var(--aq-text); }

/* ── Slider (display size) ───────────────────────────────────────── */
.se-slider { display: flex; align-items: center; gap: 10px; flex: 1; }
.se-slider-track {
  flex: 1;
  height: 4px;
  background: var(--aq-line);
  border-radius: 2px;
  position: relative;
}
.se-slider-fill {
  display: block;
  height: 100%;
  background: var(--aq-text);
  border-radius: 2px;
}
.se-slider-val {
  font-size: 11.5px;
  color: var(--aq-text-dim);
  font-variant-numeric: tabular-nums;
  font-family: var(--aq-ff-mono);
  min-width: 36px;
  text-align: right;
}

/* ── Media block ─────────────────────────────────────────────────── */
.se-media-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.se-media-thumb {
  width: 88px; height: 88px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--aq-line);
  flex-shrink: 0;
}
.se-media-thumb-art {
  width: 100%; height: 100%;
  background:
    radial-gradient(ellipse 80% 110% at 30% 30%, oklch(0.55 0.10 var(--sp-hue) / 0.55), transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 80%, oklch(0.40 0.14 var(--sp-hue) / 0.45), transparent 65%),
    oklch(0.22 0.04 var(--sp-hue));
  display: grid;
  place-items: center;
}
.se-media-thumb-mono {
  font-family: var(--aq-ff-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.55);
  background: rgba(0,0,0,0.18);
  padding: 2px 6px;
  border-radius: 3px;
}
.se-media-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

/* ── Tabs (variant 2) ────────────────────────────────────────────── */
.se-tabs {
  display: flex;
  gap: 2px;
  padding: 0 16px;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.se-tab {
  position: relative;
  background: transparent;
  border: 0;
  padding: 10px 10px 11px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--aq-text-dim);
  cursor: pointer;
  white-space: nowrap;
}
.se-tab { transition: color var(--aq-d-1) var(--aq-ease), background var(--aq-d-1) var(--aq-ease); }
.se-tab:hover { color: var(--aq-text); background: rgba(255,255,255,0.04); border-radius: 5px; }
.se-tab.is-active { color: var(--aq-text); }
.se-tab.is-active::after {
  content: "";
  position: absolute;
  left: 6px; right: 6px; bottom: -1px;
  height: 1.5px;
  background: var(--aq-text);
  border-radius: 1px;
}

/* ── Accordion (variant 3) ───────────────────────────────────────── */
.se-acc + .se-acc { border-top: 1px solid var(--aq-line); }
.se-acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: transparent;
  border: 0;
  color: var(--aq-text);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.085em;
  transition: background var(--aq-d-1) var(--aq-ease);
}
.se-acc-head:hover { background: rgba(255,255,255,0.04); }
.se-acc.is-open .se-acc-head { padding-bottom: 6px; }
.se-section-label-text { color: var(--aq-text-faint); font-weight: 500; font-size: 10.5px; }
.se-acc.is-open .se-section-label-text { color: var(--aq-text); }
.se-acc-chev {
  color: var(--aq-text-faint);
  transition: transform var(--aq-d-1) var(--aq-ease);
}
.se-acc-chev.is-open { transform: rotate(90deg); }
.se-acc-summary {
  margin-left: auto;
  font-size: 11.5px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--aq-text-faint);
  font-weight: 400;
}
.se-acc-body {
  padding: 4px 22px 18px;
}

/* ── Footer ──────────────────────────────────────────────────────── */
.se-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  flex-shrink: 0;
}
.se-footer-actions { display: flex; align-items: center; gap: 8px; }

/* ── Scrollbar ───────────────────────────────────────────────────── */
.se-body::-webkit-scrollbar { width: 8px; }
.se-body::-webkit-scrollbar-thumb { background: var(--aq-line-strong); border-radius: 4px; }
.se-body::-webkit-scrollbar-track { background: transparent; }

/* ── Light-mode overrides ────────────────────────────────────────────
   The prototype's interactive surfaces use rgba(255,255,255,…) hover/
   raised states for the dark theme. Those go invisible on white in
   light mode — flip them to subtle surface tokens. The .se-screen and
   .se-preview backgrounds stay dark (intentional — they represent
   physical screen content). */

html[data-color-scheme="light"] .se-btn {
  background: var(--aq-surface-2);
}
html[data-color-scheme="light"] .se-btn:hover {
  background: var(--aq-surface-3);
}
html[data-color-scheme="light"] .se-btn.is-primary {
  background: var(--aq-text);
  color: #fff;
}
html[data-color-scheme="light"] .se-btn.is-ghost { background: transparent; }
html[data-color-scheme="light"] .se-btn.is-ghost:hover {
  background: var(--aq-surface-2);
}
html[data-color-scheme="light"] .se-icon-btn:hover {
  background: var(--aq-surface-2);
}
html[data-color-scheme="light"] .se-acc-head:hover {
  background: var(--aq-surface-2);
}
html[data-color-scheme="light"] .se-footer {
  background: var(--aq-bg);
}
html[data-color-scheme="light"] .se-select select option {
  background: var(--aq-surface);
  color: var(--aq-text);
}
