:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #687083;
  --line: #dfe4ec;
  --panel: #ffffff;
  --paper: #f6f8fb;
  --field: #ffffff;
  --mint: #08a889;
  --mint-dark: #047968;
  --coral: #df5d50;
  --amber: #d99a21;
  --blue: #2f6fd8;
  --plum: #7957c8;
  --rose: #d7628e;
  --shadow: 0 24px 80px rgba(20, 32, 54, 0.12);
  --soft-shadow: 0 14px 34px rgba(20, 32, 54, 0.08);
  --page-pad: clamp(12px, 1.4vw, 20px);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f6f2ff;
  --muted: #b7afc2;
  --line: #333a4d;
  --panel: #171b27;
  --paper: #0b0f18;
  --field: #171c29;
  --mint: #5fe3d0;
  --mint-dark: #7bf1de;
  --coral: #ff876f;
  --amber: #e7b75a;
  --blue: #86b0ff;
  --plum: #c1a4ff;
  --rose: #f19ab7;
  --shadow: 0 28px 82px rgba(0, 0, 0, 0.44);
  --soft-shadow: 0 16px 42px rgba(0, 0, 0, 0.26);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background:
    linear-gradient(90deg, rgba(17, 24, 39, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(17, 24, 39, 0.03) 1px, transparent 1px),
    linear-gradient(145deg, rgba(8, 168, 137, 0.14), transparent 34%),
    linear-gradient(25deg, rgba(223, 93, 80, 0.1), transparent 34%),
    linear-gradient(225deg, rgba(47, 111, 216, 0.1), transparent 42%),
    var(--paper);
  background-size:
    38px 38px,
    38px 38px,
    auto,
    auto;
}

:root[data-theme="dark"] body {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(145deg, rgba(95, 227, 208, 0.14), transparent 38%),
    linear-gradient(35deg, rgba(255, 135, 111, 0.09), transparent 32%),
    linear-gradient(225deg, rgba(134, 176, 255, 0.12), transparent 42%),
    var(--paper);
  background-size:
    38px 38px,
    38px 38px,
    auto,
    auto,
    auto;
}

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

button {
  cursor: pointer;
}

.shell {
  width: min(1560px, 100%);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: var(--page-pad);
}

.workspace {
  display: grid;
  align-items: stretch;
  grid-template-columns: minmax(360px, clamp(390px, 32vw, 470px)) minmax(0, 1fr);
  gap: 22px;
  min-height: calc(100vh - 40px);
  min-height: calc(100dvh - (var(--page-pad) * 2));
}

.composer,
.result-area {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(250, 252, 255, 0.72));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

:root[data-theme="dark"] .composer,
:root[data-theme="dark"] .result-area {
  background:
    linear-gradient(180deg, rgba(25, 27, 42, 0.96), rgba(15, 18, 29, 0.92));
}

.composer {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  padding: 18px;
}

.composer::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--mint), var(--amber), var(--plum));
  content: "";
}

.composer > * {
  flex-shrink: 0;
}

@media (min-width: 941px) {
  .workspace {
    height: calc(100vh - 40px);
    height: calc(100dvh - (var(--page-pad) * 2));
    min-height: 0;
  }

  .composer {
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    scrollbar-color: rgba(8, 168, 137, 0.42) transparent;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
  }

  .composer::-webkit-scrollbar {
    width: 8px;
  }

  .composer::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(8, 168, 137, 0.34);
    background-clip: content-box;
  }

  .result-area {
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    scrollbar-color: rgba(8, 168, 137, 0.42) transparent;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
  }

  .result-area::-webkit-scrollbar {
    width: 8px;
  }

  .result-area::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(8, 168, 137, 0.34);
    background-clip: content-box;
  }
}

@media (min-width: 941px) and (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(340px, 390px) minmax(0, 1fr);
    gap: 16px;
  }

  .composer {
    padding: 16px;
  }

  .result-panel {
    padding: 24px;
  }

  .empty-state {
    min-height: clamp(360px, 48vh, 560px);
  }
}

