@font-face {
  font-family: "Noto Sans SC";
  src: url("/fonts/NotoSansSC-Variable.woff2") format("woff2");
  font-display: swap;
  font-weight: 100 900;
}

@font-face {
  font-family: "Montserrat";
  src: url("/fonts/Montserrat-Variable.woff2") format("woff2");
  font-display: swap;
  font-weight: 100 900;
}

:root {
  color-scheme: light;
  --ink: #222;
  --muted: #888;
  --subtle: #aaa;
  --canvas: #fff;
  --line: #999;
  --line-light: #d7d7d7;
  --green: #00d66f;
  --green-soft: rgba(0, 214, 111, .28);
  --lime: #d1ff02;
  --danger: #b74343;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--canvas); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Noto Sans SC", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
img { display: block; max-width: 100%; }
a { color: inherit; }

.boot-screen,
.page-state {
  min-height: 60vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--muted);
}

.boot-mark { display: none; }
.site-shell { min-height: 100vh; }

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  width: min(1320px, calc(100% - 120px));
  min-height: 100px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
}

.brand-block { display: flex; align-items: center; gap: 34px; }
.brand { display: inline-flex; align-items: center; border: 0; padding: 0; color: var(--ink); background: transparent; }
.brand-mark { display: none; }
.brand-word { font-family: Montserrat, sans-serif; font-size: 32px; font-weight: 750; letter-spacing: -.04em; line-height: 1; }
.site-tagline { color: var(--ink); font-size: 14px; white-space: nowrap; }
.topnav { display: flex; align-items: center; gap: 13px; }
.nav-link, .text-button { border: 0; padding: 4px 0; color: var(--ink); background: transparent; font-size: 14px; white-space: nowrap; }
.nav-link:hover, .nav-link:focus-visible, .text-button:hover, .text-button:focus-visible { text-decoration: underline; }
.nav-icons { display: inline-flex; align-items: center; gap: 15px; margin-left: 13px; }
.nav-icon { display: grid; place-items: center; width: 20px; height: 20px; border: 0; padding: 0; background: transparent; }
.nav-icon img { width: 16px; height: 16px; object-fit: contain; }
.user-pill { display: inline-flex; align-items: center; gap: 8px; border: 0; padding: 0; color: var(--ink); background: transparent; }
.avatar { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--ink); border-radius: 50%; color: var(--ink); background: var(--canvas); font-family: Montserrat, sans-serif; font-size: 10px; font-weight: 700; }
.content { width: 100%; margin: 0 auto; padding-bottom: 80px; }
.eyebrow, .section-kicker { color: var(--ink); font-family: Montserrat, "Noto Sans SC", sans-serif; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.25; }

