:root {
  color-scheme: dark;
  --bg: #050c14;
  --bg-2: #0c1622;
  --panel: rgba(11, 19, 30, 0.9);
  --panel-strong: rgba(16, 26, 40, 0.96);
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.24);
  --text: #f6f9fc;
  --muted: #b8c4d4;
  --subtle: #93a3b8;
  --accent: #7ee5d1;
  --accent-2: #f6b26b;
  --danger: #ff8d8d;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.36);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font-ui: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: var(--font-ui);
  background:
    radial-gradient(circle at top left, rgba(126, 229, 209, 0.18), transparent 28%),
    radial-gradient(circle at 84% 10%, rgba(255, 214, 140, 0.18), transparent 26%),
    radial-gradient(circle at 64% 18%, rgba(255, 243, 211, 0.08), transparent 18%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.55), transparent 90%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: auto -18vw -24vh auto;
  width: 50vw;
  height: 50vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 150, 0.18), rgba(255, 176, 99, 0.08) 34%, transparent 72%);
  filter: blur(48px);
  pointer-events: none;
  z-index: 0;
}

.page-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1480px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 24px 0 36px;
}

.auth-gate {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 56px 0 24px;
}

.auth-card {
  display: grid;
  gap: 18px;
  padding: 28px;
}

.auth-form {
  gap: 16px;
}

.auth-form input {
  width: 100%;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 8px 4px 0;
}

.brand-block {
  display: grid;
  gap: 12px;
  max-width: 72ch;
}

.eyebrow,
.section-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.74rem;
}

.eyebrow {
  color: var(--accent-2);
}

h1,
h2,
p {
  margin: 0;
}

h1,
h2 {
  line-height: 0.96;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 5.4rem);
  letter-spacing: -0.065em;
  color: transparent;
  background: linear-gradient(180deg, #fffdf7 0%, #fff0c9 38%, #f6c76f 72%, #dca15d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 14px 26px rgba(255, 204, 120, 0.12));
}

h2 {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.lede {
  max-width: 68ch;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.5;
}

.quick-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.step-chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 228, 172, 0.22);
  background: linear-gradient(135deg, rgba(126, 229, 209, 0.08), rgba(246, 178, 107, 0.12));
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.status-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  align-items: center;
  gap: 10px;
  max-width: 44rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 700;
  white-space: nowrap;
}

.pill[data-state='complete'] {
  border-color: rgba(126, 229, 209, 0.34);
  background: linear-gradient(135deg, rgba(126, 229, 209, 0.18), rgba(246, 178, 107, 0.12));
}

.pill[data-state='current'] {
  border-color: rgba(246, 178, 107, 0.3);
  background: rgba(246, 178, 107, 0.12);
}

.pill[data-state='locked'] {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 0.96fr);
  gap: 18px;
  align-items: start;
}

.left-column,
.right-column {
  display: grid;
  gap: 18px;
  align-content: start;
}

.panel {
  position: relative;
  padding: 22px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 24%),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

body.ready .panel {
  animation: panel-rise 520ms ease both;
}

.panel:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.panel-head p {
  max-width: 68ch;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 8px;
}

.compact-head {
  align-items: center;
  margin: 14px 0 16px;
}

.compact-head p {
  margin: 0;
}

.head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: end;
}

.stack {
  display: grid;
  gap: 14px;
}

.simple-collapsible,
.advanced-block {
  display: grid;
  gap: 12px;
}

.simple-collapsible > summary,
.advanced-block > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  padding: 0;
  color: var(--text);
  font-weight: 700;
}

.simple-collapsible > summary::-webkit-details-marker,
.advanced-block > summary::-webkit-details-marker {
  display: none;
}

.simple-collapsible > summary::after,
.advanced-block > summary::after {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 1rem;
  flex: 0 0 auto;
}

.simple-collapsible[open] > summary::after,
.advanced-block[open] > summary::after {
  content: "−";
}

.simple-collapsible > summary span,
.advanced-block > summary span {
  display: grid;
  gap: 8px;
}

.advanced-block {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.prompt-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: -2px;
}

.example-chip {
  min-height: 40px;
}

.starter-tip {
  margin-top: -4px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 0.98rem;
}

