:root {
  color-scheme: dark;
  --bg: #020817;
  --bg-2: #06142e;
  --panel: #080d19;
  --panel-2: #0d1324;
  --panel-3: #111a2c;
  --ink: #e7fbff;
  --muted: #82a0b7;
  --faint: #43556a;
  --line: rgba(136, 218, 255, 0.18);
  --line-strong: rgba(172, 242, 255, 0.48);
  --cyan: #a9f6ff;
  --cyan-2: #4dd8ff;
  --blue: #1448ff;
  --red: #ff4d6d;
  --lime: #b7ff5a;
  --amber: #ffba2f;
  --ok: #75ffc3;
  --danger: #ff6c7f;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
  --glow: 0 0 20px rgba(119, 229, 255, 0.28);
  --mono: "Courier New", "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 16% 0%, rgba(33, 94, 202, 0.38), transparent 34rem),
    radial-gradient(circle at 82% 16%, rgba(42, 220, 255, 0.16), transparent 28rem),
    linear-gradient(180deg, #030712 0%, #061337 42%, #020817 100%);
  color: var(--ink);
  font-family: var(--sans);
  overflow-x: hidden;
}

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

body::before {
  background:
    linear-gradient(rgba(169, 246, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(169, 246, 255, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, black, transparent 85%);
}

body::after {
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.035) 0,
      rgba(255, 255, 255, 0.035) 1px,
      transparent 1px,
      transparent 5px
    );
  opacity: 0.22;
  mix-blend-mode: screen;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.studio,
.workspace {
  position: relative;
  min-height: calc(100vh - 36px);
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(10, 19, 42, 0.92), rgba(4, 9, 22, 0.96)),
    var(--panel);
  box-shadow: var(--shadow);
}

.studio::before,
.workspace::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(145, 235, 255, 0.08), transparent) 0 0 / 100% 1px,
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 20%);
}

.topbar {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.topbar::after,
.block-title::after,
.preview-toolbar::after {
  content: "";
  width: 74px;
  height: 8px;
  align-self: flex-end;
  background:
    linear-gradient(90deg, var(--cyan) 0 44%, transparent 44% 56%, var(--red) 56% 70%, transparent 70% 78%, var(--lime) 78%);
  clip-path: polygon(0 0, 100% 0, 92% 100%, 0 100%);
  box-shadow: var(--glow);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--ok);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 0 14px rgba(117, 255, 195, 0.34);
}

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

h1 {
  margin-bottom: 0;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 4.6rem;
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow:
    0 0 18px rgba(169, 246, 255, 0.34),
    0 0 48px rgba(20, 72, 255, 0.32);
}

h2,
h3 {
  margin-bottom: 0;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
}

.status-pill,
.ghost-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(8, 13, 25, 0.88);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition:
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.ghost-link:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateY(-1px);
  box-shadow: var(--glow);
}

.status-pill.live {
  border-color: rgba(117, 255, 195, 0.38);
  color: var(--ok);
}

.status-pill.mock {
  border-color: rgba(255, 77, 109, 0.44);
  color: var(--red);
}

.app-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(360px, 500px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.flow-surface,
.result-stage,
.preview-card,
.admin-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(15, 24, 43, 0.94), rgba(8, 13, 25, 0.98)),
    var(--panel);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

.flow-surface::before,
.result-stage::before,
.preview-card::before,
.admin-panel::before {
  content: "";
  position: absolute;
  inset: -1px auto auto -1px;
  width: 42px;
  height: 42px;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
  pointer-events: none;
}

.flow-surface {
  display: grid;
  gap: 18px;
  padding: 18px;
  position: sticky;
  top: 18px;
}

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

.step-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(4, 8, 19, 0.72);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  transition:
    transform 190ms ease,
    border-color 190ms ease,
    background 190ms ease,
    color 190ms ease,
    opacity 190ms ease,
    box-shadow 190ms ease;
}

.step-pill::after {
  content: "";
  position: absolute;
  inset: auto 10px 7px;
  height: 2px;
  background: rgba(130, 160, 183, 0.32);
  transition: background 190ms ease;
}

.step-pill span {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  background: rgba(169, 246, 255, 0.08);
  color: var(--cyan);
  font-size: 0.78rem;
}

.step-pill.is-active {
  border-color: var(--cyan);
  background:
    linear-gradient(180deg, rgba(58, 203, 255, 0.18), rgba(4, 8, 19, 0.92));
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(169, 246, 255, 0.08), var(--glow);
}

.step-pill.is-active span {
  background: var(--cyan);
  color: #05101f;
}

