/* Jordan Canning order app: an editorial catalogue look, kept simple for customers.
   Hairline rules, sharp corners, gold crop marks for the chosen option, big pictures and few words.
   Factory identity from the 2026 catalogue: navy #001028 / #213469, paper #F0F0F8, gold accent;
   type: Readex Pro (Arabic), Bricolage Grotesque (codes and figures), DM Sans (English text).
   Light / dark on html[data-theme]; Arabic (rtl) / English (ltr) with logical properties only. */

:root {
    --f-ar: "Readex Pro", "DM Sans", system-ui, sans-serif;
    --f-en: "DM Sans", "Readex Pro", system-ui, sans-serif;
    --f-num: "Bricolage Grotesque", "DM Sans", "Readex Pro", system-ui, sans-serif;
    --ease: cubic-bezier(.22, .8, .12, 1);
    --hdr: 68px;
    --dock: 76px;
    --gut: clamp(16px, 3.2vw, 48px);
    --band-h: clamp(320px, 50vh, 560px);
}
html[data-theme="light"] {
    color-scheme: light;
    --bg: #F0F0F8;
    --paper: #FFFFFF;
    --ink: #001028;
    --ink-2: #26324F;
    --mute: #687089;
    --rule: rgba(0, 16, 40, .16);
    --rule-2: rgba(0, 16, 40, .08);
    --grid: rgba(33, 52, 105, .055);
    --hover: rgba(0, 16, 40, .03);
    --gold: #8E7535;
    --gold-line: #BAA260;
    --gold-wash: rgba(186, 162, 96, .14);
    --go: #001028;
    --go-ink: #F0F0F8;
    --go-hover: #213469;
    --plate: #FFFFFF;
    --die: #001028;
    --win: #6FAFCB;
    --err: #A8241C;
    --ok: #1C6E47;
    --shade: 0 1px 0 rgba(0, 16, 40, .04), 0 24px 60px -36px rgba(0, 16, 40, .35);
}
html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #001028;
    --paper: #031738;
    --ink: #F0F0F8;
    --ink-2: #C8CEE0;
    --mute: #8690AD;
    --rule: rgba(240, 240, 248, .17);
    --rule-2: rgba(240, 240, 248, .08);
    --grid: rgba(240, 240, 248, .045);
    --hover: rgba(240, 240, 248, .035);
    --gold: #CDB677;
    --gold-line: #CDB677;
    --gold-wash: rgba(205, 182, 119, .12);
    --go: #CDB677;
    --go-ink: #001028;
    --go-hover: #E2CF96;
    --plate: #031738;
    --die: #F0F0F8;
    --win: #5E9DBA;
    --err: #FF8F86;
    --ok: #7FD1A8;
    --shade: 0 30px 70px -40px rgba(0, 0, 0, .9);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; min-height: 100vh; min-height: 100dvh; overflow-x: hidden;
    font-family: var(--f-ar); font-size: 15.5px; line-height: 1.6; color: var(--ink); background: var(--bg);
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    transition: background-color .4s var(--ease), color .4s var(--ease);
}
html[lang="en"] body { font-family: var(--f-en); }
button, input, textarea { font: inherit; color: inherit; border-radius: 0; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
b, strong { font-weight: 600; }
::selection { background: var(--gold-wash); }
:focus-visible { outline: 1.5px solid var(--gold-line); outline-offset: 3px; }
.ic { width: 20px; height: 20px; flex: none; }
html[dir="rtl"] .ic.arrow, html[dir="ltr"] .ic.flip { transform: scaleX(-1); }

.code { font-family: var(--f-num); font-weight: 600; letter-spacing: -.03em; direction: ltr; unicode-bidi: isolate; }
.lbl { margin: 0; font-size: 11px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--mute); }
html[lang="ar"] .lbl { font-size: 13px; letter-spacing: 0; }
.logo {
    display: block; width: 156px; aspect-ratio: 600 / 135; background: var(--ink);
    -webkit-mask: url(../assets/logo.png) center / contain no-repeat; mask: url(../assets/logo.png) center / contain no-repeat;
}

/* crop marks: the printer's sign for "this one" */
.crop::after, .cell.on::after, .hbtn.on::after, .cat.on::after, .plate.dragover::after {
    content: ""; position: absolute; inset: 7px; pointer-events: none; z-index: 3;
    --c: var(--gold-line); --l: 16px; --w: 1.5px;
    background:
        linear-gradient(var(--c), var(--c)) top left / var(--l) var(--w), linear-gradient(var(--c), var(--c)) top left / var(--w) var(--l),
        linear-gradient(var(--c), var(--c)) top right / var(--l) var(--w), linear-gradient(var(--c), var(--c)) top right / var(--w) var(--l),
        linear-gradient(var(--c), var(--c)) bottom left / var(--l) var(--w), linear-gradient(var(--c), var(--c)) bottom left / var(--w) var(--l),
        linear-gradient(var(--c), var(--c)) bottom right / var(--l) var(--w), linear-gradient(var(--c), var(--c)) bottom right / var(--w) var(--l);
    background-repeat: no-repeat;
}