.field-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.5;
}

.help-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  background:
    linear-gradient(135deg, rgba(126, 229, 209, 0.12), rgba(246, 178, 107, 0.08)),
    rgba(10, 16, 25, 0.94);
}

.help-strip h2 {
  margin: 4px 0 6px;
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  letter-spacing: -0.02em;
}

.help-strip p {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
  line-height: 1.55;
}

.help-strip-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.mode-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 0;
}

.mode-chip {
  min-height: 38px;
  padding: 8px 14px;
}

.mode-chip.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #071018;
  border-color: transparent;
}

.prompt-engine-note {
  margin-top: -2px;
}

.voice-assistant-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(126, 229, 209, 0.18);
  background:
    linear-gradient(135deg, rgba(126, 229, 209, 0.1), rgba(246, 178, 107, 0.07)),
    rgba(10, 16, 25, 0.92);
}

.voice-assistant-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.voice-assistant-head h3 {
  margin: 4px 0 6px;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.voice-assistant-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.voice-assistant-actions,
.voice-command-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.voice-assistant-actions {
  justify-content: flex-end;
}

.voice-command-chip {
  min-height: 40px;
}

.voice-transcript {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  line-height: 1.5;
}

.voice-command-status {
  color: var(--text);
}

.field-help-link {
  justify-self: start;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.field-help-link:hover {
  text-decoration: underline;
}

.offer-banner {
  border: 1px solid rgba(126, 229, 209, 0.22);
  background:
    linear-gradient(135deg, rgba(126, 229, 209, 0.08), rgba(246, 178, 107, 0.08)),
    rgba(9, 14, 22, 0.9);
  border-radius: 20px;
  padding: 18px 20px;
}

.offer-banner h3 {
  margin: 6px 0 4px;
  font-size: 1.1rem;
}

.offer-banner p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.setup-banner {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid rgba(246, 178, 107, 0.22);
  background:
    radial-gradient(circle at top right, rgba(255, 241, 205, 0.08), transparent 38%),
    linear-gradient(135deg, rgba(246, 178, 107, 0.12), rgba(126, 229, 209, 0.08)),
    rgba(9, 14, 22, 0.88);
}

.setup-banner h3 {
  margin: 6px 0 4px;
  font-size: 1.08rem;
}

.setup-banner p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

input,
textarea,
button,
.link-button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(6, 10, 17, 0.88);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(154, 167, 186, 0.75);
}

input:focus,
textarea:focus {
  border-color: rgba(126, 229, 209, 0.5);
  box-shadow: 0 0 0 3px rgba(126, 229, 209, 0.12);
}

textarea {
  resize: vertical;
  min-height: 88px;
  line-height: 1.45;
}

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

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

.inline-field {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inline-field input {
  flex: 1;
}

.tiny-button {
  flex: 0 0 auto;
  padding: 11px 12px;
  border-radius: 12px;
}

.preset-rail,
.command-rail,
.size-rail,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.preset-rail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.preset-card {
  width: 100%;
  display: grid;
  justify-items: start;
  gap: 6px;
  min-height: 88px;
  border-radius: 22px;
  border: 1px solid var(--line);
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.preset-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
}

.preset-card.active {
  border-color: rgba(126, 229, 209, 0.36);
  background: linear-gradient(135deg, rgba(126, 229, 209, 0.14), rgba(246, 178, 107, 0.12));
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.18);
}

.preset-card-title {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.preset-card-copy {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.45;
}

.chip,
button:not(.preset-card),
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #071018;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease, border-color 160ms ease, background 160ms ease;
}

button:not(.preset-card):hover,
.chip:hover,
.link-button:hover {
  transform: translateY(-1px);
}

button:not(.preset-card):active,
.chip:active,
.link-button:active {
  transform: translateY(0);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-color: var(--line);
}

.secondary:hover {
  border-color: var(--line-strong);
}

.danger {
  color: #ffdede;
  border-color: rgba(255, 141, 141, 0.2);
  background: rgba(255, 141, 141, 0.08);
}

.danger:hover {
  border-color: rgba(255, 141, 141, 0.34);
}

.chip.active {
  background: linear-gradient(135deg, rgba(126, 229, 209, 0.25), rgba(246, 178, 107, 0.2));
  color: var(--text);
  border-color: rgba(126, 229, 209, 0.35);
}

.status-copy {
  min-height: 1.2em;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.45;
}

.preview-panel {
  display: grid;
  gap: 16px;
}

.preview-frame {
  position: relative;
  min-height: 520px;
  aspect-ratio: 1 / 1;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    radial-gradient(circle at 50% 0%, rgba(126, 229, 209, 0.12), transparent 42%),
    radial-gradient(circle at 100% 100%, rgba(246, 178, 107, 0.12), transparent 38%),
    rgba(4, 7, 12, 0.9);
  overflow: hidden;
  display: grid;
  place-items: center;
  --artwork-scale: 0.88;
}

.preview-frame::before {
  content: "";
  position: absolute;
  inset: -16%;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 248, 222, 0.52), transparent 16%),
    radial-gradient(circle at 50% 45%, rgba(255, 228, 156, 0.2), transparent 28%),
    radial-gradient(circle at 50% 54%, rgba(126, 229, 209, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 24%),
    repeating-linear-gradient(115deg, rgba(255, 237, 177, 0.08) 0 2px, transparent 2px 44px);
  opacity: 0.82;
  filter: blur(7px);
  transform: scale(1.02);
  mix-blend-mode: screen;
  animation: divine-light 12s ease-in-out infinite;
  pointer-events: none;
}