.step-pill.is-active::after {
  background: linear-gradient(90deg, var(--red), var(--cyan), var(--lime));
}

.step-pill:disabled {
  cursor: not-allowed;
  opacity: 0.44;
}

.flow-panel {
  display: none;
  gap: 16px;
}

.flow-panel.is-active {
  display: grid;
  animation: panelIn 360ms cubic-bezier(0.2, 0.72, 0.2, 1);
}

.panel-heading {
  display: grid;
  gap: 4px;
}

.panel-heading span,
.selection-summary,
.form-message,
.preview-card figcaption,
.upload-drop small,
.choice-copy small,
.muted,
.block-title span {
  color: var(--muted);
  font-size: 0.84rem;
}

.step-label {
  margin-bottom: 0;
  color: var(--red);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.upload-drop {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 136px;
  padding: 18px;
  border: 1px dashed rgba(169, 246, 255, 0.38);
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(77, 216, 255, 0.13), rgba(255, 77, 109, 0.06)),
    rgba(4, 8, 19, 0.68);
  transition:
    border-color 190ms ease,
    background 190ms ease,
    transform 190ms ease,
    box-shadow 190ms ease;
}

.upload-drop:hover,
.upload-drop:focus-within {
  border-color: var(--cyan);
  box-shadow: var(--glow);
  transform: translateY(-1px);
}

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

.upload-symbol {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  background: #050a14;
  color: var(--cyan);
  box-shadow: inset 0 0 0 1px var(--line), 0 0 24px rgba(77, 216, 255, 0.18);
}

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

.upload-drop strong {
  max-width: 100%;
  margin-bottom: 4px;
  color: #fff;
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1.22;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.upload-drop > span:last-child {
  min-width: 0;
}

.hairstyle-grid {
  counter-reset: style-card;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

.choice-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(5, 10, 20, 0.84);
  transition:
    border-color 190ms ease,
    box-shadow 190ms ease,
    transform 190ms ease,
    background 190ms ease;
}

.choice-card:hover,
.choice-card:has(input:focus-visible) {
  border-color: rgba(169, 246, 255, 0.7);
  box-shadow: var(--glow);
  transform: translateY(-2px);
}

.choice-card:has(input:checked) {
  border-color: var(--red);
  background: rgba(20, 15, 29, 0.94);
  box-shadow:
    0 0 0 1px rgba(255, 77, 109, 0.2),
    0 18px 42px rgba(255, 77, 109, 0.12);
}

.choice-card:has(input:checked)::after {
  content: "";
  position: absolute;
  inset: 9px 9px auto auto;
  width: 13px;
  height: 13px;
  border: 2px solid #06101f;
  background: var(--red);
  box-shadow: 0 0 16px rgba(255, 77, 109, 0.72);
}

.choice-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.hairstyle-card {
  counter-increment: style-card;
  display: grid;
}

.hairstyle-card::before {
  content: "0" counter(style-card);
  position: absolute;
  z-index: 2;
  inset: 10px auto auto 10px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.78rem;
  text-shadow: var(--glow);
}

.choice-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #07101f;
}

.style-tile {
  display: block;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 46%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 7px),
    var(--tile-accent);
  filter: saturate(0.95) brightness(0.9);
  transition:
    filter 180ms ease,
    transform 220ms ease;
}

.style-preview-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.choice-card:hover .style-tile {
  filter: saturate(1.16) brightness(1.1);
  transform: scale(1.02);
}

.choice-card:hover .style-preview-img {
  transform: scale(1.02);
}

.choice-copy {
  min-width: 0;
  padding: 11px 10px 12px;
  background: rgba(7, 12, 23, 0.86);
  color: #fff;
  border-top: 1px solid var(--line);
}

.choice-copy strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.choice-copy small {
  display: -webkit-box;
  min-height: 36px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.28;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.hairstyle-card .choice-copy {
  min-height: 52px;
}

.color-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  padding: 10px;
}

.color-card .choice-copy {
  padding: 0;
  background: transparent;
  color: var(--ink);
  border-top: 0;
}

.color-card .choice-copy small {
  color: var(--muted);
}

.color-swatch {
  width: 42px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 0;
  box-shadow: 0 0 0 1px rgba(169, 246, 255, 0.22), 0 0 18px rgba(169, 246, 255, 0.12);
}

