﻿:root {
  color-scheme: dark;
  --bg: #05090e;
  --bg-soft: #08111a;
  --panel: rgba(9, 18, 28, 0.88);
  --panel-strong: rgba(11, 23, 35, 0.96);
  --panel-soft: rgba(15, 31, 45, 0.68);
  --line: rgba(126, 180, 205, 0.16);
  --line-strong: rgba(96, 221, 231, 0.34);
  --text: #e9f4f7;
  --muted: #8299a6;
  --muted-strong: #a9bdc6;
  --cyan: #56e6e7;
  --cyan-soft: rgba(86, 230, 231, 0.13);
  --blue: #4f8cff;
  --blue-soft: rgba(79, 140, 255, 0.14);
  --violet: #9577ff;
  --danger: #ff667d;
  --warning: #f4be62;
  --success: #67e2a2;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  --font-ui: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --font-display: "Bahnschrift", "Arial Narrow", "Microsoft YaHei UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
}

body {
  min-width: 960px;
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
select,
input[type="range"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

::selection {
  color: #031014;
  background: var(--cyan);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(121, 166, 184, 0.26);
  background-clip: padding-box;
}

.ambient-bg,
.ambient-grid,
.scanline,
.ambient-glow {
  position: fixed;
  pointer-events: none;
}

.ambient-bg {
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.ambient-grid {
  inset: -20%;
  opacity: 0.28;
  transform: perspective(600px) rotateX(58deg) translateY(9%);
  background-image:
    linear-gradient(rgba(91, 216, 226, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 216, 226, 0.1) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, transparent 4%, #000 42%, transparent 92%);
}

.ambient-glow {
  width: 42vw;
  height: 42vw;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.13;
}

.glow-one {
  top: -20vw;
  left: 24vw;
  background: var(--cyan);
}

.glow-two {
  right: -18vw;
  bottom: -24vw;
  background: var(--blue);
}

.scanline {
  inset: 0;
  opacity: 0.045;
  background: repeating-linear-gradient(to bottom, transparent 0 3px, #d9ffff 4px);
}

.app-shell {
  display: grid;
  grid-template-rows: 68px minmax(0, 1fr);
  height: 100vh;
  padding: 0 14px 14px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(240px, 290px) 1fr auto;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px 4px 12px 4px;
  background: linear-gradient(145deg, rgba(86, 230, 231, 0.15), rgba(79, 140, 255, 0.04));
  color: var(--cyan);
  font: 700 16px/1 var(--font-display);
  letter-spacing: 0.08em;
  box-shadow: inset 0 0 20px rgba(86, 230, 231, 0.05);
}

.brand-copy {
  display: grid;
  gap: 3px;
}

.brand-copy strong {
  font: 700 15px/1 var(--font-display);
  letter-spacing: 0.12em;
}

.brand-copy small {
  color: var(--muted);
  font: 600 9px/1 var(--font-display);
  letter-spacing: 0.13em;
}

.topnav {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.nav-tab {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 10px 16px;
  background: transparent;
  color: var(--muted-strong);
  font-size: 13px;
  transition: 160ms ease;
}

.nav-tab:hover {
  border-color: var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}

.nav-tab.is-active {
  border-color: var(--line-strong);
  color: var(--cyan);
  background: var(--cyan-soft);
  box-shadow: inset 0 -2px 0 rgba(86, 230, 231, 0.25);
}

.system-status {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  color: var(--muted-strong);
  background: rgba(6, 13, 20, 0.72);
  font-size: 11px;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px rgba(103, 226, 162, 0.65);
}

.system-status.is-api .status-dot {
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(86, 230, 231, 0.75);
}

.system-status.is-error .status-dot {
  background: var(--danger);
  box-shadow: 0 0 10px rgba(255, 102, 125, 0.7);
}

.workspace {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr) 368px;
  gap: 12px;
  min-height: 0;
  padding-top: 14px;
}

.panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.018), transparent 36%),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.left-panel,
.right-panel {
  overflow: hidden;
}

.center-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-scroll {
  min-height: 0;
  overflow-y: auto;
}

.left-panel .panel-scroll,
.right-panel .panel-scroll {
  height: 100%;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 20px 18px 13px;
}

.eyebrow {
  display: block;
  margin-bottom: 5px;
  color: var(--cyan);
  font: 600 9px/1 var(--font-display);
  letter-spacing: 0.18em;
}

.panel-heading h2,
.view-header h1,
.modal-head h2 {
  margin: 0;
  font: 650 18px/1.2 var(--font-display);
  letter-spacing: 0.02em;
}

.panel-heading .muted {
  color: var(--muted);
  font-size: 11px;
}

.logo-readout {
  padding: 0 18px 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.logo-readout strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
  font-size: 13px;
}

.side-section {
  border-top: 1px solid var(--line);
  padding: 15px 12px;
}

.side-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 6px 10px;
  color: var(--muted);
  font: 600 10px/1 var(--font-display);
  letter-spacing: 0.14em;
}

.category-list,
.preset-list,
.side-actions {
  display: grid;
  gap: 5px;
}

.category-button,
.preset-button,
.side-action {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 9px 9px;
  background: transparent;
  color: var(--muted-strong);
  text-align: left;
  font-size: 12px;
  transition: 150ms ease;
}

.category-button:hover,
.preset-button:hover,
.side-action:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
}

.category-button.is-active {
  border-color: rgba(86, 230, 231, 0.25);
  color: var(--cyan);
  background: var(--cyan-soft);
}

.category-code {
  display: grid;
  width: 27px;
  height: 25px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font: 600 9px/1 var(--font-display);
  letter-spacing: 0.05em;
}

.category-button.is-active .category-code {
  border-color: var(--line-strong);
  color: var(--cyan);
}

.category-count {
  min-width: 24px;
  color: var(--muted);
  text-align: right;
  font-size: 10px;
}

.preset-button {
  grid-template-columns: 1fr;
  gap: 3px;
  padding: 10px 11px;
}

.preset-button strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.preset-button small {
  color: var(--muted);
  font-size: 10px;
}

.side-action {
  grid-template-columns: auto 1fr;
}

.side-action .action-icon {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--cyan);
  font-size: 13px;
}

.side-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin: 4px 6px;
}

.side-stat {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.018);
}

.side-stat strong {
  display: block;
  color: var(--text);
  font: 700 18px/1 var(--font-display);
}

.side-stat span {
  color: var(--muted);
  font-size: 9px;
}

.center-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
}

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.view-header h1 {
  font-size: 24px;
}

.view-header p {
  max-width: 660px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.header-actions,
.button-row,
.modal-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.button,
.icon-button {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.026);
  transition: 150ms ease;
}

.button {
  min-height: 36px;
  padding: 8px 13px;
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 600;
}

.button:hover,
.icon-button:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: rgba(86, 230, 231, 0.07);
}

