:root {
  color-scheme: light;
  --ink: #252529;
  --muted: #72747b;
  --line: #d9dce2;
  --paper: #f4f3f5;
  --card: #ffffff;
  --ice: #a9cbe4;
  --lilac: #b9a9dc;
  --powder: #e6b1c8;
  --silver: #bfc3ca;
  --champagne: #d8c2a5;
  --accent-light: #e8edf3;
  --success: #3f8058;
  --success-light: #e8f4ec;
  --shadow: 0 18px 50px rgba(37, 37, 41, 0.09);
  --safe-top: max(18px, env(safe-area-inset-top));
  --safe-bottom: max(14px, env(safe-area-inset-bottom));
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% -8%, rgba(169, 203, 228, 0.5), transparent 32rem),
    radial-gradient(circle at 92% 12%, rgba(185, 169, 220, 0.18), transparent 26rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button,
label {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.app-shell {
  width: min(100%, 980px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 22px 112px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--safe-top) 2px 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 15px;
  color: var(--ink);
  background: linear-gradient(145deg, var(--ice), var(--lilac));
  font-family: Georgia, serif;
  font-size: 22px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  letter-spacing: -0.02em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.connection-dot {
  width: 10px;
  height: 10px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: #c7c7cb;
  box-shadow: 0 0 0 1px #d8d8dc;
}

.connection-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 1px #b8d6c2;
}

.view {
  display: none;
  animation: enter 220ms ease-out;
}

.view.active {
  display: block;
}

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

.hero {
  max-width: 720px;
  padding: 30px 0 28px;
}

.eyebrow {
  display: block;
  margin-bottom: 10px;
  color: #6f6790;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 680px;
  margin-bottom: 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 7vw, 58px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.hero h1 em {
  font-style: italic;
  font-weight: inherit;
}

.hero p {
  max-width: 520px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

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

.product-card {
  position: relative;
  display: flex;
  min-height: 230px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  overflow: hidden;
  padding: 22px;
  border: 1px solid rgba(20, 20, 22, 0.05);
  border-radius: 26px;
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.tryon-card {
  background: linear-gradient(145deg, var(--ice) 0%, var(--lilac) 100%);
  color: var(--ink);
}

.cover-card {
  background: var(--ink);
  color: #fff;
}

.retouch-card {
  background: linear-gradient(145deg, var(--powder) 0%, var(--champagne) 100%);
}

.product-icon {
  display: block;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 50%;
  background: var(--silver);
  box-shadow: 0 0 0 1px rgba(37, 37, 41, 0.2);
}

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

.tryon-card .product-icon img {
  object-position: 50% 48%;
}

.cover-card .product-icon img {
  object-position: 70% 48%;
}

.retouch-card .product-icon img {
  object-position: 52% 48%;
}

.product-meta {
  display: block;
  margin-top: auto;
  padding-top: 24px;
}

.product-meta small,
.product-meta strong,
.product-meta span {
  display: block;
}

.product-meta small {
  margin-bottom: 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  opacity: 0.6;
  text-transform: uppercase;
}

.product-meta strong {
  margin-bottom: 7px;
  font-family: Georgia, serif;
  font-size: 29px;
  font-weight: 500;
}

.product-meta span {
  max-width: 210px;
  font-size: 12px;
  line-height: 1.45;
  opacity: 0.7;
}

.arrow {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 21px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 18px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.66);
  backdrop-filter: blur(12px);
}

.status-strip > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.status-strip > div:not(:first-child) {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.status-value {
  font-family: Georgia, serif;
  font-size: 25px;
}

.status-label {
  color: var(--muted);
  font-size: 12px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 0 26px;
}

.section-heading .eyebrow {
  margin-bottom: 4px;
}

.section-heading h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(30px, 5vw, 42px);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.back-button {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  cursor: pointer;
}

.workflow-card {
  margin-bottom: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 36px rgba(20, 20, 22, 0.05);
}

.step-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 20px;
}

.step-heading strong,
.step-heading small {
  display: block;
}

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

.step-heading small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.step-number {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--ice);
  font-family: Georgia, serif;
}

.master-gallery {
  display: grid;
  grid-auto-columns: 118px;
  grid-auto-flow: column;
  gap: 10px;
  overflow-x: auto;
  margin: 0 -4px 16px;
  padding: 4px;
  scrollbar-width: none;
}

.master-gallery:empty {
  display: none;
}

.master-gallery::-webkit-scrollbar {
  display: none;
}

.master-item {
  position: relative;
  height: 142px;
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 18px;
  background: var(--accent-light);
  cursor: pointer;
}

.master-item.selected {
  border-color: var(--lilac);
  box-shadow: 0 0 0 3px rgba(185, 169, 220, 0.32);
}

.master-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.master-item span {
  position: absolute;
  right: 7px;
  bottom: 7px;
  left: 7px;
  overflow: hidden;
  padding: 5px 6px;
  border-radius: 8px;
  color: #fff;
  background: rgba(20, 20, 22, 0.72);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(6px);
}

.upload-zone {
  display: flex;
  min-height: 88px;
  align-items: center;
  gap: 14px;
  padding: 15px;
  border: 1px dashed var(--silver);
  border-radius: 18px;
  background: #fbfbfc;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.upload-zone:hover,
.upload-zone:focus-within {
  border-color: var(--ice);
  background: rgba(169, 203, 228, 0.14);
}

.upload-zone.compact {
  min-height: 70px;
}

.upload-zone.large {
  min-height: 122px;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.upload-zone strong,
.upload-zone small {
  display: block;
}

.upload-zone strong {
  font-size: 13px;
}

.upload-zone small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.upload-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  color: var(--ink);
  background: var(--ice);
  font-size: 13px;
  font-weight: 750;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  border-radius: 14px;
  background: var(--accent-light);
}

.segmented button {
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.segmented button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 4px 12px rgba(20, 20, 22, 0.08);
}

.page-tabs {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 14px;
}

.form-stack {
  display: grid;
  gap: 13px;
}

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

.field > span {
  font-size: 11px;
  font-weight: 700;
}

.field em {
  color: var(--muted);
  font-style: normal;
  font-weight: 400;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: #fff;
  font-size: 13px;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--lilac);
  box-shadow: 0 0 0 3px rgba(185, 169, 220, 0.28);
}

.primary-button {
  min-height: 52px;
  margin-top: 2px;
  padding: 13px 18px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 8px 22px rgba(37, 37, 41, 0.18);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease;
}

.primary-button:active {
  transform: scale(0.985);
}

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

.naming-note {
  display: grid;
  gap: 6px;
  padding: 13px;
  border-radius: 14px;
  color: var(--ink);
  background: rgba(216, 194, 165, 0.46);
  font-size: 11px;
}

.naming-note code {
  width: fit-content;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.58);
}

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

.choice-row.wide {
  grid-template-columns: repeat(2, 1fr);
}

.choice-row button {
  min-height: 46px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}

.choice-row button.active {
  border-color: var(--lilac);
  color: var(--ink);
  background: linear-gradient(145deg, var(--ice), var(--lilac));
}

.choice-row button small {
  display: block;
  margin-top: 2px;
  color: inherit;
  font-size: 9px;
  opacity: 0.62;
}

.upload-progress {
  height: 5px;
  overflow: hidden;
  margin-top: 14px;
  border-radius: 999px;
  background: var(--line);
}

.upload-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ice), var(--lilac));
  transition: width 160ms ease;
}