.native-swatch {
  background:
    linear-gradient(135deg, transparent 0 42%, #fff 42% 56%, transparent 56%),
    conic-gradient(from 45deg, #211815, #6d3f2f, #d8b46a, #211815);
}

.native-color {
  border-color: rgba(169, 246, 255, 0.34);
}

.button-row {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 10px;
}

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 13px 16px;
  border-radius: 0;
  font-family: var(--mono);
  font-weight: 700;
  transition:
    transform 180ms ease,
    background 180ms ease,
    opacity 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease;
}

.primary-button {
  border: 1px solid rgba(169, 246, 255, 0.58);
  background:
    linear-gradient(90deg, rgba(77, 216, 255, 0.2), rgba(255, 77, 109, 0.12)),
    #07101f;
  color: #fff;
  box-shadow: 0 0 24px rgba(77, 216, 255, 0.16);
}

.secondary-button {
  border: 1px solid var(--line);
  background: rgba(5, 10, 20, 0.82);
  color: var(--cyan);
}

.danger-button {
  border: 1px solid rgba(255, 77, 109, 0.42);
  background: rgba(255, 77, 109, 0.08);
  color: var(--danger);
}

.primary-button:hover:not(:disabled),
.secondary-button:hover:not(:disabled),
.danger-button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.primary-button:hover:not(:disabled) {
  border-color: var(--cyan);
  background:
    linear-gradient(90deg, rgba(77, 216, 255, 0.28), rgba(255, 77, 109, 0.16)),
    #09182c;
  box-shadow: var(--glow);
}

.secondary-button:hover:not(:disabled) {
  border-color: rgba(169, 246, 255, 0.58);
  color: #fff;
}

.danger-button:hover:not(:disabled) {
  border-color: rgba(255, 77, 109, 0.74);
  background: rgba(255, 77, 109, 0.14);
  color: #fff;
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.44;
  box-shadow: none;
}

.selection-summary,
.form-message {
  min-height: 22px;
  margin: 0;
  font-family: var(--mono);
  line-height: 1.45;
}

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

.form-message.success {
  color: var(--ok);
}

.result-stage {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.segmented {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
}

.segment {
  min-height: 38px;
  padding: 8px 14px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  transition:
    background 170ms ease,
    color 170ms ease;
}

.segment.is-active {
  background: var(--cyan);
  color: #05101f;
}

.preview-grid {
  display: grid;
  grid-template-columns: minmax(280px, 680px);
  justify-content: center;
  gap: 14px;
}

.preview-grid.after-only {
  grid-template-columns: 1fr;
}

.preview-grid.after-only .preview-card:first-child {
  display: none;
}

.preview-card {
  min-width: 0;
  margin: 0;
  padding: 12px;
}

.preview-card figcaption {
  display: flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 10px;
  font-weight: 700;
}

.image-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 430px;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 0;
  background:
    linear-gradient(135deg, rgba(169, 246, 255, 0.05), transparent 46%),
    #030812;
  border: 1px solid rgba(169, 246, 255, 0.14);
}

.image-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(169, 246, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(169, 246, 255, 0.04) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.72;
}

.image-frame.has-result {
  min-height: 0;
  aspect-ratio: var(--result-ratio, 4 / 5);
  background: #020817;
}

.image-frame img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  opacity: 0;
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.image-frame.crop-right-result img {
  object-fit: cover;
  object-position: right center;
}

.image-frame img.has-image {
  opacity: 1;
}

.placeholder {
  position: relative;
  z-index: 2;
  max-width: 240px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
}

.result-placeholder {
  display: grid;
  gap: 12px;
  justify-items: center;
}

.spinner {
  display: none;
  width: 38px;
  height: 38px;
  border: 2px solid rgba(169, 246, 255, 0.16);
  border-top-color: var(--cyan);
  border-radius: 50%;
  box-shadow: var(--glow);
  animation: spin 900ms linear infinite;
}

.is-loading .spinner {
  display: inline-block;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.92fr) minmax(480px, 1.08fr);
  gap: 18px;
  align-items: start;
}

.admin-dashboard {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-main-stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.admin-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.admin-auth-panel {
  max-width: 760px;
  margin: 0 auto;
}

.catalog-panel {
  grid-row: span 3;
}

.save-panel {
  align-self: start;
}

.admin-side-panel {
  position: sticky;
  top: 18px;
  align-self: start;
}

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

.admin-stat-grid article {
  display: grid;
  gap: 4px;
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(77, 216, 255, 0.12), transparent 52%),
    rgba(5, 10, 20, 0.72);
}

.admin-stat-grid strong {
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 2rem;
  line-height: 1;
}

.admin-stat-grid span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.admin-divider {
  height: 1px;
  background: var(--line);
}

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

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

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

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