.button.primary {
  border-color: rgba(86, 230, 231, 0.42);
  background: linear-gradient(135deg, rgba(86, 230, 231, 0.18), rgba(79, 140, 255, 0.15));
  color: #d8ffff;
  box-shadow: inset 0 0 20px rgba(86, 230, 231, 0.05);
}

.button.danger {
  border-color: rgba(255, 102, 125, 0.24);
  color: var(--danger);
}

.button.ghost {
  background: transparent;
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  color: var(--muted);
  font-size: 20px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(108px, auto));
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: rgba(3, 10, 16, 0.52);
}

.search-wrap {
  position: relative;
}

.search-wrap::before {
  position: absolute;
  top: 50%;
  left: 12px;
  color: var(--cyan);
  content: "⌕";
  transform: translateY(-52%);
  font-size: 17px;
}

.search-wrap input,
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 11, 17, 0.76);
  color: var(--text);
  transition: 150ms ease;
}

.search-wrap input {
  height: 38px;
  padding: 0 12px 0 34px;
  font-size: 12px;
}

.toolbar select,
.field input,
.field select {
  height: 38px;
  padding: 0 10px;
  font-size: 11px;
}

.toolbar select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #08131d;
  color: var(--muted-strong);
}

.search-wrap input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(86, 230, 231, 0.07);
}

.result-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  color: var(--muted);
  font-size: 11px;
}

.result-meta strong {
  color: var(--text);
  font: 700 18px/1 var(--font-display);
}

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

.prompt-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 186px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(86, 230, 231, 0.035), transparent 48%),
    rgba(9, 19, 29, 0.76);
  transition: 170ms ease;
}

.prompt-card::after {
  position: absolute;
  right: -30px;
  bottom: -50px;
  width: 100px;
  height: 100px;
  border: 1px solid rgba(86, 230, 231, 0.07);
  border-radius: 50%;
  content: "";
}

.prompt-card:hover,
.prompt-card.is-selected {
  border-color: rgba(86, 230, 231, 0.38);
  transform: translateY(-2px);
  background:
    linear-gradient(145deg, rgba(86, 230, 231, 0.07), transparent 52%),
    rgba(11, 25, 37, 0.92);
}

.prompt-card.is-selected {
  box-shadow: inset 3px 0 0 var(--cyan);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 7px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.02);
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
}

.badge.cyan {
  border-color: rgba(86, 230, 231, 0.3);
  color: var(--cyan);
  background: var(--cyan-soft);
}

.badge.blue {
  border-color: rgba(79, 140, 255, 0.27);
  color: #91b4ff;
  background: var(--blue-soft);
}

.favorite-button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
}

.favorite-button:hover,
.favorite-button.is-favorite {
  border-color: rgba(244, 190, 98, 0.25);
  color: var(--warning);
  background: rgba(244, 190, 98, 0.06);
}

.prompt-card h3 {
  margin: 14px 0 7px;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
}

.card-description {
  display: -webkit-box;
  flex: 1;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 600 9px/1 var(--font-display);
  letter-spacing: 0.05em;
}

.card-tags {
  display: flex;
  min-width: 0;
  gap: 5px;
  overflow: hidden;
}

.card-tags span {
  max-width: 95px;
  overflow: hidden;
  padding: 3px 6px;
  border-radius: 5px;
  color: #9db6c1;
  background: rgba(255, 255, 255, 0.035);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  display: grid;
  min-height: 300px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 15px;
}

.detail-empty {
  display: grid;
  height: 100%;
  min-height: 360px;
  padding: 24px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.radar {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
  border: 1px solid rgba(86, 230, 231, 0.2);
  border-radius: 50%;
  box-shadow: inset 0 0 40px rgba(86, 230, 231, 0.05);
}

.radar::before,
.radar::after {
  position: absolute;
  content: "";
}

.radar::before {
  inset: 20px;
  border: 1px solid rgba(86, 230, 231, 0.14);
  border-radius: 50%;
}

.radar::after {
  top: 50%;
  left: 50%;
  width: 47%;
  height: 1px;
  transform-origin: left center;
  background: linear-gradient(90deg, var(--cyan), transparent);
  animation: radarSweep 4s linear infinite;
}

@keyframes radarSweep {
  to { transform: rotate(360deg); }
}

.detail-content {
  padding-bottom: 18px;
}

.detail-hero {
  padding: 22px 20px 17px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(86, 230, 231, 0.07), transparent 55%);
}

.detail-hero h2 {
  margin: 12px 0 6px;
  font: 650 20px/1.3 var(--font-display);
}

.detail-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.detail-body {
  padding: 18px 18px 22px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 16px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.018);
}

.metric strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font: 650 14px/1 var(--font-display);
}

.metric span {
  color: var(--muted);
  font-size: 9px;
}

.detail-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 17px 0 8px;
  color: var(--muted);
  font: 600 9px/1 var(--font-display);
  letter-spacing: 0.14em;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-cloud .tag {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 7px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.025);
  font-size: 9px;
}

.prompt-box,
.output-box {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(3, 10, 16, 0.58);
}

.prompt-box {
  padding: 13px;
  color: #c9dce2;
  font-size: 11px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 16px;
}

.detail-actions .button:last-child {
  grid-column: 1 / -1;
}

.energy-bars {
  display: inline-flex;
  gap: 3px;
  vertical-align: middle;
}

.energy-bars i {
  width: 8px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.energy-bars i.on {
  background: var(--cyan);
  box-shadow: 0 0 6px rgba(86, 230, 231, 0.4);
}

/* Generator */
.generator-layout {
  display: grid;
  gap: 12px;
}

.control-section {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 14px;
  background: rgba(5, 13, 21, 0.54);
}

.control-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.control-head h3 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 650;
}

.control-head p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.limit-counter {
  color: var(--muted);
  font: 600 10px/1.4 var(--font-display);
  white-space: nowrap;
}

.limit-counter.has-selection {
  color: var(--cyan);
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.select-chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--muted-strong);
  font-size: 10px;
  transition: 140ms ease;
}

.select-chip:hover {
  border-color: rgba(86, 230, 231, 0.27);
  color: var(--text);
}

.select-chip.is-selected {
  border-color: rgba(86, 230, 231, 0.42);
  color: #cfffff;
  background: var(--cyan-soft);
  box-shadow: inset 0 0 14px rgba(86, 230, 231, 0.05);
}

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

.range-field {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.018);
}

.range-field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted-strong);
  font-size: 10px;
}

.range-field output {
  color: var(--cyan);
  font: 700 12px/1 var(--font-display);
}

input[type="range"] {
  width: 100%;
  height: 4px;
  border: 0;
  border-radius: 999px;
  appearance: none;
  background: linear-gradient(90deg, var(--cyan), var(--blue), rgba(255, 255, 255, 0.1));
}

input[type="range"]::-webkit-slider-thumb {
  width: 15px;
  height: 15px;
  border: 2px solid #071018;
  border-radius: 50%;
  appearance: none;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(86, 230, 231, 0.5);
}