.result-panel {
  margin-top: 15px;
  padding: 15px;
  border: 1px solid #cadecf;
  border-radius: 16px;
  color: #294b35;
  background: #edf5ef;
  font-size: 12px;
  line-height: 1.5;
}

.result-panel.error {
  border-color: #e5c7c1;
  color: #773b32;
  background: #fbefed;
}

.result-panel strong {
  display: block;
  margin-bottom: 5px;
}

.result-panel ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.result-panel pre {
  overflow-x: auto;
  margin: 10px 0 0;
  padding: 10px;
  border-radius: 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
  font-family: inherit;
  font-size: 11px;
  white-space: pre-wrap;
}

.tryon-result-image {
  display: block;
  width: 100%;
  margin-top: 14px;
  border: 1px solid rgba(37, 37, 41, 0.1);
  border-radius: 18px;
  background: var(--pearl);
  cursor: zoom-in;
  object-fit: contain;
}

.tryon-batch-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.tryon-batch-card {
  overflow: hidden;
  min-width: 0;
  padding-bottom: 8px;
  border: 1px solid rgba(37, 37, 41, 0.1);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.74);
}

.tryon-batch-card > img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: var(--pearl);
  cursor: zoom-in;
  object-fit: cover;
}

.tryon-batch-card > strong {
  overflow: hidden;
  margin: 8px 8px 0;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tryon-batch-card .result-actions {
  gap: 4px;
  margin: 8px 8px 0;
}

.tryon-batch-card .result-actions button {
  min-height: 32px;
  overflow: hidden;
  padding: 5px 2px;
  font-size: 8px;
  text-overflow: ellipsis;
}

.result-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.result-actions button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--silver);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.cover-gallery {
  margin-top: 16px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
}

