:root {
  --bg: #f5f8f6;
  --paper: #ffffff;
  --paper-soft: #fbfdfb;
  --ink: #17211d;
  --muted: #6b7771;
  --line: #dce7df;
  --mint: #60c7a1;
  --mint-dark: #279b76;
  --aqua: #dff6ee;
  --blue: #6697e8;
  --rose: #ef6f78;
  --amber: #f4be57;
  --shadow: 0 18px 48px rgba(32, 63, 48, 0.12);
  --radius: 8px;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  color: var(--ink);
}

button, input, textarea {
  font: inherit;
}

button {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: #26332e;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.dark button {
  border-color: var(--line);
  background: #17211d;
  color: var(--ink);
}

.dark button:hover {
  background: #1f2b26;
}

.app-root {
  min-height: 100vh;
  background:
    radial-gradient(circle at 6% 7%, rgba(96, 199, 161, 0.24), transparent 28%),
    linear-gradient(135deg, #f7faf8 0%, #eef7f3 54%, #f9f3ee 100%);
  color: var(--ink);
}

.app-root.dark {
  --paper: #151d1a;
  --paper-soft: #1b2521;
  --ink: #edf6f1;
  --muted: #9baaa3;
  --line: #2b3a34;
  --aqua: #1d3b32;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  background:
    radial-gradient(circle at 6% 7%, rgba(96, 199, 161, 0.14), transparent 28%),
    linear-gradient(135deg, #0f1714 0%, #131d19 54%, #1b1917 100%);
}

.shell {
  width: 100vw;
  height: 100vh;
  padding: 0;
}

.app-frame {
  height: 100%;
  display: grid;
  grid-template-rows: 58px 1fr;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: none;
  backdrop-filter: blur(22px);
}

.dark .app-frame {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(18, 27, 23, 0.82);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.dark .topbar {
  background: rgba(18, 27, 23, 0.8);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 230px;
}

.logo {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  overflow: hidden;
  background: transparent;
  color: #fff;
  box-shadow: none;
}

.logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.brand h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.1;
  letter-spacing: 0;
}

.brand h1 .ghost-link {
  height: auto;
  min-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.brand h1 .ghost-link:hover {
  color: #1e9f78;
}

.brand span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.endpoint {
  min-width: 0;
  flex: 1;
  max-width: 560px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-soft);
  color: var(--muted);
  font-size: 12px;
}

.endpoint code {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #2c3a34;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
}

.dark .endpoint code { color: #dbe8e1; }

.dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 5px rgba(96, 199, 161, 0.16);
}

.dot.warn {
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(244, 190, 87, 0.16);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.primary {
  border-color: transparent;
  background: #1e9f78;
  color: #fff;
  box-shadow: 0 10px 22px rgba(39, 155, 118, 0.22);
}

.dark .primary,
.dark .primary:hover {
  border-color: transparent;
  background: #1e9f78;
  color: #fff;
  box-shadow: 0 10px 22px rgba(39, 155, 118, 0.18);
}

.full { width: 100%; }

.main {
  display: grid;
  grid-template-columns: var(--sidebar-width, 244px) 2px minmax(0, 1fr) 318px;
  min-height: 0;
}

.main.settings-hidden {
  grid-template-columns: var(--sidebar-width, 244px) 2px minmax(0, 1fr);
}

.main.gallery-mode {
  grid-template-columns: var(--sidebar-width, 244px) 2px minmax(0, 1fr);
}

.sidebar, .inspector {
  min-height: 0;
  padding: 16px;
  background: rgba(251, 253, 251, 0.82);
}

.dark .sidebar, .dark .inspector {
  background: rgba(21, 29, 26, 0.88);
}

.sidebar {
  display: flex;
  flex-direction: column;
  padding-right: 10px;
}

.sidebar-resizer {
  width: 2px;
  min-height: 0;
  cursor: col-resize;
  background: linear-gradient(to right, var(--line), transparent);
  opacity: 0.72;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.sidebar-resizer:hover {
  opacity: 1;
  background: var(--mint);
}

.inspector {
  overflow: auto;
  border-left: 1px solid var(--line);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.session-list {
  display: grid;
  gap: 8px;
  flex: 1;
  align-content: start;
  overflow: auto;
}

.session {
  height: auto;
  display: block;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  text-align: left;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.session.active {
  border-color: #b7e8d6;
  background: #effbf6;
}

.dark .session.active {
  border-color: #2b7e63;
  background: #17342b;
}

.session:hover {
  border-color: #cfe5da;
  transform: translateY(-1px);
}

.dark .session:hover {
  border-color: #2f4a40;
  background: rgba(237, 246, 241, 0.04);
}

.session-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px 24px;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.icon-only {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
}

.danger { color: #bb4b55; }

.dark .danger {
  color: #ffadb4;
}

.session-delete {
  flex: 0 0 auto;
  justify-self: end;
}

.session-loading-slot {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  color: #2b8b6b;
}

.session-loading-indicator {
  width: 13px;
  height: 13px;
  display: block;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.82;
  animation: session-loading-pulse 1.6s steps(4, end) infinite;
}

.dark .session-loading-slot {
  color: #8ce0bd;
}

.session.generating:not(.active) {
  background: rgba(223, 246, 238, 0.48);
}

.dark .session.generating:not(.active) {
  background: rgba(29, 59, 50, 0.34);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 3px 8px;
  border: 0;
  border-radius: 999px;
  background: #eef3f0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  box-shadow: none;
}

.pill.good { background: var(--aqua); color: #25815f; }
.pill.warn { background: #fff3dd; color: #95661c; }
.pill.fail { background: #ffe9ea; color: #b7424c; }
.pill.blue { background: #e9f0ff; color: #356ec8; }

.dark .pill { background: #22302b; color: #aab8b2; }
.dark .pill.good { background: #1d3b32; color: #8ce0bd; }
.dark .pill.warn { background: #3d3320; color: #f3c86c; }
.dark .pill.fail { background: #3b2227; color: #ffadb4; }
.dark .pill.blue { background: #1e2d49; color: #a8c4ff; }

.tiny {
  min-height: 23px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 10px;
}

.draft {
  display: -webkit-box;
  min-height: 34px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.42;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.session-draft {
  display: block;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  -webkit-line-clamp: unset;
  -webkit-box-orient: initial;
}

.app-footer {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.version-line, .theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.theme-toggle {
  width: 100%;
  background: rgba(255, 255, 255, 0.62);
}

.dark .theme-toggle {
  background: rgba(17, 26, 23, 0.92);
  border-color: #2b3a34;
  color: #edf6f1;
}

.dark .theme-toggle .switch {
  background: #60c7a1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.dark .theme-toggle .switch.off {
  background: #36433d;
}

.dark .theme-toggle .switch::after {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
}

.workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: rgba(255, 255, 255, 0.58);
}

.dark .workspace, .dark .gallery-page {
  background: rgba(18, 27, 23, 0.66);
}

.dark .prompt-library-page {
  background: rgba(18, 27, 23, 0.66);
}

.composer {
  min-width: 0;
  padding: 10px 16px 10px 12px;
  border-bottom: 1px solid var(--line);
}

.composer.drop-active {
  background: rgba(46, 173, 124, 0.08);
}

.dark .composer.drop-active {
  background: rgba(96, 199, 161, 0.1);
}

.composer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.composer-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.composer-head button {
  height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.composer-head button svg {
  flex: 0 0 auto;
}

.composer-head .clear-prompt-button {
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  font-synthesis: none;
}

.composer-head .clear-prompt-button span {
  display: inline-block;
  font: inherit;
  line-height: 1;
}

.composer-head .clear-prompt-button svg {
  width: 14px;
  height: 14px;
}

.reference-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-bottom: 8px;
}

.reference-list {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0;
}

.reference-chip {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: grab;
}

.reference-chip > svg {
  position: absolute;
  left: 4px;
  top: 4px;
  z-index: 1;
  color: rgba(35, 52, 45, 0.72);
}

.dark .reference-chip > svg {
  color: rgba(237, 246, 241, 0.76);
}

.reference-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.reference-chip button {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
}

.dark .reference-chip button {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(17, 26, 23, 0.66);
  color: #edf6f1;
}

.reference-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.dark .reference-chip {
  background: #17211d;
  border-color: var(--line);
}

.reference-footer-button {
  position: relative;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: rgba(36, 94, 76, 0.66);
  box-shadow: none;
}

.reference-footer-button:hover {
  background: transparent;
  color: rgba(30, 159, 120, 0.92);
}

.dark .reference-footer-button {
  background: transparent;
  color: rgba(184, 233, 212, 0.68);
}

.dark .reference-footer-button:hover {
  background: transparent;
  color: rgba(140, 224, 189, 0.94);
}

.reference-footer-button span {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  background: #1e9f78;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.prompt-box {
  display: grid;
  grid-template-rows: 1fr 44px;
  height: 142px;
  border: 1px solid #bee6d5;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(43, 95, 70, 0.06);
}

.dark .prompt-box,
.dark .panel,
.dark .history-card,
.dark .input-control,
.dark .search-wrap {
  background: #17211d;
}

.dark .prompt-box {
  border-color: #2b5f4e;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.dark .input-control {
  color: var(--ink);
}

.dark .input-control::placeholder,
.dark textarea::placeholder,
.dark .search-wrap input::placeholder {
  color: #75867f;
}

textarea {
  resize: none;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  overflow-y: auto;
  padding: 12px 16px;
  border: 0;
  outline: 0;
  border-radius: 12px 12px 0 0;
  background: transparent;
  color: #202b27;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.62;
  scroll-padding-block: 15px;
}

.dark textarea { color: #edf6f1; }

.prompt-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px 7px 16px;
}

.hint {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.3;
}

.field .hint {
  white-space: normal;
}

.field-label-with-help {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.info-icon:hover {
  background: transparent;
  color: var(--mint-dark);
}

.dark .info-icon {
  color: #9baaa3;
}

.dark .info-icon:hover {
  color: #8ce0bd;
}

.mini-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.prompt-foot button {
  height: 31px;
  min-width: 72px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.prompt-foot .reference-footer-button {
  width: 32px;
  min-width: 32px;
  padding: 0;
}

.generate-button {
  min-width: 106px;
}

.canvas-area {
  min-height: 0;
  overflow: auto;
  padding: 18px 20px 18px 14px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.canvas-area::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 11px;
}

.history-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 900;
}

.workspace-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.workspace-head-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.clear-failed-button {
  height: 26px;
  padding: 0 10px;
  border-color: rgba(190, 65, 76, 0.22);
  background: rgba(255, 235, 237, 0.88);
  color: #b74450;
  font-size: 12px;
  font-weight: 850;
}

.clear-failed-button:hover {
  background: rgba(255, 225, 229, 0.98);
}

.dark .clear-failed-button {
  border-color: rgba(255, 173, 180, 0.18);
  background: rgba(44, 22, 26, 0.92);
  color: #ffb8be;
}

.dark .clear-failed-button:hover {
  background: rgba(61, 28, 33, 0.98);
}

.summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.dark .summary-chip {
  border-color: rgba(219, 230, 224, 0.08);
  background: rgba(237, 246, 241, 0.06);
  color: #c8d5ce;
}

.summary-chip strong {
  color: inherit;
  font-weight: 950;
}

.summary-chip.total {
  border-color: rgba(56, 84, 73, 0.18);
  background: rgba(248, 250, 249, 0.82);
  color: #43534d;
}

.summary-chip.success {
  border-color: rgba(31, 132, 96, 0.22);
  background: rgba(224, 248, 237, 0.82);
  color: #1f7658;
}

.summary-chip.danger {
  border-color: rgba(190, 65, 76, 0.22);
  background: rgba(255, 235, 237, 0.86);
  color: #b74450;
}

.summary-chip.active {
  border-color: rgba(37, 113, 173, 0.24);
  background: rgba(224, 242, 255, 0.86);
  color: #256a9f;
}

.dark .summary-chip.total {
  border-color: rgba(219, 230, 224, 0.08);
  background: rgba(237, 246, 241, 0.08);
  color: #c8d5ce;
}

.dark .summary-chip.success {
  border-color: rgba(62, 204, 150, 0.2);
  background: rgba(35, 93, 72, 0.38);
  color: #8fe2c0;
}

.dark .summary-chip.danger {
  border-color: rgba(244, 114, 126, 0.2);
  background: rgba(116, 45, 53, 0.42);
  color: #f0a0aa;
}

.dark .summary-chip.active {
  border-color: rgba(100, 181, 246, 0.2);
  background: rgba(36, 78, 111, 0.44);
  color: #a9d8ff;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1px;
  align-content: start;
  align-items: start;
}

.art-card {
  position: relative;
  width: 100%;
  height: auto;
  align-self: start;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 3px;
  background: #eaf5ef;
  box-shadow: 0 12px 25px rgba(32, 63, 48, 0.1);
}

.dark .art-card {
  border-color: rgba(255, 255, 255, 0.08);
  background: #18231f;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.22);
}

.art-card.selectable {
  cursor: pointer;
}

.art-card.selected {
  border-color: #1e9f78;
  box-shadow: 0 0 0 2px rgba(30, 159, 120, 0.24), 0 12px 25px rgba(32, 63, 48, 0.1);
}

.image-card {
  cursor: pointer;
}

.image-card > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.18s ease;
}

.image-card:hover > img {
  transform: scale(1.02);
}

.art-card.loading {
  background: linear-gradient(135deg, #edf8f3 0%, #f8fbf9 52%, #e5f1ff 100%);
  display: grid;
  place-items: center;
}

.dark .art-card.loading {
  background: linear-gradient(135deg, #17211d 0%, #1d3029 52%, #1e2d49 100%);
}

.generating-card {
  gap: 10px;
  contain: layout paint;
}

.generating-card.retry-details-card {
  cursor: pointer;
}

.generating-center {
  display: grid;
  place-items: center;
  gap: 8px;
  max-width: calc(100% - 28px);
}

.generating-label {
  color: #245e4c;
  font-size: 13px;
  font-weight: 900;
}

.dark .generating-label {
  color: #b8e9d4;
}

.retry-failure-message {
  max-width: 100%;
  color: #aa3b45;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  word-break: break-word;
}

.dark .retry-failure-message {
  color: #ffadb4;
}

.retry-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(24, 125, 93, 0.12);
  color: #1c6d55;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.dark .retry-chip {
  background: rgba(86, 205, 159, 0.16);
  color: #b8e9d4;
}

.generating-meta {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #245e4c;
  font-size: 11px;
  font-weight: 800;
}

.dark .generating-meta {
  color: #b8e9d4;
}

.cancel-chip {
  height: 22px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  color: inherit;
  font-size: 11px;
  font-weight: 800;
  box-shadow: none;
}

.dark .cancel-chip {
  background: rgba(17, 26, 23, 0.48);
}

.dark .cancel-chip:hover {
  background: rgba(17, 26, 23, 0.68);
}

.art-card.failed {
  display: grid;
  place-items: center;
  background: #fff7f4;
  box-shadow: none;
  cursor: pointer;
}

.dark .art-card.failed {
  background: #2a171a;
}

.fail-content {
  position: relative;
  z-index: 1;
  width: calc(100% - 34px);
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.fail-content strong {
  min-width: 0;
  display: block;
  color: #aa3b45;
  font-size: 13px;
  line-height: 1.42;
  word-break: break-word;
}

.dark .fail-content strong {
  color: #ffadb4;
}

.art-tools {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 5px;
  padding: 0;
  background: transparent;
}

.art-tools button {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 6px;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.52);
  color: #31413a;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(8px);
  opacity: 0.88;
}

.art-tools button:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.72);
}

.art-tools button svg {
  flex: 0 0 auto;
}

.tile-select {
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 2;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.62);
  color: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(8px);
}

.tile-select.selected {
  border-color: transparent;
  background: #1e9f78;
}

.dark .art-tools {
  background: transparent;
}

.dark .art-tools button {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(17, 26, 23, 0.48);
  color: #edf6f1;
}

.dark .art-tools button:hover {
  background: rgba(30, 43, 38, 0.72);
}

.filled {
  fill: #ef6f78;
  color: #ef6f78;
}

.config-stack {
  display: grid;
  gap: 13px;
}

.panel {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.panel h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 11px;
  color: var(--ink);
  font-size: 13px;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.field-error {
  color: #b74450;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.35;
}

.dark .field-error {
  color: #ffadb4;
}

.input-control {
  height: 34px;
  width: 100%;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
  background: #fbfdfb;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f5f8f6;
}

.dark .segmented { background: #111a17; }

.segmented button {
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}

.segmented .on {
  background: #fff;
  color: #1d7f61;
  box-shadow: 0 3px 10px rgba(38, 84, 64, 0.08);
}

.dark .segmented .on {
  background: #22302b;
  color: #8ce0bd;
}

.dark .segmented button {
  background: transparent;
  color: var(--muted);
}

.toggle-row {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: space-between;
  padding: 8px 0;
  border: 0;
  border-top: 1px solid #edf3ef;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
}

.toggle-row .info-icon {
  width: 14px;
  height: 14px;
}

.switch {
  width: 38px;
  height: 22px;
  padding: 3px;
  border-radius: 999px;
  background: #60c7a1;
}

.switch::after {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  margin-left: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(35, 55, 46, 0.22);
  transition: margin 0.18s ease;
}

.switch.off {
  background: #d7ded9;
}

.dark .switch.off {
  background: #36433d;
}

.switch.off::after {
  margin-left: 0;
}

.status-error {
  margin-bottom: 10px;
  padding: 9px;
  border-radius: 8px;
  background: #fff1f2;
  color: #9c3440;
  font-size: 12px;
  line-height: 1.45;
}

.dark .status-error {
  background: #3b2227;
  color: #ffadb4;
}

.advanced-settings {
  margin-top: 2px;
  margin-bottom: 10px;
  padding-top: 4px;
}

.advanced-settings > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(30, 159, 120, 0.42);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(223, 246, 238, 0.96), rgba(233, 240, 255, 0.92));
  color: #17694f;
  box-shadow: 0 8px 18px rgba(39, 155, 118, 0.12);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.advanced-settings > summary:hover {
  border-color: rgba(30, 159, 120, 0.7);
  box-shadow: 0 10px 22px rgba(39, 155, 118, 0.18);
  transform: translateY(-1px);
}

.dark .advanced-settings > summary {
  border-color: rgba(96, 199, 161, 0.38);
  background: linear-gradient(135deg, rgba(29, 59, 50, 0.96), rgba(30, 45, 73, 0.72));
  color: #8ce0bd;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.dark .advanced-settings > summary:hover {
  border-color: rgba(140, 224, 189, 0.62);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.3);
}

.advanced-settings > summary::-webkit-details-marker {
  display: none;
}

.advanced-settings-body {
  display: grid;
  gap: 8px;
  padding-top: 10px;
}

.gallery-page {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  padding: 20px 20px 20px 14px;
  overflow: hidden;
  background: rgba(250, 252, 250, 0.92);
}

.gallery-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.gallery-hero h2 {
  margin: 0 0 6px;
  font-size: 24px;
  letter-spacing: 0;
}

.gallery-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.gallery-tools {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0 8px;
  flex-wrap: wrap;
  overflow: visible;
}

.gallery-tools .search-wrap {
  flex: 0 0 292px;
  width: 292px;
}

.gallery-tools button {
  height: 34px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}

.search-wrap {
  flex: 1;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
}

.search-wrap input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
}

.active-soft {
  background: var(--aqua);
  color: #25815f;
}

.dark .active-soft,
.dark button.active-soft {
  border-color: rgba(62, 204, 150, 0.22);
  background: #1d3b32;
  color: #8ce0bd;
}

.gallery-select {
  position: relative;
  flex: 0 0 auto;
  min-width: 78px;
}

.settings-select {
  width: 100%;
  min-width: 0;
}

.settings-select .gallery-select-trigger {
  width: 100%;
}

.gallery-tools .gallery-select {
  flex-basis: 112px;
  width: 112px;
  min-width: 112px;
}

.gallery-select.model-select {
  min-width: 112px;
}

.gallery-select.sort-select {
  min-width: 112px;
}

.gallery-select.page-size-select {
  min-width: 82px;
}

.gallery-select-trigger {
  width: 100%;
  height: 34px;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  box-shadow: none;
}

.gallery-select-trigger span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.gallery-select-trigger svg {
  flex: 0 0 auto;
  color: var(--muted);
  transition: transform 0.16s ease;
}

.gallery-select-trigger[aria-expanded="true"] {
  border-color: rgba(39, 155, 118, 0.48);
  box-shadow: 0 0 0 3px rgba(96, 199, 161, 0.14);
}

.dark .gallery-select-trigger[aria-expanded="true"] {
  border-color: rgba(96, 199, 161, 0.42);
  box-shadow: 0 0 0 3px rgba(96, 199, 161, 0.12);
}

.gallery-select-trigger[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.gallery-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  width: max-content;
  min-width: 100%;
  max-width: min(260px, 70vw);
  max-height: 280px;
  display: grid;
  gap: 3px;
  overflow: auto;
  padding: 5px;
  border: 1px solid rgba(205, 224, 214, 0.92);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 36px rgba(32, 63, 48, 0.16);
}

.gallery-select-menu button {
  width: 100%;
  height: 30px;
  justify-content: space-between;
  gap: 12px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 750;
  box-shadow: none;
}

.gallery-select-menu button:hover {
  background: #eef9f4;
  color: #1d7f61;
}

.gallery-select-menu button.selected {
  background: #dff6ee;
  color: #1e8767;
}

.gallery-select-menu button span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.gallery-select-menu button svg {
  flex: 0 0 auto;
}

.gallery-pagination .gallery-select-menu {
  top: auto;
  bottom: calc(100% + 6px);
}

.dark .gallery-select-trigger {
  background: #17211d;
  color: #edf6f1;
}

.dark .gallery-select-menu {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(23, 33, 29, 0.98);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}

.dark .gallery-select-menu button:hover {
  background: #22302b;
  color: #8ce0bd;
}

.dark .gallery-select-menu button.selected {
  background: #1d3b32;
  color: #8ce0bd;
}

.gallery-bulkbar {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 0 10px;
}

.gallery-bulk-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.gallery-bulk-title {
  min-height: 28px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.muted-line {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.gallery-bulk-actions {
  justify-content: flex-start;
}

.gallery-bulk-actions button {
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1px;
  align-content: start;
  align-items: start;
  min-height: 0;
  overflow: auto;
  grid-auto-flow: row;
  grid-auto-rows: auto;
  padding-bottom: 8px;
}

.gallery-tile-frame {
  aspect-ratio: auto;
  position: relative;
  width: 100%;
  min-width: 0;
}

.gallery-tile-frame::before {
  content: "";
  display: block;
  padding-top: 133.3333%;
}

.gallery-tile-frame > .art-card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}

.gallery-tile-frame > .image-card > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.gallery-pagination button {
  height: 28px;
  padding: 0 8px;
  font-size: 12px;
}

.gallery-pagination .gallery-select-trigger {
  height: 28px;
  padding: 0 8px;
}

.gallery-pagination .gallery-select-menu button {
  height: 30px;
  padding: 0 8px;
}

.prompt-library-page {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0;
  padding: 20px 20px 20px 14px;
  overflow: hidden;
  background: rgba(250, 252, 250, 0.92);
}

.prompt-library-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.prompt-library-hero h2 {
  margin: 0 0 6px;
  font-size: 24px;
  letter-spacing: 0;
}

.prompt-library-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.prompt-library-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.prompt-library-tools {
  padding-top: 10px;
}

.prompt-library-tools .gallery-select-menu {
  top: calc(100% + 1px);
  border-radius: 7px;
  box-shadow: 0 10px 22px rgba(47, 85, 66, 0.12);
}

.prompt-library-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(244px, 1fr));
  gap: 10px;
  overflow: auto;
  padding-top: 10px;
  align-content: start;
}

.prompt-template-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 10px;
  min-height: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 25px rgba(32, 63, 48, 0.08);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.prompt-template-card:hover {
  transform: translateY(-1px);
  border-color: #cfe5da;
  box-shadow: 0 14px 28px rgba(32, 63, 48, 0.12);
}

.dark .prompt-template-card {
  border-color: var(--line);
  background: #17211d;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.18);
}

.prompt-template-card-head {
  display: grid;
  gap: 8px;
}

.prompt-template-card-head h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
}

.prompt-template-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.prompt-template-card-badges,
.prompt-template-tags,
.prompt-library-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.prompt-template-card-text {
  margin: 0;
  overflow: hidden;
  color: #202b27;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 11px;
  line-height: 1.58;
  display: -webkit-box;
  -webkit-line-clamp: 7;
  -webkit-box-orient: vertical;
}

.dark .prompt-template-card-head h3,
.dark .prompt-template-card-text,
.dark .prompt-template-panel-card p,
.dark .prompt-template-side a {
  color: #edf6f1;
}

.dark .prompt-template-card-head p,
.dark .prompt-template-panel-card p {
  color: #9baaa3;
}

.prompt-template-card-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.prompt-template-card-actions button {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: none;
}

.prompt-template-card-actions button svg {
  flex: 0 0 auto;
}

.prompt-template-card-actions .primary {
  flex-basis: 34px;
  background: #60c7a1;
  border-color: #60c7a1;
  color: #fff;
}

.prompt-template-card-actions .danger {
  background: rgba(255, 235, 237, 0.92);
  border-color: rgba(190, 65, 76, 0.24);
  color: #b74450;
}

.prompt-template-card-actions button:hover {
  background: #eef9f4;
}

.prompt-template-card-actions .primary:hover {
  background: #4fb18f;
}

.prompt-template-card-actions .danger:hover {
  background: rgba(255, 225, 229, 0.98);
}

.prompt-template-panel {
  width: min(1180px, calc(100vw - 24px));
  height: min(860px, 92vh);
  border-color: #dce7df;
  background: #fff;
  box-shadow: 0 28px 72px rgba(47, 85, 66, 0.16);
  color: var(--ink);
}

.prompt-template-panel .modal-head,
.prompt-editor-panel .modal-head {
  color: var(--ink);
}

.prompt-template-panel .mini-controls button,
.prompt-editor-panel .mini-controls button {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.prompt-template-panel .mini-controls button:hover,
.prompt-editor-panel .mini-controls button:hover {
  background: #eef9f4;
}

.prompt-template-panel .prompt-template-side-actions button,
.prompt-editor-panel .prompt-editor-actions button {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.prompt-template-panel .prompt-template-side-actions .primary,
.prompt-editor-panel .prompt-editor-actions .primary {
  background: #60c7a1;
  color: #fff;
  border-color: #60c7a1;
}

.prompt-template-panel .prompt-template-side-actions .primary:hover,
.prompt-editor-panel .prompt-editor-actions .primary:hover {
  background: #4fb18f;
}

.prompt-template-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0;
  border-top: 1px solid var(--line);
  background: #f6f7f8;
}

.prompt-template-main {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 18px 22px;
}

.prompt-template-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.prompt-template-section {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

.prompt-template-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.ghost-link {
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mint-dark);
  box-shadow: none;
}

.prompt-template-text {
  margin: 0;
  overflow: auto;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.7;
}

.prompt-template-side {
  min-height: 0;
  display: grid;
  gap: 10px;
  padding: 18px 22px;
  border-left: 1px solid var(--line);
  background: #fff;
}

.prompt-template-panel-card {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.prompt-template-panel-card h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  font-size: 13px;
}

.prompt-template-panel-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.prompt-template-side-actions {
  display: grid;
  gap: 8px;
}

.prompt-template-panel-card .prompt-template-params {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.prompt-template-source {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--mint-dark);
  text-decoration: none;
  font-size: 12px;
  line-height: 1.4;
}

.prompt-template-source span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.prompt-editor-panel {
  width: min(760px, calc(100vw - 24px));
  height: auto;
  max-height: 92vh;
  border-color: #dce7df;
  background: #fff;
  box-shadow: 0 28px 72px rgba(47, 85, 66, 0.16);
  color: var(--ink);
}

.prompt-editor-body {
  min-height: 0;
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 6px;
  overflow: auto;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--line);
  background: #f6f7f8;
  color: var(--ink);
}

.prompt-editor-body .field {
  margin: 0;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 2px;
  color: var(--muted);
}

.prompt-editor-body .input-control,
.prompt-editor-body .gallery-select-trigger {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.prompt-editor-top-row {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: start;
  align-content: start;
  gap: 6px;
}

.editable-select {
  position: relative;
  min-width: 0;
}

.editable-select-menu {
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  z-index: 6;
  width: 100%;
  max-height: 220px;
  overflow: auto;
  display: grid;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(47, 85, 66, 0.12);
}

.editable-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  font-size: 12px;
  font-weight: 700;
}

.editable-select-option:hover,
.editable-select-option.selected {
  background: #eef9f4;
  color: #1d7f61;
}

.editable-select-option.create {
  background: #f4f6f7;
  color: #44504a;
}

.editable-select-empty {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 12px;
}

.editable-multi-select {
  position: relative;
  min-width: 0;
}

.editable-multi-select-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(96, 199, 161, 0.22);
  border-radius: 999px;
  background: #e0f8ed;
  color: #1d7f61;
  font-size: 12px;
  font-weight: 750;
}

.prompt-editor-panel .tag-pill {
  background: #e0f8ed;
  border-color: rgba(96, 199, 161, 0.22);
  color: #1d7f61;
}

.prompt-editor-panel .tag-pill:hover {
  background: #d1f2e4;
}

.tag-pill svg {
  flex: 0 0 auto;
}

.editable-multi-select-text {
  flex: 1 1 28px;
  min-width: 28px;
  height: 24px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.editable-multi-select-text::placeholder {
  color: var(--muted);
}

.editable-multi-select-menu {
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  z-index: 6;
  width: 100%;
  max-height: 220px;
  overflow: auto;
  display: grid;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(47, 85, 66, 0.12);
}

.prompt-editor-panel .editable-multi-select-menu {
  border-color: var(--line);
  background: #fff;
}

.editable-multi-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  font-size: 12px;
  font-weight: 700;
}

.editable-multi-select-option:hover,
.editable-multi-select-option.selected {
  background: #eef9f4;
  color: #1d7f61;
}

.editable-multi-select-option.create {
  background: #f4f6f7;
  color: #44504a;
}

.prompt-editor-body .gallery-select-trigger svg {
  color: var(--muted);
}

.prompt-editor-body .gallery-select-menu {
  top: calc(100% + 1px);
  border-color: var(--line);
  background: #fff;
  gap: 3px;
  padding: 4px;
  box-shadow: 0 10px 22px rgba(47, 85, 66, 0.12);
}

.prompt-editor-body .gallery-select-menu button {
  min-height: 32px;
  color: var(--ink);
}

.prompt-editor-body .gallery-select-menu button:hover,
.prompt-editor-body .gallery-select-menu button.selected {
  background: #eef9f4;
  color: #1d7f61;
}

.prompt-editor-textarea {
  height: auto;
  min-height: 92px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.62;
  resize: vertical;
}

.prompt-editor-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  align-content: start;
  gap: 6px;
}

.prompt-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

@media (max-width: 1080px) {
  .prompt-library-hero {
    align-items: flex-start;
  }

  .prompt-library-summary {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .prompt-editor-top-row {
    grid-template-columns: 1fr;
  }

  .prompt-editor-row {
    grid-template-columns: 1fr;
  }

  .prompt-template-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .prompt-template-side {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .prompt-template-card-actions {
    gap: 6px;
  }
}

@media (max-width: 640px) {
  .prompt-library-page {
    padding: 16px 14px 14px 12px;
  }

  .prompt-library-hero h2 {
    font-size: 22px;
  }

  .prompt-library-summary {
    width: 100%;
  }

  .prompt-template-card-actions button {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }

  .prompt-editor-body {
    padding-left: 20px;
    padding-right: 20px;
  }
}

.workspace-pagination {
  margin-top: 10px;
}

.history-card {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 10px;
  min-height: 118px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.thumb {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(135deg, #a8ead3, #83aaf0 55%, #ffc1aa);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb.fail {
  background: linear-gradient(135deg, #fff0ed, #ffe1e5);
}

.dark .thumb.fail {
  background: linear-gradient(135deg, #3b2227, #2a171a);
}

.history-info {
  min-width: 0;
}

.history-info strong {
  display: block;
  overflow: hidden;
  margin-bottom: 5px;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
}

.history-info p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.38;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 240px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
}

.grid-empty {
  grid-column: 1 / -1;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(8, 12, 10, 0.74);
  z-index: 20;
}

.modal.open { display: flex; }

.modal-panel {
  width: min(1220px, calc(100vw - 24px));
  height: min(920px, 94vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(10, 16, 13, 0.98);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
  contain: layout paint;
}

.modal-panel:fullscreen {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
}

.error-details-panel {
  width: min(1120px, calc(100vw - 24px));
  height: min(860px, 94vh);
}

.error-details-body {
  min-height: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
  overflow: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #edf6f1;
}

.error-details-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 8px;
  color: rgba(237, 246, 241, 0.88);
  font-size: 12px;
  font-weight: 750;
}

.error-details-meta-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}

.error-details-meta-label {
  color: rgba(237, 246, 241, 0.58);
  font-weight: 800;
}

.error-details-meta-value {
  color: rgba(237, 246, 241, 0.92);
}

.error-details-meta-separator {
  margin: 0 2px;
  color: rgba(237, 246, 241, 0.32);
  font-weight: 800;
}

.error-details-section {
  display: grid;
  gap: 8px;
}

.error-details-section h4 {
  margin: 0;
  font-size: 13px;
}

.error-details-section pre {
  margin: 0;
  overflow: auto;
  max-height: 240px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(237, 246, 241, 0.9);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 11px;
  line-height: 1.5;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: #edf6f1;
}

.modal-head span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 800;
  font-size: 13px;
}

.modal-head .mini-controls {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.modal-head .mini-controls button {
  height: 28px;
  padding: 0 10px;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #edf6f1;
}

.zoom-value {
  min-width: 42px;
  text-align: center;
  color: rgba(237, 246, 241, 0.82);
  font-size: 12px;
  font-weight: 800;
}

.prompt-template-panel,
.prompt-editor-panel {
  border-color: #dce7df;
  background: #fff;
  box-shadow: 0 28px 72px rgba(47, 85, 66, 0.16);
  color: var(--ink);
}

.modal-panel.prompt-editor-panel {
  width: min(760px, calc(100vw - 24px));
  height: auto;
  max-height: 92vh;
}

.prompt-template-panel .modal-head,
.prompt-editor-panel .modal-head {
  color: var(--ink);
}

.prompt-template-panel .modal-head .mini-controls button,
.prompt-editor-panel .modal-head .mini-controls button {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.prompt-template-panel .modal-head .mini-controls button:hover,
.prompt-editor-panel .modal-head .mini-controls button:hover {
  background: #eef9f4;
}

.modal-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-art {
  position: relative;
  min-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
}

.modal-image-stage {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
  transition: transform 0.12s ease;
  will-change: transform;
}

.modal-image-stage.dragging {
  cursor: grabbing;
  transition: none;
}

.modal-art img {
  max-width: none;
  max-height: none;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
  user-select: none;
  pointer-events: none;
  transition: transform 0.12s ease;
}

.modal-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 38px;
  height: 54px;
  padding: 0;
  transform: translateY(-50%);
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(237, 246, 241, 0.9);
  backdrop-filter: blur(10px);
}

.modal-nav.previous {
  left: 18px;
}

.modal-nav.next {
  right: 18px;
}

.modal-nav:disabled {
  opacity: 0;
  pointer-events: none;
}

.modal-counter {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 2;
  transform: translateX(-50%);
  color: rgba(237, 246, 241, 0.78);
  font-size: 12px;
  font-weight: 900;
}

.modal-prompt {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(96px, 1fr) auto;
  gap: 12px;
  padding: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  color: #edf6f1;
}

.modal-meta {
  display: grid;
  gap: 7px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-meta-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 12px;
}

.modal-meta-row span {
  color: rgba(237, 246, 241, 0.58);
  font-weight: 800;
}

.modal-meta-row strong {
  min-width: 0;
  overflow: hidden;
  color: rgba(237, 246, 241, 0.92);
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-prompt-head span {
  font-size: 13px;
  font-weight: 900;
}

.modal-prompt-head button {
  height: 28px;
  padding: 0 9px;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #edf6f1;
  font-size: 12px;
}

.modal-prompt p {
  min-height: 0;
  margin: 0;
  overflow: auto;
  padding-right: 4px;
  color: rgba(237, 246, 241, 0.86);
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.65;
}

.modal-references {
  min-height: 0;
  display: grid;
  grid-template-rows: 24px minmax(0, 1fr);
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-references .modal-prompt-head {
  min-height: 24px;
}

.modal-reference-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 72px;
  gap: 10px;
  overflow: auto;
  padding-right: 2px;
}

.modal-reference-grid button {
  width: 100%;
  height: 72px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

.dark .modal-reference-grid button {
  background: transparent;
  border-color: transparent;
}

.dark .modal-reference-grid button:hover {
  background: transparent;
}

.modal-reference-grid img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 8px;
}

.reference-preview-panel {
  width: min(980px, calc(100vw - 24px));
  height: min(820px, 92vh);
}

.reference-preview-body {
  position: relative;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.reference-preview-body img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
}

@media (max-width: 860px) {
  .modal-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) 190px;
  }

  .modal-prompt {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .prompt-template-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) 240px;
  }

  .prompt-template-side {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(16px);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(23, 33, 29, 0.9);
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 30;
  font-size: 13px;
  font-weight: 800;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.spin {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes session-loading-pulse {
  0% { opacity: 0.22; transform: scale(0.7); }
  25% { opacity: 0.5; transform: scale(0.82); }
  50% { opacity: 0.82; transform: scale(1); }
  75% { opacity: 0.5; transform: scale(0.82); }
  100% { opacity: 0.22; transform: scale(0.7); }
}

@media (max-width: 1180px) {
  .shell { padding: 0; }
  .main, .main.settings-hidden {
    grid-template-columns: minmax(180px, var(--sidebar-width, 220px)) 2px minmax(0, 1fr);
  }
  .inspector {
    display: none;
  }
  .endpoint {
    display: none;
  }
  .preview-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

/* Visual refinement layer: keeps the current layout, upgrades material, rhythm, and states. */
:root {
  --bg: #f7f3ea;
  --paper: #fffdfa;
  --paper-soft: #f8f4ec;
  --paper-warm: #fbf7ef;
  --ink: #1f2722;
  --muted: #7a7469;
  --line: #e5ddd0;
  --line-strong: #d8ccb9;
  --mint: #2f8a64;
  --mint-dark: #16623f;
  --aqua: #e7f2ea;
  --blue: #4f82b8;
  --rose: #bd5b5d;
  --amber: #b98a2e;
  --shadow: 0 18px 42px rgba(54, 45, 31, 0.1);
  --shadow-soft: 0 8px 22px rgba(54, 45, 31, 0.075);
  --shadow-lift: 0 18px 44px rgba(44, 53, 40, 0.14);
  --focus-ring: 0 0 0 3px rgba(47, 138, 100, 0.16);
  --radius: 8px;
  font-family: "SF Pro Text", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
}

body {
  background: var(--bg);
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

button,
.gallery-select-trigger,
.input-control,
textarea {
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

button:hover:not(:disabled),
.gallery-select-trigger:hover,
.input-control:hover {
  border-color: var(--line-strong);
  background: #fffdf8;
}

button:focus-visible,
.gallery-select-trigger:focus-visible,
.input-control:focus-visible,
textarea:focus-visible,
.session:focus-visible,
.art-card:focus-visible {
  outline: 0;
  border-color: rgba(47, 138, 100, 0.54);
  box-shadow: var(--focus-ring);
}

.app-root {
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.96) 0%, rgba(247, 243, 234, 0.98) 48%, rgba(241, 236, 226, 1) 100%);
}

.app-frame {
  grid-template-rows: 62px 1fr;
  border-color: rgba(219, 210, 194, 0.86);
  background: rgba(255, 253, 248, 0.74);
  backdrop-filter: blur(18px);
}

.topbar {
  min-height: 62px;
  padding: 0 22px;
  border-bottom-color: rgba(219, 210, 194, 0.8);
  background: rgba(255, 252, 246, 0.84);
  backdrop-filter: blur(20px);
}

.brand {
  min-width: 214px;
}

.brand h1 {
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand h1 .ghost-link:hover {
  color: var(--mint-dark);
}

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

.endpoint {
  height: 38px;
  border-color: rgba(221, 211, 195, 0.9);
  background: rgba(255, 253, 248, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.dot {
  background: #5e9b66;
  box-shadow: 0 0 0 5px rgba(94, 155, 102, 0.14);
}

.primary {
  border-color: rgba(17, 90, 56, 0.38);
  background: linear-gradient(180deg, #1f7a4d 0%, #155d3b 100%);
  box-shadow: 0 14px 24px rgba(31, 122, 77, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.primary:hover:not(:disabled) {
  border-color: rgba(17, 90, 56, 0.42);
  background: linear-gradient(180deg, #258b58 0%, #176642 100%);
  transform: translateY(-1px);
}

.sidebar,
.inspector {
  background: rgba(252, 248, 240, 0.86);
}

.sidebar {
  border-right: 1px solid rgba(226, 217, 202, 0.56);
}

.inspector {
  border-left-color: rgba(226, 217, 202, 0.8);
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.55);
}

.workspace,
.gallery-page,
.prompt-library-page {
  background: rgba(255, 252, 246, 0.7);
}

.section-title,
.history-title,
.panel h3,
.prompt-library-hero h2,
.gallery-hero h2 {
  letter-spacing: 0;
}

.session-list {
  gap: 7px;
}

.session {
  padding: 9px 10px;
  border-color: transparent;
  border-radius: 10px;
}

.session:hover {
  border-color: rgba(197, 181, 153, 0.68);
  background: rgba(255, 253, 248, 0.72);
  box-shadow: var(--shadow-soft);
}

.session.active {
  border-color: rgba(47, 138, 100, 0.42);
  background: linear-gradient(180deg, rgba(233, 245, 237, 0.96), rgba(244, 249, 243, 0.94));
  box-shadow: inset 3px 0 0 rgba(47, 138, 100, 0.72), var(--shadow-soft);
}

.session.generating:not(.active) {
  background: rgba(231, 242, 234, 0.54);
}

.draft {
  color: #746f66;
}

.app-footer {
  border-top-color: rgba(226, 217, 202, 0.88);
}

.theme-toggle {
  border-color: rgba(226, 217, 202, 0.9);
  background: rgba(255, 253, 248, 0.7);
}

.pill,
.summary-chip {
  border: 1px solid rgba(226, 217, 202, 0.78);
  background: rgba(255, 253, 248, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.pill.good,
.summary-chip.success {
  border-color: rgba(47, 138, 100, 0.22);
  background: rgba(231, 242, 234, 0.9);
  color: #206645;
}

.pill.warn {
  border-color: rgba(185, 138, 46, 0.24);
  background: #fbefd8;
  color: #7d5d1e;
}

.pill.fail,
.summary-chip.danger {
  border-color: rgba(189, 91, 93, 0.24);
  background: #fae9e5;
  color: #9a4749;
}

.pill.blue,
.summary-chip.active {
  border-color: rgba(79, 130, 184, 0.2);
  background: #e9f1f6;
  color: #38698f;
}

.composer {
  padding: 14px 18px 14px 16px;
  border-bottom-color: rgba(226, 217, 202, 0.82);
  background: rgba(255, 252, 246, 0.58);
}

.composer-head {
  margin-bottom: 9px;
}

.composer-head button,
.prompt-foot button,
.gallery-tools button,
.gallery-bulk-actions button,
.gallery-pagination button {
  border-color: rgba(226, 217, 202, 0.9);
  background: rgba(255, 253, 248, 0.76);
}

.prompt-assist-button:hover:not(:disabled) {
  color: var(--mint-dark);
}

.clear-prompt-button:hover:not(:disabled),
.danger:hover:not(:disabled) {
  border-color: rgba(189, 91, 93, 0.28);
  background: #faebe7;
  color: #a24b4e;
}

.prompt-box {
  height: 154px;
  border-color: rgba(207, 192, 167, 0.82);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.prompt-box:focus-within {
  border-color: rgba(47, 138, 100, 0.46);
  box-shadow: var(--focus-ring), var(--shadow-soft);
}

textarea {
  color: #20231f;
  font-size: 14px;
  line-height: 1.7;
}

textarea::placeholder {
  color: rgba(122, 116, 105, 0.74);
}

.prompt-foot {
  border-top: 1px solid rgba(226, 217, 202, 0.6);
  background: rgba(250, 246, 238, 0.68);
}

.reference-chip {
  width: 54px;
  height: 54px;
  border-color: rgba(218, 207, 188, 0.9);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: var(--shadow-soft);
}

.reference-chip:hover {
  border-color: rgba(47, 138, 100, 0.38);
  transform: translateY(-1px);
}

.reference-chip.dragging {
  opacity: 0.58;
  transform: scale(0.96);
  cursor: grabbing;
}

.reference-chip.drag-over {
  border-color: rgba(47, 138, 100, 0.7);
  box-shadow: 0 0 0 3px rgba(47, 138, 100, 0.14), var(--shadow-soft);
}

.reference-order {
  position: absolute;
  left: 4px;
  bottom: 4px;
  z-index: 2;
  min-width: 17px;
  height: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(20, 31, 25, 0.68);
  color: #fff;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
}

.reference-drag-handle {
  padding: 2px;
  border-radius: 5px;
  background: rgba(255, 253, 248, 0.68);
  cursor: grab;
}

.reference-chip:hover .reference-drag-handle {
  background: rgba(47, 138, 100, 0.16);
  color: #1f714b;
}

.reference-chip button,
.art-tools button,
.tile-select {
  backdrop-filter: blur(12px);
}

.canvas-area {
  padding: 20px 22px 20px 18px;
}

.history-head {
  margin-bottom: 13px;
}

.preview-grid,
.gallery-grid {
  gap: 12px;
}

.art-card {
  border-color: rgba(226, 217, 202, 0.8);
  border-radius: 8px;
  background: #f1ede4;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.art-card:hover {
  border-color: rgba(47, 138, 100, 0.34);
  box-shadow: var(--shadow-lift);
  transform: translateY(-2px);
}

.art-card.selected {
  border-color: rgba(47, 138, 100, 0.78);
  box-shadow: 0 0 0 2px rgba(47, 138, 100, 0.2), var(--shadow-lift);
}

.image-card > img {
  transition: transform 0.24s ease, filter 0.24s ease;
}

.image-card:hover > img {
  transform: scale(1.025);
  filter: saturate(1.03) contrast(1.02);
}

.art-tools {
  top: 9px;
  right: 9px;
  gap: 6px;
  opacity: 0;
  transform: translateX(4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.art-card:hover .art-tools,
.art-card:focus-within .art-tools,
.art-card.failed .art-tools {
  opacity: 1;
  transform: translateX(0);
}

.art-tools button {
  width: 26px;
  height: 26px;
  border-color: rgba(255, 255, 255, 0.72);
  border-radius: 7px;
  background: rgba(255, 253, 248, 0.78);
  color: #2b352f;
  box-shadow: 0 8px 18px rgba(18, 20, 16, 0.16);
}

.art-tools button:hover {
  background: rgba(255, 253, 248, 0.94);
  transform: translateY(-1px);
}

.tile-select {
  top: 8px;
  left: 8px;
  width: 20px;
  height: 20px;
  border-radius: 6px;
}

.tile-select.selected {
  background: var(--mint);
}

.art-card.loading {
  background:
    linear-gradient(rgba(255, 253, 248, 0.46), rgba(255, 253, 248, 0.46)),
    linear-gradient(135deg, #e9f2ec 0%, #f7f2e7 58%, #e9eff3 100%);
}

.generating-card::before {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: 999px;
  border: 3px solid rgba(47, 138, 100, 0.1);
  border-top-color: rgba(47, 138, 100, 0.58);
  animation: spin 1.2s linear infinite;
}

.generating-center,
.generating-meta {
  z-index: 1;
}

.generating-label {
  color: var(--mint-dark);
}

.retry-chip {
  border: 1px solid rgba(47, 138, 100, 0.18);
  background: rgba(231, 242, 234, 0.84);
  color: #206645;
}

.art-card.failed {
  border-color: rgba(189, 91, 93, 0.26);
  background:
    linear-gradient(rgba(255, 253, 248, 0.54), rgba(255, 253, 248, 0.54)),
    linear-gradient(135deg, #fae9e5, #f3eee6);
  box-shadow: var(--shadow-soft);
}

.fail-content strong {
  color: #9a4749;
}

.panel {
  padding: 15px;
  border-color: rgba(226, 217, 202, 0.86);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.76);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.panel h3 {
  margin-bottom: 13px;
  font-size: 14px;
}

.field {
  gap: 7px;
  margin-bottom: 12px;
  color: #746e64;
}

.input-control,
.search-wrap,
.gallery-select-trigger,
.editable-multi-select-input,
.prompt-editor-textarea {
  border-color: rgba(226, 217, 202, 0.94);
  background: rgba(255, 253, 248, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.input-control:focus,
.search-wrap:focus-within,
.gallery-select-trigger[aria-expanded="true"] {
  border-color: rgba(47, 138, 100, 0.48);
  box-shadow: var(--focus-ring);
}

.segmented {
  gap: 4px;
  border-color: rgba(226, 217, 202, 0.9);
  background: rgba(244, 239, 230, 0.76);
}

.segmented button:hover:not(:disabled) {
  background: rgba(255, 253, 248, 0.72);
}

.segmented .on {
  background: #fffdfa;
  color: var(--mint-dark);
  box-shadow: 0 8px 16px rgba(54, 45, 31, 0.08);
}

.toggle-row {
  border-top-color: rgba(226, 217, 202, 0.72);
}

.switch {
  background: var(--mint);
}

.advanced-settings > summary {
  border-color: rgba(47, 138, 100, 0.3);
  background: linear-gradient(180deg, rgba(233, 245, 237, 0.96), rgba(250, 246, 238, 0.86));
  color: var(--mint-dark);
  box-shadow: var(--shadow-soft);
}

.advanced-settings > summary:hover {
  border-color: rgba(47, 138, 100, 0.48);
  box-shadow: var(--shadow-soft);
}

.gallery-page,
.prompt-library-page {
  padding: 20px 22px 20px 18px;
}

.gallery-tools {
  padding-top: 0;
}

.search-wrap {
  height: 36px;
}

.gallery-select-trigger {
  height: 36px;
}

.gallery-select-menu,
.editable-select-menu,
.editable-multi-select-menu {
  border-color: rgba(218, 207, 188, 0.94);
  border-radius: 9px;
  background: rgba(255, 253, 248, 0.98);
  box-shadow: 0 20px 44px rgba(54, 45, 31, 0.16);
}

.gallery-select-menu button:hover,
.editable-select-option:hover,
.editable-select-option.selected,
.editable-multi-select-option:hover,
.editable-multi-select-option.selected {
  background: rgba(231, 242, 234, 0.9);
  color: var(--mint-dark);
}

.gallery-select-menu button.selected {
  background: rgba(225, 239, 229, 0.96);
  color: var(--mint-dark);
}

.gallery-pagination {
  border-top-color: rgba(226, 217, 202, 0.78);
}

.prompt-template-card {
  border-color: rgba(226, 217, 202, 0.84);
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.82);
  box-shadow: var(--shadow-soft);
}

.prompt-template-card:hover {
  border-color: rgba(47, 138, 100, 0.34);
  box-shadow: var(--shadow-lift);
}

.empty-state {
  border-color: rgba(207, 192, 167, 0.86);
  background: rgba(255, 253, 248, 0.42);
}

.modal {
  background: rgba(20, 18, 14, 0.66);
  backdrop-filter: blur(10px);
}

.modal-panel {
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(18, 21, 18, 0.98);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.48);
}

.toast {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(31, 39, 34, 0.94);
  box-shadow: 0 14px 34px rgba(20, 18, 14, 0.24);
  backdrop-filter: blur(14px);
}

.app-root.dark {
  --paper: #121a17;
  --paper-soft: #17211d;
  --paper-warm: #18231f;
  --ink: #edf6f1;
  --muted: #98a9a1;
  --line: #2a3832;
  --line-strong: #40534a;
  --mint: #57c491;
  --mint-dark: #8ce0bd;
  --aqua: #1b352b;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.24);
  --shadow-lift: 0 18px 44px rgba(0, 0, 0, 0.38);
  --focus-ring: 0 0 0 3px rgba(87, 196, 145, 0.15);
  background: linear-gradient(180deg, #101614 0%, #121a17 48%, #171914 100%);
}

.dark .app-frame,
.dark .topbar {
  background: rgba(18, 26, 23, 0.86);
}

.dark .sidebar,
.dark .inspector,
.dark .workspace,
.dark .gallery-page,
.dark .prompt-library-page {
  background: rgba(18, 26, 23, 0.82);
}

.dark button:hover:not(:disabled),
.dark .gallery-select-trigger:hover,
.dark .input-control:hover {
  border-color: var(--line-strong);
  background: #1a2521;
}

.dark .primary,
.dark .primary:hover:not(:disabled) {
  border-color: rgba(87, 196, 145, 0.28);
  background: linear-gradient(180deg, #27875a 0%, #176642 100%);
  color: #fff;
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.dark .session.active {
  border-color: rgba(87, 196, 145, 0.44);
  background: linear-gradient(180deg, rgba(28, 58, 45, 0.94), rgba(25, 41, 35, 0.92));
  box-shadow: inset 3px 0 0 rgba(87, 196, 145, 0.78), var(--shadow-soft);
}

.dark .session:hover {
  border-color: var(--line-strong);
  background: rgba(237, 246, 241, 0.04);
}

.dark .prompt-box,
.dark .panel,
.dark .input-control,
.dark .search-wrap,
.dark .gallery-select-trigger,
.dark .editable-multi-select-input {
  border-color: var(--line);
  background: rgba(23, 33, 29, 0.86);
}

.dark .prompt-foot {
  border-top-color: rgba(255, 255, 255, 0.06);
  background: rgba(18, 26, 23, 0.72);
}

.dark .art-card {
  border-color: rgba(255, 255, 255, 0.08);
  background: #18231f;
}

.dark .art-card:hover {
  border-color: rgba(87, 196, 145, 0.34);
}

.dark .art-tools button {
  background: rgba(18, 26, 23, 0.66);
}

/* Second refinement pass: restore command hierarchy and polish repeated work surfaces. */
.prompt-foot .generate-button.primary,
.composer .generate-button.primary,
button.generate-button.primary {
  min-width: 128px;
  height: 34px;
  border-color: rgba(17, 90, 56, 0.38);
  background: linear-gradient(180deg, #1f7a4d 0%, #155d3b 100%);
  color: #fff;
  box-shadow: 0 14px 24px rgba(31, 122, 77, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.prompt-foot .generate-button.primary:hover:not(:disabled),
.composer .generate-button.primary:hover:not(:disabled),
button.generate-button.primary:hover:not(:disabled) {
  border-color: rgba(17, 90, 56, 0.42);
  background: linear-gradient(180deg, #258b58 0%, #176642 100%);
  color: #fff;
  transform: translateY(-1px);
}

.prompt-foot .generate-button.primary:disabled,
.composer .generate-button.primary:disabled,
button.generate-button.primary:disabled {
  border-color: rgba(122, 116, 105, 0.2);
  background: linear-gradient(180deg, #d7d0c2 0%, #c8bead 100%);
  color: rgba(255, 255, 255, 0.9);
  box-shadow: none;
}

.composer-tools .pill {
  height: 24px;
  padding-inline: 9px;
}

.prompt-assist-button {
  color: #384239;
}

.prompt-assist-button:not(:disabled):hover {
  border-color: rgba(47, 138, 100, 0.28);
  background: rgba(231, 242, 234, 0.82);
}

.reference-list {
  padding: 3px 1px 6px;
}

.reference-chip::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
  pointer-events: none;
}

.history-title svg,
.section-title svg,
.composer-tools svg {
  color: var(--mint);
}

.workspace-summary {
  gap: 7px;
}

.summary-chip {
  height: 26px;
  padding-inline: 9px;
}

.art-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background: linear-gradient(180deg, transparent, rgba(20, 18, 14, 0.18));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.image-card:hover::after {
  opacity: 1;
}

.art-card.failed::after,
.art-card.loading::after {
  display: none;
}

.art-card.failed .art-tools {
  opacity: 1;
}

.generating-card {
  border-style: solid;
  border-color: rgba(47, 138, 100, 0.24);
}

.generating-meta {
  padding: 7px 8px;
  border: 1px solid rgba(47, 138, 100, 0.12);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.56);
  backdrop-filter: blur(10px);
}

.cancel-chip:hover:not(:disabled) {
  background: rgba(250, 235, 231, 0.94);
  color: #9a4749;
}

.panel + .panel {
  position: relative;
}

.panel h3::before {
  content: "";
  width: 6px;
  height: 18px;
  display: inline-block;
  margin-right: 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(47, 138, 100, 0.92), rgba(47, 138, 100, 0.18));
}

.field > span:first-child,
.field-label-with-help > span:first-child {
  color: #5e584f;
}

.inspector .config-stack {
  gap: 15px;
}

.gallery-tools,
.gallery-bulkbar {
  border-radius: 10px;
}

.gallery-bulkbar {
  min-height: 40px;
  padding: 8px 10px;
  margin-bottom: 10px;
  border: 1px solid rgba(226, 217, 202, 0.7);
  background: rgba(255, 253, 248, 0.48);
}

.gallery-bulk-title span {
  color: #5e584f;
}

.top-actions button.active-soft,
.gallery-tools button.active-soft {
  border-color: rgba(47, 138, 100, 0.26);
  background: rgba(231, 242, 234, 0.92);
  color: var(--mint-dark);
}

.modal-head .mini-controls button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
}

.dark .prompt-foot .generate-button.primary,
.dark .composer .generate-button.primary,
.dark button.generate-button.primary,
.dark .prompt-foot .generate-button.primary:hover:not(:disabled),
.dark .composer .generate-button.primary:hover:not(:disabled),
.dark button.generate-button.primary:hover:not(:disabled) {
  border-color: rgba(87, 196, 145, 0.28);
  background: linear-gradient(180deg, #27875a 0%, #176642 100%);
  color: #fff;
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.dark .prompt-foot .generate-button.primary:disabled,
.dark .composer .generate-button.primary:disabled,
.dark button.generate-button.primary:disabled {
  border-color: rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, #34423b 0%, #27332e 100%);
  color: rgba(237, 246, 241, 0.62);
}

.dark .prompt-assist-button {
  color: #d7e5de;
}

.dark .prompt-assist-button:not(:disabled):hover {
  border-color: rgba(87, 196, 145, 0.26);
  background: rgba(27, 53, 43, 0.82);
}

.dark .field > span:first-child,
.dark .field-label-with-help > span:first-child {
  color: #c2d0c9;
}

.dark .generating-meta {
  border-color: rgba(87, 196, 145, 0.16);
  background: rgba(18, 26, 23, 0.58);
}

.dark .gallery-bulkbar {
  border-color: rgba(255, 255, 255, 0.07);
  background: rgba(23, 33, 29, 0.54);
}

/* Final dark-mode repair: keep the refined surface system from leaking light materials. */
.app-root.dark {
  background:
    radial-gradient(circle at 18% 0%, rgba(47, 138, 100, 0.16), transparent 26%),
    linear-gradient(180deg, #0e1412 0%, #121a17 54%, #171a15 100%);
  color: var(--ink);
}

.dark .app-frame {
  border-color: rgba(255, 255, 255, 0.07);
  background: rgba(15, 22, 19, 0.9);
}

.dark .topbar {
  border-bottom-color: rgba(255, 255, 255, 0.07);
  background: rgba(15, 22, 19, 0.9);
}

.dark .endpoint {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(23, 33, 29, 0.74);
  color: #98a9a1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dark .endpoint code {
  color: #dbe8e1;
}

.dark .sidebar,
.dark .inspector {
  border-color: rgba(255, 255, 255, 0.07);
  background: rgba(18, 26, 23, 0.9);
  box-shadow: none;
}

.dark .workspace,
.dark .gallery-page,
.dark .prompt-library-page {
  background: rgba(15, 22, 19, 0.78);
}

.dark button,
.dark .gallery-select-trigger,
.dark .input-control,
.dark .search-wrap,
.dark .editable-multi-select-input,
.dark .prompt-editor-textarea {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(23, 33, 29, 0.88);
  color: #edf6f1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.dark button:hover:not(:disabled),
.dark .gallery-select-trigger:hover,
.dark .input-control:hover,
.dark .search-wrap:hover {
  border-color: rgba(140, 224, 189, 0.24);
  background: rgba(29, 43, 37, 0.92);
  color: #edf6f1;
}

.dark button:disabled {
  color: rgba(237, 246, 241, 0.48);
}

.dark .brand h1 .ghost-link,
.dark .section-title,
.dark .history-title,
.dark .panel h3,
.dark .gallery-hero h2,
.dark .prompt-library-hero h2 {
  color: #edf6f1;
}

.dark .draft,
.dark .muted-line,
.dark .version-line,
.dark .gallery-bulk-title,
.dark .gallery-hero p,
.dark .prompt-library-hero p {
  color: #98a9a1;
}

.dark .session {
  color: #edf6f1;
}

.dark .session:hover {
  border-color: rgba(140, 224, 189, 0.18);
  background: rgba(237, 246, 241, 0.045);
  box-shadow: none;
}

.dark .session.active {
  border-color: rgba(87, 196, 145, 0.48);
  background: linear-gradient(180deg, rgba(28, 58, 45, 0.96), rgba(23, 38, 33, 0.96));
  box-shadow: inset 3px 0 0 rgba(87, 196, 145, 0.82);
}

.dark .session.generating:not(.active) {
  background: rgba(27, 53, 43, 0.44);
}

.dark .theme-toggle {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(23, 33, 29, 0.88);
  color: #edf6f1;
}

.dark .pill,
.dark .summary-chip {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(237, 246, 241, 0.06);
  color: #b8c8c0;
  box-shadow: none;
}

.dark .pill.good,
.dark .summary-chip.success {
  border-color: rgba(87, 196, 145, 0.2);
  background: rgba(27, 53, 43, 0.82);
  color: #8ce0bd;
}

.dark .pill.blue,
.dark .summary-chip.active {
  border-color: rgba(94, 151, 211, 0.22);
  background: rgba(28, 43, 61, 0.78);
  color: #a6c9ef;
}

.dark .pill.warn {
  border-color: rgba(244, 190, 87, 0.2);
  background: rgba(58, 46, 27, 0.82);
  color: #f3c86c;
}

.dark .pill.fail,
.dark .summary-chip.danger {
  border-color: rgba(244, 114, 126, 0.2);
  background: rgba(66, 32, 36, 0.84);
  color: #ffadb4;
}

.dark .composer {
  border-bottom-color: rgba(255, 255, 255, 0.07);
  background: rgba(15, 22, 19, 0.42);
}

.dark .composer-head button,
.dark .prompt-foot button,
.dark .gallery-tools button,
.dark .gallery-bulk-actions button,
.dark .gallery-pagination button {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(23, 33, 29, 0.88);
  color: #edf6f1;
}

.dark .prompt-assist-button:not(:disabled):hover {
  border-color: rgba(87, 196, 145, 0.28);
  background: rgba(27, 53, 43, 0.92);
  color: #8ce0bd;
}

.dark .clear-prompt-button:hover:not(:disabled),
.dark .danger:hover:not(:disabled) {
  border-color: rgba(255, 173, 180, 0.22);
  background: rgba(66, 32, 36, 0.84);
  color: #ffadb4;
}

.dark .prompt-box {
  border-color: rgba(140, 224, 189, 0.18);
  background: rgba(18, 26, 23, 0.9);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dark .prompt-box:focus-within {
  border-color: rgba(87, 196, 145, 0.44);
  box-shadow: var(--focus-ring), 0 8px 22px rgba(0, 0, 0, 0.28);
}

.dark textarea {
  color: #edf6f1;
}

.dark textarea::placeholder {
  color: rgba(152, 169, 161, 0.78);
}

.dark .prompt-foot {
  border-top-color: rgba(255, 255, 255, 0.07);
  background: rgba(15, 22, 19, 0.6);
}

.dark .reference-footer-button,
.dark .reference-footer-button:hover {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.dark .reference-chip {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(23, 33, 29, 0.88);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
}

.dark .reference-chip:hover {
  border-color: rgba(87, 196, 145, 0.28);
}

.dark .reference-chip.drag-over {
  border-color: rgba(87, 196, 145, 0.58);
  box-shadow: 0 0 0 3px rgba(87, 196, 145, 0.14), 0 8px 22px rgba(0, 0, 0, 0.24);
}

.dark .reference-order {
  background: rgba(237, 246, 241, 0.78);
  color: #12211b;
}

.dark .reference-drag-handle {
  background: rgba(17, 26, 23, 0.62);
}

.dark .reference-chip:hover .reference-drag-handle {
  background: rgba(87, 196, 145, 0.16);
  color: #b8e9d4;
}

.dark .art-card {
  border-color: rgba(255, 255, 255, 0.08);
  background: #18231f;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
}

.dark .art-card:hover {
  border-color: rgba(87, 196, 145, 0.3);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
}

.dark .art-card.selected {
  border-color: rgba(87, 196, 145, 0.72);
  box-shadow: 0 0 0 2px rgba(87, 196, 145, 0.2), 0 18px 44px rgba(0, 0, 0, 0.38);
}

.dark .art-card.loading {
  background: linear-gradient(135deg, #17211d 0%, #1d3029 52%, #1e2d49 100%);
}

.dark .art-card.failed {
  border-color: rgba(244, 114, 126, 0.18);
  background: linear-gradient(135deg, #2a171a, #201917);
}

.dark .art-tools button,
.dark .tile-select,
.dark .cancel-chip {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(15, 22, 19, 0.7);
  color: #edf6f1;
}

.dark .art-tools button:hover,
.dark .cancel-chip:hover:not(:disabled) {
  background: rgba(29, 43, 37, 0.9);
}

.dark .panel {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(23, 33, 29, 0.78);
  box-shadow: none;
}

.dark .field > span:first-child,
.dark .field-label-with-help > span:first-child {
  color: #c2d0c9;
}

.dark .segmented {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(15, 22, 19, 0.78);
}

.dark .segmented button {
  color: #98a9a1;
}

.dark .segmented button:hover:not(:disabled) {
  background: rgba(237, 246, 241, 0.055);
  color: #edf6f1;
}

.dark .segmented .on {
  background: rgba(27, 53, 43, 0.96);
  color: #8ce0bd;
  box-shadow: none;
}

.dark .toggle-row {
  border-top-color: rgba(255, 255, 255, 0.07);
  background: transparent;
  color: #edf6f1;
}

.dark .advanced-settings > summary {
  border-color: rgba(87, 196, 145, 0.28);
  background: linear-gradient(180deg, rgba(27, 53, 43, 0.96), rgba(23, 33, 29, 0.9));
  color: #8ce0bd;
  box-shadow: none;
}

.dark .gallery-bulkbar {
  border-color: rgba(255, 255, 255, 0.07);
  background: rgba(23, 33, 29, 0.54);
}

.dark .gallery-select-menu,
.dark .editable-select-menu,
.dark .editable-multi-select-menu {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(18, 26, 23, 0.98);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.34);
}

.dark .gallery-select-menu button,
.dark .editable-select-option,
.dark .editable-multi-select-option {
  color: #edf6f1;
}

.dark .gallery-select-menu button:hover,
.dark .gallery-select-menu button.selected,
.dark .editable-select-option:hover,
.dark .editable-select-option.selected,
.dark .editable-multi-select-option:hover,
.dark .editable-multi-select-option.selected {
  background: rgba(27, 53, 43, 0.88);
  color: #8ce0bd;
}

.dark .prompt-template-card {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(23, 33, 29, 0.78);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.dark .prompt-template-card:hover {
  border-color: rgba(87, 196, 145, 0.28);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
}

.dark .empty-state {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(23, 33, 29, 0.42);
}

.dark .status-error {
  border: 1px solid rgba(255, 173, 180, 0.18);
  background: rgba(66, 32, 36, 0.84);
  color: #ffadb4;
}

.dark .top-actions button.active-soft,
.dark .gallery-tools button.active-soft {
  border-color: rgba(87, 196, 145, 0.26);
  background: rgba(27, 53, 43, 0.92);
  color: #8ce0bd;
  box-shadow: inset 0 -2px 0 rgba(87, 196, 145, 0.72);
}

.dark .top-actions button.active-soft:hover:not(:disabled),
.dark .gallery-tools button.active-soft:hover:not(:disabled) {
  border-color: rgba(140, 224, 189, 0.34);
  background: rgba(31, 65, 51, 0.96);
  color: #aaf0d1;
}

/* Third pass: stronger product surface while preserving the current three-column workflow. */
.session {
  min-height: 88px;
}

.session-line {
  grid-template-columns: 58px minmax(0, 1fr) 16px 24px;
  gap: 10px;
}

.session-thumb {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(226, 217, 202, 0.82);
  border-radius: 8px;
  background: linear-gradient(135deg, #e8dbc8, #dbeadf);
  color: var(--mint-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(54, 45, 31, 0.08);
}

.session-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

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

.session-title {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
}

.session-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: #7a7469;
  font-size: 10px;
  font-weight: 850;
}

.session-meta span {
  min-width: 0;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.72);
  white-space: nowrap;
}

.session.active .session-meta span {
  background: rgba(47, 138, 100, 0.1);
  color: var(--mint-dark);
}

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

.prompt-count {
  min-width: 0;
  justify-self: end;
  color: rgba(122, 116, 105, 0.72);
  font-size: 11px;
  font-weight: 850;
}

.prompt-foot .generate-button.primary,
.composer .generate-button.primary,
button.generate-button.primary {
  min-width: 156px;
  height: 38px;
  padding-inline: 18px;
  border-radius: 10px;
  font-size: 13px;
}

.prompt-foot .generate-button.primary svg,
.composer .generate-button.primary svg {
  width: 17px;
  height: 17px;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.12));
}

.tile-status-badge {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 2;
  height: 25px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 253, 248, 0.78);
  color: #26332e;
  box-shadow: 0 8px 18px rgba(18, 20, 16, 0.16);
  backdrop-filter: blur(12px);
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
}

.tile-status-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.tile-status-badge.success {
  color: #1f714b;
}

.tile-status-badge.failed {
  color: #9a4749;
}

.tile-status-badge.generating {
  color: #38698f;
}

.tile-info-strip {
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 9px;
  z-index: 2;
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(20, 18, 14, 0.42);
  color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.tile-info-strip span {
  min-width: 0;
  overflow: hidden;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 10px;
  font-weight: 900;
}

.tile-error-action {
  color: rgba(154, 71, 73, 0.78);
  font-size: 11px;
  font-weight: 850;
}

.tile-select {
  top: 42px;
  left: 9px;
}

.art-tools {
  z-index: 3;
}

.dark .session-thumb {
  border-color: rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, #1b352b, #1e2d49);
  color: #8ce0bd;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

.dark .session-title {
  color: #edf6f1;
}

.dark .session-meta {
  color: #98a9a1;
}

.dark .session-meta span {
  background: rgba(237, 246, 241, 0.06);
}

.dark .session.active .session-meta span {
  background: rgba(87, 196, 145, 0.12);
  color: #8ce0bd;
}

.dark .prompt-count {
  color: rgba(152, 169, 161, 0.74);
}

.dark .tile-status-badge {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(15, 22, 19, 0.72);
  color: #edf6f1;
}

.dark .tile-status-badge.success {
  color: #8ce0bd;
}

.dark .tile-status-badge.failed {
  color: #ffadb4;
}

.dark .tile-status-badge.generating {
  color: #a6c9ef;
}

.dark .tile-info-strip {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(15, 22, 19, 0.62);
  color: rgba(237, 246, 241, 0.9);
}

.dark .tile-error-action {
  color: rgba(255, 173, 180, 0.78);
}

/* Keep artwork clean: metadata lives below the image, not over it. */
.art-card.image-card {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 38px;
  aspect-ratio: auto;
  min-height: 0;
}

.image-card > img {
  min-height: 0;
}

.image-card:hover::after {
  opacity: 0;
}

.image-card .art-tools {
  opacity: 0;
}

.tile-info-strip {
  position: static;
  z-index: 1;
  min-height: 38px;
  height: 38px;
  border: 0;
  border-top: 1px solid rgba(226, 217, 202, 0.78);
  border-radius: 0;
  background: rgba(255, 253, 248, 0.92);
  color: #5e584f;
  backdrop-filter: none;
}

.tile-info-strip span {
  background: rgba(244, 239, 230, 0.92);
  color: inherit;
}

.tile-status-badge.success {
  display: none;
}

.tile-status-badge.generating {
  left: 50%;
  top: auto;
  bottom: 58px;
  transform: translateX(-50%);
  background: rgba(15, 22, 19, 0.58);
  color: #fff;
}

.art-card.loading.generating-card {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(47, 138, 100, 0.24), transparent 28%),
    linear-gradient(135deg, rgba(36, 58, 48, 0.28), rgba(232, 219, 200, 0.64)),
    linear-gradient(135deg, #d6cdbf, #eef3ed);
}

.art-card.loading.generating-card::after {
  content: "";
  position: absolute;
  inset: 0;
  display: block;
  background:
    linear-gradient(rgba(255, 253, 248, 0.1), rgba(255, 253, 248, 0.1)),
    radial-gradient(circle at 25% 18%, rgba(255, 255, 255, 0.26), transparent 18%),
    linear-gradient(145deg, rgba(22, 31, 27, 0.12), rgba(22, 31, 27, 0.34));
  backdrop-filter: blur(8px);
  opacity: 1;
}

.generating-card::before {
  inset: 28%;
  z-index: 1;
  border-width: 5px;
  border-color: rgba(255, 255, 255, 0.24);
  border-top-color: rgba(47, 138, 100, 0.86);
}

.generating-center {
  z-index: 2;
  width: 100%;
  gap: 9px;
  color: #fff;
}

.generating-time {
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.34);
  font-size: 26px;
  font-weight: 950;
  line-height: 1;
}

.generating-label {
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
}

.generating-meta {
  z-index: 3;
  left: 9px;
  right: 9px;
  bottom: 9px;
  height: 34px;
  padding: 0 9px;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(15, 22, 19, 0.42);
  color: rgba(255, 255, 255, 0.88);
}

.dark .tile-info-strip {
  border-top-color: rgba(255, 255, 255, 0.08);
  background: rgba(18, 26, 23, 0.96);
  color: rgba(237, 246, 241, 0.84);
}

.dark .tile-info-strip span {
  background: rgba(237, 246, 241, 0.06);
}

.dark .art-card.loading.generating-card {
  background:
    radial-gradient(circle at 50% 42%, rgba(87, 196, 145, 0.24), transparent 28%),
    linear-gradient(135deg, rgba(28, 58, 45, 0.76), rgba(28, 43, 61, 0.72)),
    linear-gradient(135deg, #17211d, #1e2d49);
}

.dark .art-card.loading.generating-card::after {
  background:
    radial-gradient(circle at 25% 18%, rgba(255, 255, 255, 0.08), transparent 18%),
    linear-gradient(145deg, rgba(6, 10, 8, 0.16), rgba(6, 10, 8, 0.48));
}

/* Restore uniform portrait cards while keeping metadata below the artwork. */
.art-card.image-card {
  aspect-ratio: 3 / 4;
  grid-template-rows: minmax(0, 1fr) 38px;
}

.image-card > img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}

.gallery-tile-frame > .art-card.image-card {
  height: 100%;
}

/* Generating tiles: continuous background and a chasing arc spinner. */
.art-card.loading.generating-card {
  background:
    radial-gradient(circle at 34% 22%, rgba(255, 255, 255, 0.38), transparent 30%),
    radial-gradient(circle at 52% 52%, rgba(47, 138, 100, 0.18), transparent 34%),
    linear-gradient(145deg, #b8bbae 0%, #d8d7c8 52%, #eee8d8 100%);
}

.art-card.loading.generating-card::after {
  content: "";
  position: absolute;
  inset: 0;
  display: block;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.08), transparent 34%),
    linear-gradient(145deg, rgba(30, 35, 30, 0.16), rgba(255, 253, 248, 0.12));
  backdrop-filter: blur(6px);
  opacity: 1;
}

.generating-card::before {
  inset: 30%;
  z-index: 2;
  border: 0;
  border-radius: 999px;
  background:
    conic-gradient(
      from 18deg,
      transparent 0deg,
      transparent 202deg,
      rgba(255, 255, 255, 0.22) 238deg,
      rgba(47, 138, 100, 0.92) 318deg,
      transparent 360deg
    );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  animation: spin 1.15s linear infinite;
}

.generating-center {
  z-index: 3;
}

.tile-status-badge.generating,
.generating-meta {
  z-index: 4;
}

.dark .art-card.loading.generating-card {
  background:
    radial-gradient(circle at 34% 22%, rgba(237, 246, 241, 0.11), transparent 30%),
    radial-gradient(circle at 52% 52%, rgba(87, 196, 145, 0.2), transparent 34%),
    linear-gradient(145deg, #17211d 0%, #1d3029 52%, #1e2d49 100%);
}

.dark .art-card.loading.generating-card::after {
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.05), transparent 34%),
    linear-gradient(145deg, rgba(6, 10, 8, 0.18), rgba(6, 10, 8, 0.42));
}

.dark .generating-card::before {
  background:
    conic-gradient(
      from 18deg,
      transparent 0deg,
      transparent 202deg,
      rgba(237, 246, 241, 0.18) 238deg,
      rgba(87, 196, 145, 0.95) 318deg,
      transparent 360deg
    );
}

/* Final generating-tile correction: no seam, true circular chasing arc. */
.art-card.loading.generating-card {
  background: #cfd1c5;
}

.art-card.loading.generating-card::after {
  content: "";
  position: absolute;
  inset: 0;
  display: block;
  background:
    radial-gradient(circle at 34% 16%, rgba(255, 255, 255, 0.28), transparent 25%),
    radial-gradient(circle at 52% 50%, rgba(47, 138, 100, 0.14), transparent 34%),
    radial-gradient(circle at center, transparent 0%, rgba(76, 76, 66, 0.16) 100%);
  backdrop-filter: none;
  opacity: 1;
}

.generating-card::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 150px;
  height: 150px;
  border: 0;
  border-radius: 999px;
  transform-origin: center;
  background:
    conic-gradient(
      from 0deg,
      transparent 0deg,
      transparent 226deg,
      rgba(255, 255, 255, 0.2) 252deg,
      rgba(47, 138, 100, 0.92) 322deg,
      transparent 360deg
    );
  -webkit-mask: radial-gradient(circle, transparent 0 61px, #000 62px 75px, transparent 76px);
  mask: radial-gradient(circle, transparent 0 61px, #000 62px 75px, transparent 76px);
  animation: generating-arc-spin 1.05s linear infinite;
}

.generating-time {
  font-size: 30px;
}

.dark .art-card.loading.generating-card {
  background: #1d2622;
}

.dark .art-card.loading.generating-card::after {
  background:
    radial-gradient(circle at 34% 16%, rgba(237, 246, 241, 0.1), transparent 25%),
    radial-gradient(circle at 52% 50%, rgba(87, 196, 145, 0.18), transparent 34%),
    radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.24) 100%);
}

.dark .generating-card::before {
  background:
    conic-gradient(
      from 0deg,
      transparent 0deg,
      transparent 226deg,
      rgba(237, 246, 241, 0.16) 252deg,
      rgba(87, 196, 145, 0.95) 322deg,
      transparent 360deg
    );
}

@keyframes generating-arc-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Final simplification: generating cards use a plain surface, no layered background. */
.art-card.loading.generating-card,
.dark .art-card.loading.generating-card {
  background: var(--paper-soft);
}

.art-card.loading.generating-card::after,
.dark .art-card.loading.generating-card::after {
  display: none;
}

.generating-time {
  color: #26332e;
  text-shadow: none;
}

.generating-label {
  color: #526057;
}

.dark .generating-time {
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.34);
}

.dark .generating-label {
  color: rgba(255, 255, 255, 0.88);
}

/* Prompt library polish: dedicated actions and editor modal use the same refined system. */
.prompt-library-tools .prompt-create-button.primary,
.gallery-tools .prompt-create-button.primary,
button.prompt-create-button.primary {
  min-width: 86px;
  border-color: rgba(17, 90, 56, 0.38);
  background: linear-gradient(180deg, #1f7a4d 0%, #155d3b 100%);
  color: #fff;
  box-shadow: 0 12px 22px rgba(31, 122, 77, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.prompt-library-tools .prompt-create-button.primary:hover:not(:disabled),
.gallery-tools .prompt-create-button.primary:hover:not(:disabled),
button.prompt-create-button.primary:hover:not(:disabled) {
  border-color: rgba(17, 90, 56, 0.42);
  background: linear-gradient(180deg, #258b58 0%, #176642 100%);
  color: #fff;
  transform: translateY(-1px);
}

.prompt-editor-panel {
  border-color: rgba(226, 217, 202, 0.88);
  background: rgba(255, 253, 248, 0.98);
  box-shadow: 0 34px 90px rgba(54, 45, 31, 0.18);
}

.prompt-editor-panel .modal-head {
  min-height: 54px;
  border-bottom: 1px solid rgba(226, 217, 202, 0.78);
  background: rgba(250, 246, 238, 0.82);
}

.prompt-editor-body {
  border-top: 0;
  background: rgba(255, 252, 246, 0.78);
}

.prompt-editor-body .field {
  gap: 7px;
}

.prompt-editor-body .input-control,
.prompt-editor-body .gallery-select-trigger,
.prompt-editor-body .prompt-editor-textarea,
.prompt-editor-body .editable-multi-select-input {
  border-color: rgba(226, 217, 202, 0.94);
  background: rgba(255, 253, 248, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.prompt-editor-body .input-control:focus,
.prompt-editor-body .prompt-editor-textarea:focus,
.prompt-editor-body .editable-multi-select-input:focus-within {
  border-color: rgba(47, 138, 100, 0.48);
  box-shadow: var(--focus-ring);
}

.prompt-editor-textarea {
  min-height: 112px;
}

.prompt-editor-actions {
  padding-top: 8px;
}

.prompt-editor-actions button {
  min-width: 76px;
}

.prompt-editor-actions .prompt-editor-save.primary,
button.prompt-editor-save.primary {
  border-color: rgba(17, 90, 56, 0.38);
  background: linear-gradient(180deg, #1f7a4d 0%, #155d3b 100%);
  color: #fff;
  box-shadow: 0 12px 22px rgba(31, 122, 77, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.prompt-editor-actions .prompt-editor-save.primary:hover:not(:disabled),
button.prompt-editor-save.primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #258b58 0%, #176642 100%);
  color: #fff;
}

.dark .prompt-library-tools .prompt-create-button.primary,
.dark .gallery-tools .prompt-create-button.primary,
.dark button.prompt-create-button.primary,
.dark .prompt-library-tools .prompt-create-button.primary:hover:not(:disabled),
.dark .gallery-tools .prompt-create-button.primary:hover:not(:disabled),
.dark button.prompt-create-button.primary:hover:not(:disabled),
.dark .prompt-editor-actions .prompt-editor-save.primary,
.dark button.prompt-editor-save.primary,
.dark .prompt-editor-actions .prompt-editor-save.primary:hover:not(:disabled),
.dark button.prompt-editor-save.primary:hover:not(:disabled) {
  border-color: rgba(87, 196, 145, 0.28);
  background: linear-gradient(180deg, #27875a 0%, #176642 100%);
  color: #fff;
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.dark .prompt-editor-panel {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(18, 26, 23, 0.98);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.46);
}

.dark .prompt-editor-panel .modal-head {
  border-bottom-color: rgba(255, 255, 255, 0.07);
  background: rgba(15, 22, 19, 0.9);
}

.dark .prompt-editor-body {
  background: rgba(15, 22, 19, 0.78);
}

.dark .prompt-editor-body .input-control,
.dark .prompt-editor-body .gallery-select-trigger,
.dark .prompt-editor-body .prompt-editor-textarea,
.dark .prompt-editor-body .editable-multi-select-input {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(23, 33, 29, 0.88);
  color: #edf6f1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

/* Prompt editor dark-mode final override: older modal rules used light surfaces. */
.dark .modal-panel.prompt-editor-panel {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(18, 26, 23, 0.98);
  color: #edf6f1;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.46);
}

.dark .modal-panel.prompt-editor-panel .modal-head {
  border-bottom-color: rgba(255, 255, 255, 0.07);
  background: rgba(15, 22, 19, 0.94);
  color: #edf6f1;
}

.dark .modal-panel.prompt-editor-panel .modal-head .mini-controls button,
.dark .modal-panel.prompt-editor-panel .prompt-editor-actions button {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(23, 33, 29, 0.88);
  color: #edf6f1;
}

.dark .modal-panel.prompt-editor-panel .prompt-editor-body {
  background: rgba(15, 22, 19, 0.82);
  color: #edf6f1;
}

.dark .modal-panel.prompt-editor-panel .field,
.dark .modal-panel.prompt-editor-panel .field > span:first-child,
.dark .modal-panel.prompt-editor-panel .field-label-with-help > span:first-child {
  color: #c2d0c9;
}

.dark .modal-panel.prompt-editor-panel .input-control,
.dark .modal-panel.prompt-editor-panel .gallery-select-trigger,
.dark .modal-panel.prompt-editor-panel .prompt-editor-textarea,
.dark .modal-panel.prompt-editor-panel .editable-select .input-control,
.dark .modal-panel.prompt-editor-panel .editable-multi-select-input,
.dark .modal-panel.prompt-editor-panel .editable-multi-select-text {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(23, 33, 29, 0.88);
  color: #edf6f1;
}

.dark .modal-panel.prompt-editor-panel .input-control::placeholder,
.dark .modal-panel.prompt-editor-panel .prompt-editor-textarea::placeholder,
.dark .modal-panel.prompt-editor-panel .editable-multi-select-text::placeholder {
  color: rgba(152, 169, 161, 0.78);
}

.dark .modal-panel.prompt-editor-panel .gallery-select-menu,
.dark .modal-panel.prompt-editor-panel .editable-select-menu,
.dark .modal-panel.prompt-editor-panel .editable-multi-select-menu {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(18, 26, 23, 0.98);
  color: #edf6f1;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.34);
}

.dark .modal-panel.prompt-editor-panel .gallery-select-menu button,
.dark .modal-panel.prompt-editor-panel .editable-select-option,
.dark .modal-panel.prompt-editor-panel .editable-multi-select-option {
  color: #edf6f1;
}

.dark .modal-panel.prompt-editor-panel .gallery-select-menu button:hover,
.dark .modal-panel.prompt-editor-panel .gallery-select-menu button.selected,
.dark .modal-panel.prompt-editor-panel .editable-select-option:hover,
.dark .modal-panel.prompt-editor-panel .editable-select-option.selected,
.dark .modal-panel.prompt-editor-panel .editable-multi-select-option:hover,
.dark .modal-panel.prompt-editor-panel .editable-multi-select-option.selected {
  background: rgba(27, 53, 43, 0.88);
  color: #8ce0bd;
}

body.wlensai-dark .modal-panel.prompt-editor-panel {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(18, 26, 23, 0.98);
  color: #edf6f1;
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.46);
}

body.wlensai-dark .modal-panel.prompt-editor-panel .modal-head {
  border-bottom-color: rgba(255, 255, 255, 0.07);
  background: rgba(15, 22, 19, 0.94);
  color: #edf6f1;
}

body.wlensai-dark .modal-panel.prompt-editor-panel .modal-head .mini-controls button,
body.wlensai-dark .modal-panel.prompt-editor-panel .prompt-editor-actions button {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(23, 33, 29, 0.88);
  color: #edf6f1;
}

body.wlensai-dark .modal-panel.prompt-editor-panel .prompt-editor-body {
  background: rgba(15, 22, 19, 0.82);
  color: #edf6f1;
}

body.wlensai-dark .modal-panel.prompt-editor-panel .field,
body.wlensai-dark .modal-panel.prompt-editor-panel .field > span:first-child,
body.wlensai-dark .modal-panel.prompt-editor-panel .field-label-with-help > span:first-child {
  color: #c2d0c9;
}

body.wlensai-dark .modal-panel.prompt-editor-panel .input-control,
body.wlensai-dark .modal-panel.prompt-editor-panel .gallery-select-trigger,
body.wlensai-dark .modal-panel.prompt-editor-panel .prompt-editor-textarea,
body.wlensai-dark .modal-panel.prompt-editor-panel .editable-select .input-control,
body.wlensai-dark .modal-panel.prompt-editor-panel .editable-multi-select-input,
body.wlensai-dark .modal-panel.prompt-editor-panel .editable-multi-select-text {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(23, 33, 29, 0.88);
  color: #edf6f1;
}

body.wlensai-dark .modal-panel.prompt-editor-panel .input-control::placeholder,
body.wlensai-dark .modal-panel.prompt-editor-panel .prompt-editor-textarea::placeholder,
body.wlensai-dark .modal-panel.prompt-editor-panel .editable-multi-select-text::placeholder {
  color: rgba(152, 169, 161, 0.78);
}

body.wlensai-dark .modal-panel.prompt-editor-panel .gallery-select-menu,
body.wlensai-dark .modal-panel.prompt-editor-panel .editable-select-menu,
body.wlensai-dark .modal-panel.prompt-editor-panel .editable-multi-select-menu {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(18, 26, 23, 0.98);
  color: #edf6f1;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.34);
}

body.wlensai-dark .modal-panel.prompt-editor-panel .gallery-select-menu button,
body.wlensai-dark .modal-panel.prompt-editor-panel .editable-select-option,
body.wlensai-dark .modal-panel.prompt-editor-panel .editable-multi-select-option {
  color: #edf6f1;
}

body.wlensai-dark .modal-panel.prompt-editor-panel .gallery-select-menu button:hover,
body.wlensai-dark .modal-panel.prompt-editor-panel .gallery-select-menu button.selected,
body.wlensai-dark .modal-panel.prompt-editor-panel .editable-select-option:hover,
body.wlensai-dark .modal-panel.prompt-editor-panel .editable-select-option.selected,
body.wlensai-dark .modal-panel.prompt-editor-panel .editable-multi-select-option:hover,
body.wlensai-dark .modal-panel.prompt-editor-panel .editable-multi-select-option.selected {
  background: rgba(27, 53, 43, 0.88);
  color: #8ce0bd;
}

body.wlensai-dark .modal-panel.prompt-editor-panel .prompt-editor-save.primary,
body.wlensai-dark .modal-panel.prompt-editor-panel .prompt-editor-save.primary:hover:not(:disabled) {
  border-color: rgba(87, 196, 145, 0.28);
  background: linear-gradient(180deg, #27875a 0%, #176642 100%);
  color: #fff;
}