@media (min-width: 941px) and (max-height: 680px) {
  textarea {
    min-height: 118px;
  }

  .empty-state {
    min-height: 320px;
  }
}

.brand-row,
.toolbar,
.image-actions,
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.site-logo {
  display: block;
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border: 1px solid rgba(207, 216, 228, 0.9);
  border-radius: 14px;
  background: #f7fbfd;
  object-fit: cover;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.1);
}

:root[data-theme="dark"] .site-logo {
  border-color: rgba(95, 227, 208, 0.2);
  background: #141827;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.brand-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.theme-toggle {
  flex: 0 0 auto;
  color: var(--plum);
}

.theme-toggle .sun-icon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .moon-icon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .sun-icon {
  display: block;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--mint-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-weight: 850;
  letter-spacing: 0;
}

h1 {
  font-size: 36px;
  line-height: 1.04;
}

h2 {
  font-size: 24px;
}

.status-pill {
  flex: 0 1 auto;
  max-width: 170px;
  overflow: hidden;
  border: 1px solid rgba(43, 138, 110, 0.35);
  border-radius: 999px;
  padding: 8px 13px;
  color: var(--mint-dark);
  background: rgba(38, 128, 107, 0.08);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:root[data-theme="dark"] .status-pill {
  border-color: rgba(95, 227, 208, 0.34);
  color: var(--mint-dark);
  background: rgba(95, 227, 208, 0.11);
}

.field {
  display: grid;
  gap: 8px;
}

.field span,
.prompt-field-title,
.switch,
.counter {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.prompt-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.prompt-field-title {
  min-width: 0;
}

.reset-content-button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

textarea,
select,
input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: var(--field);
  color: var(--ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 1px 2px rgba(20, 32, 54, 0.04);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background-color 0.16s ease;
}

:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select,
:root[data-theme="dark"] input {
  background: var(--field);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

textarea:focus,
select:focus,
input:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 4px rgba(43, 138, 110, 0.14);
}

textarea {
  min-height: 150px;
  resize: vertical;
  padding: 14px;
  line-height: 1.55;
}

input[readonly] {
  color: #4d5552;
  background:
    linear-gradient(90deg, rgba(38, 128, 107, 0.08), rgba(49, 95, 142, 0.06)),
    #f7f9f6;
}

:root[data-theme="dark"] input[readonly] {
  color: #c7d4cf;
  background:
    linear-gradient(90deg, rgba(95, 227, 208, 0.1), rgba(132, 169, 238, 0.08)),
    #181c2a;
}

select,
input {
  padding: 0 12px;
}

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

.prompt-examples,
.reference-panel,
.relay-panel {
  position: relative;
  overflow: hidden;
}

.prompt-examples::before,
.reference-panel::before,
.relay-panel::before {
  position: absolute;
  inset: 10px auto 10px 0;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--mint), var(--plum));
  content: "";
}

.prompt-examples {
  display: grid;
  gap: 9px;
  border: 1px solid rgba(121, 87, 200, 0.18);
  border-radius: 8px;
  padding: 11px;
  background:
    linear-gradient(135deg, rgba(121, 87, 200, 0.08), transparent 46%),
    linear-gradient(315deg, rgba(8, 168, 137, 0.08), transparent 44%),
    rgba(255, 255, 255, 0.78);
  box-shadow: var(--soft-shadow);
}

:root[data-theme="dark"] .prompt-examples {
  border-color: rgba(193, 164, 255, 0.24);
  background:
    linear-gradient(135deg, rgba(193, 164, 255, 0.12), transparent 46%),
    linear-gradient(315deg, rgba(95, 227, 208, 0.11), transparent 44%),
    rgba(24, 27, 42, 0.82);
}

.example-head,
.carousel-controls,
.sample-showcase-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.example-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  flex: 1 1 auto;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--plum);
  background: rgba(255, 255, 255, 0.54);
  font-weight: 850;
  text-align: left;
}

:root[data-theme="dark"] .example-toggle {
  background: rgba(19, 22, 36, 0.52);
}

.example-toggle span {
  color: var(--plum);
  font-size: 12px;
  font-weight: 850;
}

