:root {
  color-scheme: dark;
  --font-sans: "Segoe UI Variable Text", "HarmonyOS Sans SC", "MiSans", "PingFang SC",
    "Microsoft YaHei UI", "Noto Sans SC", Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Segoe UI Variable Display", "SF Pro Display", "HarmonyOS Sans SC",
    "MiSans", "PingFang SC", Inter, ui-sans-serif, system-ui, sans-serif;
  font-family: var(--font-sans);
  --page: #07101a;
  --surface: rgba(7, 15, 27, 0.68);
  --surface-strong: rgba(7, 15, 27, 0.84);
  --surface-soft: rgba(255, 255, 255, 0.055);
  --line: rgba(225, 239, 255, 0.18);
  --line-strong: rgba(191, 255, 239, 0.34);
  --text: #f7fbff;
  --muted: #b9c6d4;
  --muted-2: #8795a7;
  --mint: #88efd9;
  --mint-strong: #5ddfc4;
  --blue: #a9c3ff;
  --warm: #f2d494;
  --danger: #fca5a5;
  --ok: #a7f3c4;
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow: 0 26px 78px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  --ease-out: cubic-bezier(0.22, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  position: relative;
  color: var(--text);
  background: var(--page);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::after,
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::after {
  z-index: 0;
  background-image: url("/website-bg-optimized-1920.webp?v=quiet-luminous-20260609-3");
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  transform: translate3d(0, 0, 0) scale(1.01);
  transform-origin: 58% 40%;
  will-change: transform;
  animation: ambient-background 42s var(--ease-out) infinite alternate;
}

body::before {
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(4, 10, 19, 0.82) 0%, rgba(4, 10, 19, 0.54) 34%, rgba(4, 10, 19, 0.08) 66%, rgba(4, 10, 19, 0.12) 100%),
    linear-gradient(180deg, rgba(4, 10, 19, 0.12) 0%, rgba(4, 10, 19, 0.03) 42%, rgba(4, 10, 19, 0.72) 100%),
    radial-gradient(circle at 18% 12%, rgba(136, 239, 217, 0.08), transparent 30rem);
}

.particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.ambient-particle-canvas {
  opacity: 0.54;
}

.app {
  position: relative;
  z-index: 3;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 52px 0 56px;
}

.hero {
  min-height: clamp(292px, 37vh, 396px);
  display: flex;
  align-items: flex-end;
  padding: 22px 0 24px;
}

.hero-copy {
  width: min(560px, 50vw);
  min-width: 0;
  animation: surface-in 0.62s var(--ease-out) both;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 560px;
  margin: 0;
  padding: 0.04em 0 0.12em;
  font-family: var(--font-display);
  font-size: clamp(33px, 3.8vw, 50px);
  font-weight: 790;
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: transparent;
  background: linear-gradient(112deg, #ffffff 0 58%, #a9f5e6 94%);
  -webkit-background-clip: text;
  background-clip: text;
  white-space: nowrap;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.24));
}

h2,
h3 {
  margin: 0 0 12px;
  font-weight: 820;
  letter-spacing: -0.02em;
}

.desc {
  margin: 12px 0 0;
  color: rgba(239, 247, 250, 0.9);
  font-size: clamp(14px, 1.12vw, 16px);
  font-weight: 620;
  line-height: 1.6;
  letter-spacing: 0.035em;
  text-shadow: 0 6px 24px rgba(0, 0, 0, 0.48);
}

.hero-capabilities {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 12px 0 0;
  color: rgba(238, 249, 249, 0.78);
  font-size: 13px;
  font-weight: 720;
  letter-spacing: 0.04em;
}

.hero-capabilities span {
  display: inline-flex;
  align-items: center;
}

.hero-capabilities span + span::before {
  content: "";
  width: 3px;
  height: 3px;
  margin: 0 11px;
  border-radius: 50%;
  background: rgba(136, 239, 217, 0.72);
  box-shadow: 0 0 10px rgba(136, 239, 217, 0.5);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.custom-gen-entry {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 8px 18px 8px 8px;
  border: 1px solid rgba(220, 255, 247, 0.26);
  border-radius: 999px;
  color: #f7fffd;
  background: linear-gradient(135deg, rgba(154, 190, 255, 0.25), rgba(94, 223, 196, 0.18));
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.18);
  text-decoration: none;
  font-size: 15px;
  font-weight: 740;
  letter-spacing: 0.01em;
  text-align: left;
  overflow: hidden;
  transition:
    transform 0.2s var(--ease-out),
    border-color 0.2s var(--ease-out),
    background 0.2s var(--ease-out),
    box-shadow 0.2s var(--ease-out);
}