.account-panel {
  align-self: start;
}

.admin-form label,
.admin-token {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-form input,
.admin-form textarea,
.admin-token input {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(5, 10, 20, 0.82);
  color: var(--ink);
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.admin-form input:focus,
.admin-form textarea:focus,
.admin-token input:focus {
  border-color: rgba(169, 246, 255, 0.7);
  background: rgba(7, 16, 31, 0.96);
  box-shadow: 0 0 0 1px rgba(169, 246, 255, 0.14), var(--glow);
}

.admin-form textarea {
  resize: vertical;
}

.admin-form input[type="color"] {
  padding: 4px;
}

.full-field,
.admin-form button {
  grid-column: 1 / -1;
}

.field-note {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.45;
}

.card-preview-box {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(5, 10, 20, 0.58);
}

.card-preview-tile {
  display: grid;
  place-items: center;
  min-height: 132px;
  overflow: hidden;
  border: 1px solid rgba(169, 246, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 46%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 7px),
    var(--tile-accent);
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--mono);
  font-size: 0.78rem;
  text-align: center;
}

.card-preview-tile img {
  width: 100%;
  height: 100%;
  min-height: 132px;
  object-fit: cover;
}

.reference-uploader {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(77, 216, 255, 0.08), transparent 42%),
    rgba(5, 10, 20, 0.58);
}

.reference-preview {
  display: grid;
  place-items: center;
  min-height: 190px;
  overflow: hidden;
  border: 1px solid rgba(169, 246, 255, 0.22);
  background: #fff;
  color: #17202c;
  font-family: var(--mono);
  font-size: 0.78rem;
  text-align: center;
}

.reference-preview img {
  width: 100%;
  height: 100%;
  min-height: 190px;
  object-fit: contain;
}

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

.reference-copy strong {
  color: var(--ink);
  font-family: var(--mono);
  text-transform: uppercase;
}

.reference-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.source-file-pill {
  display: block;
  max-width: 100%;
  overflow: hidden;
  padding: 8px 10px;
  border: 1px solid rgba(169, 246, 255, 0.22);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-hint-pill {
  white-space: nowrap;
}

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

.admin-list h3 {
  margin: 10px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.admin-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(5, 10, 20, 0.82);
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    background 160ms ease;
}

.admin-row:hover {
  transform: translateY(-1px);
  border-color: rgba(169, 246, 255, 0.42);
  background: rgba(7, 16, 31, 0.96);
}

.admin-row.compact-row {
  grid-template-columns: 42px minmax(0, 1fr) auto;
}

.admin-row i {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 0;
  box-shadow: 0 0 0 1px rgba(169, 246, 255, 0.18);
}

.admin-thumb {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border: 1px solid rgba(169, 246, 255, 0.5);
  border-radius: 0;
  box-shadow: 0 0 0 1px rgba(169, 246, 255, 0.18);
}

.admin-row span {
  min-width: 0;
}

.admin-row strong,
.admin-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-row strong {
  font-family: var(--mono);
}

.admin-row small {
  color: var(--muted);
  font-size: 0.78rem;
}

.admin-row-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.mini-button {
  min-height: 34px;
  padding: 8px 10px;
  font-size: 0.7rem;
}

.color-list {
  margin-top: 2px;
}

.account-panel .danger-button {
  width: 100%;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(5, 10, 20, 0.82);
  color: var(--danger);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1180px) {
  .app-grid,
  .admin-layout,
  .admin-dashboard {
    grid-template-columns: 1fr;
  }

  .flow-surface,
  .admin-side-panel {
    position: static;
  }

  .catalog-panel {
    grid-row: auto;
  }
}

@media (max-width: 760px) {
  .app-shell,
  .shell {
    padding: 10px;
  }

  .studio,
  .workspace {
    min-height: calc(100vh - 20px);
    padding: 14px;
  }

  .topbar,
  .preview-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  h1 {
    font-size: 2.7rem;
  }

  .top-actions {
    justify-content: stretch;
  }

  .ghost-link,
  .status-pill,
  .segmented {
    flex: 1;
  }

  .stepper,
  .hairstyle-grid,
  .color-grid,
  .preview-grid,
  .button-row,
  .admin-form,
  .compact-admin-form,
  .card-preview-box,
  .reference-uploader {
    grid-template-columns: 1fr;
  }

  .admin-row,
  .admin-row.compact-row {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .admin-row-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .admin-row-actions .mini-button {
    flex: 1;
  }

  .image-frame {
    min-height: 310px;
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  h1 {
    font-size: 3.8rem;
  }
}