.example-toggle strong {
  color: var(--mint-dark);
  font-size: 12px;
}

:root[data-theme="dark"] .example-toggle span,
:root[data-theme="dark"] .example-toggle strong {
  color: var(--mint);
}

.prompt-example-body {
  display: grid;
  gap: 9px;
}

.prompt-example-body[hidden] {
  display: none;
}

.prompt-examples.is-collapsed .carousel-controls {
  display: none;
}

.carousel-controls {
  flex: 0 0 auto;
  gap: 7px;
}

.mini-button {
  width: 36px;
  min-height: 36px;
  color: var(--plum);
}

.mini-button span {
  color: inherit;
  font-size: 20px;
  font-weight: 850;
  line-height: 1;
}

.prompt-example-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  border: 1px solid rgba(121, 87, 200, 0.16);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.82);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.prompt-example-card:hover {
  border-color: rgba(22, 136, 118, 0.58);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(20, 32, 54, 0.08);
  transform: translateY(-1px);
}

:root[data-theme="dark"] .prompt-example-card {
  border-color: rgba(193, 164, 255, 0.22);
  background: rgba(19, 22, 36, 0.82);
}

:root[data-theme="dark"] .prompt-example-card:hover {
  border-color: rgba(95, 227, 208, 0.62);
  background: rgba(28, 32, 49, 0.92);
}

.prompt-example-card span {
  color: var(--mint-dark);
  font-size: 12px;
  font-weight: 850;
}

.prompt-example-card strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.48;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.prompt-example-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.use-example-button {
  width: 100%;
}

.control-generate-button {
  grid-column: 1 / -1;
  margin-top: 0;
}

.reference-panel {
  display: grid;
  gap: 9px;
  border: 1px solid rgba(8, 168, 137, 0.2);
  border-radius: 8px;
  padding: 11px;
  background:
    linear-gradient(135deg, rgba(8, 168, 137, 0.09), transparent 42%),
    linear-gradient(315deg, rgba(223, 93, 80, 0.08), transparent 48%),
    rgba(255, 255, 255, 0.78);
  box-shadow: var(--soft-shadow);
}

:root[data-theme="dark"] .reference-panel {
  border-color: rgba(95, 227, 208, 0.24);
  background:
    linear-gradient(135deg, rgba(95, 227, 208, 0.11), transparent 42%),
    linear-gradient(315deg, rgba(255, 135, 111, 0.1), transparent 48%),
    rgba(24, 27, 42, 0.82);
}

.reference-head,
.reference-head > div,
.reference-preview-item > div,
.reference-copy {
  min-width: 0;
}

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

.reference-head > div,
.reference-preview-item > div,
.reference-copy {
  display: grid;
  gap: 3px;
}

.reference-head span {
  color: var(--mint-dark);
  font-size: 12px;
  font-weight: 850;
}

.reference-head small,
.reference-copy small,
.reference-preview-item small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-drop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  border: 1.5px dashed rgba(8, 168, 137, 0.34);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.62);
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    transform 0.18s ease;
}

.reference-drop:hover,
.reference-drop.is-dragging {
  border-color: var(--mint);
  background: rgba(255, 255, 255, 0.82);
  transform: translateY(-1px);
}

:root[data-theme="dark"] .reference-drop {
  background: rgba(18, 21, 34, 0.7);
}

:root[data-theme="dark"] .reference-drop:hover,
:root[data-theme="dark"] .reference-drop.is-dragging {
  background: rgba(28, 32, 49, 0.92);
}

.reference-drop input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.reference-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  color: var(--mint-dark);
  background:
    linear-gradient(135deg, rgba(8, 168, 137, 0.16), rgba(121, 87, 200, 0.1));
}

.reference-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.reference-copy strong,
.reference-preview-item strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-preview {
  display: grid;
  gap: 8px;
}

:root[data-theme="dark"] .reference-preview {
  color: var(--ink);
}

.reference-preview[hidden] {
  display: none;
}

.reference-preview-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(109, 74, 163, 0.18);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.64);
}