.entry-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.entry-copy strong {
  color: #f7fffd;
  font-size: 15px;
  line-height: 1.2;
}

.entry-copy small {
  color: rgba(231, 244, 246, 0.72);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
}

.entry-icon {
  width: 33px;
  height: 33px;
  border-radius: 10px;
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.22);
}

.entry-symbol {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  color: #06131d;
  background: linear-gradient(145deg, #88efd9, #a9c3ff 72%);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.22), 0 0 20px rgba(136, 239, 217, 0.14);
  font-size: 25px;
  font-weight: 900;
  line-height: 1;
}

.infinite-canvas-entry {
  border-color: rgba(169, 195, 255, 0.34);
  background:
    linear-gradient(135deg, rgba(136, 239, 217, 0.2), rgba(169, 195, 255, 0.2)),
    rgba(255, 255, 255, 0.04);
}

.infinite-canvas-entry:hover {
  border-color: rgba(169, 195, 255, 0.56);
  background:
    linear-gradient(135deg, rgba(136, 239, 217, 0.27), rgba(169, 195, 255, 0.29)),
    rgba(255, 255, 255, 0.055);
}

.custom-gen-entry:hover {
  transform: translateY(-1px);
  border-color: rgba(136, 239, 217, 0.5);
  background: linear-gradient(135deg, rgba(169, 195, 255, 0.34), rgba(94, 223, 196, 0.25));
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.24);
}

.custom-gen-entry:hover .entry-icon,
.custom-gen-entry:hover .entry-symbol {
  transform: scale(1.06) rotate(-2deg);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24), 0 0 24px rgba(136, 239, 217, 0.2);
}

.entry-icon,
.entry-symbol {
  transition: transform 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out);
}

.custom-gen-entry:active {
  transform: scale(0.985);
}

.canvas-module {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr);
  background: #101114;
}

.canvas-module-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px 10px 18px;
  border-bottom: 1px solid rgba(225, 239, 255, 0.13);
  background: rgba(13, 17, 24, 0.96);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
}

.canvas-module-bar div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.canvas-module-bar span {
  color: #88efd9;
  font-size: 11px;
  font-weight: 840;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.canvas-module-bar strong {
  color: #f7fbff;
  font-size: 17px;
  font-weight: 880;
}

.canvas-module-bar button {
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid rgba(225, 239, 255, 0.16);
  color: #e8f0f6;
  background: rgba(255, 255, 255, 0.065);
  box-shadow: none;
}

.canvas-module-frame {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  background: #101114;
}

.canvas-module-open {
  overflow: hidden;
}

.panel,
.status,
.image-card,
pre {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.018)),
    var(--surface);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
  backdrop-filter: blur(14px) saturate(1.05);
}

.panel {
  padding: 24px;
  margin-bottom: 18px;
}

.app > .panel:not(.hidden),
.app > .status,
.results > .image-card {
  animation: surface-in 0.54s var(--ease-out) both;
}

#authPanel.panel:empty,
#userPanel.panel:empty,
#adminPanel.panel:empty,
#results:empty {
  display: none;
}

.hidden {
  display: none !important;
}

label {
  display: grid;
  gap: 9px;
  color: #e9f0f6;
  font-size: 14px;
  font-weight: 720;
}

textarea,
select,
input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(221, 235, 248, 0.19);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  outline: none;
  color: #f8fbff;
  background: rgba(4, 10, 20, 0.68);
  font: inherit;
  transition:
    border-color 0.18s var(--ease-out),
    box-shadow 0.18s var(--ease-out),
    background 0.18s var(--ease-out);
}

textarea:focus,
select:focus,
input:focus {
  border-color: rgba(136, 239, 217, 0.76);
  background: rgba(4, 10, 20, 0.8);
  box-shadow: 0 0 0 3px rgba(136, 239, 217, 0.13);
}

textarea::placeholder,
input::placeholder {
  color: #778598;
}

select,
select option {
  color-scheme: dark;
  color: #f8fafc;
  background-color: #111a27;
}