.custom-input {
  width: 100%;
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
  resize: vertical;
  background: rgba(4, 11, 17, 0.76);
  color: var(--text);
  font-size: 11px;
  line-height: 1.6;
}

/* Output panel */
.output-panel {
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
}

.output-head {
  padding: 20px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.output-head h2 {
  margin: 5px 0 0;
  font: 650 18px/1.2 var(--font-display);
}

.output-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.output-content {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 16px;
}

.output-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.output-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.output-label span {
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 600;
}

.output-box textarea {
  display: block;
  width: 100%;
  min-height: 146px;
  border: 0;
  padding: 12px;
  resize: vertical;
  background: transparent;
  color: #ccdfe4;
  font-size: 11px;
  line-height: 1.7;
}

.output-box textarea:focus {
  outline: none;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(86, 230, 231, 0.25);
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--cyan);
  background: var(--cyan-soft);
  font: 600 9px/1 var(--font-display);
  letter-spacing: 0.06em;
}

.source-badge.local {
  border-color: rgba(244, 190, 98, 0.22);
  color: var(--warning);
  background: rgba(244, 190, 98, 0.07);
}

.output-empty {
  display: grid;
  flex: 1;
  min-height: 280px;
  padding: 24px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.output-empty .pulse {
  display: grid;
  width: 86px;
  height: 86px;
  margin: 0 auto 18px;
  place-items: center;
  border: 1px solid rgba(86, 230, 231, 0.25);
  border-radius: 50%;
  color: var(--cyan);
  font: 700 19px/1 var(--font-display);
  box-shadow: 0 0 0 14px rgba(86, 230, 231, 0.025), inset 0 0 35px rgba(86, 230, 231, 0.05);
}

/* Settings */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-card {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 16px;
  background: rgba(5, 13, 21, 0.56);
}

.settings-card h3 {
  margin: 0 0 5px;
  font-size: 14px;
}

.settings-card > p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.settings-card.full {
  grid-column: 1 / -1;
}

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

.field {
  display: grid;
  gap: 7px;
  color: var(--muted-strong);
  font-size: 10px;
}

.field-wide {
  grid-column: 1 / -1;
}

.field textarea {
  padding: 10px;
  resize: vertical;
  line-height: 1.65;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.018);
  font-size: 10px;
  line-height: 1.55;
}

.checkbox-row input {
  margin-top: 2px;
  accent-color: var(--cyan);
}

.security-note {
  border-left: 2px solid var(--warning);
  padding: 10px 12px;
  color: #bfae8d;
  background: rgba(244, 190, 98, 0.045);
  font-size: 10px;
  line-height: 1.7;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.connection-result {
  margin-top: 10px;
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--muted-strong);
  background: rgba(255, 255, 255, 0.025);
  font-size: 10px;
  line-height: 1.5;
}

/* Modal */
.modal {
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 36px);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 0;
  background: #08121b;
  color: var(--text);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.7);
}

.modal::backdrop {
  background: rgba(1, 5, 9, 0.7);
  backdrop-filter: blur(5px);
}

.modal-card {
  display: flex;
  max-height: calc(100vh - 36px);
  flex-direction: column;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px 15px;
  border-bottom: 1px solid var(--line);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  overflow-y: auto;
  padding: 18px 22px;
}

.modal-actions {
  justify-content: flex-end;
  padding: 14px 22px 19px;
  border-top: 1px solid var(--line);
}

/* Toast */
.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  display: grid;
  width: min(340px, calc(100vw - 44px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  padding: 11px 13px;
  background: rgba(7, 18, 28, 0.96);
  color: var(--text);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.42);
  font-size: 11px;
  line-height: 1.5;
  animation: toastIn 180ms ease-out;
}

.toast.error {
  border-color: rgba(255, 102, 125, 0.38);
}

.toast.warning {
  border-color: rgba(244, 190, 98, 0.38);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
}

.is-hidden {
  display: none !important;
}

@media (max-width: 1260px) {
  .workspace {
    grid-template-columns: 216px minmax(0, 1fr) 330px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1040px) {
  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
  }

  .workspace {
    grid-template-columns: 216px minmax(0, 1fr);
    align-items: start;
  }

  .left-panel {
    position: sticky;
    top: 12px;
    max-height: calc(100vh - 92px);
  }

  .center-panel {
    overflow: visible;
  }

  .center-scroll {
    overflow: visible;
  }

  .right-panel {
    grid-column: 1 / -1;
  }

  .right-panel .panel-scroll {
    height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}



/* Desktop readability tuning */
.preset-button {
  padding: 13px 12px;
}

.preset-button strong {
  font-size: 15px;
  line-height: 1.35;
}

.preset-button small {
  margin-top: 3px;
  font-size: 12.5px;
  line-height: 1.5;
}

.side-section-title {
  font-size: 11px;
}

.control-head h3 {
  font-size: 16px;
}

.control-head p {
  margin-top: 3px;
  font-size: 12.5px;
  line-height: 1.55;
}

.limit-counter {
  font-size: 11px;
}

.select-chip {
  padding: 8px 11px;
  font-size: 13px;
  line-height: 1.25;
}

.generator-layout .control-section {
  padding: 16px;
}


/* Dual age range */
.age-range-section .limit-counter b {
  color: var(--cyan);
  font-weight: 700;
}

.dual-range {
  position: relative;
  height: 32px;
  margin-top: 4px;
}

.range-track {
  position: absolute;
  top: 14px;
  right: 5px;
  left: 5px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.range-track span {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--range-start);
  width: calc(var(--range-end) - var(--range-start));
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  box-shadow: 0 0 12px rgba(86, 230, 231, 0.35);
}

.dual-range input[type="range"] {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 32px;
  margin: 0;
  appearance: none;
  background: transparent;
  pointer-events: none;
}

.dual-range input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
}

.dual-range input[type="range"]::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -6px;
  pointer-events: auto;
}

.dual-range input[type="range"]::-moz-range-track {
  height: 4px;
  background: transparent;
}

.dual-range input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 2px solid #071018;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px rgba(86, 230, 231, 0.5);
  pointer-events: auto;
}

.range-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 1px;
  color: var(--muted);
  font: 600 11px/1 var(--font-display);
  letter-spacing: 0.04em;
}

/* Animated output halo */
.output-empty .pulse {
  position: relative;
  animation: coreBreathe 2.6s ease-in-out infinite;
}