/* ---------- header ---------- */
.hdr {
    position: sticky; top: 0; z-index: 40; height: var(--hdr);
    display: grid; grid-template-columns: auto 1fr auto; align-items: stretch;
    background: var(--bg); border-bottom: 1px solid var(--rule);
    transition: background-color .4s var(--ease);
}
.hdr-logo { display: flex; align-items: center; padding: 0 var(--gut); border-inline-end: 1px solid var(--rule); }
.hdr-logo .logo { width: 150px; }
.proc { display: flex; justify-content: center; margin: 0; padding: 0; list-style: none; min-width: 0; }
.proc li { display: flex; }
.proc a {
    position: relative; display: flex; align-items: center; gap: 10px; padding: 0 22px;
    font-size: 14px; color: var(--mute); white-space: nowrap; transition: color .25s, background-color .25s;
}
.proc a i {
    display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid currentColor;
    font-style: normal; font-family: var(--f-num); font-size: 12px; font-weight: 600;
}
.proc a:hover { color: var(--ink); }
.proc a::after { content: ""; position: absolute; inset-inline: 22px; bottom: -1px; height: 2px; background: var(--ink); transform: scaleX(0); transition: transform .45s var(--ease); }
.proc li.on a { color: var(--ink); }
.proc li.on a i { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.proc li.on a::after { transform: scaleX(1); }
.proc li.done a { color: var(--ink-2); }
.proc li.done a i { border-color: var(--gold-line); color: var(--gold); }
.proc li.locked a { pointer-events: none; opacity: .4; }
.hdr-tools { display: flex; align-items: stretch; }
.tx {
    display: flex; align-items: center; gap: 10px; padding: 0 22px; border-inline-start: 1px solid var(--rule);
    font-size: 13.5px; color: var(--ink-2); transition: background-color .25s;
}
.tx:hover { background: var(--hover); }
#langBtn { min-width: 84px; justify-content: center; }
html[lang="ar"] #langBtn { font-family: var(--f-en); letter-spacing: .08em; }
html[lang="en"] #langBtn { font-family: var(--f-ar); }
.tx .sw { width: 14px; height: 14px; border: 1.5px solid var(--ink); background: linear-gradient(135deg, var(--ink) 50%, transparent 50%); }
.tx.install { color: var(--gold); }

/* ---------- views ---------- */
.view { animation: fade .5s var(--ease); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ========== 1 choose a tin ========== */
.mast { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: end; gap: 24px 56px; padding: 52px var(--gut) 44px; border-bottom: 1px solid var(--rule); }
.mast-title {
    margin: 16px 0 0; font-family: var(--f-num); font-weight: 300; font-size: clamp(42px, 5.4vw, 88px);
    line-height: .96; letter-spacing: -.045em; animation: rise .9s var(--ease) both;
}
html[lang="ar"] .mast-title { font-family: var(--f-ar); font-weight: 200; font-size: clamp(38px, 4.6vw, 74px); line-height: 1.18; letter-spacing: -.01em; }
.mast-title b { display: block; font-weight: 500; color: var(--gold); }
.how { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); animation: rise .9s .1s var(--ease) both; }
.how li { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--rule-2); font-size: 16px; color: var(--ink-2); line-height: 1.45; }
.how i {
    flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--gold-line);
    font-style: normal; font-family: var(--f-num); font-weight: 600; font-size: 13px; color: var(--gold);
}

.pick { padding: 40px var(--gut) 20px; }
.pick-title { margin: 0 0 18px; font-size: 22px; font-weight: 500; }
html[lang="en"] .pick-title { font-family: var(--f-num); font-size: 26px; font-weight: 400; letter-spacing: -.02em; }