/* The homepage follows the Figma canvas: a narrow filter rail and a four-column artwork wall. */
.home-layout { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 92px; width: min(1336px, calc(100% - 104px)); margin: 19px auto 0; }
.home-sidebar { width: 120px; }
.filter-section { margin-bottom: 29px; }
.filter-section-title { display: flex; align-items: center; justify-content: space-between; min-height: 40px; padding: 0 9px; font-size: 14px; font-weight: 700; }
.filter-section-title button { border: 0; padding: 0; color: var(--ink); background: transparent; }
.filter-options { display: grid; gap: 2px; }
.filter-chip { display: block; width: 120px; min-height: 40px; border: 0; border-radius: 0; padding: 0 10px; color: var(--ink); background: transparent; font-size: 12px; text-align: left; }
.filter-chip:hover, .filter-chip:focus-visible { background: #f1f1f1; }
.filter-chip.is-active { color: var(--ink); background: var(--green); }
.home-results { min-width: 0; }
.sort-row { display: flex; justify-content: flex-end; align-items: center; min-height: 40px; color: var(--ink); font-size: 12px; }
.result-count { color: var(--muted); }
.template-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 240px)); justify-content: space-between; column-gap: 25px; row-gap: 43px; padding-top: 16px; }
.template-card { min-width: 0; border: 0; background: transparent; }
.template-card-button { display: block; width: 100%; border: 0; padding: 0; color: inherit; background: transparent; text-align: left; }
.template-cover { width: 100%; aspect-ratio: 3 / 4; background: transparent; }
.template-cover img { width: 100%; height: 100%; object-fit: cover; transition: opacity .18s ease; }
.template-card-button:hover .template-cover img { opacity: .84; }
.template-cover-fallback { display: grid; place-items: center; width: 100%; height: 100%; color: var(--subtle); background: #f1f1f1; font-family: Montserrat, sans-serif; font-size: 40px; }
.template-info { padding-top: 10px; }
.template-title { margin-bottom: 7px; color: var(--ink); font-size: 13px; font-weight: 600; }
.template-info h3, .template-technique { display: none; }
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 7px; }
.tag, .status-chip { display: inline-flex; align-items: center; min-height: 22px; border: 1px solid var(--line); border-radius: 0; padding: 0 8px; color: var(--ink); background: var(--canvas); font-size: 10px; font-weight: 400; white-space: nowrap; }
.template-action { color: #555; font-size: 12px; }
.template-action::after { content: "  ▸"; color: var(--ink); }
.empty-box { border: 1px dashed var(--line); padding: 48px 24px; color: var(--muted); text-align: center; }
.empty-box strong { display: block; margin-bottom: 6px; color: var(--ink); font-weight: 600; }

/* Reusable artwork frame: real frame face, mitred corners, bevelled mat and artwork stay separate. */
.art-frame {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: var(--frame-ratio, 3 / 4);
  overflow: hidden;
  background: var(--mat-color, #f8f6f0);
  box-shadow: 0 8px 18px rgba(64, 53, 40, .1), 0 2px 4px rgba(64, 53, 40, .06);
  isolation: isolate;
}
.art-frame--card, .art-frame--task, .art-frame--thumb { --frame-width: 6px; --mat-width: clamp(14px, 1.7vw, 24px); --mat-cut-width: clamp(2px, .5vw, 4px); }
.art-frame--detail, .art-frame--result { --frame-width: 13px; --mat-width: clamp(22px, 3.2vw, 42px); --mat-cut-width: 4px; }
.art-frame .artwork {
  position: absolute;
  top: calc(var(--frame-width) + var(--mat-width));
  left: calc(var(--frame-width) + var(--mat-width));
  z-index: 1;
  display: block;
  width: calc(100% - var(--frame-width) - var(--mat-width) - var(--frame-width) - var(--mat-width));
  height: calc(100% - var(--frame-width) - var(--mat-width) - var(--frame-width) - var(--mat-width));
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #f7f3ea;
  object-fit: cover;
  object-position: center;
}
.art-frame .artwork-fallback { display: grid; place-items: center; color: var(--subtle); font-size: 12px; }
.frame-svg { position: absolute; inset: 0; z-index: 3; display: block; width: 100%; height: 100%; pointer-events: none; }
.frame-piece { fill: var(--frame-base, #3a3a3a); shape-rendering: geometricPrecision; }
.mitre-seam { fill: none; stroke: rgba(0, 0, 0, .38); stroke-linecap: square; stroke-opacity: .42; stroke-width: 1; vector-effect: non-scaling-stroke; }
.frame-edge-shadow { fill: none; stroke: var(--frame-edge-shadow, rgba(20, 20, 20, .36)); stroke-linecap: square; filter: blur(1.15px); pointer-events: none; vector-effect: non-scaling-stroke; }
.frame-edge-shadow[data-frame-shadow="top"], .frame-edge-shadow[data-frame-shadow="left"] { stroke-opacity: 1; stroke-width: 2.2; }
.frame-edge-shadow[data-frame-shadow="right"], .frame-edge-shadow[data-frame-shadow="bottom"] { stroke: var(--frame-edge-highlight, rgba(220, 220, 220, .34)); stroke-opacity: 1; stroke-width: 2; }
.mat-cut { shape-rendering: geometricPrecision; }
.mat-cut[data-mat-tone="dark"] { fill: color-mix(in srgb, var(--mat-color, #f8f6f0) 84%, #777 16%); }
.mat-cut[data-mat-tone="light"] { fill: color-mix(in srgb, var(--mat-color, #f8f6f0) 94%, white 6%); }

/* Template detail and upload flow. */
.detail-head { width: min(1180px, calc(100% - 60px)); margin: 38px auto 34px; }
.back-button { display: inline-flex; align-items: center; border: 0; padding: 0; color: var(--ink); background: transparent; font-size: 14px; }
.back-button:hover { text-decoration: underline; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 540px) minmax(0, 548px); gap: 92px; align-items: start; width: min(1180px, calc(100% - 60px)); margin: 0 auto; }
.gallery-panel { display: block; min-width: 0; }
.gallery-main { width: 100%; background: transparent; }
.gallery-main .art-frame, .result-image .art-frame, .task-preview .art-frame { height: auto; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(5, 88px); gap: 25px; margin-top: 20px; }
.gallery-thumb { overflow: hidden; width: 88px; height: 88px; border: 0; padding: 0; background: #f1f1f1; opacity: .45; }
.gallery-thumb.is-active { outline: 2px solid var(--lime); opacity: 1; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.detail-copy { min-width: 0; padding-top: 0; }
.detail-style-line { margin: 3px 0 12px; color: var(--ink); font-size: 14px; font-weight: 700; }
.detail-description { max-width: 548px; margin-bottom: 28px; color: var(--ink); font-size: 12px; line-height: 2; }
.suitable-title { margin: 0 0 7px; font-size: 14px; font-weight: 700; }
.suitable-copy { margin: 0; font-size: 12px; line-height: 1.9; }
.work-card { margin-top: 29px; padding: 0; border: 0; background: transparent; }
.work-card h2, .work-subtitle { display: none; }
.control-block { margin-top: 0; }
.control-label { display: flex; align-items: baseline; gap: 18px; margin-bottom: 14px; color: var(--ink); font-size: 14px; font-weight: 700; }
.control-label small { color: var(--muted); font-size: 12px; font-weight: 400; }
.size-grid { display: grid; gap: 15px; }
.size-row { display: grid; grid-template-columns: 72px repeat(3, 85px); gap: 20px; align-items: center; }
.size-direction { font-size: 12px; font-weight: 700; }
.size-choice { width: 85px; height: 30px; border: 1px solid var(--line); border-radius: 0; padding: 0; color: var(--ink); background: var(--canvas); font-size: 12px; }
.size-choice:hover { border-color: var(--ink); }
.size-choice.is-selected { border-color: var(--green); background: var(--green); }
.size-choice strong { font-size: 12px; font-weight: 400; }
.size-choice span { display: none; }
.upload-zone { position: relative; display: grid; min-height: 160px; margin-top: 30px; border: 1px dashed #777; padding: 5px; background: #fbfcfc; text-align: left; transition: border-color .2s ease, background .2s ease; }
.upload-zone:hover, .upload-zone.is-dragging { border-color: var(--green); background: #f2fff8; }
.upload-zone input { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; opacity: 0; }
.upload-placeholder, .upload-preview { display: flex; align-items: center; gap: 84px; min-height: 150px; padding: 0; }
.upload-sample, .upload-preview img, .upload-icon { display: grid; place-items: center; flex: 0 0 150px; width: 150px; height: 150px; color: var(--subtle); background: linear-gradient(145deg, #e5efea, #d8e9dc 48%, #f1c576 49%, #df9860); font-family: Montserrat, sans-serif; font-size: 22px; object-fit: cover; }
.upload-preview { gap: 18px; }
.upload-preview img { border-radius: 0; }
.upload-preview strong { display: block; overflow: hidden; max-width: 280px; margin-bottom: 4px; text-overflow: ellipsis; white-space: nowrap; }
.upload-preview span { color: var(--muted); font-size: 12px; }
.upload-copy { min-width: 0; }
.upload-title { display: block; margin-bottom: 9px; color: var(--ink); font-size: 14px; font-weight: 600; }
.upload-hint { display: block; color: var(--muted); font-size: 12px; line-height: 1.8; }
.generate-row { display: block; margin-top: 20px; }
.quota-note { display: block; min-height: 0; margin-bottom: 7px; color: var(--muted); font-size: 12px; }
.quota-note strong { color: var(--ink); font-weight: 700; }
.primary-button, .secondary-button, .danger-button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; border-radius: 0; padding: 0 20px; font-size: 14px; transition: background .18s ease, border-color .18s ease, opacity .18s ease; }
.primary-button { border: 1px solid var(--green); color: var(--ink); background: var(--green); }
.primary-button:hover:not(:disabled) { background: #24e487; }
.primary-button:disabled { opacity: .3; }
.secondary-button { border: 1px solid var(--line); color: var(--ink); background: var(--canvas); }
.secondary-button:hover:not(:disabled) { border-color: var(--ink); }
.danger-button { border: 1px solid var(--danger); color: var(--danger); background: var(--canvas); }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.generate-row .primary-button { width: 100%; height: 64px; }
.service-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 13px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.service-dot { flex: 0 0 auto; width: 7px; height: 7px; margin-top: 6px; background: var(--muted); }
.service-dot.is-ready { background: var(--green); }
.validation-note { margin: 12px 0 0; color: var(--danger); font-size: 12px; }

/* Background task and result states keep the same white canvas and geometry. */
.task-shell { display: grid; grid-template-columns: 200px minmax(0, 548px); gap: 116px; align-items: start; width: min(864px, calc(100% - 60px)); margin: 39px auto 0; }
.task-shell > .eyebrow, .task-shell > h1, .task-shell > .lede, .task-shell > .progress-track, .task-shell > .task-steps, .task-shell > .task-id, .task-shell > .button-row { grid-column: 2; }
.task-preview { grid-column: 1; grid-row: 1 / span 8; width: 200px; background: transparent; }
.task-preview img { width: 100%; height: 100%; object-fit: cover; }
.task-shell h1 { margin: 7px 0 13px; font-size: 30px; font-weight: 700; }
.task-shell .lede { margin-bottom: 0; color: var(--ink); font-size: 14px; line-height: 1.9; }
.task-id { color: var(--muted); font-family: Montserrat, sans-serif; font-size: 11px; overflow-wrap: anywhere; }
.progress-track { height: 3px; margin: 28px 0 20px; overflow: hidden; background: var(--line-light); }
.progress-bar { width: 35%; height: 100%; background: var(--green); animation: progress-slide 1.7s ease-in-out infinite; }
@keyframes progress-slide { 0% { transform: translateX(-120%); } 100% { transform: translateX(340%); } }
.task-steps { display: grid; gap: 9px; }
.task-step { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.task-step::before { content: ""; width: 7px; height: 7px; border: 1px solid var(--muted); border-radius: 50%; }
.task-step.is-current { color: var(--ink); }
.task-step.is-current::before, .task-step.is-done::before { border-color: var(--green); background: var(--green); }
.task-step.is-done { color: var(--ink); }

.result-shell { width: min(1180px, calc(100% - 60px)); margin: 38px auto 0; }
.result-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.result-head h1 { max-width: 760px; margin: 7px 0 0; font-size: 32px; font-weight: 700; }
.result-meta { color: var(--muted); font-size: 12px; }
.result-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 30px; }
.result-image { overflow: visible; background: transparent; }
.result-image img { width: 100%; max-height: 720px; object-fit: contain; background: #f1f1f1; }
.result-side { display: grid; align-content: start; gap: 14px; }
.result-card, .account-card, .share-card { border: 1px solid var(--line-light); background: var(--canvas); }
.result-card { padding: 20px; }
.result-card h3 { margin-bottom: 8px; font-size: 17px; }
.result-card p { margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.result-card .button-row { margin-top: 15px; }
.artwork-label { display: inline-flex; margin-bottom: 11px; color: var(--ink); font-size: 12px; }
.space-preview { margin-top: 18px; }
.space-preview .result-image img { max-height: 360px; }
.order-select { width: 100%; margin-top: 12px; border: 1px solid var(--line); border-radius: 0; padding: 11px 12px; color: var(--ink); background: var(--canvas); }
.price-line { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; color: var(--muted); font-size: 13px; }
.price-line strong { color: var(--ink); font-family: Montserrat, sans-serif; font-size: 15px; font-weight: 600; }
.status-chip.is-warn { color: var(--danger); border-color: var(--danger); background: var(--canvas); }

/* Account, order and share views are functional views on the same design system. */
.account-head, .account-tabs, .account-grid, .order-detail, .share-shell { width: min(1180px, calc(100% - 60px)); margin-left: auto; margin-right: auto; }
.account-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 38px 0 28px; }
.account-profile { display: flex; align-items: center; gap: 15px; }
.account-profile .avatar { width: 42px; height: 42px; font-size: 15px; }
.account-profile h1 { margin: 3px 0 3px; font-size: 24px; font-weight: 700; }
.account-id { color: var(--muted); font-family: Montserrat, sans-serif; font-size: 11px; overflow-wrap: anywhere; }
.quota-box { display: flex; gap: 12px; width: min(1180px, calc(100% - 60px)); margin: 0 auto 22px; }
.quota-item { min-width: 180px; border: 1px solid var(--line-light); padding: 13px; }
.quota-item span { display: block; color: var(--muted); font-size: 12px; }
.quota-item strong { display: block; margin-top: 5px; color: var(--ink); font-family: Montserrat, sans-serif; font-size: 20px; font-weight: 600; }
.account-tabs { display: flex; gap: 25px; border-bottom: 1px solid var(--line); }
.account-tab { border: 0; border-bottom: 2px solid transparent; padding: 11px 0; color: var(--muted); background: transparent; font-size: 13px; }
.account-tab.is-active { border-color: var(--green); color: var(--ink); }
.account-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); gap: 18px; padding-top: 22px; }
.account-card { padding: 20px; }
.account-card h2 { margin-bottom: 6px; font-size: 20px; }
.account-card .card-caption { margin-bottom: 16px; color: var(--muted); font-size: 13px; }
.artwork-list, .order-list { display: grid; gap: 10px; }
.artwork-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 13px; align-items: center; border: 1px solid var(--line-light); padding: 9px; color: var(--ink); background: var(--canvas); text-align: left; }
.artwork-row img { width: 74px; height: 74px; object-fit: cover; background: #f1f1f1; }
.artwork-row h3 { margin-bottom: 4px; font-size: 15px; }
.artwork-row p { margin: 0; color: var(--muted); font-size: 12px; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { min-width: 0; flex: 1; }
.profile-form { display: grid; gap: 10px; }
.order-row { display: flex; justify-content: space-between; gap: 14px; border: 0; border-bottom: 1px solid var(--line-light); padding: 11px 0; color: var(--ink); background: transparent; text-align: left; }
.order-row:last-child { border-bottom: 0; }
.order-row strong { display: block; margin-bottom: 4px; font-family: Montserrat, sans-serif; font-size: 12px; font-weight: 600; }
.order-row span { color: var(--muted); font-size: 13px; }
.order-detail { margin-top: 38px; }
.order-detail-header { display: flex; justify-content: space-between; gap: 18px; align-items: start; margin: 29px 0 20px; }
.order-detail h1 { margin: 7px 0 6px; font-size: 30px; }
.order-number { color: var(--muted); font-family: Montserrat, sans-serif; font-size: 11px; }
.timeline { display: grid; gap: 0; margin-top: 14px; }
.timeline-item { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; padding-bottom: 18px; }
.timeline-item::before { content: ""; position: absolute; top: 10px; bottom: 0; left: 6px; width: 1px; background: var(--line-light); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { position: relative; z-index: 1; width: 13px; height: 13px; margin-top: 3px; border: 1px solid var(--line); border-radius: 50%; background: var(--canvas); }
.timeline-item.is-current .timeline-dot { border-color: var(--green); background: var(--green); }
.timeline-item strong { display: block; margin-bottom: 2px; font-weight: 600; }
.timeline-item span { color: var(--muted); font-size: 13px; }
.share-shell { margin-top: 54px; }
.share-card { overflow: hidden; }
.share-visual { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-light); }
.share-visual .result-image { border-radius: 0; }
.share-copy { padding: 30px; }
.share-copy h1 { margin: 7px 0 10px; font-size: 30px; }
.share-copy p { color: var(--muted); }
.share-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0; }
.share-fact { border-top: 1px solid var(--line-light); padding-top: 9px; }
.share-fact span { display: block; color: var(--muted); font-size: 12px; }
.share-fact strong { display: block; margin-top: 3px; font-size: 14px; font-weight: 500; }

.field { display: grid; gap: 7px; }
.field label { color: var(--ink); font-size: 14px; }
.field input, .field select { width: 100%; border: 1px solid var(--line); border-radius: 0; padding: 12px 13px; outline: none; color: var(--ink); background: var(--canvas); }
.field input:focus, .field select:focus { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-soft); }
.field-hint { color: var(--muted); font-size: 12px; }
.field-error { color: var(--danger); font-size: 13px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: rgba(34, 34, 34, .28); }
.modal { width: min(440px, 100%); max-height: min(720px, calc(100vh - 40px)); overflow: auto; border: 1px solid var(--line); padding: 24px; background: var(--canvas); }
.modal-head { display: flex; justify-content: space-between; gap: 15px; align-items: start; margin-bottom: 20px; }
.modal-head h2 { margin-bottom: 5px; font-size: 24px; }
.modal-head p { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.close-button { border: 0; padding: 4px 7px; color: var(--ink); background: transparent; font-size: 22px; line-height: 1; }
.form-stack { display: grid; gap: 14px; }
.form-actions { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-top: 2px; }
.form-actions .primary-button { flex: 1; }
.auth-switch { border: 0; padding: 0; color: var(--ink); background: transparent; font-size: 13px; }
.auth-switch:hover { text-decoration: underline; }
.modal-message { border: 1px solid var(--danger); padding: 10px 12px; color: var(--danger); background: var(--canvas); font-size: 13px; }
.modal-message.is-success { border-color: var(--green); color: var(--ink); }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 40; max-width: min(420px, calc(100% - 44px)); border: 1px solid var(--line); padding: 12px 15px; color: var(--ink); background: var(--canvas); font-size: 14px; }
.toast.is-error { border-color: var(--danger); color: var(--danger); }

.turnstile-challenge { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(34, 34, 34, .28); }
.turnstile-challenge-card { display: grid; gap: 10px; width: min(360px, 100%); border: 1px solid var(--line); padding: 22px; background: var(--canvas); box-shadow: 0 12px 36px rgba(34, 34, 34, .12); }
.turnstile-challenge-card strong { font-size: 18px; }
.turnstile-challenge-card span { color: var(--muted); font-size: 13px; }
.turnstile-slot { min-height: 65px; }

@media (max-width: 1180px) {
  .topbar { width: min(100% - 60px, 1320px); }
  .home-layout { width: min(100% - 60px, 1100px); gap: 40px; }
  .template-grid { grid-template-columns: repeat(3, minmax(0, 240px)); }
  .detail-layout { grid-template-columns: minmax(0, 540px) minmax(0, 1fr); gap: 40px; }
}

@media (max-width: 820px) {
  .topbar { min-height: 76px; }
  .brand-block { gap: 16px; }
  .brand-word { font-size: 25px; }
  .site-tagline { font-size: 12px; }
  .nav-icons { display: none; }
  .home-layout { grid-template-columns: 100px minmax(0, 1fr); gap: 20px; width: calc(100% - 30px); }
  .home-sidebar, .filter-chip { width: 100px; }
  .template-grid { grid-template-columns: repeat(2, minmax(0, 240px)); justify-content: space-between; row-gap: 30px; }
  .detail-head, .detail-layout, .result-shell, .account-head, .account-tabs, .account-grid, .order-detail, .share-shell { width: calc(100% - 30px); }
  .detail-layout { grid-template-columns: 1fr; gap: 30px; }
  .gallery-main { max-width: 540px; }
  .gallery-thumbs { grid-template-columns: repeat(5, minmax(0, 88px)); gap: 10px; }
  .detail-copy { max-width: 548px; }
  .task-shell { grid-template-columns: 1fr; gap: 20px; width: calc(100% - 30px); }
  .task-preview { grid-column: 1; grid-row: auto; width: min(200px, 100%); }
  .task-shell > .eyebrow, .task-shell > h1, .task-shell > .lede, .task-shell > .progress-track, .task-shell > .task-steps, .task-shell > .task-id, .task-shell > .button-row { grid-column: 1; }
  .result-grid, .account-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .topbar { width: calc(100% - 30px); }
  .site-tagline { display: none; }
  .topnav { gap: 8px; }
  .home-layout { grid-template-columns: 1fr; gap: 22px; }
  .home-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; width: 100%; }
  .filter-section { margin: 0; }
  .filter-chip { width: 100%; }
  .template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
  .size-row { grid-template-columns: 55px repeat(3, minmax(0, 1fr)); gap: 8px; }
  .size-choice { width: 100%; }
  .upload-placeholder, .upload-preview { gap: 14px; }
  .upload-sample, .upload-preview img, .upload-icon { flex-basis: 100px; width: 100px; height: 100px; }
  .upload-title { font-size: 12px; }
  .upload-hint { font-size: 11px; }
  .account-head { align-items: start; flex-direction: column; }
  .quota-box { width: calc(100% - 30px); }
  .quota-item { min-width: 0; flex: 1; }
  .account-tabs { overflow-x: auto; white-space: nowrap; }
  .artwork-row { grid-template-columns: 60px minmax(0, 1fr); }
  .artwork-row img { width: 60px; height: 60px; }
  .artwork-row .status-chip { grid-column: 2; justify-self: start; }
  .share-visual { grid-template-columns: 1fr; }
  .share-copy { padding: 23px; }
  .share-facts { grid-template-columns: 1fr 1fr; }
}

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