@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url(assets/fonts/dmsans-400.woff2) format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url(assets/fonts/dmsans-500.woff2) format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url(assets/fonts/dmsans-600.woff2) format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url(assets/fonts/dmsans-700.woff2) format('woff2'); }

/* Tokens mirror the Nyam studio (menu/frontend/src/app/shared/studio.css). */
:root {
  color-scheme: light dark;
  --bg: #fff;
  --surface: #fff;
  --soft: #f5f5f5;
  --hover: #f0f0f0;
  --active: #ebebeb;
  --line-soft: #ededed;
  --line: #dedede;
  --text: #111;
  --secondary: #555;
  --muted: #747474;
  --brand-red: #e20000;
  --brand-rest-opacity: .14;
  --brand-hover-opacity: .34;
  --brand-print-ink: radial-gradient(circle at 1.6px 1.6px, var(--brand-red) .6px, transparent .75px);
  --brand-dot-size: 3.2px 3.2px;
  --button: #111;
  --button-text: #fff;
  --danger: var(--brand-red);
  --success: #19805b;
  --radius-s: 8px;
  --radius-m: 10px;
  --radius-l: 16px;
  --halftone: #111;
  --halftone-opacity: .08;
  --font: 'DM Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --surface: #0b0b0b;
    --soft: #151515;
    --hover: #1c1c1c;
    --active: #242424;
    --line-soft: #1c1c1c;
    --line: #303030;
    --text: #f5f5f5;
    --secondary: #bcbcbc;
    --muted: #909090;
    --button: #f5f5f5;
    --button-text: #111;
    --brand-rest-opacity: .9;
    --brand-hover-opacity: 1;
    --success: #68cfaa;
    --halftone: #fff;
    --halftone-opacity: .1;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
/* The studio's faint print-edge halftone fading out of the bottom-right corner. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle, var(--halftone) .8px, transparent 1.1px) 0 0 / 6px 6px;
  mask-image: radial-gradient(120% 90% at 100% 100%, #000, transparent 55%);
  -webkit-mask-image: radial-gradient(120% 90% at 100% 100%, #000, transparent 55%);
  opacity: var(--halftone-opacity);
  pointer-events: none;
}
button, input { color: inherit; font: inherit; }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:where(button, a, input, .dropzone) { transition: background-color 160ms var(--ease), border-color 160ms var(--ease), color 160ms var(--ease), box-shadow 160ms var(--ease); }
:where(button, a, input[type=range], input[type=color]):focus-visible { outline: 1px solid var(--muted); outline-offset: 2px; }
h1, p { margin-top: 0; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Header: one 16px gutter, logo left, control right. */
.studio-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; }
.brand picture, .brand img { display: block; width: 92px; height: auto; }
.brand-caption { padding-left: 9px; border-left: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: .07em; line-height: 18px; }
.lang-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-s); }
.lang-switch button { min-width: 36px; height: 28px; padding: 0 8px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.lang-switch button[aria-pressed=true] { background: var(--active); color: var(--text); }

/* Layout: an unboxed form beside a sticky preview. */
.maker { display: grid; grid-template-columns: minmax(0, 560px) minmax(300px, 420px); justify-content: center; gap: 56px; width: min(100% - 40px, 1060px); margin: 0 auto; padding: 32px 0 72px; animation: arrive 180ms var(--ease) both; }
@keyframes arrive { from { transform: translateY(12px); } }
.create-heading { margin-bottom: 32px; }
.create-heading h1 { margin: 0; font-size: 30px; font-weight: 600; line-height: 1.1; letter-spacing: -.02em; text-wrap: balance; }
.create-heading p { margin: 10px 0 0; color: var(--secondary); max-width: 46ch; }

.create-field { display: flex; flex-direction: column; gap: 9px; margin: 0; color: var(--secondary); font-size: 13px; font-weight: 550; }
.create-field b { color: var(--danger); }
.address-feedback { min-height: 18px; color: var(--muted); font-size: 12px; font-weight: 400; }
.address-feedback.field-issue { color: var(--danger); }
.link-input { display: flex; min-width: 0; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); color: var(--muted); }
.link-input:focus-within { border-color: var(--muted); }
.link-input.invalid { border-color: var(--danger); }
.link-input > .icon { margin-left: 14px; width: 16px; height: 16px; }
.link-input input { min-width: 0; flex: 1; margin: 0; padding: 13px 10px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; }
.link-input input::placeholder { color: var(--muted); opacity: .8; }
.clear-input { display: grid; place-items: center; width: 34px; height: 34px; margin-right: 6px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.clear-input .icon { width: 15px; height: 15px; }
.clear-input[hidden] { display: none; }

.form-section { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line-soft); }
.section-title { margin-bottom: 14px; color: var(--secondary); font-size: 13px; font-weight: 550; }
.row-label { color: var(--muted); font-size: 13px; }