/* the five kinds of tin, as pictures */
.cats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-inline-start: 1px solid var(--rule); }
.cat {
    position: relative; display: flex; flex-direction: column; align-items: stretch; padding: 0 0 16px; text-align: start; overflow: hidden;
    border-inline-end: 1px solid var(--rule); border-bottom: 1px solid var(--rule); transition: background-color .25s;
}
.cat:hover { background: var(--hover); }
/* real photographs of the factory's products (jordantinplate.com) */
.cat-pic { position: relative; display: block; aspect-ratio: 4 / 3; margin-bottom: 12px; overflow: hidden; background: #E9E8EC; }
.cat-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.cat:hover .cat-pic img { transform: scale(1.04); }
.cat b, .cat small { padding-inline: 16px; }
.cat b { font-size: 15.5px; font-weight: 500; line-height: 1.35; }
html[lang="en"] .cat b { font-family: var(--f-num); font-size: 17px; letter-spacing: -.01em; }
.cat small { font-size: 12.5px; color: var(--mute); }
.cat.on { background: var(--hover); }
.cat.on::before { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 3px; background: var(--ink); z-index: 2; }
html[data-theme="dark"] .cat.on::before { background: var(--gold-line); }

.cat-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; padding: 24px 0 18px; }
.tabs { display: flex; flex-wrap: wrap; border: 1px solid var(--rule); }
.tabs:empty { display: none; }
.tabs button { padding: 10px 18px; font-size: 14px; color: var(--ink-2); transition: background-color .2s, color .2s; }
.tabs button + button { border-inline-start: 1px solid var(--rule); }
.tabs button small { margin-inline-start: 6px; font-family: var(--f-num); font-size: 12px; color: var(--mute); }
.tabs button:hover { background: var(--hover); }
.tabs button.on { background: var(--ink); color: var(--bg); }
.tabs button.on small { color: inherit; opacity: .7; }
.find { margin-inline-start: auto; width: min(300px, 100%); }
.find input {
    display: block; width: 100%; padding: 8px 0; border: 0; border-bottom: 1px solid var(--rule); background: none; font-size: 14.5px; outline: none;
}
.find input:focus { border-bottom-color: var(--gold-line); }
.find input::placeholder { color: var(--mute); opacity: .9; }
.find input::-webkit-search-cancel-button { -webkit-appearance: none; }
.results { margin: 0 0 12px; font-size: 14px; color: var(--mute); }

.check { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; font-size: 14.5px; color: var(--ink-2); }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check i { position: relative; flex: none; width: 20px; height: 20px; border: 1.5px solid var(--ink); transition: background-color .2s; }
.check i::after { content: ""; position: absolute; inset: 2px 5.5px 4.5px; border: solid var(--go-ink); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) scale(0); transition: transform .25s var(--ease); }
.check input:checked + i { background: var(--go); border-color: var(--go); }
.check input:checked + i::after { transform: rotate(45deg) scale(1); }
.check input:focus-visible + i { outline: 1.5px solid var(--gold-line); outline-offset: 3px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); border-top: 1px solid var(--rule); border-inline-start: 1px solid var(--rule); }
.spec {
    position: relative; display: flex; flex-direction: column; min-width: 0; padding: 18px 20px 20px;
    border-inline-end: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
    transition: background-color .3s; animation: rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms);
}
.spec:hover { background: var(--hover); }
.spec.crop::after { opacity: 0; transition: opacity .3s; }
.spec.crop:hover::after { opacity: 1; }
.spec-art { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; margin-bottom: 12px; }
.spec-art img { position: absolute; inset: 8%; width: 84%; height: 84%; object-fit: contain; transition: transform .7s var(--ease); }
.spec:hover .spec-art img { transform: translateY(-6px) scale(1.03); }
.spec-art .pack-ic { width: 46%; height: auto; }
.spec-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.spec-top .code { font-size: 24px; line-height: 1.1; }
.flag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--mute); }
.flag::before { content: ""; width: 9px; height: 9px; border: 1.5px solid var(--win); }
.spec-name { margin-top: 2px; font-size: 14.5px; color: var(--ink-2); }
.spec-go { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13.5px; font-weight: 500; color: var(--gold); }
.spec-go .ic { width: 16px; height: 16px; transition: transform .35s var(--ease); }
.spec:hover .spec-go .ic.arrow { transform: translateX(4px); }
html[dir="rtl"] .spec:hover .spec-go .ic.arrow { transform: scaleX(-1) translateX(4px); }
.empty { padding: 50px 0; color: var(--mute); }

/* pack drawings (form-only mode, and while the renders load) */
.ic-front { fill: var(--paper); stroke: var(--mute); stroke-width: 1; stroke-linejoin: round; }
.ic-top { fill: var(--bg); stroke: var(--mute); stroke-width: 1; stroke-linejoin: round; }
.ic-side { fill: var(--gold-wash); stroke: var(--mute); stroke-width: 1; stroke-linejoin: round; }
.bd-line { fill: none; stroke: var(--mute); stroke-width: 1.2; vector-effect: non-scaling-stroke; }