button,
.actions a {
  min-height: 43px;
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  cursor: pointer;
  color: #07131d;
  background: linear-gradient(135deg, var(--blue), var(--mint));
  box-shadow: 0 12px 28px rgba(93, 223, 196, 0.13);
  text-decoration: none;
  font: inherit;
  font-weight: 840;
  line-height: 1.2;
  transition:
    transform 0.18s var(--ease-out),
    filter 0.18s var(--ease-out),
    box-shadow 0.18s var(--ease-out),
    border-color 0.18s var(--ease-out),
    background 0.18s var(--ease-out);
}

button:hover,
.actions a:hover {
  transform: translateY(-1px);
  filter: saturate(1.06);
  box-shadow: 0 15px 34px rgba(93, 223, 196, 0.18);
}

button:active,
.actions a:active {
  transform: scale(0.985);
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

a:focus-visible,
button:focus-visible,
textarea:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(136, 239, 217, 0.74);
  outline-offset: 3px;
}

.primary {
  background: linear-gradient(135deg, var(--blue), var(--mint));
}

.secondary,
.prompt-assistant button,
.mode-tab:not(.active) {
  color: #e8f0f6;
  border: 1px solid rgba(225, 239, 255, 0.16);
  background: rgba(255, 255, 255, 0.065);
  box-shadow: none;
}

.secondary:hover,
.prompt-assistant button:hover,
.mode-tab:not(.active):hover {
  border-color: rgba(136, 239, 217, 0.3);
  background: rgba(136, 239, 217, 0.1);
  box-shadow: none;
}

.wide {
  width: 100%;
  justify-content: center;
}

.button-row,
.actions,
.userbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.grid,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}

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

.status {
  margin: 18px 0;
  padding: 13px 17px;
  color: #c7d3de;
  white-space: pre-wrap;
}

#status:empty {
  display: none;
}

.status.ok {
  color: var(--ok);
}

.status.error {
  color: var(--danger);
}

.quote {
  display: inline-flex;
  margin: 4px 0 12px;
  padding: 8px 12px;
  border: 1px solid rgba(242, 212, 148, 0.2);
  border-radius: 999px;
  color: #ffe7ac;
  background: rgba(242, 212, 148, 0.08);
  font-weight: 820;
}

.payment-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(242, 212, 148, 0.18);
  border-radius: var(--radius-md);
  color: #ffe5a4;
  background: rgba(242, 212, 148, 0.075);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.55;
}

.auth-shell {
  width: min(504px, 100%);
  display: block;
  margin-right: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.badge,
.history-date,
.admin-title,
.history-cache-title {
  width: max-content;
  max-width: 100%;
  border: 1px solid rgba(136, 239, 217, 0.25);
  border-radius: 999px;
  padding: 7px 11px;
  color: #c9fff3;
  background: rgba(136, 239, 217, 0.09);
  font-size: 12px;
  font-weight: 840;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-card {
  min-height: 286px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 25px 26px 24px;
  border: 1px solid rgba(225, 239, 255, 0.15);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(18, 29, 45, 0.66), rgba(4, 10, 20, 0.5)),
    rgba(4, 10, 20, 0.46);
  box-shadow:
    0 22px 62px rgba(0, 0, 0, 0.29),
    inset 0 1px 0 rgba(255, 255, 255, 0.065);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
  backdrop-filter: blur(14px) saturate(1.08);
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-card label {
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}

.auth-card input {
  min-height: 44px;
  padding: 11px 13px;
}

.auth-card .primary {
  font-weight: 800;
}

.auth-switch {
  margin: 15px 0 0;
  color: #cbd6df;
  font-size: 12.5px;
  font-weight: 650;
  text-align: center;
}

.auth-switch button {
  min-height: 0;
  margin-left: 4px;
  padding: 0;
  border-radius: 0;
  color: #a7f6e6;
  background: transparent;
  box-shadow: none;
}

.auth-switch button:hover {
  transform: none;
  box-shadow: none;
  text-decoration: underline;
}

@media (min-width: 1280px) {
  .hero-copy,
  #authPanel.auth-shell {
    margin-left: clamp(-64px, calc((1280px - 100vw) * 0.12), -24px);
  }
}

.userbar {
  justify-content: space-between;
}

.is-authenticated .hero {
  min-height: 0;
  height: 0;
  padding: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.is-authenticated .app {
  padding-top: 28px;
}

.is-authenticated #userPanel {
  padding: 0;
  overflow: hidden;
}

.session-head {
  display: grid;
  grid-template-columns: minmax(190px, 0.72fr) minmax(0, 1.28fr);
  gap: 18px;
  align-items: center;
  padding: 22px 24px;
  border-bottom: 1px solid rgba(225, 239, 255, 0.11);
  background: linear-gradient(130deg, rgba(169, 195, 255, 0.1), rgba(136, 239, 217, 0.035));
}

.session-copy {
  display: grid;
  gap: 7px;
}

.session-copy > strong {
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.03em;
}

.session-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.session-copy b {
  color: var(--mint);
}

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

.workspace-launcher {
  min-width: 0;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border: 1px solid rgba(225, 239, 255, 0.14);
  border-radius: var(--radius-lg);
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  box-shadow: none;
  text-align: left;
  text-decoration: none;
}

.workspace-launcher:hover {
  border-color: rgba(136, 239, 217, 0.36);
  background: rgba(136, 239, 217, 0.085);
  box-shadow: none;
}

.workspace-launcher img,
.workspace-launcher .entry-symbol {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 11px;
}

.workspace-launcher > span:last-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.workspace-launcher strong,
.workspace-launcher small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-launcher strong {
  color: var(--text);
  font-size: 14px;
}

.workspace-launcher small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.account-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.85fr);
  gap: 16px;
  align-items: center;
  padding: 18px 24px 22px;
}