/* Style tiles: the selected one takes the brand's red outline and print. */
.style-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.style-tile { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; padding: 12px 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); color: var(--secondary); font-size: 12px; font-weight: 550; cursor: pointer; }
.style-tile svg { display: block; width: 100%; max-width: 64px; height: auto; border-radius: 4px; }
.style-tile::before { content: ""; position: absolute; z-index: -1; inset: 0; background-image: var(--brand-print-ink); background-size: var(--brand-dot-size); opacity: 0; transition: opacity 220ms var(--ease), transform 280ms var(--ease); pointer-events: none; }
.style-tile[aria-checked=true] { border-color: var(--brand-red); color: var(--text); }
.style-tile[aria-checked=true]::before { opacity: var(--brand-rest-opacity); }
@media (prefers-color-scheme: dark) { .style-tile[aria-checked=true]::before { opacity: .35; } }

/* Colors: round swatches with a custom picker at the end. */
.color-row, .slider-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 44px; }
.swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.swatch { position: relative; width: 28px; height: 28px; padding: 0; border: 1px solid color-mix(in srgb, var(--text) 14%, transparent); border-radius: 50%; background: var(--c); cursor: pointer; }
.swatch[aria-checked=true] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--text); }
.swatch.same { display: grid; place-items: center; width: auto; min-width: 28px; padding: 0 10px; border-radius: 999px; border-color: var(--line); background: var(--surface); color: var(--secondary); font-size: 12px; font-weight: 550; }
.swatch.same[aria-checked=true] { border-color: var(--text); box-shadow: none; color: var(--text); }
.swatch.transparent { background: repeating-conic-gradient(#d6d6d6 0 25%, #fff 0 50%) 0 0 / 10px 10px; }
.swatch.picker { overflow: hidden; background: conic-gradient(from 90deg, #e20000, #f0a400, #19805b, #1f4fd1, #7b2fbf, #e20000); }
.swatch.picker input { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); padding: 0; border: 0; opacity: 0; cursor: pointer; }
.contrast-note { margin: 10px 0 0; padding: 9px 12px; border-radius: var(--radius-s); background: color-mix(in srgb, var(--brand-red) 6%, var(--surface)); color: var(--danger); font-size: 12px; }
@media (prefers-color-scheme: dark) { .contrast-note { background: color-mix(in srgb, var(--brand-red) 15%, var(--surface)); color: var(--text); } }

/* Segmented controls match the studio's view switch. */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); }
.segmented button { min-height: 36px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 550; cursor: pointer; }
.segmented button[aria-checked=true] { background: var(--active); color: var(--text); }
.segmented.compact { justify-self: start; width: min(100%, 240px); }
.segmented.compact button { min-height: 30px; font-size: 12px; }
@media (hover: hover) {
  .segmented button:hover:not([aria-checked=true]), .lang-switch button:hover:not([aria-pressed=true]) { color: var(--text); }
  .style-tile:hover:not([aria-checked=true]) { border-color: color-mix(in srgb, var(--brand-red) 28%, var(--line)); }
  .clear-input:hover { background: var(--soft); color: var(--text); }
}

.dropzone { position: relative; isolation: isolate; overflow: hidden; display: flex; width: 100%; min-height: 128px; margin-top: 12px; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); color: var(--text); text-align: center; cursor: pointer; }
.dropzone[hidden] { display: none; }
.dropzone::before { content: ""; position: absolute; z-index: -1; inset: 0; background-image: var(--brand-print-ink); background-size: var(--brand-dot-size); opacity: var(--brand-rest-opacity); transition: opacity 220ms var(--ease), transform 280ms var(--ease); pointer-events: none; }
.dropzone small { color: var(--muted); font-size: 12px; }
.dropzone .drop-icon { width: 22px; height: 22px; }
.dropzone.dropping { border-color: var(--brand-red); }
.dropzone.dropping::before { opacity: var(--brand-hover-opacity); transform: translateX(1.6px); }
.drop-preview { display: grid; place-items: center; width: 56px; height: 56px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; }
.drop-preview[hidden] { display: none; }
.drop-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.has-logo .drop-icon { display: none; }