.preview-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.shirt-canvas {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0.92;
  pointer-events: none;
}

.shirt-canvas::before {
  content: "";
  position: absolute;
  width: min(56%, 360px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 248, 222, 0.9) 0%, rgba(255, 225, 164, 0.5) 26%, rgba(255, 182, 96, 0.18) 48%, transparent 72%);
  filter: blur(18px);
  opacity: 0.75;
  transform: translateY(18px);
  animation: divine-pulse 8s ease-in-out infinite;
}

.shirt-print-zone {
  position: absolute;
  left: 50%;
  top: 52%;
  width: clamp(160px, calc(40% * var(--artwork-scale)), 260px);
  aspect-ratio: 12 / 16;
  max-width: 54%;
  max-height: 58%;
  transform: translate(calc(-50% + var(--artwork-offset-x, 0%)), calc(-50% + var(--artwork-offset-y, 0%)));
  pointer-events: auto;
  display: grid;
  place-items: center;
  cursor: grab;
  touch-action: none;
}

.shirt-print-art {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 220ms ease, transform 220ms ease;
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.24)) drop-shadow(0 0 32px rgba(255, 236, 176, 0.14));
  pointer-events: none;
  user-select: none;
}

.preview-frame.has-image .shirt-print-art {
  opacity: 1;
  transform: none;
}

.shirt-print-zone.dragging,
.preview-frame.is-dragging .shirt-print-zone {
  cursor: grabbing;
}

.preview-tools {
  display: grid;
  gap: 8px;
  padding: 14px 16px 0;
}

.preview-feedback {
  margin: 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(126, 229, 209, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  line-height: 1.5;
}

.edit-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.quick-edit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-edit-btn {
  min-height: 38px;
  padding: 8px 14px;
}

.edit-note {
  margin-top: -2px;
}

.preview-range-field {
  gap: 8px;
}

.preview-tool-actions {
  gap: 8px;
}

.placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 18px;
  padding: 42px;
  text-align: center;
  color: var(--muted);
  line-height: 1.55;
}

.shirt-preview-mark {
  width: min(52vw, 320px);
  max-width: 320px;
  height: auto;
  filter: drop-shadow(0 32px 42px rgba(0, 0, 0, 0.3)) drop-shadow(0 0 26px rgba(255, 255, 255, 0.18));
}

.shirt-preview-mark path {
  vector-effect: non-scaling-stroke;
}

.placeholder p {
  max-width: 28ch;
  margin: 0;
}

.preview-frame.has-image .placeholder {
  opacity: 0;
  pointer-events: none;
}

@keyframes divine-light {
  0%,
  100% {
    transform: scale(1.02) translate3d(0, 0, 0);
    opacity: 0.76;
  }
  50% {
    transform: scale(1.05) translate3d(0, -10px, 0);
    opacity: 0.96;
  }
}