.output-empty .pulse::before,
.output-empty .pulse::after {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.output-empty .pulse::before {
  inset: -14px;
  border: 1px solid rgba(86, 230, 231, 0.36);
  animation: haloRipple 2.4s ease-out infinite;
}

.output-empty .pulse::after {
  inset: -25px;
  border: 1px solid transparent;
  border-top-color: rgba(86, 230, 231, 0.62);
  border-right-color: rgba(79, 140, 255, 0.28);
  animation: haloSpin 4.2s linear infinite;
}

@keyframes coreBreathe {
  0%, 100% { box-shadow: 0 0 0 14px rgba(86, 230, 231, 0.025), inset 0 0 35px rgba(86, 230, 231, 0.05); }
  50% { box-shadow: 0 0 0 20px rgba(86, 230, 231, 0.045), 0 0 28px rgba(86, 230, 231, 0.12), inset 0 0 42px rgba(86, 230, 231, 0.09); }
}

@keyframes haloRipple {
  0% { opacity: 0.8; transform: scale(0.82); }
  80%, 100% { opacity: 0; transform: scale(1.28); }
}

@keyframes haloSpin {
  to { transform: rotate(360deg); }
}


/* Categorized style matrix and live listening profile */
.style-group-list {
  display: grid;
  gap: 12px;
}

.style-group {
  border-top: 1px solid var(--line);
  padding-top: 11px;
}

.style-group:first-child {
  border-top: 0;
  padding-top: 0;
}

.style-group-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 9px;
}

.style-group-icon {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border: 1px solid rgba(86, 230, 231, 0.22);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(86, 230, 231, 0.1), rgba(79, 140, 255, 0.04));
  font-size: 15px;
}

.style-group-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.style-group-head strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}

.style-group-head small {
  color: var(--muted);
  font-size: 9px;
}

.style-group-count {
  min-width: 24px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 7px;
  color: var(--muted);
  text-align: center;
  font: 700 9px/1 var(--font-display);
}

.style-group-count.has-selection {
  border-color: rgba(86, 230, 231, 0.36);
  color: var(--cyan);
  background: var(--cyan-soft);
}

.style-insight {
  position: relative;
  margin-top: 14px;
  border: 1px solid rgba(86, 230, 231, 0.24);
  border-radius: 12px;
  padding: 12px;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(86, 230, 231, 0.075), transparent 46%),
    rgba(3, 11, 17, 0.82);
  animation: insightReveal 260ms ease-out;
}

.style-insight::before {
  position: absolute;
  inset: 0 auto 0 -45%;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(86, 230, 231, 0.12), transparent);
  content: "";
  animation: insightSweep 3.6s ease-in-out infinite;
}

.style-insight.is-empty {
  display: flex;
  align-items: center;
  gap: 11px;
  border-style: dashed;
  color: var(--muted);
}

.style-insight.is-empty strong {
  display: block;
  margin-bottom: 3px;
  color: var(--muted-strong);
  font-size: 12px;
}

.style-insight.is-empty p {
  margin: 0;
  font-size: 10px;
  line-height: 1.55;
}

.insight-scan {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border: 1px solid rgba(86, 230, 231, 0.35);
  border-radius: 50%;
  box-shadow: inset 0 0 13px rgba(86, 230, 231, 0.12);
}

.insight-scan::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 1px;
  transform-origin: left center;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(86, 230, 231, 0.8);
  content: "";
  animation: insightSpin 2.8s linear infinite;
}

.insight-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}

.insight-heading > div {
  display: grid;
  gap: 3px;
}

.insight-heading small {
  color: var(--cyan);
  font: 700 8px/1 var(--font-display);
  letter-spacing: 0.15em;
}

.insight-heading strong {
  font-size: 13px;
}

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

.insight-item {
  border-left: 2px solid rgba(86, 230, 231, 0.46);
  padding: 8px 9px;
  background: rgba(255, 255, 255, 0.018);
  animation: insightReveal 320ms ease-out both;
}