.account-tools .payment-note {
  margin: 0;
}

.account-tools .redeem-box {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.account-tools #redeemCode {
  width: 100%;
  justify-self: stretch;
}

.redeem-box {
  min-width: min(100%, 430px);
  display: grid;
  gap: 10px;
}

#redeemCode {
  width: 66.666%;
  justify-self: center;
}

.redeem-actions {
  justify-content: center;
}

.workspace-panel {
  padding: 0;
  overflow: hidden;
}

.workspace-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border-bottom: 1px solid rgba(225, 239, 255, 0.11);
  background: linear-gradient(130deg, rgba(169, 195, 255, 0.1), rgba(136, 239, 217, 0.035));
}

.workspace-head h2 {
  margin: 12px 0 0;
  font-size: clamp(27px, 3vw, 38px);
}

.mode-switch {
  display: flex;
  gap: 7px;
  padding: 5px;
  border: 1px solid rgba(225, 239, 255, 0.13);
  border-radius: var(--radius-lg);
  background: rgba(4, 10, 20, 0.38);
  white-space: nowrap;
}

.mode-tab {
  min-height: 39px;
  padding: 9px 14px;
  border-radius: var(--radius-md);
}

.mode-tab.active {
  color: #07131d;
  background: linear-gradient(135deg, var(--blue), var(--mint));
}

.mode-tab.disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.studio-form {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.prompt-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 14px;
  align-items: stretch;
}

.prompt-field {
  width: 100%;
}

#prompt {
  width: 100%;
  min-height: 142px;
  resize: vertical;
  overflow-y: hidden;
}

.negative-field textarea {
  min-height: 76px;
  resize: vertical;
  overflow-y: hidden;
}

.prompt-assistant {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px;
  border: 1px solid rgba(225, 239, 255, 0.12);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.038);
}

.prompt-assistant strong {
  color: #d9fff7;
  font-size: 14px;
}

.prompt-assistant button {
  min-height: 40px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  text-align: left;
}

.reference-field {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px dashed rgba(136, 239, 217, 0.3);
  border-radius: var(--radius-lg);
  color: #e8f7f4;
  background: rgba(136, 239, 217, 0.055);
}

.reference-field input {
  padding: 12px;
}

.reference-field span,
.studio-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.studio-grid {
  margin: 0;
}

.studio-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(225, 239, 255, 0.1);
}

.studio-hint {
  margin: 0;
}

.studio-actions {
  justify-content: flex-end;
}

.studio-actions button {
  min-width: 150px;
}

.results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  content-visibility: auto;
  contain-intrinsic-size: 600px;
}

.image-card {
  overflow: hidden;
}

.image-card img {
  width: 100%;
  display: block;
  background: rgba(255, 255, 255, 0.04);
}

.image-card .meta {
  padding: 11px 14px;
  color: #d9e5ed;
  font-size: 13px;
}

.image-card .actions {
  padding: 0 14px 14px;
}