@keyframes divine-pulse {
  0%,
  100% {
    transform: translateY(18px) scale(0.98);
    opacity: 0.68;
  }
  50% {
    transform: translateY(12px) scale(1.03);
    opacity: 0.86;
  }
}

.range-field {
  display: grid;
  gap: 10px;
}

.range-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.range-field input[type='range'] {
  width: 100%;
  accent-color: var(--accent);
}

.range-value {
  min-width: 52px;
  text-align: right;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
}

.field-note {
  margin: 0;
  color: var(--subtle);
  font-size: 0.92rem;
  line-height: 1.5;
}

.publish-note {
  margin-top: -2px;
}

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

.label-hint {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(126, 229, 209, 0.12);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body[data-ui-mode='simple'] .ui-advanced {
  display: none !important;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 14px;
  margin: 0;
}

.meta-grid dt {
  color: var(--subtle);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.meta-grid dd {
  margin: 0;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}

.muted-actions {
  opacity: 0.98;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-item {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.history-item:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
}

.history-item.active {
  border-color: rgba(126, 229, 209, 0.4);
  box-shadow: 0 0 0 1px rgba(126, 229, 209, 0.15) inset;
}

.history-thumb {
  width: 100px;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.34);
}

.history-body {
  display: grid;
  gap: 8px;
}

.history-title {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.history-snippet {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.93rem;
}

.history-meta {
  color: var(--subtle);
  font-size: 0.82rem;
  line-height: 1.45;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.history-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.history-actions .secondary,
.history-actions .danger {
  min-width: 110px;
}

.chat-log {
  display: grid;
  gap: 10px;
  max-height: 290px;
  overflow: auto;
  padding-right: 4px;
}

.chat-bubble {
  display: grid;
  gap: 6px;
  max-width: 100%;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.chat-bubble.user {
  justify-self: end;
  background: rgba(126, 229, 209, 0.08);
  border-color: rgba(126, 229, 209, 0.18);
}

.chat-bubble.assistant {
  justify-self: start;
  background: rgba(246, 178, 107, 0.08);
  border-color: rgba(246, 178, 107, 0.18);
}

.chat-role {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.68rem;
  color: var(--subtle);
}

.chat-text {
  white-space: pre-wrap;
  line-height: 1.5;
}

.chat-meta {
  color: var(--subtle);
  font-size: 0.76rem;
}

.assistant-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.assistant-compose input {
  min-width: 0;
}

.link-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.08) 46%, transparent 70%);
  transform: translateX(-100%);
  animation: sheen 1.1s linear infinite;
  pointer-events: none;
}

button.recording {
  border-color: rgba(255, 141, 141, 0.38);
  box-shadow: 0 0 0 3px rgba(255, 141, 141, 0.12);
}

button.recording::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 0 rgba(255, 141, 141, 0.55);
  animation: pulse 1.4s ease infinite;
}

.store-panel {
  display: grid;
  gap: 16px;
}

.store-list-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-top: 4px;
}

.store-list-head h3 {
  margin: 4px 0 0;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.store-list {
  display: grid;
  gap: 12px;
}

.store-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.store-item:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
}

.store-item.active {
  border-color: rgba(126, 229, 209, 0.4);
  box-shadow: 0 0 0 1px rgba(126, 229, 209, 0.15) inset;
}

.store-item-thumb {
  width: 92px;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.34);
}

.store-item-body {
  display: grid;
  gap: 8px;
}