.insight-item h4 {
  margin: 0 0 5px;
  color: transparent;
  background: linear-gradient(90deg, #dffeff, var(--cyan), #8db5ff, #dffeff);
  background-size: 240% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.02em;
  animation: insightTextGlow 3.8s linear infinite;
}

.insight-item p {
  margin: 0;
  color: #a9bec7;
  font-size: 10px;
  line-height: 1.62;
}

@keyframes insightReveal {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes insightSweep {
  0% { transform: translateX(-30%); }
  45%, 100% { transform: translateX(390%); }
}

@keyframes insightSpin {
  to { transform: rotate(360deg); }
}

@keyframes insightTextGlow {
  to { background-position: -240% 0; }
}


/* Larger in-group listening profiles */
.style-insight {
  padding: 14px;
}

.insight-heading {
  margin-bottom: 12px;
}

.insight-heading small {
  font-size: 9px;
}

.insight-heading strong {
  font-size: 15px;
}

.insight-list {
  grid-template-columns: 1fr;
  gap: 9px;
}

.insight-item {
  padding: 10px 11px;
}

.insight-item h4 {
  margin-bottom: 6px;
  font-size: 13px;
}

.insight-item p {
  font-size: 12px;
  line-height: 1.72;
}

/* Tag-driven vortex output state */
.vortex-empty {
  min-height: 360px;
}

.vortex-stage {
  position: relative;
  display: grid;
  width: 220px;
  height: 220px;
  place-items: center;
  isolation: isolate;
}

.vortex-stage::before,
.vortex-stage::after {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.vortex-stage::before {
  inset: 12px;
  border: 1px dashed rgba(86, 230, 231, 0.14);
  animation: vortexOrbit 13s linear infinite;
}

.vortex-stage::after {
  inset: 42px;
  border: 1px solid rgba(79, 140, 255, 0.12);
  box-shadow: inset 0 0 28px rgba(86, 230, 231, 0.04);
  animation: vortexOrbitReverse 9s linear infinite;
}

.vortex-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: var(--size);
  height: var(--size);
  margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2);
  border: 1px solid rgba(125, 245, 247, 0.72);
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 9px rgba(86, 230, 231, 0.72);
  animation: vortexPull var(--duration) linear var(--delay) infinite;
}

.vortex-particle:nth-child(3n) {
  border-radius: 2px;
  background: var(--blue);
  box-shadow: 0 0 9px rgba(79, 140, 255, 0.72);
}

.vortex-particle:nth-child(4n) {
  width: calc(var(--size) * 2);
  height: 1px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(90deg, transparent, #b7ffff);
}

.vortex-ring {
  position: absolute;
  inset: 66px;
  z-index: 2;
  border: 1px solid rgba(86, 230, 231, 0.35);
  border-radius: 50%;
  background: conic-gradient(from 20deg, transparent 0 52%, rgba(86, 230, 231, 0.75) 64%, transparent 72%);
  animation: vortexOrbit 3.6s linear infinite;
  mask: radial-gradient(circle, transparent 57%, #000 59%);
}

.vortex-core {
  position: relative;
  z-index: 3;
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  border: 1px solid rgba(86, 230, 231, 0.52);
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 35%, rgba(255, 255, 255, 0.2), transparent 18%),
    radial-gradient(circle, rgba(86, 230, 231, 0.2), rgba(4, 13, 21, 0.94) 68%);
  box-shadow: 0 0 22px rgba(86, 230, 231, 0.2), inset 0 0 28px rgba(86, 230, 231, 0.14);
  animation: vortexCore 2.6s ease-in-out infinite;
}

.vortex-core span {
  color: #d8ffff;
  font: 700 16px/1 var(--font-display);
  letter-spacing: 0.12em;
  text-shadow: 0 0 12px rgba(86, 230, 231, 0.72);
}

.vortex-core small {
  position: absolute;
  bottom: -23px;
  color: var(--cyan);
  font: 600 9px/1 var(--font-display);
  letter-spacing: 0.12em;
  white-space: nowrap;
}

@keyframes vortexPull {
  0% {
    opacity: 0;
    transform: rotate(var(--angle)) translateX(var(--distance)) scale(1);
  }
  18% { opacity: 1; }
  72% { opacity: 0.72; }
  100% {
    opacity: 0;
    transform: rotate(calc(var(--angle) + 190deg)) translateX(7px) scale(0.12);
  }
}

@keyframes vortexOrbit {
  to { transform: rotate(360deg); }
}

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

@keyframes vortexCore {
  0%, 100% { transform: scale(0.96); box-shadow: 0 0 18px rgba(86, 230, 231, 0.18), inset 0 0 24px rgba(86, 230, 231, 0.12); }
  50% { transform: scale(1.05); box-shadow: 0 0 31px rgba(86, 230, 231, 0.32), inset 0 0 34px rgba(86, 230, 231, 0.2); }
}


/* Theme switcher */
.top-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 9px;
}

.theme-picker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 5px 4px 10px;
  background: rgba(6, 13, 20, 0.72);
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.theme-picker select {
  height: 27px;
  border: 0;
  border-radius: 999px;
  padding: 0 8px;
  background: var(--cyan-soft);
  color: var(--text);
  font-size: 11px;
}

/* Bright theme: warm cool-gray, never pure white */
html[data-theme="bright"] {
  color-scheme: light;
  --bg: #e8eef1;
  --bg-soft: #dce6ea;
  --panel: rgba(242, 247, 248, 0.92);
  --panel-strong: rgba(247, 250, 250, 0.97);
  --panel-soft: rgba(225, 235, 238, 0.72);
  --line: rgba(37, 76, 92, 0.17);
  --line-strong: rgba(0, 132, 148, 0.42);
  --text: #142d37;
  --muted: #687e87;
  --muted-strong: #425f69;
  --cyan: #008c9b;
  --cyan-soft: rgba(0, 140, 155, 0.11);
  --blue: #376fd2;
  --blue-soft: rgba(55, 111, 210, 0.1);
  --violet: #7759c9;
  --danger: #cf405d;
  --warning: #b9781d;
  --success: #27885b;
  --shadow: 0 24px 65px rgba(43, 68, 79, 0.13);
  --control-bg: rgba(255, 255, 255, 0.52);
  --card-bg: rgba(255, 255, 255, 0.4);
}

/* Soft lavender-pink theme */
html[data-theme="pink"] {
  color-scheme: light;
  --bg: #f2e7f4;
  --bg-soft: #ead9ed;
  --panel: rgba(250, 241, 250, 0.92);
  --panel-strong: rgba(253, 246, 252, 0.97);
  --panel-soft: rgba(241, 224, 241, 0.72);
  --line: rgba(111, 62, 117, 0.17);
  --line-strong: rgba(194, 70, 169, 0.42);
  --text: #43274a;
  --muted: #87708b;
  --muted-strong: #6d5273;
  --cyan: #c14aa6;
  --cyan-soft: rgba(193, 74, 166, 0.11);
  --blue: #7955da;
  --blue-soft: rgba(121, 85, 218, 0.11);
  --violet: #9a55d6;
  --danger: #cd4967;
  --warning: #b8792c;
  --success: #4c8e69;
  --shadow: 0 24px 65px rgba(93, 50, 98, 0.13);
  --control-bg: rgba(255, 249, 255, 0.56);
  --card-bg: rgba(255, 249, 255, 0.42);
}

html[data-theme="bright"] .ambient-grid,
html[data-theme="pink"] .ambient-grid {
  opacity: 0.13;
}

html[data-theme="bright"] .ambient-glow,
html[data-theme="pink"] .ambient-glow {
  opacity: 0.2;
}

html[data-theme="bright"] .scanline,
html[data-theme="pink"] .scanline {
  opacity: 0.018;
}

html[data-theme="bright"] .theme-picker,
html[data-theme="pink"] .theme-picker,
html[data-theme="bright"] .system-status,
html[data-theme="pink"] .system-status,
html[data-theme="bright"] .toast,
html[data-theme="pink"] .toast {
  background: var(--control-bg);
}

html[data-theme="bright"] .modal,
html[data-theme="pink"] .modal {
  background: var(--panel-strong);
}

html[data-theme="bright"] .toolbar,
html[data-theme="bright"] .control-section,
html[data-theme="bright"] .settings-card,
html[data-theme="bright"] .range-field,
html[data-theme="bright"] .metric,
html[data-theme="bright"] .side-stat,
html[data-theme="bright"] .prompt-box,
html[data-theme="bright"] .output-box,
html[data-theme="bright"] .checkbox-row,
html[data-theme="pink"] .toolbar,
html[data-theme="pink"] .control-section,
html[data-theme="pink"] .settings-card,
html[data-theme="pink"] .range-field,
html[data-theme="pink"] .metric,
html[data-theme="pink"] .side-stat,
html[data-theme="pink"] .prompt-box,
html[data-theme="pink"] .output-box,
html[data-theme="pink"] .checkbox-row {
  background: var(--control-bg);
}

html[data-theme="bright"] .prompt-card,
html[data-theme="pink"] .prompt-card {
  background: var(--card-bg);
}

html[data-theme="bright"] .prompt-card:hover,
html[data-theme="bright"] .prompt-card.is-selected,
html[data-theme="pink"] .prompt-card:hover,
html[data-theme="pink"] .prompt-card.is-selected {
  background: var(--cyan-soft);
}

html[data-theme="bright"] .search-wrap input,
html[data-theme="bright"] .field input,
html[data-theme="bright"] .field select,
html[data-theme="bright"] .field textarea,
html[data-theme="bright"] .custom-input,
html[data-theme="bright"] .toolbar select,
html[data-theme="pink"] .search-wrap input,
html[data-theme="pink"] .field input,
html[data-theme="pink"] .field select,
html[data-theme="pink"] .field textarea,
html[data-theme="pink"] .custom-input,
html[data-theme="pink"] .toolbar select {
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
}

html[data-theme="bright"] .output-box textarea,
html[data-theme="bright"] .prompt-box,
html[data-theme="pink"] .output-box textarea,
html[data-theme="pink"] .prompt-box {
  color: #38515b;
}

html[data-theme="pink"] .output-box textarea,
html[data-theme="pink"] .prompt-box {
  color: #59445d;
}

html[data-theme="bright"] .select-chip,
html[data-theme="bright"] .button,
html[data-theme="pink"] .select-chip,
html[data-theme="pink"] .button {
  background: rgba(20, 60, 72, 0.035);
}

html[data-theme="pink"] .select-chip,
html[data-theme="pink"] .button {
  background: rgba(112, 55, 119, 0.04);
}

html[data-theme="bright"] .vortex-core,
html[data-theme="pink"] .vortex-core {
  background:
    radial-gradient(circle at 38% 35%, rgba(255, 255, 255, 0.76), transparent 22%),
    radial-gradient(circle, var(--cyan-soft), var(--panel-strong) 72%);
}

html[data-theme="bright"] .vortex-core span,
html[data-theme="pink"] .vortex-core span {
  color: var(--text);
  text-shadow: 0 0 12px var(--cyan-soft);
}

html[data-theme="pink"] .brand-mark {
  background: linear-gradient(145deg, rgba(193, 74, 166, 0.17), rgba(121, 85, 218, 0.08));
}

html[data-theme="bright"] .button.primary {
  border-color: rgba(0, 140, 155, 0.42);
  background: linear-gradient(135deg, rgba(0, 140, 155, 0.22), rgba(55, 111, 210, 0.16));
  color: #103b43;
}

html[data-theme="pink"] .button.primary {
  border-color: rgba(193, 74, 166, 0.42);
  background: linear-gradient(135deg, rgba(193, 74, 166, 0.22), rgba(121, 85, 218, 0.16));
  color: #5d2b60;
}


/* Theme-aware contrast and readability */
.select-chip.is-selected {
  border-color: var(--cyan);
  background: linear-gradient(135deg, var(--cyan-soft), var(--blue-soft));
  color: var(--text);
  font-weight: 750;
  box-shadow: inset 0 0 0 1px var(--cyan-soft), 0 0 12px var(--cyan-soft);
}

.control-head h3 {
  font-size: 17px;
}

.control-head p {
  font-size: 13.5px;
}

.style-group-head strong {
  font-size: 14px;
}

.style-group-head small {
  font-size: 11px;
}

.style-group-icon {
  width: 31px;
  height: 31px;
  flex-basis: 31px;
  font-size: 17px;
}

.select-chip {
  padding: 9px 12px;
  font-size: 14px;
}

.style-insight {
  border-color: var(--line-strong);
  background:
    linear-gradient(120deg, var(--cyan-soft), transparent 48%),
    var(--control-bg, rgba(3, 11, 17, 0.82));
}

.style-insight::before {
  background: linear-gradient(90deg, transparent, var(--cyan-soft), transparent);
}

.insight-heading strong {
  font-size: 16px;
}

.insight-heading small {
  font-size: 10px;
}

.insight-item {
  background: var(--control-bg, rgba(255, 255, 255, 0.018));
}

.insight-item h4 {
  background: linear-gradient(90deg, var(--text), var(--cyan), var(--violet), var(--text));
  background-size: 240% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  font-size: 15px;
}

.insight-item p {
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.75;
}

/* Full-panel intake vortex */
.output-empty.vortex-empty {
  position: relative;
  flex: 1;
  min-height: 0;
  height: 100%;
  padding: 0;
  overflow: hidden;
}

.vortex-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 560px;
}