.colophon {
    display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 40px; margin-top: 40px; padding: 52px var(--gut) 40px;
    background: #001028; color: #C8CEE0;
}
html[data-theme="dark"] .colophon { background: #000A1D; border-top: 1px solid var(--rule); }
.colophon .logo { width: 170px; background: #F0F0F8; }
.colophon dl { display: grid; grid-template-columns: repeat(4, minmax(0, auto)); gap: 18px 40px; margin: 0; }
.colophon dt { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: #8690AD; }
html[lang="ar"] .colophon dt { letter-spacing: 0; font-size: 12px; }
.colophon dd { margin: 4px 0 0; font-size: 14px; color: #F0F0F8; }
.colophon dd a:hover { color: #CDB677; }
.colophon small { font-size: 12px; color: #8690AD; }
.demo-chip { margin: 0; padding: 12px var(--gut); font-size: 12.5px; color: var(--gold); border-bottom: 1px solid var(--rule); }

/* ========== 2 options / 3 design ========== */
.work { padding-bottom: var(--dock); }
.band {
    position: sticky; top: var(--hdr); z-index: 20; height: var(--band-h);
    display: grid; grid-template-columns: minmax(240px, 26%) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
    background: var(--bg); border-bottom: 1px solid var(--rule);
    transition: background-color .4s var(--ease);
}
.band-title { display: flex; flex-direction: column; justify-content: center; gap: 10px; min-width: 0; min-height: 0; overflow: hidden; padding: 24px; padding-inline-start: var(--gut); border-inline-end: 1px solid var(--rule); }
.band-back { position: absolute; top: 22px; display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--mute); transition: color .2s; }
.band-back:hover { color: var(--ink); }
.band-back .ic { width: 16px; height: 16px; }
.band-title .code { align-self: flex-start; font-size: clamp(48px, 5vw, 86px); line-height: .9; }
.cap-name { font-size: 16px; color: var(--ink); }
.cap-size { font-size: 14px; color: var(--mute); }
.viewport {
    position: relative; overflow: hidden; isolation: isolate;
    background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 32px 32px; background-position: center center;
}
.viewport canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.viewport canvas:active { cursor: grabbing; }
.vp-hint { position: absolute; top: 18px; inset-inline-end: 22px; z-index: 2; margin: 0; font-size: 12.5px; color: var(--mute); pointer-events: none; }
.views { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 3; display: none; border: 1px solid var(--rule); background: var(--bg); }
html.r-artwork .views { display: flex; }
.views button { padding: 8px 14px; font-size: 13px; color: var(--mute); white-space: nowrap; transition: color .2s, background-color .2s; }
.views button + button { border-inline-start: 1px solid var(--rule-2); }
.views button:hover { color: var(--ink); }
.views button.active { background: var(--ink); color: var(--bg); }
.views .spin.active { background: none; color: var(--gold); }
.lite-panel { display: none; }
html.lite .viewport canvas, html.lite .vp-hint, html.lite .views { display: none !important; }
html.lite .lite-panel { position: absolute; inset: 0; display: grid; place-items: center; }
html.lite .lite-icon .pack-ic { width: min(220px, 40vw); height: auto; }

.pane { display: none; padding: 0 var(--gut); }
.pane.active { display: block; animation: fade .45s var(--ease); max-width: 1100px; margin: 0 auto; }
.q { padding: 30px 0; border-bottom: 1px solid var(--rule); }
.q h3 { margin: 0 0 16px; font-size: 20px; font-weight: 500; line-height: 1.3; }
html[lang="en"] .q h3 { font-family: var(--f-num); font-size: 22px; font-weight: 500; letter-spacing: -.015em; }

/* heights: plain buttons */
.hbtns { display: flex; flex-wrap: wrap; gap: 10px; }
.hbtn {
    position: relative; display: flex; flex-direction: column; align-items: center; min-width: 110px; padding: 14px 18px 12px;
    border: 1px solid var(--rule); background: var(--paper); transition: border-color .2s, background-color .2s;
}
.hbtn:hover { border-color: var(--ink-2); }
.hbtn b { font-family: var(--f-num); font-size: 26px; font-weight: 400; line-height: 1; direction: ltr; }
.hbtn b span { font-family: var(--f-en); font-size: 12px; color: var(--mute); margin-inline-start: 4px; }
html[lang="ar"] .hbtn b span { font-family: var(--f-ar); }
.hbtn small { margin-top: 6px; font-size: 12px; color: var(--mute); }
.hbtn.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.hbtn.on b { font-weight: 600; }
.single { margin: 0; font-size: 16px; color: var(--ink-2); }
.single b { font-family: var(--f-num); font-size: 24px; font-weight: 500; color: var(--ink); }

/* free heights: a ruler */
.ruler { max-width: 640px; }
.ruler-read { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.ruler-read input {
    width: 3.2ch; padding: 0; border: 0; border-bottom: 1px solid var(--ink); background: none; outline: none;
    font-family: var(--f-num); font-size: 52px; font-weight: 300; line-height: 1; letter-spacing: -.04em; -moz-appearance: textfield; text-align: center;
}
.ruler-read input::-webkit-inner-spin-button { -webkit-appearance: none; }
.ruler-read span { font-size: 14px; color: var(--mute); }
.rule-range {
    -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 34px; margin: 0;
    background:
        repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px 10px) bottom / 100% 9px no-repeat,
        repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 50px) bottom / 100% 16px no-repeat;
}
.rule-range::-webkit-slider-runnable-track { height: 34px; background: none; }
.rule-range::-moz-range-track { height: 34px; background: none; }
.rule-range::-webkit-slider-thumb { -webkit-appearance: none; width: 4px; height: 34px; background: var(--gold-line); box-shadow: 0 0 0 5px var(--gold-wash); }
.rule-range::-moz-range-thumb { width: 4px; height: 34px; border: 0; border-radius: 0; background: var(--gold-line); }
.ruler-ends { display: flex; justify-content: space-between; margin-top: 6px; font-family: var(--f-num); font-size: 12.5px; color: var(--mute); }

/* option cells: real renders of the tin with each choice */
.cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 210px)); gap: 10px; }
.cells.two { grid-template-columns: repeat(2, minmax(0, 210px)); }
.cell {
    position: relative; display: flex; flex-direction: column; align-items: stretch; min-width: 0; padding: 10px 12px 14px;
    border: 1px solid var(--rule); background: var(--paper); text-align: start; transition: border-color .2s;
}
.cell:hover { border-color: var(--ink-2); }
.cell-pic { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; margin-bottom: 8px; }
.cell-pic img { position: absolute; inset: 5%; width: 90%; height: 90%; object-fit: contain; animation: fade .5s var(--ease); }
.cell-pic svg { width: 58%; height: auto; overflow: visible; }
.cell-pic.wait::before { content: ""; width: 30%; aspect-ratio: 1; border: 1px dashed var(--rule); animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .35; } }
.cell b { font-size: 14px; font-weight: 500; line-height: 1.35; }
.wtag { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--mute); }
.wtag::before { content: ""; width: 8px; height: 8px; border: 1.5px solid var(--win); }
.cell.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.cell.on b { font-weight: 600; }