:root[data-theme="dark"] .reference-preview-item {
  border-color: rgba(193, 164, 255, 0.18);
  background: rgba(18, 21, 34, 0.74);
}

.reference-preview-item img {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  background: #eceee8;
}

:root[data-theme="dark"] .reference-preview-item img {
  background: #151927;
}

.mini-icon-button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(109, 74, 163, 0.18);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-size: 18px;
  font-weight: 850;
  line-height: 1;
}

.mini-icon-button:hover {
  color: var(--coral);
  border-color: rgba(223, 93, 80, 0.32);
}

:root[data-theme="dark"] .mini-icon-button {
  border-color: rgba(193, 164, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
}

.switch-row {
  min-height: 34px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.switch span {
  position: relative;
  width: 48px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #e9ebe7;
  transition: background 0.16s ease;
}

:root[data-theme="dark"] .switch span {
  background: #2b3040;
}

.switch span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
  content: "";
  transition: transform 0.16s ease;
}

.switch input:checked + span {
  background: var(--mint);
}

.switch input:checked + span::after {
  transform: translateX(20px);
}

.relay-panel {
  display: grid;
  gap: 12px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(246, 248, 245, 0.72));
  box-shadow: var(--soft-shadow);
}

:root[data-theme="dark"] .relay-panel {
  background:
    linear-gradient(180deg, rgba(27, 31, 47, 0.84), rgba(20, 24, 38, 0.84));
}

.relay-panel legend {
  padding: 0 6px;
  color: var(--mint-dark);
  font-size: 13px;
  font-weight: 820;
}

.relay-panel.is-disabled {
  opacity: 0.72;
}

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

.span-2 {
  grid-column: 1 / -1;
}

.settings-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 38px;
}

.settings-actions span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-actions div {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

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

.key-row {
  grid-template-columns: minmax(0, 1fr) 44px;
}

.model-row input,
.model-row select,
.key-row input {
  min-width: 0;
}

.model-row .compact-button {
  min-width: 86px;
  white-space: nowrap;
}

.generate-button,
.ghost-button,
.icon-button,
.image-actions button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  font-weight: 820;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease,
    background-color 0.18s ease;
}

.generate-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 50px;
  margin-top: auto;
  padding: 0 16px;
  color: #fff;
  background: linear-gradient(135deg, #111827, #047968 48%, #7957c8);
  box-shadow: 0 16px 34px rgba(4, 121, 104, 0.22);
}

:root[data-theme="dark"] .generate-button {
  color: #081014;
  background: linear-gradient(135deg, #7bf1de, #e7b75a 48%, #c1a4ff);
  box-shadow: 0 18px 38px rgba(95, 227, 208, 0.18);
}

.generate-button:hover {
  background: linear-gradient(135deg, #0b1220, #058d78 48%, #6c4aba);
  transform: translateY(-1px);
}

.generate-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.button-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--coral);
  font-size: 13px;
  line-height: 1.5;
}

.result-area {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  padding: 0;
}

.result-panel {
  display: grid;
  gap: 24px;
  border: 1px solid rgba(207, 216, 228, 0.92);
  border-radius: 16px;
  padding: 32px;
  background: #ffffff;
  box-shadow: 0 18px 52px rgba(20, 32, 54, 0.1);
}

:root[data-theme="dark"] .result-panel {
  border-color: rgba(66, 75, 96, 0.9);
  background: rgba(18, 22, 34, 0.94);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.32);
}

.toolbar {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  min-height: 0;
  margin-bottom: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.result-title-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
  align-content: center;
}

.result-heading-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}

.toolbar h2 {
  font-size: 28px;
  line-height: 1.25;
}

.result-time-tip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(8, 168, 137, 0.22);
  border-radius: 999px;
  padding: 0 12px;
  color: #087769;
  background: linear-gradient(135deg, rgba(14, 196, 164, 0.11), rgba(231, 183, 90, 0.12));
  font-size: 13px;
  font-weight: 760;
  line-height: 1.25;
  white-space: nowrap;
}