.vortex-particle-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.vortex-particle {
  border-color: var(--cyan);
  background: var(--cyan);
  box-shadow: 0 0 11px var(--cyan);
}

.vortex-particle:nth-child(3n) {
  background: var(--blue);
  box-shadow: 0 0 11px var(--blue);
}

.vortex-particle:nth-child(4n) {
  background: linear-gradient(90deg, transparent, var(--cyan));
}

.vortex-stage::before {
  border-color: var(--line-strong);
}

.vortex-stage::after {
  border-color: var(--line);
  box-shadow: inset 0 0 28px var(--cyan-soft);
}

.vortex-ring {
  border-color: var(--line-strong);
  background: conic-gradient(from 20deg, transparent 0 52%, var(--cyan) 64%, transparent 72%);
}

.vortex-core {
  width: 96px;
  height: 96px;
  border-color: var(--cyan);
  box-shadow: 0 0 24px var(--cyan-soft), inset 0 0 28px var(--cyan-soft);
}

.vortex-core span {
  color: var(--text);
  font-size: 15px;
  letter-spacing: 0.05em;
}

.vortex-core small {
  bottom: -25px;
  color: var(--cyan);
  font-size: 10px;
}

@keyframes vortexPull {
  0% {
    opacity: 0;
    transform: rotate(var(--angle)) translateX(var(--distance)) scale(1);
  }
  8% { opacity: 0.92; }
  78% { opacity: 0.72; }
  100% {
    opacity: 0.08;
    transform: rotate(calc(var(--angle) + 210deg)) translateX(5px) scale(0.1);
  }
}


/* Premium header rhythm stream */
.topbar {
  position: relative;
  overflow: hidden;
}

.topbar > *:not(.header-rhythm) {
  position: relative;
  z-index: 2;
}

.header-rhythm {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}

.rhythm-aurora {
  position: absolute;
  top: 50%;
  right: -24%;
  width: 54%;
  height: 70px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: linear-gradient(90deg, transparent, var(--cyan-soft), var(--blue-soft), transparent);
  filter: blur(16px);
  animation: rhythmAurora 6.4s ease-in-out infinite;
}

.rhythm-beam {
  position: absolute;
  right: -38%;
  width: 34%;
  height: 1px;
  transform: skewX(-24deg);
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 13px var(--cyan-soft);
  animation: rhythmBeam 5.8s linear infinite;
}

.beam-a { top: 26%; }
.beam-b { top: 52%; animation-delay: -1.9s; animation-duration: 6.7s; }
.beam-c { top: 74%; animation-delay: -3.4s; animation-duration: 7.5s; }

.rhythm-bar {
  position: absolute;
  top: var(--top);
  right: -8%;
  width: 2px;
  height: var(--height);
  border-radius: 999px;
  background: linear-gradient(to bottom, transparent, var(--cyan), var(--blue), transparent);
  box-shadow: 0 0 8px var(--cyan-soft);
  opacity: 0;
  animation: rhythmPass var(--speed) linear var(--delay) infinite;
}

@keyframes rhythmBeam {
  0% { opacity: 0; transform: translateX(0) skewX(-24deg) scaleX(0.3); }
  18% { opacity: 0.82; }
  100% { opacity: 0; transform: translateX(-390%) skewX(-24deg) scaleX(1.35); }
}

@keyframes rhythmPass {
  0% { opacity: 0; transform: translateX(0) scaleY(0.22); }
  16% { opacity: 0.9; }
  58% { opacity: 0.62; }
  100% { opacity: 0; transform: translateX(-1850%) scaleY(1.12); }
}

@keyframes rhythmAurora {
  0%, 100% { opacity: 0.45; transform: translateY(-50%) translateX(14%); }
  50% { opacity: 0.82; transform: translateY(-50%) translateX(-28%); }
}