.cover-gallery-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.cover-gallery-heading h3 {
  margin-top: 4px;
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 500;
}

.cover-gallery-heading small {
  color: var(--muted);
  font-size: 9px;
}

.cover-variant-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.cover-variant {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 18px;
  background: var(--pearl);
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease;
}

.cover-variant-card:only-child {
  grid-column: 1 / -1;
}

.cover-variant-card {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.cover-variant:not(:disabled):active {
  transform: scale(0.985);
}

.cover-variant.selected {
  border-color: var(--lilac);
  box-shadow: 0 0 0 2px rgba(185, 169, 220, 0.22);
}

.cover-variant.saved {
  border-color: var(--silver);
  cursor: default;
}

.cover-variant img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.cover-variant-marker {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 24px;
  padding: 5px 7px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  backdrop-filter: blur(8px);
}

.cover-variant.selected .cover-variant-marker {
  background: var(--lilac);
}

.prompt-button {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--silver);
  border-radius: 11px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

.cover-task-prompts {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.cover-task-prompts > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.cover-task-prompts > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 6px;
}

.cover-gallery-note {
  margin: 10px 4px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  text-align: center;
}

.empty-state {
  display: grid;
  min-height: 380px;
  place-items: center;
  align-content: center;
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.75);
  text-align: center;
}

.empty-state > span {
  display: grid;
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--ice);
  font-size: 25px;
}

.empty-state h3 {
  margin-bottom: 8px;
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 500;
}

.empty-state p {
  max-width: 380px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

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

.history-tabs {
  grid-template-columns: repeat(2, 1fr);
}

.cover-history-list {
  gap: 14px;
}

.cover-history-batch {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
}

.cover-history-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.cover-history-heading strong,
.cover-history-heading small {
  display: block;
}

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

.cover-history-heading small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.cover-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.cover-history-card {
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--pearl);
}

.cover-history-card > img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: var(--silver);
  cursor: zoom-in;
  object-fit: cover;
}

.cover-history-caption {
  padding: 9px 9px 0;
}

.cover-history-caption strong,
.cover-history-caption small {
  display: block;
}

.cover-history-caption strong {
  font-size: 11px;
}

.cover-history-caption small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.cover-history-card .result-actions {
  gap: 4px;
  margin: 8px;
}

.cover-history-card > .prompt-button {
  width: calc(100% - 16px);
  margin: 8px 8px 0;
}

.cover-history-card .result-actions button {
  min-height: 34px;
  overflow: hidden;
  padding: 6px 3px;
  font-size: 8px;
  text-overflow: ellipsis;
}

.history-item {
  display: grid;
  gap: 10px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
}

.history-item.has-preview {
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: start;
}

.history-preview {
  display: block;
  width: 72px;
  aspect-ratio: 4 / 5;
  border-radius: 12px;
  background: var(--pearl);
  cursor: zoom-in;
  object-fit: cover;
}

.history-item-content {
  min-width: 0;
}

.history-item-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.history-item-heading > div {
  min-width: 0;
}

.history-item-heading .history-status {
  flex: 0 0 auto;
}

.history-item .result-actions {
  width: 100%;
  max-width: none;
}

.history-item .result-actions button {
  padding: 7px 4px;
  font-size: 9px;
}

.history-error {
  display: block;
  margin-top: 8px;
  color: #773b32;
}

.image-viewer {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: stretch;
}

.image-viewer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(10, 10, 12, 0.92);
}