.history-panel {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
}

.history-image-folds,
.history-date-folds,
.history-generation-list,
.history-list,
.admin-section-body {
  display: grid;
  gap: 10px;
}

.history-cache-card,
.history-date-card,
.history-image-card,
.history-box,
.admin-folds,
.history-day,
.admin-section {
  overflow: hidden;
  border: 1px solid rgba(225, 239, 255, 0.11);
  border-radius: var(--radius-lg);
  background: rgba(3, 9, 18, 0.2);
}

.history-box,
.admin-folds {
  padding: 12px;
}

.history-date-card,
.history-image-card,
.history-day,
.admin-section {
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
}

.history-cache-summary,
.history-date-summary,
.history-image-summary,
.history-summary,
.admin-summary {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 12px 13px;
  cursor: pointer;
  color: #dbe7ef;
  font-weight: 790;
  list-style: none;
  user-select: none;
}

.history-cache-summary::-webkit-details-marker,
.history-date-summary::-webkit-details-marker,
.history-image-summary::-webkit-details-marker,
.history-summary::-webkit-details-marker,
.admin-summary::-webkit-details-marker {
  display: none;
}

.history-cache-summary::before,
.history-date-summary::before,
.history-image-summary::before,
.history-summary::before,
.admin-summary::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 2px;
  border-right: 2px solid #d9fff7;
  border-bottom: 2px solid #d9fff7;
  opacity: 0.82;
  transform: rotate(-45deg);
  transition: transform 0.18s var(--ease-out);
}

details[open] > summary::before {
  transform: rotate(45deg);
}

.history-cache-summary:hover,
.history-date-summary:hover,
.history-image-summary:hover,
.history-summary:hover,
.admin-summary:hover {
  background: rgba(255, 255, 255, 0.035);
}

.history-cache-summary > span:not(.history-cache-title),
.history-date-summary > span:not(.history-date),
.history-image-summary > span:not(.history-date),
.history-summary > span:not(.history-date),
.admin-summary > span:not(.admin-title),
.history-meta span,
.history-meta b {
  padding: 5px 8px;
  border-radius: 999px;
  color: #d5e1ea;
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.history-date-folds,
.history-generation-list,
.history-list,
.admin-section-body {
  padding: 0 12px 12px;
}

.history-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  padding: 0 12px 12px;
}

