@font-face { font-family: Inter; src: url("/fonts/inter-cyrillic.woff2") format("woff2"); font-weight: 400 750; font-display: swap; unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: Inter; src: url("/fonts/inter-latin.woff2") format("woff2"); font-weight: 400 750; font-display: swap; unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
:root {
  color-scheme: light;
  --page:#f7f6f8; --surface:#fff; --soft:#f3f1f4; --hover:#eae6ec; --text:#272329; --muted:#655e69;
  --line:#dfdbe1; --stroke:#c7c1ca; --accent:#833c61; --accent-hover:#6c2b4e; --on-accent:#fff;
  --tint:#f4e7ee; --focus:#a54376; --danger:#a33044; --on-danger:#fff; --shadow:0 4px 20px #2e173109;
  --overlay:#20181dd4; --overlay-text:#fff; --photo-bg:#e8e3e7;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page:#17161a; --surface:#211f24; --soft:#2b282e; --hover:#37313a; --text:#f6f2f7; --muted:#bcb4c1;
  --line:#3c3740; --stroke:#655d6a; --accent:#edaccf; --accent-hover:#f7c5dd; --on-accent:#391b2d;
  --tint:#402d3b; --focus:#f6b5d4; --danger:#ec9da9; --on-danger:#33141b; --shadow:0 5px 20px #0002; --photo-bg:#302c32;
}
* { box-sizing:border-box; }
[hidden] { display:none!important; }
.access-required #studio,.access-required #works,.access-required .top nav {display:none}
#access-gate {max-width:36rem;margin:clamp(40px,10vh,100px) auto;display:grid;gap:18px}
#access-form {display:grid;gap:16px}
#access-code {display:block;width:100%;min-width:0;margin-top:6px;padding:12px;border:1px solid var(--stroke);border-radius:10px;background:var(--surface);font-size:16px}
#access-gate .outline,#access-form button {justify-self:start}
.catalog-batch {display:grid;gap:12px}
.catalog-item {min-width:0;border:1px solid var(--line);border-radius:12px;padding:12px}
.catalog-item legend {max-width:100%;overflow-wrap:anywhere;color:var(--muted)}
.catalog-frame {width:min(100%,180px);aspect-ratio:1;margin:0 auto;display:grid;place-items:center}
.catalog-frame img {width:100%;height:100%;object-fit:contain}
body { margin:0; background:var(--page); color:var(--text); font:15px/1.5 Inter,"Segoe UI",sans-serif; -webkit-font-smoothing:antialiased; }
button,input,select,textarea { font:inherit; color:inherit; }
button,a { touch-action:manipulation; -webkit-tap-highlight-color:transparent; }
button { cursor:pointer; }
button:disabled { cursor:default; opacity:.52; }
a { color:inherit; text-decoration:none; }
:focus-visible { outline:3px solid var(--focus); outline-offset:3px; }
h1,h2,h3,p { margin:0; }
h1,h2,h3 { line-height:1.16; text-wrap:balance; }
h1 { font-size:clamp(34px,4vw,56px); font-weight:650; letter-spacing:-.058em; }
h2 { font-size:clamp(23px,2.1vw,30px); font-weight:650; letter-spacing:-.045em; }
h3 { font-size:16px; }
.sr { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.symbols { position:absolute; width:0; height:0; overflow:hidden; pointer-events:none; }
.icon { display:block; width:19px; height:19px; flex:none; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }

.top { background:var(--surface); border-bottom:1px solid var(--line); }
.bar, main { max-width:1540px; padding-inline:clamp(20px,4vw,68px); margin:auto; }
.bar { height:76px; display:flex; align-items:center; gap:clamp(24px,4vw,62px); }
.brand { display:inline-flex; align-items:center; font-size:25px; font-weight:700; line-height:1; letter-spacing:-.075em; }
.brand>span:last-child { color:var(--accent); }
.brandmark { display:grid; place-items:center; width:37px; height:37px; margin-right:10px; color:#fff; background:#743752; border-radius:12px; }
.brandmark .icon { width:26px; height:26px; stroke-width:1.35; }
nav,.theme-switch,.tabs { display:flex; align-items:center; }
nav { gap:5px; }
nav a,.theme-switch button,.tabs button { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:42px; border:0; border-radius:10px; background:transparent; color:var(--muted); font-weight:550; }
nav a { padding:8px 15px; }
nav a[aria-current="page"] { color:var(--accent); background:var(--tint); }
#job-n:not(:empty),.tabs span:not(:empty),#source-n { padding:1px 7px; background:var(--soft); border-radius:7px; color:var(--muted); font-size:13px; font-weight:600; font-variant-numeric:tabular-nums; }
.theme-switch { gap:2px; padding:3px; margin-left:auto; border:1px solid var(--line); border-radius:13px; background:var(--soft); }
.theme-switch button { width:41px; min-height:36px; }
.theme-switch button[aria-pressed="true"],.tabs button[aria-pressed="true"] { background:var(--surface); color:var(--text); box-shadow:0 1px 5px #1d13221b; }
main { padding-bottom:65px; }
.page-title { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:18px; padding:clamp(27px,3.5vw,54px) 0 clamp(22px,2.8vw,40px); }
.page-title p { margin-top:8px; color:var(--muted); font-size:16px; }
.studio-intro { flex:1 1 560px; max-width:780px; }
.studio-intro p { max-width:65ch; }
.motion-dialog { width:min(610px,95vw); }
.motion-stage { height:min(48dvh,440px); background:var(--photo-bg); border-radius:12px; overflow:hidden; }
.motion-stage > :is(canvas,video,img) { display:block; width:100%; height:100%; object-fit:contain; }
.motion-status { margin:10px 0; color:var(--muted); }
.credit-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.credit { padding:9px 14px; border-radius:24px; background:var(--tint); color:var(--accent); font-weight:650; }
.layout { display:grid; grid-template-columns:minmax(0,1fr) clamp(300px,25vw,360px); grid-template-rows:auto 1fr; grid-template-areas:"refs sources" "refs order"; align-items:start; gap:16px clamp(20px,2.6vw,40px); }
.mobile-steps { display:none; }
.gallery {grid-area:refs} #source-panel {grid-area:sources} #order-panel {grid-area:order}
.gallery,.panel { min-width:0; }
.section-top { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.catalog-actions { display:flex; justify-content:flex-end; gap:6px; flex-wrap:wrap; }
.catalog-field { margin:10px 0; }
.catalog-field input { display:block; box-sizing:border-box; width:100%; margin-top:5px; padding:8px; color:var(--text); background:var(--surface); border:1px solid var(--line); border-radius:8px; }
.catalog-upload-preview { display:block; max-width:100%; max-height:160px; margin:auto; border-radius:8px; }
.outline,.text-btn,.primary,.danger,.icon-action { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:42px; border:1px solid var(--line); padding:8px 13px; border-radius:11px; background:var(--surface); color:var(--text); font-size:14px; font-weight:600; line-height:1.3; text-align:center; text-decoration:none; }
.text-btn { background:var(--soft); border-color:transparent; }
.primary,.danger { padding:11px 17px; font-size:15px; min-height:46px; }
.primary { color:var(--on-accent); background:var(--accent); border-color:transparent; }
.danger { color:var(--on-danger); background:var(--danger); border-color:transparent; }
.icon-action { width:42px; height:42px; flex:none; padding:0; }
.icon-action.on-photo,.source-remove { color:var(--overlay-text); background:var(--overlay); border:1px solid #fff5; box-shadow:0 2px 8px #0002; }
.selection-bar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; margin:18px 0 16px; }
.tabs { flex-wrap:wrap; gap:3px; padding:4px; border-radius:13px; background:var(--soft); border:1px solid var(--line); }
.tabs button { font-size:14px; padding:7px 13px; min-height:37px; }
.catalog-filters { display:grid; grid-template-columns:minmax(140px,1.45fr) minmax(0,1fr) minmax(0,1fr); gap:10px; }
.catalog-filters label,.format-label,.edit-label { display:block; color:var(--muted); font-size:14px; font-weight:550; min-width:0; }
select,input[type="search"],textarea { display:block; max-width:100%; width:100%; margin-top:6px; padding:10px 12px; min-height:43px; border:1px solid var(--stroke); border-radius:10px; background:var(--surface); color:var(--text); font-size:15px; font-weight:450; }
input::placeholder,textarea::placeholder { color:var(--muted); opacity:1; }
.search-field { position:relative; display:block; }
.search-field .icon { position:absolute; top:50%; left:12px; transform:translateY(-50%); width:17px; }
.search-field input { padding-left:38px; }
.catalog-count,.viewer-controls,.work-actions,.dialog-actions,.source-actions,.ref-controls,.photo-toolbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.catalog-count { margin:12px 0; min-height:36px; color:var(--muted); font-size:14px; }
.cards,.jobs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:22px 15px; }
.card,.job { min-width:0; position:relative; }
.card-select,.result-thumb { display:block; width:100%; padding:0; border:0; background:transparent; text-align:left; border-radius:14px; }
.card-photo,.work-photo { display:block; overflow:hidden; position:relative; border-radius:15px; background:var(--photo-bg); }
.card-photo { aspect-ratio:4/3; }
.ref-delete-layer {position:absolute;inset:0 0 auto;aspect-ratio:4/3;pointer-events:none}
.ref-delete-layer .ref-delete {position:absolute;right:7px;bottom:7px;pointer-events:auto;border-radius:50%;color:white;background:#261820ed}
.card-photo img,.source img,.lib-choice img,.result-thumb img { display:block; width:100%; height:100%; object-fit:cover; }
.card-photo img { object-fit:contain; transition:transform .19s ease; }
.card-select[aria-pressed="true"] .card-photo { outline:3px solid var(--accent); outline-offset:-3px; }
.card-select[aria-pressed="true"] .card-photo::after { content:""; position:absolute; inset:0; border:3px solid var(--accent); border-radius:inherit; pointer-events:none; }
.tick { position:absolute; z-index:1; top:9px; left:9px; width:30px; height:30px; display:grid; place-items:center; border:1px solid #fff9; border-radius:50%; color:#fff; background:var(--overlay); }
.tick .icon { width:17px; }
.card-select[aria-pressed="true"] .tick { background:var(--accent); color:var(--on-accent); }
.preview-action,.work-remove { position:absolute; top:7px; right:7px; border-radius:50%; }
.card-title { display:block; margin-top:10px; padding:0 1px; color:var(--text); font-size:clamp(16px,1.2vw,19px); font-weight:630; letter-spacing:-.026em; line-height:1.3; overflow-wrap:anywhere; }
.ref-meta,.count,.field-hint,.review-row small,.job small,.job p { color:var(--muted); font-size:14px; }
.ref-meta { display:block; margin:4px 1px; }
.ref-controls { margin-top:6px; }
.stepper { display:inline-flex; align-items:center; border:1px solid var(--line); border-radius:9px; overflow:hidden; background:var(--surface); }
.stepper button { width:36px; height:36px; font-size:18px; border:0; background:none; }
.stepper output { min-width:20px; text-align:center; }
.field-hint { margin-top:8px; line-height:1.5; }
.field-hint:empty { display:none; }
#more-refs { display:flex; margin:22px auto 0; }
.panel,.job { border:1px solid var(--line); border-radius:18px; background:var(--surface); box-shadow:var(--shadow); }
.panel { padding:clamp(17px,1.6vw,25px); }
.panel h2 { font-size:20px; letter-spacing:-.04em; }
.panel>section+section { border-top:1px solid var(--line); margin-top:22px; padding-top:20px; }
#drop { display:grid; justify-items:center; align-content:center; gap:2px; width:100%; margin-top:15px; padding:17px 7px; background:var(--soft); border:1px dashed var(--stroke); border-radius:13px; }
#drop.drag { background:var(--tint); border-color:var(--accent); }
#drop strong { font-size:15px; font-weight:620; }
#drop small { font-size:14px; color:var(--muted); }
.photo-transfer {display:grid;gap:4px;min-width:0;margin:10px 0;padding:12px 14px;background:var(--tint);border-radius:12px}
.transfer-heading {display:flex;align-items:baseline;justify-content:space-between;gap:8px;font-variant-numeric:tabular-nums}
.transfer-file {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:14px}
.transfer-track {height:5px;margin-top:5px;overflow:hidden;border-radius:4px;background:var(--stroke)}
.transfer-track span {display:block;height:100%;border-radius:inherit;background:var(--accent)}
.transfer-track:not([aria-valuenow]) span {width:38%;animation:transfer-slide 1.4s ease-in-out infinite alternate}
@keyframes transfer-slide {from{transform:translateX(0)}to{transform:translateX(163%)}}
.upload-icon { display:grid; place-items:center; width:38px; height:38px; border-radius:12px; margin-bottom:5px; background:var(--tint); color:var(--accent); }
.sources { display:flex; flex-wrap:wrap; gap:10px; margin-top:14px; }
.sources:empty { display:none; }
.source-tile { position:relative; padding:4px 7px 0 0; }
.source { display:block; width:65px; height:76px; padding:0; border:0; border-radius:10px; overflow:hidden; background:var(--soft); }
.source[aria-pressed="true"] { outline:2px solid var(--accent); outline-offset:2px; }
.source-remove { position:absolute; top:-4px; right:-4px; width:30px; height:30px; min-height:30px; border-radius:50%; }
.source-remove .icon { width:15px; height:15px; }
.source-info { color:var(--muted); font-size:14px; overflow-wrap:anywhere; margin:9px 0; }
#choose-library { margin-top:10px; }
.settings select { margin-top:13px; }
.summary>div { display:flex; justify-content:space-between; align-items:baseline; gap:10px; margin-bottom:6px; }
.summary>div span { color:var(--muted); }
#order-cost { font-size:20px; letter-spacing:-.04em; }
#review { width:100%; justify-content:space-between; margin:11px 0 0; }
.notice,.empty { border:1px solid var(--line); border-radius:14px; background:var(--surface); padding:17px; color:var(--muted); }
.notice { margin-top:15px; }.notice button { margin-left:8px; }
.empty,.failed-jobs { grid-column:1/-1; }
.jobs { grid-template-columns:repeat(auto-fill,minmax(min(236px,100%),1fr)); }
.job { overflow:hidden; padding:11px; }
.result-thumb { cursor:zoom-in; border-radius:12px; aspect-ratio:4/4.6; overflow:hidden; }
.work-preview { opacity:0; }
.work-preview.ready { opacity:1; }
.job>strong { display:block; font-size:17px; letter-spacing:-.022em; margin:11px 3px 2px; overflow-wrap:anywhere; }
.job>small,.job>p { display:block; margin:3px; }
.work-actions { margin:10px 2px 1px; }
.work-actions small { margin-right:auto; }
.job.pending::before { content:""; display:block; width:24px; height:24px; border:2px solid var(--line); border-top-color:var(--accent); border-radius:50%; animation:spin 1.1s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.edit-caption { overflow-wrap:anywhere; }
.failed-jobs { padding:14px 0; border-top:1px solid var(--line); color:var(--muted); }
.failed-jobs summary { cursor:pointer; width:fit-content; padding:9px 0; }.failed-jobs .jobs { margin-top:12px; }
.error,.job .error { color:var(--danger); }
#toast { display:none; position:fixed; z-index:10; inset:auto 16px calc(18px + env(safe-area-inset-bottom)); width:max-content; max-width:min(450px,calc(100% - 32px)); margin:auto; padding:12px 18px; border-radius:13px; color:var(--page); background:var(--text); box-shadow:var(--shadow); }
#toast.visible { display:block; }

dialog { padding:22px; width:470px; max-width:calc(100% - 24px); max-height:90dvh; overflow:auto; border:1px solid var(--line); border-radius:19px; color:var(--text); background:var(--surface); box-shadow:0 14px 80px #0003; }
dialog::backdrop { background:#18131b8a; }
.dialog-top,.photo-toolbar { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.dialog-top { margin-bottom:17px; }
.dialog-top h2 { font-size:24px; overflow-wrap:anywhere; }
.dialog-actions { margin-top:18px; }
.remove-preview { display:block; max-height:150px; max-width:100%; border-radius:9px; margin:0 0 12px; }
.lib { display:flex; flex-wrap:wrap; gap:10px; }
.lib-choice { width:93px; height:108px; padding:0; overflow:hidden; border:1px solid var(--line); border-radius:10px; background:var(--soft); }
.review-row { padding:12px 0; border-bottom:1px solid var(--line); }.review-row small { display:block; margin-top:3px; }
.preview-ref { display:block; width:100%; max-height:64dvh; object-fit:contain; border-radius:11px; background:var(--photo-bg); }
.frame-pair { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:12px; margin:12px 0; }
.frame-preview { min-width:0; margin:0; }
.frame-image { position:relative; width:100%; aspect-ratio:4/3; overflow:hidden; background:var(--photo-bg); border-radius:9px; }
.frame-image img { display:block; width:100%; height:100%; object-fit:contain; }
.frame-image.cropped img { position:absolute; max-width:none; object-fit:fill; }
.frame-preview figcaption { margin-top:5px; color:var(--muted); font-size:14px; }
.review-styles { display:grid; gap:8px; }
.crop-stage { position:relative; width:min(100%,270px); aspect-ratio:3/4; margin:auto; overflow:hidden; background:var(--photo-bg); touch-action:none; cursor:grab; border-radius:9px; }
.crop-stage img { position:absolute; max-width:none; user-select:none; pointer-events:none; }
.crop-stage::after { content:""; position:absolute; inset:0; pointer-events:none; background:linear-gradient(to right,transparent 33%,#fff8 33.1%,transparent 33.6%,transparent 66%,#fff8 66.1%,transparent 66.6%),linear-gradient(to bottom,transparent 33%,#fff8 33.1%,transparent 33.6%,transparent 66%,#fff8 66.1%,transparent 66.6%); }
.zoom { display:flex; align-items:center; gap:10px; margin-top:12px; }
.zoom input { width:100%; accent-color:var(--accent); }
.format-label { margin-bottom:12px; }
.edit-label textarea { font-size:16px; resize:vertical; min-height:90px; }
dialog.photo-dialog { width:min(1050px,95vw); max-width:95vw; max-height:94dvh; }
.result-stage { position:relative; height:clamp(150px,58dvh,680px); overflow:auto; overscroll-behavior:contain; background:var(--photo-bg); border-radius:11px; touch-action:manipulation; }
.result-surface { display:grid; place-items:center; width:max-content; min-width:100%; min-height:100%; }
.result-stage img { display:block; max-width:none; max-height:none; height:auto; user-select:none; cursor:zoom-out; }
.result-stage.fitted { overflow:hidden; }
.result-stage.fitted img { cursor:zoom-in; }
.result-stage.dragging,.result-stage.dragging img { cursor:grabbing; }
.zoom-scale { font-size:14px; font-variant-numeric:tabular-nums; color:var(--muted); }
.viewer-controls,.photo-toolbar { margin-top:10px; }
.photo-toolbar .viewer-controls,.photo-toolbar .work-actions { margin:0; }
.compare-frame { position:relative; }
.compare-choices { position:absolute; top:9px; left:50%; transform:translateX(-50%); display:flex; gap:2px; width:max-content; max-width:calc(100% - 12px); padding:3px; background:#211921de; border:1px solid #ffffff52; border-radius:12px; }
.compare-choices button { padding:7px 11px; min-height:38px; border:0; border-radius:8px; background:transparent; color:white; font-size:14px; font-weight:600; }
.compare-choices button[aria-pressed="true"] { background:#fff; color:#29212a; }
.compare-choices button:disabled { color:#ddd6da; opacity:.72; }
.compare-notice { color:var(--muted); font-size:14px; margin-top:8px; }.compare-notice:empty { display:none; }
.viewer-controls [aria-pressed=true] { background:var(--tint); color:var(--accent); }
.picks-view { display:block; }
.selection-group { padding:12px 0; }.selection-group+.selection-group { border-top:1px solid var(--line); }
.selection-group h3 { font-size:14px; font-weight:600; color:var(--muted); overflow-wrap:anywhere; }
.selection-line { display:grid; grid-template-columns:44px minmax(0,1fr) 42px; align-items:center; gap:3px 9px; margin:10px 0; }
.selection-line img { grid-row:1/3; width:44px; height:58px; object-fit:cover; border-radius:7px; }
.pick-name { font-size:15px; line-height:1.3; font-weight:550; overflow-wrap:anywhere; }
.selection-line select { grid-column:2; grid-row:2; width:fit-content; max-width:100%; margin:0; padding:4px; min-height:34px; font-size:14px; }
.remove-pick { grid-column:3; grid-row:1/3; }
.picks-view .selection-group { border:1px solid var(--line); border-radius:14px; padding:14px; background:var(--surface); margin-bottom:10px; }
.edit-surface { position:relative; width:min(100%,var(--native-width,100%),calc(43dvh * var(--photo-ratio,1))); margin:10px auto; touch-action:none; cursor:crosshair; user-select:none; line-height:0; }
.edit-surface img { display:block; width:100%; height:auto; pointer-events:none; }
.edit-modes { width:fit-content; }
.edit-marks { position:absolute; inset:0; width:100%; height:100%; overflow:visible; pointer-events:none; }
.edit-marks polygon,.edit-marks polyline,.edit-marks circle { fill:#9b32615c; stroke:#fff; stroke-width:2px; vector-effect:non-scaling-stroke; filter:drop-shadow(0 0 1px #171218); }
.edit-marks polyline { stroke-dasharray:5 3; }
.edit-regions .viewer-controls { justify-content:space-between; margin-bottom:12px; }
@media(hover:hover) {
  .outline:hover,.text-btn:hover,.icon-action:hover,.tabs button:hover,.theme-switch button:hover,nav a:hover,.stepper button:hover { background:var(--hover); color:var(--text); }
  .primary:hover:not(:disabled) { background:var(--accent-hover); }
  .on-photo:hover,.source-remove:hover { background:#211921; color:white; }
  .card-select:hover img { transform:scale(1.025); }
  #drop:hover { background:var(--tint); border-color:var(--accent); }
}
@media(max-width:1100px) {
  .cards { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:780px) {
  .bar,main { padding-inline:18px; }
  .bar { gap:18px; height:66px; }
  nav a { padding-inline:10px; }
  .layout { grid-template-columns:minmax(0,1fr); grid-template-rows:auto; grid-template-areas:"steps" "sources" "refs" "order"; }
  .panel { width:100%; }
  .mobile-steps {grid-area:steps;position:sticky;top:0;z-index:3;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;padding:4px;background:var(--surface);border:1px solid var(--line);border-radius:13px;box-shadow:var(--shadow)}
  .mobile-steps button {min-height:44px;min-width:0;padding:4px;border:0;border-radius:9px;background:transparent;color:var(--muted);font-size:14px;font-weight:600}
  .mobile-steps button[aria-current] {color:var(--accent);background:var(--tint)}
  #mobile-quantity:not(:empty) {padding:2px 5px;border-radius:6px;background:var(--soft);font-variant-numeric:tabular-nums}
  .layout>[tabindex] {scroll-margin-top:64px}
  #drop {grid-template-columns:auto auto;grid-template-rows:auto auto;justify-content:center;justify-items:start;gap:0 12px}
  #drop .upload-icon {grid-row:span 2;align-self:center;margin:0}
  .cards { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media(max-width:590px) {
  .bar { justify-content:space-between; height:60px; gap:6px; }
  .brand { font-size:24px; }.brandmark { width:34px; height:34px; }
  nav { position:fixed; z-index:4; left:0; right:0; bottom:0; justify-content:center; gap:12px; padding:6px 12px calc(6px + env(safe-area-inset-bottom)); border-top:1px solid var(--line); background:var(--surface); }
  nav a { min-height:44px; flex:1; max-width:220px; }
  main { padding-bottom:calc(80px + env(safe-area-inset-bottom)); }
  #toast { bottom:calc(69px + env(safe-area-inset-bottom)); }
  .theme-switch button { width:44px; min-height:44px; }
  .page-title { padding:24px 0 22px; gap:13px; }.page-title p { font-size:15px; }
  .credit-actions { gap:7px; }.credit { font-size:14px; }
  .layout { gap:16px; }
  .gallery>.section-top {display:grid;gap:10px}
  .catalog-actions {justify-content:start}
  .catalog-actions button {flex:1 1 120px;}
  .catalog-filters {min-width:0}
  .studio-intro h1 {font-size:clamp(27px,7.3vw,36px)}
  #choose-library {width:100%}
  .gallery>.field-hint {margin-bottom:10px}
  .cards,.jobs { grid-template-columns:repeat(2,minmax(0,1fr)); gap:17px 11px; }
  .catalog-filters { grid-template-columns:1fr 1fr; }.search-ref { grid-column:1/-1; }
  .selection-bar { gap:6px; }
  .selection-bar .tabs { display:grid; grid-template-columns:repeat(3,auto); gap:0; width:100%; }
  .tabs button { gap:4px; min-height:40px; padding:7px 4px; white-space:nowrap; }
  .ref-meta { font-size:13px; }
  .job { padding:7px; border-radius:13px; }.job>strong { font-size:16px; }
  .job .work-actions { gap:5px; }.job .work-actions small { width:100%; }
  .dialog-top h2 { font-size:21px; }.result-stage { height:55dvh; }
  .outline,.text-btn,.icon-action,.stepper button { min-height:44px; }
  .icon-action,.stepper button { min-width:44px; }
  .source-tile { padding:6px 6px 0 0; }
  .source-remove { min-width:36px; min-height:36px; }
  .source { width:70px; height:80px; }
  .selection-line { grid-template-columns:44px minmax(0,1fr) 44px; }
  input:not([type=file]),select,textarea,.selection-line select { font-size:16px; }
  .selection-line select {min-height:44px}
  .bar,main {padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right))}
  #access-gate {margin:24px auto;min-width:0;padding:20px;border:1px solid var(--line);border-radius:16px;background:var(--surface)}
  #access-gate h1 {font-size:28px}
  #access-gate .outline,#access-form button {width:100%}
  dialog {padding:15px;max-height:calc(100dvh - 24px - env(safe-area-inset-bottom))}
  .dialog-actions>button {flex:1 1 112px}
  .tabs button {min-height:44px}
  #works .jobs {grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr))}
  .job .work-actions {gap:8px}
}
@media(max-width:355px) {
  main,.bar { padding-inline:12px; } .tabs button { font-size:13px; padding-inline:3px; }
  .jobs { grid-template-columns:1fr; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { transition:none!important; animation:none!important; } }