/* Premium signal-field output state */
.signal-empty {
  position: relative;
  flex: 1;
  min-height: 0;
  height: 100%;
  padding: 0;
  overflow: hidden;
}

.signal-field {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 560px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, var(--cyan-soft), transparent 28%),
    linear-gradient(145deg, transparent, var(--blue-soft) 72%, transparent);
}

.signal-backdrop {
  position: absolute;
  inset: 0;
  opacity: calc(0.18 + var(--energy, 0) * 0.25);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(circle at center, #000 0 24%, transparent 74%);
}

.signal-ribbons {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.signal-ribbons i {
  position: absolute;
  top: var(--ribbon-y);
  right: -70%;
  width: 70%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--violet), transparent);
  filter: blur(0.2px);
  opacity: 0;
  animation: signalRibbon 5.8s cubic-bezier(.4, 0, .2, 1) var(--ribbon-delay) infinite;
}

.signal-rings {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 270px;
  height: 270px;
  transform: translate(-50%, -50%);
}

.signal-rings i {
  position: absolute;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.signal-rings i:nth-child(1) {
  inset: 0;
  border-style: dashed;
  opacity: 0.45;
  animation: signalSpin 24s linear infinite;
}

.signal-rings i:nth-child(2) {
  inset: 35px;
  border-color: var(--line);
  animation: signalSpinReverse 17s linear infinite;
}

.signal-rings i:nth-child(3) {
  inset: 70px;
  border-color: var(--cyan);
  opacity: calc(0.2 + var(--energy, 0) * 0.42);
  box-shadow: 0 0 22px var(--cyan-soft), inset 0 0 28px var(--cyan-soft);
}

.signal-core {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  display: grid;
  width: 118px;
  height: 118px;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid var(--cyan);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 42%),
    var(--panel-strong);
  box-shadow: 0 0 34px var(--cyan-soft), inset 0 0 28px var(--cyan-soft);
  animation: signalCore 4.2s ease-in-out infinite;
}

.signal-core span {
  color: var(--text);
  font: 750 16px/1.25 var(--font-display);
  letter-spacing: 0.08em;
  text-align: center;
}