/* quantity */
.counter { display: flex; align-items: stretch; max-width: 420px; border: 1px solid var(--rule); background: var(--paper); }
.counter button { display: grid; place-items: center; width: 58px; color: var(--ink); transition: background-color .2s; }
.counter button:hover { background: var(--hover); }
.counter input {
    flex: 1; min-width: 0; padding: 8px 0; border: 0; border-inline: 1px solid var(--rule-2); background: none; outline: none; text-align: center;
    font-family: var(--f-num); font-size: 40px; font-weight: 300; letter-spacing: -.03em; line-height: 1; -moz-appearance: textfield;
}
.counter input::-webkit-inner-spin-button { -webkit-appearance: none; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.presets button { padding: 6px 12px; border: 1px solid var(--rule-2); font-family: var(--f-num); font-size: 14px; color: var(--ink-2); transition: border-color .2s, color .2s; }
.presets button:hover { border-color: var(--ink-2); }
.presets button.on { border-color: var(--ink); color: var(--ink); font-weight: 600; }

/* the folded extras */
.more { border-bottom: 1px solid var(--rule); }
.more summary {
    display: flex; align-items: center; gap: 12px; padding: 22px 0; cursor: pointer; list-style: none; font-size: 17px; font-weight: 500;
}
.more summary::-webkit-details-marker { display: none; }
.more summary small { font-size: 13px; font-weight: 400; color: var(--mute); }
.more summary i { position: relative; width: 14px; height: 14px; margin-inline-start: auto; }
.more summary i::before, .more summary i::after { content: ""; position: absolute; inset: 6px 0 auto; height: 1.5px; background: currentColor; transition: transform .3s var(--ease); }
.more summary i::after { transform: rotate(90deg); }
.more[open] summary i::after { transform: rotate(0); }
.more-body { padding: 0 0 26px; animation: fade .4s var(--ease); }
.sub { display: block; margin-bottom: 22px; }
.sub:last-child { margin-bottom: 0; }
.sub > .lbl { display: block; margin-bottom: 10px; }
#gExtras { display: grid; gap: 14px; }
.switcher { display: inline-flex; border: 1px solid var(--rule); }
.switcher button { padding: 10px 18px; font-size: 14px; color: var(--mute); transition: background-color .2s, color .2s; }
.switcher button + button { border-inline-start: 1px solid var(--rule); }
.switcher button.on { background: var(--ink); color: var(--bg); }
.tones { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tone { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--rule-2); font-size: 13px; color: var(--ink-2); transition: border-color .2s; }
.tone i { width: 16px; height: 16px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.tone:hover { border-color: var(--ink-2); }
.tone.on { border-color: var(--ink); color: var(--ink); font-weight: 500; }

.pen { display: block; }
.pen input, .pen textarea {
    display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--rule); background: var(--paper);
    font-size: 16px; outline: none; resize: vertical; transition: border-color .2s, box-shadow .2s;
}
.pen input:focus, .pen textarea:focus { border-color: var(--gold-line); box-shadow: 0 0 0 3px var(--gold-wash); }
.pen input.bad { border-color: var(--err); box-shadow: 0 0 0 3px color-mix(in srgb, var(--err) 14%, transparent); }
.pen ::placeholder { color: var(--mute); opacity: .7; }
.pen .lbl small { font-size: 12px; opacity: .8; }
.val-plain { unicode-bidi: plaintext; text-align: start; }
.hp { position: absolute !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; inset-inline-start: -9999px; }

/* the dock: running summary and the way on */
.dock {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 30; height: calc(var(--dock) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    display: grid; grid-template-columns: 1fr auto auto; align-items: stretch;
    background: var(--bg); border-top: 1px solid var(--rule);
}
.dock-sum { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 0 var(--gut); line-height: 1.3; }
.dock-sum .code { align-self: flex-start; font-size: 22px; }
.dock-sum span { font-size: 13.5px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.go {
    display: inline-flex; align-items: center; justify-content: center; gap: 14px; min-height: 56px; padding: 0 36px;
    background: var(--go); color: var(--go-ink); font-size: 16px; font-weight: 500; white-space: nowrap; cursor: pointer;
    transition: background-color .25s, color .25s;
}
.go:hover { background: var(--go-hover); }
.go .ic { transition: transform .35s var(--ease); }
.go:hover .ic.arrow { transform: translateX(4px); }
html[dir="rtl"] .go:hover .ic.arrow { transform: scaleX(-1) translateX(4px); }
.go:disabled { opacity: .6; cursor: progress; }
.go.ghost { background: transparent; color: var(--ink); border-inline-start: 1px solid var(--rule); font-size: 15px; }
.go.ghost:hover { background: var(--hover); }
.dock .go { min-height: 0; }
.txlink { font-size: 14px; color: var(--gold); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--rule); }
.txlink:hover { text-decoration-color: var(--gold-line); }

/* 3 design: one picture per side */
.proof-head { padding: 30px 0 22px; }
.proof-title { margin: 0 0 8px; font-family: var(--f-num); font-weight: 300; font-size: 32px; line-height: 1.1; letter-spacing: -.03em; }
html[lang="ar"] .proof-title { font-family: var(--f-ar); font-weight: 300; letter-spacing: 0; }
.proof-title b { color: var(--gold); font-weight: 500; }
.proof-head p { margin: 0; color: var(--ink-2); font-size: 15.5px; max-width: 70ch; }
.plates { display: grid; grid-template-columns: var(--cols, minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr)); gap: 12px; }
.plate { position: relative; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--rule); background: var(--plate); transition: border-color .2s; }
.plate:hover { border-color: var(--ink-2); }
.plate.has-file { border-color: var(--ok); }
.plate-draw {
    position: relative; flex: 1; display: grid; place-items: center; min-height: 200px; padding: 22px; cursor: pointer;
    background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 16px 16px;
}
.plate-draw input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 4; }
.plate-draw:focus-within { outline: 1.5px solid var(--gold-line); outline-offset: -6px; }
.plate-draw svg { width: 100%; max-height: 170px; overflow: visible; }
.plate-k { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--rule-2); min-width: 0; }
.plate-k b { font-weight: 500; font-size: 16px; }
.up-status { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--gold); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.up-status::before { content: "+"; font-size: 18px; line-height: 1; }
.plate.has-file .up-status { color: var(--ok); }
.plate.has-file .up-status::before { content: "✓"; font-size: 14px; }
.die-cut { fill: none; stroke: var(--die); stroke-width: 1.3; vector-effect: non-scaling-stroke; }
.die-safe { fill: none; stroke: var(--gold-line); stroke-width: 1.2; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.die-win { fill: var(--win); fill-opacity: .22; stroke: var(--win); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.plate.dragover::after { inset: 10px; --l: 22px; }
.memo { margin: 18px 0 0; font-size: 14.5px; color: var(--ink-2); }
.memo::before { content: ""; display: inline-block; width: 12px; height: 0; margin-inline-end: 10px; border-top: 1.5px dashed var(--gold-line); vertical-align: middle; }
.memo.win::before { width: 10px; height: 10px; border: 1.5px solid var(--win); vertical-align: -1px; }
.reset { display: inline-block; margin: 16px 0 30px; }

/* ========== 4 send ========== */
.sheetview { padding: 36px var(--gut) 80px; }
.doc { max-width: 980px; margin: 0 auto; background: var(--paper); border: 1px solid var(--rule); box-shadow: var(--shade); animation: rise .6s var(--ease); }
.doc-head { padding: 28px 36px 22px; border-bottom: 2px solid var(--ink); }
.doc-title h1 { margin: 2px 0 6px; font-family: var(--f-num); font-size: 34px; font-weight: 300; line-height: 1.15; letter-spacing: -.03em; }
html[lang="ar"] .doc-title h1 { font-family: var(--f-ar); font-weight: 300; letter-spacing: 0; }
.doc-title h1 b { color: var(--gold); font-weight: 500; }
.doc-title p { margin: 0; color: var(--ink-2); font-size: 15px; }
.doc-body { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr); border-bottom: 1px solid var(--rule); }
.doc-fig {
    margin: 0; display: grid; place-items: center; padding: 24px; border-inline-end: 1px solid var(--rule);
    background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 24px 24px;
}
.doc-fig img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.doc-sec { padding: 24px 36px; }
.doc-sec h2 { margin: 0 0 16px; font-size: 19px; font-weight: 500; }
html[lang="en"] .doc-sec h2 { font-family: var(--f-num); font-size: 21px; letter-spacing: -.015em; }
.ledger { margin: 0; display: grid; }
.ledger div { display: grid; grid-template-columns: minmax(110px, 36%) 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--rule-2); font-size: 15px; }
.ledger div:last-child { border-bottom: 0; }
.ledger dt { color: var(--mute); }
.ledger dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.more.small { margin-top: 8px; border-bottom: 0; border-top: 1px solid var(--rule-2); }
.more.small summary { padding: 14px 0; font-size: 14.5px; color: var(--ink-2); }
.more.small .ledger div { font-size: 14px; }
.more.small .lbl { margin: 16px 0 4px; }
.more.small .txlink { margin-top: 14px; }
.contact { border-bottom: 1px solid var(--rule); }
.pens { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; }
.stamp { margin: 0; padding: 20px 36px; background: var(--gold-wash); border-bottom: 1px solid var(--rule); }
.stamp .lbl { color: var(--gold); }
.stamp p { margin: 6px 0 4px; font-size: 16.5px; font-weight: 500; color: var(--ink); }
.stamp small { display: block; font-size: 13.5px; color: var(--ink-2); }
.err { margin: 16px 0 0; padding: 10px 14px; border-inline-start: 3px solid var(--err); background: color-mix(in srgb, var(--err) 9%, transparent); color: var(--err); font-size: 14px; }
.doc-foot { display: flex; align-items: stretch; justify-content: space-between; }
.doc-foot .go { min-height: 72px; }
.doc-foot .go.ghost { border-inline-start: 0; border-inline-end: 1px solid var(--rule); }
.doc-foot .go.send { flex: 1; font-size: 17px; }