:root[data-theme="dark"] .result-time-tip {
  border-color: rgba(95, 227, 208, 0.26);
  color: #7bf1de;
  background: linear-gradient(135deg, rgba(95, 227, 208, 0.13), rgba(231, 183, 90, 0.1));
}

:root[data-theme="dark"] .toolbar {
  background: transparent;
}

.result-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.ghost-button,
.icon-button,
.image-actions button {
  border: 1px solid var(--line);
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
}

:root[data-theme="dark"] .ghost-button,
:root[data-theme="dark"] .icon-button,
:root[data-theme="dark"] .image-actions button {
  color: var(--ink);
  background: rgba(28, 31, 46, 0.88);
}

.ghost-button:hover,
.icon-button:hover,
.image-actions button:hover {
  border-color: var(--mint);
  box-shadow: 0 8px 20px rgba(20, 32, 54, 0.08);
  transform: translateY(-1px);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  padding: 0;
}

.icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.icon-button[aria-pressed="true"] {
  color: var(--mint-dark);
  background: rgba(38, 128, 107, 0.1);
}

:root[data-theme="dark"] .icon-button[aria-pressed="true"] {
  background: rgba(95, 227, 208, 0.14);
}

.compact-button {
  min-height: 36px;
  padding: 0 10px;
  font-size: 13px;
}

button:disabled {
  cursor: not-allowed;
}

.sample-showcase {
  --sample-shift: 18px;
  display: grid;
  gap: 10px;
  margin-bottom: 8px;
  border: 1px solid rgba(47, 111, 216, 0.16);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(47, 111, 216, 0.08), transparent 42%),
    linear-gradient(315deg, rgba(217, 154, 33, 0.1), transparent 46%),
    rgba(255, 255, 255, 0.82);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(18px);
}

:root[data-theme="dark"] .sample-showcase {
  border-color: rgba(132, 169, 238, 0.24);
  background:
    linear-gradient(135deg, rgba(132, 169, 238, 0.14), transparent 42%),
    linear-gradient(315deg, rgba(231, 183, 90, 0.12), transparent 46%),
    rgba(19, 22, 36, 0.84);
}

.sample-showcase-head {
  min-height: 40px;
}

.sample-showcase-head h3 {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 20px;
}

.sample-visual {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.84), transparent 54%),
    #ece8ef;
  box-shadow: 0 18px 44px rgba(20, 32, 54, 0.13);
  aspect-ratio: 16 / 10;
}

:root[data-theme="dark"] .sample-visual {
  background:
    radial-gradient(circle at 50% 45%, rgba(95, 227, 208, 0.1), transparent 54%),
    #111522;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.36);
}

.sample-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform-origin: center;
  will-change: opacity, transform, filter;
}

.sample-visual img.is-entering {
  animation: sampleImageEnter 720ms cubic-bezier(0.2, 0.78, 0.22, 1) both;
}

.sample-gloss {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.22), transparent 28%),
    linear-gradient(0deg, rgba(23, 21, 30, 0.2), transparent 36%);
  mix-blend-mode: screen;
}

:root[data-theme="dark"] .sample-gloss {
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.16), transparent 26%),
    linear-gradient(0deg, rgba(5, 8, 16, 0.28), transparent 42%);
}

.sample-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 18px;
  margin: 2px 0 4px;
}

.sample-dot {
  width: 28px;
  height: 6px;
  min-height: 6px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: rgba(109, 74, 163, 0.18);
  transition:
    width 0.22s ease,
    background-color 0.22s ease,
    transform 0.22s ease;
}

:root[data-theme="dark"] .sample-dot {
  background: rgba(255, 255, 255, 0.2);
}

.sample-dot[aria-current="true"] {
  width: 44px;
  background: linear-gradient(90deg, var(--mint), var(--plum));
  transform: translateY(-1px);
}

h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.16;
  letter-spacing: 0;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: clamp(420px, 52vh, 620px);
  margin-bottom: 0;
  border: 1.5px dashed #cbd5e1;
  border-radius: 14px;
  padding: 42px 28px;
  color: var(--ink);
  background: #fbfcfe;
}