.signal-core small {
  position: absolute;
  bottom: -27px;
  color: var(--cyan);
  font: 650 10px/1 var(--font-display);
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.signal-spectrum {
  position: absolute;
  right: 9%;
  bottom: 52px;
  left: 9%;
  display: flex;
  height: 76px;
  align-items: flex-end;
  gap: 3px;
}

.signal-spectrum i {
  flex: 1;
  min-width: 2px;
  height: var(--bar-height);
  border-radius: 3px 3px 1px 1px;
  transform: scaleY(0.16);
  transform-origin: bottom;
  background: var(--line-strong);
  opacity: 0.25;
  transition: transform 420ms cubic-bezier(.2, .8, .2, 1), opacity 420ms ease, background 420ms ease, box-shadow 420ms ease;
  animation: spectrumBreath 1.9s ease-in-out var(--bar-delay) infinite alternate;
}

.signal-spectrum i.is-active {
  transform: scaleY(1);
  background: linear-gradient(to top, var(--blue), var(--cyan), var(--violet));
  opacity: 0.92;
  box-shadow: 0 0 10px var(--cyan-soft);
}

@keyframes signalRibbon {
  0% { opacity: 0; transform: translateX(0) scaleX(0.35); }
  18% { opacity: 0.72; }
  100% { opacity: 0; transform: translateX(-265%) scaleX(1.18); }
}

@keyframes signalSpin {
  to { transform: rotate(360deg); }
}

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

@keyframes signalCore {
  0%, 100% { transform: translate(-50%, -50%) scale(0.98); }
  50% { transform: translate(-50%, -50%) scale(1.035); }
}

@keyframes spectrumBreath {
  from { filter: saturate(0.82) brightness(0.85); }
  to { filter: saturate(1.18) brightness(1.18); }
}


/* Mobile adaptive layout */
.mobile-panel-toggle,
.mobile-backdrop {
  display: none;
}

@media (max-width: 760px) {
  html,
  body {
    min-width: 0;
    width: 100%;
    overflow-x: hidden;
  }

  body {
    overflow-y: auto;
  }

  body.mobile-sidebar-open {
    overflow: hidden;
  }

  .app-shell {
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    height: auto;
    min-height: 100vh;
    padding: 0 8px 12px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px 0;
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: blur(18px);
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-copy strong {
    font-size: 13px;
  }

  .brand-copy small {
    display: none;
  }

  .topnav {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    order: 3;
    width: 100%;
    gap: 5px;
  }

  .nav-tab {
    padding: 9px 5px;
    font-size: 12px;
  }

  .top-actions {
    gap: 5px;
  }

  .mobile-panel-toggle {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--cyan);
    font-size: 17px;
  }

  .theme-picker {
    padding: 3px;
  }

  .theme-picker > span {
    display: none;
  }

  .theme-picker select {
    height: 28px;
    max-width: 86px;
    padding: 0 6px;
    font-size: 10px;
  }

  .system-status {
    gap: 0;
    padding: 8px;
  }

  .system-status span:last-child {
    display: none;
  }

  .header-rhythm {
    opacity: 0.55;
  }

  .mobile-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: block;
    border: 0;
    padding: 0;
    background: rgba(3, 8, 13, 0.52);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  body.mobile-sidebar-open .mobile-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
    padding-top: 10px;
  }

  .left-panel {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(86vw, 350px);
    max-height: none;
    border-radius: 0 18px 18px 0;
    transform: translateX(-105%);
    transition: transform 200ms cubic-bezier(.2, .8, .2, 1);
  }

  body.mobile-sidebar-open .left-panel {
    transform: translateX(0);
  }

  .center-panel,
  .right-panel {
    grid-column: auto;
    width: 100%;
    overflow: visible;
  }

  .center-scroll {
    overflow: visible;
    padding: 14px;
  }

  .right-panel .panel-scroll {
    height: auto;
  }

  .view-header {
    align-items: stretch;
    flex-direction: column;
    margin-bottom: 14px;
  }

  .view-header h1 {
    font-size: 23px;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .button {
    flex: 1;
  }

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

  .search-wrap {
    grid-column: 1 / -1;
  }

  .card-grid,
  .settings-grid,
  .field-grid,
  .slider-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .settings-card.full,
  .field-wide {
    grid-column: auto;
  }

  .detail-actions {
    grid-template-columns: 1fr;
  }

  .detail-actions .button:last-child {
    grid-column: auto;
  }

  .prompt-card {
    min-height: 170px;
  }

  .modal {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .modal-card {
    max-height: calc(100vh - 16px);
  }

  .output-empty.signal-empty {
    min-height: 540px;
  }

  .signal-field {
    min-height: 540px;
  }

  .signal-core {
    width: 104px;
    height: 104px;
  }

  .signal-core span {
    font-size: 14px;
  }

  .signal-spectrum {
    right: 6%;
    bottom: 36px;
    left: 6%;
    height: 66px;
    gap: 2px;
  }

  .toast-region {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
  }
}

@media (max-width: 420px) {
  .brand-copy strong {
    max-width: 118px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .theme-picker select {
    max-width: 72px;
    font-size: 9px;
  }

  .system-status {
    display: none;
  }

  .control-section {
    padding: 13px;
  }

  .control-head h3 {
    font-size: 16px;
  }

  .control-head p {
    font-size: 12.5px;
  }

  .select-chip {
    padding: 8px 10px;
    font-size: 13px;
  }

  .style-group-icon {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    font-size: 15px;
  }

  .style-group-head strong {
    font-size: 13px;
  }

  .insight-item h4 {
    font-size: 14px;
  }

  .insight-item p {
    font-size: 12.5px;
  }

  .signal-rings {
    width: 230px;
    height: 230px;
  }
}

@media (max-width: 760px) {
  .app-shell,
  .workspace,
  .panel,
  .center-scroll,
  .generator-layout,
  .control-section,
  .style-category-section,
  .style-group,
  .style-group-list,
  .chip-grid,
  .view-header,
  .header-actions,
  .top-actions {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .chip-grid {
    overflow: hidden;
  }

  .select-chip {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
  }

  .style-group-head {
    min-width: 0;
  }

  .style-group-head > div {
    flex: 1;
    min-width: 0;
  }
}

@media (max-width: 760px) {
  .chip-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .select-chip {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .brand-copy {
    display: none;
  }

  .theme-picker select {
    width: 76px;
  }

  .chip-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}


/* Custom preset controls */
.generator-header-actions {
  display: grid;
  grid-template-columns: repeat(3, 126px);
  justify-content: end;
  gap: 8px;
}

.generator-header-actions .button {
  width: 126px;
  min-width: 126px;
  max-width: 126px;
}

.generator-bottom-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.generator-bottom-generate {
  width: 126px;
  min-width: 126px;
}

.preset-button.is-custom {
  border-color: color-mix(in srgb, var(--cyan) 32%, transparent);
  background: linear-gradient(135deg, var(--cyan-soft), transparent);
}

.preset-custom-tag {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px 5px;
  color: var(--cyan);
  font-size: 8px;
  font-weight: 700;
  vertical-align: middle;
}

@media (max-width: 760px) {
  .generator-header-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .generator-header-actions .button,
  .generator-bottom-generate {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .generator-bottom-actions {
    display: block;
    width: 100%;
  }
}

.generator-view-header {
  align-items: stretch;
  flex-direction: column;
}

.generator-view-header .generator-header-actions {
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.generator-view-header .generator-header-actions .button {
  width: 100%;
  min-width: 0;
  max-width: none;
}

.system-status {
  cursor: pointer;
  font-family: inherit;
}

.system-status:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.system-status.is-local .status-dot {
  background: var(--warning);
  box-shadow: 0 0 10px color-mix(in srgb, var(--warning) 62%, transparent);
}

.preset-form-grid {
  display: block;
}

.preset-form-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

@media (max-width: 420px) {
  .system-status {
    display: inline-flex;
    padding: 8px;
  }
}


/* Collapsible tag containers */
.control-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.collapse-button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: rgba(255, 255, 255, 0.02);
  color: var(--cyan);
  font-size: 15px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.collapse-button:hover {
  border-color: var(--line-strong);
  background: var(--cyan-soft);
}

.is-collapsed > .control-head .collapse-button,
.style-group.is-collapsed > .style-group-head .collapse-button {
  transform: rotate(-90deg);
}

.control-section.is-collapsed > .chip-grid,
.style-group.is-collapsed > .chip-grid,
.style-group.is-collapsed > .style-insight {
  display: none;
}

.style-group-head .collapse-button {
  flex: 0 0 28px;
}


/* Canvas-rendered premium effects */
.header-rhythm canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.signal-field canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
}

.signal-veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at center, transparent 0 22%, var(--panel-strong) 78%),
    linear-gradient(90deg, var(--panel-strong), transparent 22% 78%, var(--panel-strong));
  opacity: 0.4;
  mix-blend-mode: screen;
}

.signal-core {
  z-index: 3;
}

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

.output-box textarea:not([readonly]) {
  min-height: 170px;
  background: linear-gradient(145deg, var(--cyan-soft), transparent 42%);
}

@media (max-width: 420px) {
  .output-preset-actions {
    grid-template-columns: 1fr;
  }
}


/* Preset management and direct mode */
.preset-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 55px;
  align-items: stretch;
  gap: 5px;
}

.preset-row .preset-button {
  min-width: 0;
}

.preset-tools {
  display: grid;
  grid-template-columns: repeat(2, 25px);
  grid-template-rows: repeat(2, 25px);
  gap: 4px;
}

.preset-tool-button {
  display: grid;
  width: 25px;
  min-height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted-strong);
  font-size: 12px;
}

.preset-tool-button:hover {
  border-color: var(--line-strong);
  color: var(--cyan);
  background: var(--cyan-soft);
}

.preset-tool-button.danger:hover {
  border-color: color-mix(in srgb, var(--danger) 38%, transparent);
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 7%, transparent);
}

.preset-pin-tag {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px 5px;
  color: var(--warning);
  font-size: 8px;
}

.system-status.is-direct .status-dot {
  background: var(--violet);
  box-shadow: 0 0 10px color-mix(in srgb, var(--violet) 62%, transparent);
}

.source-badge.direct {
  border-color: color-mix(in srgb, var(--violet) 34%, transparent);
  color: var(--violet);
  background: color-mix(in srgb, var(--violet) 9%, transparent);
}

.delete-preset-modal .preset-form-note {
  color: var(--danger);
}


/* Radio generation mode selector */
.mode-switcher {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-inline-size: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: rgba(6, 13, 20, 0.72);
}

.mode-option {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 5px 7px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  cursor: pointer;
  transition: 150ms ease;
}

.mode-option input {
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: var(--cyan);
}

.mode-option:has(input:checked) {
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--cyan-soft);
}

.mode-switcher.is-api .mode-option:has(input[value="ai"]:checked) {
  border-color: color-mix(in srgb, var(--success) 46%, transparent);
}

.mode-switcher.is-direct .mode-option:has(input[value="direct"]:checked) {
  border-color: color-mix(in srgb, var(--violet) 52%, transparent);
}

html[data-theme="bright"] .mode-switcher,
html[data-theme="pink"] .mode-switcher {
  background: var(--control-bg);
}

@media (max-width: 760px) {
  .mode-switcher {
    gap: 1px;
    padding: 2px;
  }

  .mode-option {
    gap: 2px;
    padding: 5px;
    font-size: 9px;
  }

  .mode-option input {
    width: 11px;
    height: 11px;
  }
}