.history-empty {
  padding: 10px;
  color: var(--muted);
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid rgba(225, 239, 255, 0.09);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.history-item > div:first-child,
.history-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.history-item em {
  color: var(--muted-2);
  font-size: 13px;
  font-style: normal;
}

.history-meta {
  justify-content: flex-end;
}

.history-meta b.ok {
  color: var(--ok);
  background: rgba(167, 243, 196, 0.09);
}

.history-meta b.error {
  color: #fecdd3;
  background: rgba(252, 165, 165, 0.09);
}

.code-form {
  display: grid;
  gap: 14px;
}

.code-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

pre {
  max-height: 280px;
  overflow: auto;
  padding: 16px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  color: #dce7ef;
}

th,
td {
  padding: 9px;
  border-bottom: 1px solid rgba(225, 239, 255, 0.1);
  text-align: left;
  vertical-align: top;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: rgba(2, 7, 14, 0.96);
}

.image-viewer-bar {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid rgba(225, 239, 255, 0.13);
  background: rgba(8, 16, 28, 0.94);
}

.image-viewer-bar strong {
  flex: 1;
  overflow: hidden;
  color: #eef6fa;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-viewer-bar a {
  border-radius: 999px;
  padding: 10px 13px;
  color: #07131d;
  background: linear-gradient(135deg, var(--blue), var(--mint));
  font-size: 14px;
  font-weight: 840;
  text-decoration: none;
}

.image-viewer-back {
  padding: 10px 13px;
}

.image-viewer-body {
  flex: 1;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 12px;
}

.image-viewer-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

.viewer-open {
  overflow: hidden;
}

@keyframes ambient-background {
  from {
    transform: translate3d(-0.16%, -0.1%, 0) scale(1.01);
  }
  to {
    transform: translate3d(0.16%, 0.12%, 0) scale(1.017);
  }
}

@keyframes surface-in {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@media (max-width: 900px) {
  body::after {
    background-image: url("/website-bg-optimized-1280.webp?v=quiet-luminous-20260609");
    background-position: 43% top;
    animation-duration: 40s;
  }

  body::before {
    background:
      linear-gradient(90deg, rgba(4, 10, 19, 0.88) 0%, rgba(4, 10, 19, 0.58) 48%, rgba(4, 10, 19, 0.1) 82%),
      linear-gradient(180deg, rgba(4, 10, 19, 0.12) 0%, rgba(4, 10, 19, 0.1) 38%, rgba(4, 10, 19, 0.76) 84%, rgba(4, 10, 19, 0.9) 100%);
  }

  .ambient-particle-canvas {
    opacity: 0.42;
  }

  .app {
    width: min(100% - 24px, 720px);
    padding: 28px 0 38px;
  }

  .hero {
    min-height: 244px;
    align-items: flex-start;
    padding: 18px 0 12px;
  }

  .hero-copy {
    width: min(100%, 500px);
  }

  h1 {
    max-width: 500px;
    font-size: clamp(32px, 8vw, 42px);
    line-height: 1.08;
  }

  .desc {
    font-size: 15px;
    letter-spacing: 0.065em;
  }

  .hero-actions {
    margin-top: 18px;
  }

  .panel,
  .status,
  .image-card,
  pre {
    border-radius: 18px;
    background: var(--surface-strong);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .auth-card {
    min-height: 0;
    padding: 22px 24px 24px;
    border-radius: 20px;
    background: rgba(4, 10, 20, 0.84);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .workspace-head,
  .studio-footer,
  .session-head,
  .account-tools {
    display: grid;
  }

  .session-head,
  .account-tools {
    grid-template-columns: 1fr;
  }

  .mode-switch {
    width: 100%;
    overflow-x: auto;
  }

  .prompt-layout {
    grid-template-columns: 1fr;
  }

  .prompt-assistant {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .prompt-assistant strong {
    grid-column: 1 / -1;
  }

  .button-row button,
  .actions a,
  .studio-actions button {
    width: 100%;
    text-align: center;
  }

  .redeem-actions button {
    width: auto;
    min-width: 120px;
  }

  .userbar,
  .history-item {
    align-items: flex-start;
  }

  .code-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  body::after {
    background-position: 72% top;
    background-size: auto 320px;
    animation: none;
    transform: none;
  }

  body::before {
    background:
      linear-gradient(90deg, rgba(4, 10, 19, 0.78) 0%, rgba(4, 10, 19, 0.36) 56%, rgba(4, 10, 19, 0.08) 100%),
      linear-gradient(180deg, rgba(4, 10, 19, 0.04) 0%, rgba(4, 10, 19, 0.1) 220px, rgba(4, 10, 19, 0.92) 310px, #07101a 380px, #07101a 100%);
  }

  .app {
    width: calc(100% - 20px);
    padding-top: 18px;
  }

  .hero {
    min-height: 300px;
    padding-top: 14px;
  }

  .hero-copy {
    width: 100%;
  }

  h1 {
    font-size: clamp(22px, 7vw, 28px);
    letter-spacing: -0.015em;
  }

  .desc {
    font-size: 13px;
    letter-spacing: 0.01em;
  }

  .hero-capabilities {
    font-size: 12px;
  }

  .hero-capabilities span + span::before {
    margin: 0 8px;
  }

  .custom-gen-entry {
    min-height: 48px;
    padding-right: 16px;
    font-size: 14px;
  }

  .entry-copy small {
    display: none;
  }

  .workspace-launchers {
    grid-template-columns: 1fr;
  }

  .workspace-launcher small {
    display: block;
  }

  .account-tools .redeem-box {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 18px;
  }

  .auth-shell,
  .workspace-panel {
    padding: 0;
  }

  .auth-card,
  .workspace-head,
  .studio-form {
    padding: 20px;
  }

  .prompt-assistant {
    grid-template-columns: 1fr;
  }

  .prompt-assistant strong {
    grid-column: auto;
  }

  #redeemCode {
    width: 100%;
  }

  .history-item {
    display: grid;
  }

  .history-meta {
    justify-content: flex-start;
  }
}

@media (pointer: coarse), (update: slow) {
  .panel,
  .status,
  .image-card,
  pre {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body::after,
  .app > .hero,
  .app > .panel:not(.hidden),
  .app > .status,
  .results > .image-card {
    animation: none;
  }

  .particle-canvas {
    display: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}