.store-item-title {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.store-item-summary {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.93rem;
}

.store-item-meta {
  color: var(--subtle);
  font-size: 0.82rem;
  line-height: 1.45;
}

.store-item-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.store-item-actions .secondary,
.store-item-actions .danger,
.store-item-actions .link-button {
  min-width: 104px;
}

.store-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.switch-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.switch-row input {
  width: auto;
  margin: 0;
}

.store-page .app-shell {
  width: min(1240px, calc(100vw - 28px));
}

.store-shell {
  display: grid;
  gap: 18px;
}

.store-hero,
.store-product-hero,
.store-empty {
  display: grid;
  gap: 16px;
}

.store-kicker {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(126, 229, 209, 0.22);
  background: rgba(126, 229, 209, 0.08);
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.store-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.store-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.store-stat {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.store-stat span {
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
}

.store-stat strong {
  font-size: 1rem;
  line-height: 1.4;
}

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

.store-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow);
}

.store-card-image-link {
  display: block;
  border-radius: 18px;
  overflow: hidden;
}

.store-card-image {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.store-card-body {
  display: grid;
  gap: 10px;
}

.store-card-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.store-card-title {
  font-size: 1.15rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.store-card-title a {
  color: inherit;
  text-decoration: none;
}

.store-card-copy {
  color: var(--muted);
  line-height: 1.5;
}

.store-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: var(--subtle);
  font-size: 0.88rem;
}

.store-card-tags,
.store-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.store-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 0.78rem;
}

.store-chip.muted {
  color: var(--subtle);
}

.store-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.store-card-actions .link-button,
.store-card-actions .secondary {
  min-width: 116px;
}

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

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

.seo-grid div {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.seo-grid dt {
  color: var(--subtle);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
}

.seo-grid dd {
  margin: 0;
  line-height: 1.45;
  word-break: break-word;
}

.store-copy {
  color: var(--muted);
  line-height: 1.55;
}

.store-footer {
  color: var(--subtle);
  line-height: 1.55;
}

.store-product-hero {
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  align-items: center;
}

.store-product-media {
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}

.store-product-image {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.store-product-copy {
  display: grid;
  gap: 16px;
}

.store-product-copy h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.store-empty {
  align-items: start;
}

.store-empty .link-button {
  width: fit-content;
}

@keyframes panel-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sheen {
  to {
    transform: translateX(100%);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 141, 141, 0.5);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 141, 141, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 141, 141, 0);
  }
}

@media (max-width: 1120px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .preview-frame {
    min-height: 460px;
  }

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

  .store-product-hero {
    grid-template-columns: 1fr;
  }

  .store-hero-stats {
    grid-template-columns: 1fr;
  }

  .preset-rail {
    grid-template-columns: 1fr;
  }

  .help-strip {
    grid-template-columns: 1fr;
  }

  .help-strip-actions {
    justify-content: start;
  }

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

  .voice-assistant-actions {
    justify-content: start;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100vw - 18px, 1480px);
    padding-top: 18px;
  }

  .topbar {
    flex-direction: column;
    align-items: start;
  }

  .panel {
    padding: 18px;
  }

  .panel-head {
    flex-direction: column;
  }

  .help-strip-actions {
    width: 100%;
  }

  .setup-banner {
    flex-direction: column;
  }

  .voice-assistant-actions,
  .voice-command-list {
    width: 100%;
  }

  .field-grid,
  .field-grid.two,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .history-item {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .history-actions {
    grid-column: 1 / -1;
    justify-items: stretch;
    grid-auto-flow: column;
    justify-content: start;
  }

  .store-item {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .store-item-actions {
    grid-column: 1 / -1;
    justify-items: stretch;
    grid-auto-flow: column;
    justify-content: start;
  }

  .store-card-actions {
    flex-direction: column;
  }

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

  .preview-frame {
    min-height: 360px;
  }

  .edit-compose {
    grid-template-columns: 1fr;
  }

  .quick-edit-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .label-row {
    align-items: start;
  }
}

@media (max-width: 520px) {
  .status-stack,
  .command-rail,
  .size-rail,
  .actions {
    gap: 8px;
  }

  .pill,
  .chip,
  button,
  .link-button {
    width: 100%;
  }

  .preset-card {
    min-height: 0;
  }

  .history-item {
    grid-template-columns: 1fr;
  }

  .history-thumb {
    width: 100%;
  }

  .store-item {
    grid-template-columns: 1fr;
  }

  .store-item-thumb {
    width: 100%;
  }

  .store-hero-actions,
  .store-card-actions {
    flex-direction: column;
  }

  .store-hero-actions .link-button,
  .store-card-actions .link-button,
  .store-card-actions .secondary,
  .store-item-actions .link-button,
  .store-item-actions .secondary,
  .store-item-actions .danger {
    width: 100%;
  }
}