/* receipt */
.receipt-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; border-bottom: 1px solid var(--rule); }
.seal {
    display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 40px auto; padding: 28px 40px; color: var(--gold);
    border: 2px solid var(--gold-line); outline: 1px solid var(--gold-line); outline-offset: 5px; transform: rotate(-3deg); animation: stamp .7s .2s var(--ease) both;
}
@keyframes stamp { from { opacity: 0; transform: rotate(-3deg) scale(1.6); } }
.seal span { font-size: 13px; letter-spacing: .2em; text-transform: uppercase; }
html[lang="ar"] .seal span { letter-spacing: 0; font-size: 15px; font-weight: 500; }
.seal strong { font-family: var(--f-num); font-size: 34px; font-weight: 500; letter-spacing: -.01em; color: var(--ink); }
.seal small { font-size: 12.5px; color: var(--mute); }
.receipt-body img { width: 100%; max-width: 360px; margin: 20px auto; }
.next-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--rule); }
.next-steps li { display: flex; gap: 14px; padding: 22px 28px; font-size: 15px; color: var(--ink-2); border-inline-end: 1px solid var(--rule-2); }
.next-steps li:last-child { border-inline-end: 0; }
.next-steps i { font-style: normal; font-family: var(--f-num); font-weight: 600; color: var(--gold); }