:root[data-theme="dark"] .empty-state {
  border-color: rgba(110, 122, 148, 0.58);
  background: rgba(13, 17, 27, 0.72);
}

.empty-state[hidden] {
  display: none;
}

.empty-state-content {
  display: grid;
  max-width: 620px;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.empty-state-icon {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  color: #14b8a6;
  background: #ecfdf9;
  box-shadow: none;
}

.empty-state-icon svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.empty-state h3 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.22;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  align-content: start;
}

.image-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--soft-shadow);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.image-card:hover {
  border-color: rgba(8, 168, 137, 0.35);
  box-shadow: 0 18px 42px rgba(20, 32, 54, 0.12);
  transform: translateY(-2px);
}

:root[data-theme="dark"] .image-card {
  background: rgba(20, 23, 36, 0.88);
}

.image-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background:
    linear-gradient(45deg, rgba(43, 138, 110, 0.16), transparent),
    linear-gradient(135deg, rgba(201, 137, 33, 0.2), transparent),
    #eceee8;
  aspect-ratio: var(--result-ratio, 1 / 1);
}

:root[data-theme="dark"] .image-wrap {
  background:
    linear-gradient(45deg, rgba(95, 227, 208, 0.13), transparent),
    linear-gradient(135deg, rgba(231, 183, 90, 0.14), transparent),
    #111522;
}

.image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #f2f3ef;
}

:root[data-theme="dark"] .image-wrap img {
  background: #151927;
}

.image-card.loading .image-wrap::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  content: "";
  animation: shimmer 1.1s linear infinite;
}

:root[data-theme="dark"] .image-card.loading .image-wrap::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
}

.image-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.image-actions button {
  min-width: 0;
  min-height: 38px;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-card.is-saved [data-action="download"] {
  border-color: rgba(8, 168, 137, 0.34);
  color: var(--mint-dark);
  background: rgba(8, 168, 137, 0.1);
}

.image-prompt {
  display: -webkit-box;
  min-height: 42px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

@keyframes sampleImageEnter {
  0% {
    opacity: 0.18;
    filter: blur(8px) saturate(0.9);
    transform: translateX(var(--sample-shift)) scale(1.035);
  }
  58% {
    opacity: 1;
    filter: blur(0) saturate(1.04);
  }
  100% {
    opacity: 1;
    filter: blur(0) saturate(1);
    transform: translateX(0) scale(1);
  }
}

@keyframes shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

@media (max-width: 940px) {
  .shell {
    padding: 14px;
  }

  .workspace {
    grid-template-columns: 1fr;
    gap: 14px;
    min-height: auto;
  }

  .composer {
    min-height: auto;
  }

  textarea {
    min-height: 156px;
  }
}

@media (max-width: 760px) {
  .sample-showcase {
    grid-template-columns: 1fr;
  }

  .sample-visual {
    aspect-ratio: 16 / 10;
    max-height: 420px;
  }

  .empty-state {
    min-height: 250px;
    max-height: none;
  }
}

@media (max-width: 560px) {
  .shell {
    padding: 0;
  }

  .workspace {
    gap: 0;
  }

  .composer,
  .result-area {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .result-area {
    padding: 14px;
    gap: 14px;
  }

  .result-panel {
    border-radius: 12px;
    padding: 20px;
  }

  .sample-showcase {
    margin-bottom: 4px;
  }

  .toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .brand-row,
  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-actions {
    width: 100%;
    justify-content: space-between;
  }

  .site-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }

  .status-pill {
    max-width: 100%;
  }

  .result-time-tip {
    max-width: 100%;
    white-space: normal;
  }

  h1 {
    font-size: 33px;
  }

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

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

  .settings-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-actions div {
    width: 100%;
  }

  .model-row {
    grid-template-columns: 1fr;
  }

  .empty-state {
    min-height: 230px;
    padding: 28px 18px;
  }

  .empty-state-icon {
    width: 64px;
    height: 64px;
  }

  .empty-state h3 {
    font-size: 21px;
  }

  .empty-state p {
    font-size: 14px;
  }

  .compact-button {
    flex: 1;
  }

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