.slider-row { grid-template-columns: 110px minmax(0, 1fr) 44px; margin-top: 8px; }
.slider-row:has(.segmented) { grid-template-columns: 110px minmax(0, 1fr); margin-top: 0; }
.slider-row[hidden] { display: none; }
.slider-row output { color: var(--secondary); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
input[type=range] { width: 100%; height: 20px; margin: 0; background: transparent; accent-color: var(--text); -webkit-appearance: none; appearance: none; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 2px; border-radius: 2px; background: var(--line); }
input[type=range]::-moz-range-track { height: 2px; border-radius: 2px; background: var(--line); }
input[type=range]::-webkit-slider-thumb { width: 18px; height: 18px; margin-top: -8px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px #0002; -webkit-appearance: none; appearance: none; }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px #0002; }

/* Buttons and the halftone print, as on the studio's create page. */
.create-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line-soft); }
.button { position: relative; display: inline-flex; min-width: 0; min-height: 44px; align-items: center; justify-content: center; gap: 10px; padding: 9px 14px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; text-align: center; cursor: pointer; }
.button .icon { width: 16px; height: 16px; transition: transform 180ms var(--ease); }
.button.brand-action { isolation: isolate; overflow: hidden; border-radius: var(--radius-s); }
.button.brand-action::before { content: ""; position: absolute; z-index: -1; inset: 0; border-radius: inherit; background-image: var(--brand-print-ink); background-size: var(--brand-dot-size); opacity: var(--brand-rest-opacity); transition: opacity 220ms var(--ease), transform 280ms var(--ease); pointer-events: none; }
.button:disabled { opacity: .55; cursor: not-allowed; }
.button:disabled::before { opacity: .06; }
@media (hover: hover) {
  .button:hover:not(:disabled) { background: var(--hover); border-color: var(--muted); }
  .button.brand-action:hover:not(:disabled) { background: var(--surface); border-color: var(--brand-red); }
  .button.brand-action:hover:not(:disabled)::before, .dropzone:hover::before { opacity: var(--brand-hover-opacity); transform: translateX(1.6px); }
  .button.brand-action:hover:not(:disabled) .icon { transform: translateX(2px); }
  .dropzone:hover { border-color: var(--brand-red); }
}

/* Preview */
.preview-column { position: relative; }
.preview-card { position: sticky; top: 24px; }
.preview-stage { display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; }
.preview-stage.transparent { background: repeating-conic-gradient(color-mix(in srgb, var(--text) 8%, transparent) 0 25%, transparent 0 50%) 0 0 / 16px 16px; }
.preview-stage svg { display: block; width: 100%; height: auto; animation: settle 200ms var(--ease); }
@keyframes settle { from { opacity: .7; } }
.scan-status { display: flex; align-items: center; gap: 8px; min-height: 20px; margin-top: 12px; color: var(--secondary); font-size: 12px; }
.scan-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--muted); }
.scan-status[data-state=ok] .scan-dot { background: var(--success); }
.scan-status[data-state=fail] { color: var(--danger); }
.scan-status[data-state=fail] .scan-dot { background: var(--brand-red); }
@media (prefers-color-scheme: dark) { .scan-status[data-state=fail] { color: var(--text); } }

@media (max-width: 900px) {
  .maker { grid-template-columns: minmax(0, 560px); gap: 24px; padding-top: 16px; }
  .preview-column { order: -1; }
  .preview-card { position: static; width: min(100%, 320px); margin: 0 auto; }
}
@media (max-width: 600px) {
  .maker { width: min(100% - 32px, 560px); }
  .brand picture, .brand img { width: 72px; }
  .create-heading { margin-bottom: 24px; }
  .create-heading h1 { font-size: 26px; }
  .style-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .color-row, .slider-row, .slider-row:has(.segmented) { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 6px 0; }
  .slider-row { grid-template-columns: minmax(0, 1fr) 44px; }
  .slider-row .row-label { grid-column: 1 / -1; }
  .segmented.compact { width: 100%; }
}
@media (max-width: 380px) { .create-actions { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