.image-viewer-content {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto 1fr;
}

.image-viewer-toolbar {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 14px 12px;
  color: #fff;
  background: rgba(20, 20, 22, 0.9);
}

.image-viewer-toolbar span {
  overflow: hidden;
  font-size: 10px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-viewer-toolbar button {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 11px;
  font-weight: 700;
}

.image-viewer-stage {
  overflow: auto;
  display: grid;
  align-items: center;
  justify-items: center;
  min-width: 0;
  min-height: 0;
  padding: 12px;
  overscroll-behavior: contain;
}

.image-viewer-stage img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 86px);
  cursor: zoom-in;
  object-fit: contain;
  transition: width 160ms ease;
}

.image-viewer-stage img.zoomed {
  width: 180%;
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}

.viewer-open {
  overflow: hidden;
}

.prompt-viewer {
  position: fixed;
  z-index: 110;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
}

.prompt-viewer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(10, 10, 12, 0.72);
  backdrop-filter: blur(8px);
}

.prompt-viewer-content {
  position: relative;
  z-index: 1;
  overflow: auto;
  width: min(100%, 680px);
  max-height: min(82dvh, 760px);
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  color: #fff;
  background: rgba(37, 37, 41, 0.98);
  box-shadow: 0 22px 70px rgba(20, 20, 22, 0.28);
}

.prompt-viewer-heading .eyebrow {
  color: var(--ice);
}

.prompt-viewer-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.prompt-viewer-heading h3 {
  margin-top: 4px;
  color: #fff;
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 500;
}

.prompt-viewer-heading button {
  padding: 8px 11px;
  border: 1px solid var(--silver);
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  font-size: 10px;
  font-weight: 700;
}

.prompt-viewer pre {
  overflow: visible;
  margin: 0;
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.history-item strong,
.history-item small {
  display: block;
}

.history-item strong {
  font-size: 13px;
}

.history-item small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.history-status {
  align-self: start;
  padding: 5px 8px;
  border-radius: 999px;
  color: #356747;
  background: var(--success-light);
  font-size: 9px;
  font-weight: 700;
}

.bottom-nav {
  position: fixed;
  z-index: 10;
  right: max(12px, calc((100vw - 980px) / 2 + 22px));
  bottom: var(--safe-bottom);
  left: max(12px, calc((100vw - 980px) / 2 + 22px));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  max-width: 936px;
  margin: 0 auto;
  padding: 6px;
  border: 1px solid rgba(20, 20, 22, 0.08);
  border-radius: 21px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 15px 40px rgba(20, 20, 22, 0.14);
  backdrop-filter: blur(18px);
}

.bottom-nav button {
  display: grid;
  min-height: 49px;
  place-items: center;
  gap: 2px;
  padding: 5px;
  border: 0;
  border-radius: 15px;
  color: #929297;
  background: transparent;
  font-size: 9px;
  cursor: pointer;
}

.bottom-nav button span {
  font-size: 17px;
  line-height: 1;
}

.bottom-nav button.active {
  color: var(--ink);
  background: linear-gradient(145deg, rgba(169, 203, 228, 0.58), rgba(185, 169, 220, 0.42));
}

.toast {
  position: fixed;
  z-index: 20;
  right: 18px;
  bottom: 94px;
  left: 18px;
  max-width: 500px;
  margin: 0 auto;
  padding: 13px 16px;
  border-radius: 14px;
  color: #fff;
  background: rgba(20, 20, 22, 0.94);
  box-shadow: 0 14px 36px rgba(20, 20, 22, 0.2);
  font-size: 12px;
  text-align: center;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .app-shell {
    padding-right: 14px;
    padding-left: 14px;
  }

  .hero {
    padding-top: 14px;
  }

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

  .product-card {
    min-height: 190px;
  }

  .status-strip {
    padding: 17px 14px;
  }

  .status-strip > div {
    display: grid;
    gap: 2px;
    text-align: center;
  }

  .status-strip > div:not(:first-child) {
    padding-left: 0;
  }

  .status-value {
    font-size: 22px;
  }

  .workflow-card {
    padding: 17px;
    border-radius: 22px;
  }

  .page-tabs button {
    padding: 7px 4px;
    font-size: 10px;
  }
}

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