/* toast */
.toast {
    position: fixed; bottom: calc(var(--dock) + 18px); left: 50%; z-index: 90; max-width: min(520px, calc(100vw - 32px)); padding: 13px 20px;
    background: var(--ink); color: var(--bg); font-size: 14px; opacity: 0; transform: translate(-50%, 12px); pointer-events: none;
    transition: opacity .3s var(--ease), transform .4s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* iOS install steps (js/pwa.js) */
.ios-install { position: fixed; inset: 0; z-index: 150; display: flex; align-items: flex-end; justify-content: center; padding: 16px; background: rgba(0, 16, 40, .5); opacity: 0; pointer-events: none; transition: opacity .3s; }
.ios-install.show { opacity: 1; pointer-events: auto; }
.ios-install-card { width: min(420px, 100%); padding: 28px 24px 0; background: var(--paper); border: 1px solid var(--rule); text-align: center; transform: translateY(24px); transition: transform .45s var(--ease); overflow: hidden; }
.ios-install.show .ios-install-card { transform: none; }
.ios-install-card img { width: 60px; height: 60px; margin: 0 auto; }
.ios-install-card h3 { margin: 12px 0; font-size: 18px; font-weight: 500; }
.ios-install-card ol { margin: 0 0 20px; padding-inline-start: 22px; text-align: start; color: var(--ink-2); font-size: 14px; line-height: 2; }
.ios-install-card ol .ic { width: 18px; height: 18px; vertical-align: -3px; color: var(--gold); }
.ios-install-card .btn { display: flex; align-items: center; justify-content: center; width: calc(100% + 48px); margin: 0 -24px; height: 56px; background: var(--go); color: var(--go-ink); font-weight: 500; }

/* focus and "scroll into view" land between the sticky viewport and the dock, never under them */
html.r-artwork { --band-h: clamp(280px, 38vh, 420px); }
html.r-configure, html.r-artwork { scroll-padding-top: calc(var(--hdr) + var(--band-h) + 12px); scroll-padding-bottom: calc(var(--dock) + 12px); }
html.r-catalogue, html.r-review, html.r-done { scroll-padding-top: calc(var(--hdr) + 12px); }

/* ---------- laptop ---------- */
@media (max-width: 1180px) {
    .proc a { padding: 0 14px; }
    .proc a span { display: none; }
    .proc li.on a span { display: inline; }
    .cats { grid-template-columns: repeat(5, minmax(150px, 1fr)); overflow-x: auto; scrollbar-width: none; }
    .colophon { grid-template-columns: 1fr; gap: 24px; }
    .colophon dl { grid-template-columns: repeat(2, minmax(0, auto)); }
}

/* ---------- tablet & phone ---------- */
@media (max-width: 860px) {
    :root { --hdr: 58px; --dock: 66px; --band-h: 40vh; }
    html.r-artwork { --band-h: 30vh; }
    .hdr-logo { padding: 0 16px; }
    .hdr-logo .logo { width: 112px; }
    .tx { padding: 0 14px; }
    #langBtn { min-width: 52px; }
    #themeLabel { display: none; }

    .mast { grid-template-columns: 1fr; gap: 22px; padding: 28px var(--gut) 24px; }
    .how li { font-size: 15px; padding: 11px 0; }
    .pick { padding-top: 28px; }
    .cats { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: calc(var(--gut) * -1); padding-inline: var(--gut); border-inline-start: 0; }
    .cats::-webkit-scrollbar { display: none; }
    .cat { flex: 0 0 44%; scroll-snap-align: start; border-top: 0; }
    .cat:first-child { border-inline-start: 1px solid var(--rule); }
    .cat b { font-size: 14.5px; }
    .cat-bar { gap: 14px; }
    .tabs { max-width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
    .tabs button { flex: none; }
    .find { width: 100%; margin-inline-start: 0; }
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .spec { padding: 12px 12px 14px; }
    .spec-top .code { font-size: 19px; }
    .spec-name { font-size: 13px; }
    .flag span { display: none; }
    .spec-go { display: none; }
    .pick, .mast { overflow: hidden; }

    .band { grid-template-columns: 1fr; }
    .band-title { position: absolute; top: 0; inset-inline: 0; z-index: 4; flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: flex-start; gap: 2px 10px; padding: 12px 16px; border: 0; pointer-events: none; }
    .band-back, .cap-size { display: none; }
    .band-title .code { font-size: 28px; }
    .cap-name { font-size: 13.5px; }
    .vp-hint { display: none; }
    .views { bottom: 10px; }
    .views button { padding: 7px 11px; font-size: 12.5px; }

    .q { padding: 22px 0; }
    .q h3 { font-size: 18px; margin-bottom: 12px; }
    .cells { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: minmax(140px, 44%); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: calc(var(--gut) * -1); padding-inline: var(--gut); }
    .cells::-webkit-scrollbar { display: none; }
    .cells .cell { scroll-snap-align: start; }
    .cells.two { grid-auto-columns: minmax(0, 1fr); margin: 0; padding: 0; }
    .hbtn { min-width: 88px; padding: 12px 12px 10px; }
    .hbtn b { font-size: 22px; }
    .counter input { font-size: 34px; }
    .proof-title { font-size: 26px; }
    .plates { grid-template-columns: 1fr; }
    .plate-draw { min-height: 150px; }

    .dock-sum { padding: 0 16px; }
    .dock-sum .code { font-size: 18px; }
    .go { padding: 0 22px; font-size: 15px; }
    .dock .go.ghost span { display: none; }
    .dock .go.ghost { padding: 0 18px; }

    .sheetview { padding: 0 0 40px; }
    .doc { border-inline: 0; box-shadow: none; }
    .doc-head { padding: 22px var(--gut); }
    .doc-title h1 { font-size: 26px; }
    .doc-body { grid-template-columns: 1fr; }
    .doc-fig { border-inline-end: 0; border-bottom: 1px solid var(--rule); padding: 14px var(--gut); }
    .doc-fig img { max-width: 300px; }
    .doc-sec, .stamp { padding: 20px var(--gut); }
    .pens { grid-template-columns: 1fr; }
    .doc-foot .go { min-height: 62px; }
    .receipt-body { grid-template-columns: 1fr; }
    .next-steps { grid-template-columns: 1fr; }
    .next-steps li { border-inline-end: 0; border-bottom: 1px solid var(--rule-2); }
}
@media (max-width: 420px) {
    .dock { grid-template-columns: auto 1fr; }
    .dock-sum { display: none; }
    .tx.install { display: none; }
    .proc li:not(.on) { display: none; }
    .proc li.on a span { display: inline; }
    .proc a { padding: 0 12px; gap: 8px; font-size: 13.5px; }
    .proc li.on a i::after { content: "/4"; position: absolute; transform: translateY(150%); display: none; }
    .ledger div { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 360px) {
    .proc li.on a span { display: none; }
    .proc li.on a i { width: auto; padding: 0 6px; }
    .proc li.on a i::after { content: " / 4"; position: static; transform: none; display: inline; font-weight: 400; }
}
@media (max-width: 860px) and (max-height: 640px) { :root { --band-h: 34vh; } html.r-artwork { --band-h: 26vh; } }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
