:root {
  --brand: #0e9aa7; --brand-ink: #0a7f8a; --brand-deep: #075f68; --brand-soft: #e2f5f7; --on-brand: #fff;
  --ink: #102a2e; --muted: #5a747a; --line: #d9eaec; --bg: #f3f9fa; --surface: #fff; --surface-2: #f7fbfb;
  --ok: #17803d; --ok-bg: #e3f6e9; --warn: #9a6200; --warn-bg: #fff2d6; --bad: #b3261e; --bad-bg: #fde8e6; --info: #0a6f7a; --info-bg: #dff3f6;
  --radius: 14px; --shadow: 0 1px 2px rgba(16, 42, 46, .05), 0 6px 20px rgba(16, 42, 46, .05);
  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif; --head: 'Sora', 'Figtree', system-ui, sans-serif;
}
/* Light is the default to match the PDM brand; dark applies only when data-theme="dark" is set. */
:root[data-theme="dark"] {
  --brand: #2cc3cf; --brand-ink: #4fd3dd; --brand-deep: #8fe6ec; --brand-soft: #12383d; --on-brand: #052e32;
  --ink: #e6f3f4; --muted: #8fb0b5; --line: #1f3f44; --bg: #0b1a1d; --surface: #112a2e; --surface-2: #0f2428;
  --ok: #6fd391; --ok-bg: #123a22; --warn: #f3c15c; --warn-bg: #3b2f10; --bad: #ff8b82; --bad-bg: #421a17; --info: #7fdbe4; --info-bg: #0f3a40;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); }
img { max-width: 100%; display: block; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--head); line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.1rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--muted); }
code { background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.ic { width: 20px; height: 20px; flex: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 8px; }

/* ---------- shell ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font: 700 1.02rem var(--head); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; object-fit: contain; }
.topnav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 10px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.topnav a:hover { background: var(--brand-soft); color: var(--brand-deep); text-decoration: none; }
.topnav a.on { background: var(--brand-soft); color: var(--brand-deep); }
.count { font-style: normal; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--brand); color: var(--on-brand); font-size: 12px; display: grid; place-items: center; }
.who { display: flex; align-items: center; gap: 10px; }
.who-name { display: flex; flex-direction: column; text-align: right; line-height: 1.2; }
.who-name small { font-size: 12px; }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); color: var(--muted); background: var(--surface); }
.icon-btn:hover { color: var(--brand-ink); border-color: var(--brand); text-decoration: none; }
.page { max-width: 1180px; margin: 0 auto; padding: 28px 24px 90px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.section { margin: 30px 0 12px; display: flex; align-items: center; gap: 10px; }
.count-pill { font: 600 12px var(--font); background: var(--brand-soft); color: var(--brand-deep); padding: 2px 9px; border-radius: 99px; }
.crumbs { color: var(--muted); margin-bottom: 14px; font-size: 14px; }
.lead { color: var(--muted); max-width: 62ch; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 11px; border: 1px solid var(--brand); background: var(--brand); color: var(--on-brand); font: 600 14px var(--font); cursor: pointer; transition: background .15s, transform .1s, border-color .15s; }
.btn:hover { background: var(--brand-ink); border-color: var(--brand-ink); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-lg { padding: 14px 22px; font-size: 15px; width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn-outline { background: transparent; color: var(--brand-ink); border-color: var(--line); }
.btn-outline:hover { background: var(--brand-soft); color: var(--brand-deep); border-color: var(--brand); }
.btn-danger { background: transparent; color: var(--bad); border-color: var(--line); }
.btn-danger:hover { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.link { background: none; border: 0; padding: 0; color: var(--brand-ink); font: 600 13px var(--font); cursor: pointer; }
.link.danger { color: var(--bad); }
.form { display: flex; flex-direction: column; gap: 14px; }
.form label, label.check { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; }
label.pad-t { padding-top: 26px; }
input, select, textarea { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); font: 15px var(--font); }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--brand); flex: none; padding: 0; }
input[type="file"] { padding: 9px; background: var(--surface-2); }
input:disabled { background: var(--surface-2); color: var(--muted); }
textarea { resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row-end { display: flex; justify-content: flex-end; padding-top: 12px; }
form.inline { display: inline; margin: 0; }
.searchbar { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 6px 6px 6px 14px; margin-bottom: 20px; max-width: 640px; }
.searchbar input { border: 0; padding: 8px 4px; background: transparent; }
.searchbar input:focus { outline: none; }
.filters { margin-bottom: 16px; max-width: 280px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs a { padding: 8px 15px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 600; font-size: 14px; }
.tabs a.on, .tabs a:hover { background: var(--brand); border-color: var(--brand); color: var(--on-brand); text-decoration: none; }

/* ---------- cards / tables ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow, .form.narrow { max-width: 560px; }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 6px; }
.card-head h2 { margin: 0; }
.card-foot { padding: 4px 20px 16px; }
.card h2 { margin-bottom: .6em; }
.card-head + .table-wrap, .card-head + ul { margin-top: 6px; }
.pad { padding: 4px 20px 20px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.cols-cart { grid-template-columns: 1.7fr 1fr; }
.cols-order { grid-template-columns: 1.6fr 1fr; }
.cols-inv { grid-template-columns: 1.6fr 1fr; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.sticky { position: sticky; top: 84px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font: 600 12px var(--font); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num, .num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--surface-2); }
.qty-in { width: 76px; text-align: right; padding: 8px 10px; }
.totals { width: 100%; border-collapse: collapse; margin-left: auto; max-width: 340px; font-variant-numeric: tabular-nums; }
.totals td { padding: 5px 0; } .totals td:last-child { text-align: right; }
.totals .grand td { border-top: 1px solid var(--line); padding-top: 10px; font: 700 1.1rem var(--head); }
.summary .totals { max-width: none; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 20px; border-top: 1px solid var(--line); }
.plain li:first-child { border-top: 0; }
.bullets { margin: 0; padding-left: 1.2em; } .bullets li { margin: .25em 0; }
.kv { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.timeline li { position: relative; display: flex; flex-direction: column; }
.timeline li::before { content: ''; position: absolute; left: -20px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); border: 2px solid var(--surface); }
.docs { list-style: none; margin: 0; padding: 0; }
.docs li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.docs li:last-child { border: 0; } .docs small { color: var(--muted); display: block; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font: 600 12px var(--font); white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); } .badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); } .badge-info { background: var(--info-bg); color: var(--info); }
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 500; }
.alert-ok { background: var(--ok-bg); color: var(--ok); } .alert-bad { background: var(--bad-bg); color: var(--bad); }
.alert-warn { background: var(--warn-bg); color: var(--warn); } .alert-info { background: var(--info-bg); color: var(--info); }
.alert a { color: inherit; text-decoration: underline; }
.empty { text-align: center; padding: 54px 20px; border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--surface); color: var(--muted); }
.empty h1, .empty h2 { color: var(--ink); } .empty .btn { margin: 4px; }
.thumb { max-width: 160px; border-radius: 12px; border: 1px solid var(--line); }
.logo-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.logo-preview { width: 84px; height: 84px; object-fit: contain; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); padding: 8px; }

/* ---------- steps ---------- */
.steps { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px; display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; align-items: center; }
.step .dot { grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1.5px solid var(--line); font-weight: 700; color: var(--muted); }
.step .dot .ic { width: 18px; height: 18px; }
.step small { font-size: 13px; }
.step-done .dot { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.step-now { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.step-now .dot { border-color: var(--brand); color: var(--brand-ink); }

/* ---------- catalogue ---------- */
.grid-brand { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.grid-brand.small { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.brand-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.brand-card:hover { transform: translateY(-3px); border-color: var(--brand); text-decoration: none; }
.brand-img { aspect-ratio: 1; background: var(--brand-soft); overflow: hidden; }
.small .brand-img { aspect-ratio: 1; }
.brand-img img, .prod-img img, .product-img img { width: 100%; height: 100%; object-fit: cover; }
.brand-body { padding: 11px 13px 13px; }
.brand-body h3 { font-size: 1rem; margin-bottom: 1px; } .brand-body p { color: var(--muted); margin-bottom: 6px; font-size: 13px; }
.brand-body .link { color: var(--brand-ink); }
.grid-prod { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.prod-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; color: var(--ink); transition: border-color .15s, transform .15s; }
.prod-card:hover { border-color: var(--brand); transform: translateY(-2px); text-decoration: none; }
.prod-img { aspect-ratio: 1; background: var(--brand-soft); overflow: hidden; }
.prod-body { padding: 10px 12px 12px; } .prod-body h3 { margin: 2px 0; font-size: .92rem; } .prod-body p { margin: 0 0 8px; font-size: 13px; } .prod-body small { font-size: 12px; } .prod-foot b { font-size: 13.5px; }
.prod-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.product { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); gap: 28px; align-items: start; }
.product-img { border-radius: 18px; overflow: hidden; background: var(--brand-soft); aspect-ratio: 1; border: 1px solid var(--line); position: sticky; top: 84px; max-height: 420px; }
.product-info { display: flex; flex-direction: column; gap: 14px; } .product-info h1 { margin: 0; }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.option { display: flex !important; flex-direction: row !important; align-items: center; gap: 12px !important; padding: 14px; border: 1.5px solid var(--line); border-radius: 13px; cursor: pointer; font-weight: 500 !important; }
.option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.option span { display: flex; flex-direction: column; } .option em { font-style: normal; color: var(--brand-deep); font-weight: 700; }
.qty-row, .subtotal-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; }
.subtotal-row b { font: 700 1.25rem var(--head); }
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stepper button { width: 44px; height: 44px; border: 0; background: var(--surface-2); color: var(--ink); font-size: 20px; cursor: pointer; }
.stepper input { width: 70px; border: 0; text-align: center; border-radius: 0; font-weight: 700; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.chip { display: inline-block; padding: 6px 12px; margin: 2px 4px 2px 0; border-radius: 99px; background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; font-size: 14px; }
.banks { display: grid; gap: 10px; }
.bank { display: flex !important; flex-direction: row !important; align-items: center; gap: 12px !important; padding: 14px; border: 1.5px solid var(--line); border-radius: 13px; cursor: pointer; font-weight: 500 !important; }
.bank:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.bank span { display: flex; flex-direction: column; gap: 2px; } .bank em { font-style: normal; color: var(--muted); } .bank code { align-self: flex-start; font-size: 14px; }

/* ---------- dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); color: var(--ink); }
.stat.link:hover { border-color: var(--brand); text-decoration: none; }
.stat small { text-transform: uppercase; letter-spacing: .07em; font-weight: 600; font-size: 12px; }
.stat b { font: 700 1.5rem var(--head); font-variant-numeric: tabular-nums; }
.stat em { font-style: normal; font-size: 13px; color: var(--muted); }
.up { color: var(--ok) !important; font-style: normal; font-weight: 600; } .down { color: var(--bad) !important; font-style: normal; font-weight: 600; }
.bars { list-style: none; margin: 0; padding: 4px 20px 20px; display: flex; flex-direction: column; gap: 18px; }
.bar-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.bar { height: 9px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin-bottom: 4px; }
.bar i { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.bar.ghost i { background: color-mix(in srgb, var(--brand) 30%, transparent); }
.jobs { display: grid; gap: 12px; }
.job { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--brand); border-radius: 14px; color: var(--ink); }
.job:hover { text-decoration: none; border-color: var(--brand); } .job p { margin: 2px 0; }

/* ---------- signature ---------- */
.sigbox { display: flex; flex-direction: column; gap: 6px; }
.sig-label { display: flex; justify-content: space-between; align-items: center; }
.sig-canvas { width: 100%; height: 180px; background: #fff; border: 1.5px dashed var(--brand); border-radius: 13px; touch-action: none; cursor: crosshair; }

/* ---------- auth ---------- */
body.bare { background: var(--surface); }
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { position: relative; overflow: hidden; background: linear-gradient(155deg, #0b8d99 0%, #0e9aa7 45%, #14b6c4 100%); color: #fff; padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 30px; }
.auth-art::before { content: ''; position: absolute; right: -120px; top: -80px; width: 420px; height: 420px; background: rgba(255,255,255,.1); transform: rotate(28deg); }
.auth-art::after { content: ''; position: absolute; left: -90px; bottom: -120px; width: 360px; height: 360px; background: rgba(255,255,255,.08); transform: rotate(28deg); }
.auth-art > * { position: relative; z-index: 1; }
.auth-brand { display: flex; align-items: center; gap: 12px; font: 700 1.1rem var(--head); }
.auth-brand img { width: 44px; height: 44px; border-radius: 12px; background: #fff; padding: 4px; object-fit: contain; }
.auth-copy h2 { font-size: 2.2rem; max-width: 14ch; margin-bottom: .5em; } .auth-copy p { max-width: 42ch; opacity: .92; font-size: 1.05rem; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.auth-points li { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.auth-pane { display: grid; place-items: center; padding: 32px 24px; background: var(--surface); }
.auth-card { width: 100%; max-width: 400px; } .auth-card.wide { max-width: 560px; }
.auth-card h1 { margin-bottom: 6px; } .auth-card .form { margin-top: 20px; }
.auth-alt { margin-top: 22px; text-align: center; color: var(--muted); }

/* ---------- documents ---------- */
.doc-body { background: #e8eef0; color: #111; }
.doc-bar { max-width: 820px; margin: 18px auto; padding: 0 16px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.doc { max-width: 820px; margin: 0 auto 40px; background: #fff; padding: 44px 48px; box-shadow: 0 4px 30px rgba(0,0,0,.08); color: #111; font-size: 14px; }
.doc-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 20px; border-bottom: 3px solid var(--brand); margin-bottom: 22px; }
.doc-co { display: flex; gap: 14px; } .doc-co img { width: 64px; height: 64px; object-fit: contain; }
.doc-co div { display: flex; flex-direction: column; font-size: 13px; color: #444; } .doc-co b { font: 700 1.15rem var(--head); color: #111; }
.doc-title { text-align: right; display: flex; flex-direction: column; font-size: 13px; color: #444; }
.doc-title h1 { font-size: 1.3rem; color: var(--brand-deep); margin: 0 0 4px; letter-spacing: .04em; } .doc-title b { font-size: 1.05rem; color: #111; }
.doc-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 22px; }
.doc-parties div { display: flex; flex-direction: column; } .doc-parties small { letter-spacing: .08em; font-weight: 700; color: var(--brand-deep); margin-bottom: 3px; }
.doc-table { width: 100%; border-collapse: collapse; } .doc-table th { text-align: left; padding: 9px 10px; background: #eef8f9; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #0a5f68; }
.doc-table td { padding: 10px; border-bottom: 1px solid #e4eef0; vertical-align: top; } .doc-table small { color: #666; }
.doc-totals { display: flex; justify-content: flex-end; margin: 14px 0 20px; } .doc-totals .totals { max-width: 320px; }
.doc-note { border: 1px solid #d9eaec; background: #f6fbfc; border-radius: 10px; padding: 12px 16px; margin: 12px 0; display: flex; flex-direction: column; gap: 2px; }
.doc-sigs { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 18px; }
.doc-sigs figure { margin: 0; text-align: center; } .doc-sigs img { height: 90px; width: auto; border-bottom: 1px solid #999; background: #fff; } .doc-sigs img.ph { height: 130px; border: 1px solid #ccc; border-radius: 8px; }
.doc-sigs figcaption { font-size: 12px; color: #555; margin-top: 4px; }
.doc-sigs.blank { margin-top: 50px; } .doc-sigs.blank div { flex: 1; font-size: 12px; color: #555; } .doc-sigs.blank span { display: block; border-bottom: 1px solid #333; height: 40px; margin-bottom: 4px; }
.doc-foot { margin-top: 26px; padding-top: 12px; border-top: 1px solid #e1e1e1; color: #666; font-size: 12px; text-align: center; }
.doc .totals td { color: #111; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .cols, .cols-cart, .cols-order, .cols-inv, .product, .stats { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .product-img { position: static; aspect-ratio: 4/3.2; } .sticky { position: static; }
  .auth { grid-template-columns: 1fr; } .auth-art { padding: 28px 24px; } .auth-copy h2 { font-size: 1.6rem; } .auth-points { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .topbar { padding: 8px 14px; gap: 10px; flex-wrap: wrap; }
  .brand span { display: none; }
  .who-name { display: none; }
  .topnav { order: 3; flex-basis: 100%; margin: 0 -4px; }
  .page { padding: 20px 14px 80px; }
  .grid2 { grid-template-columns: 1fr; }
  h1 { font-size: 1.4rem; }
  .doc { padding: 24px 18px; } .doc-head, .doc-parties { grid-template-columns: 1fr; flex-direction: column; } .doc-title { text-align: left; }
}
@media (max-width: 520px) { .stats { grid-template-columns: 1fr; } .steps { grid-template-columns: 1fr; } }
@media print {
  .noprint, .topbar, .alert { display: none !important; }
  body, .doc-body { background: #fff; } .doc { box-shadow: none; margin: 0; padding: 0; max-width: none; }
  .page { padding: 0; max-width: none; } .btn { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.forgot { align-self: center; font-weight: 600; font-size: 14px; }
.upd-msg { margin: 10px 0 0; min-height: 1.4em; }
.upd-msg.ok { color: var(--ok); } .upd-msg.bad { color: var(--bad); }

/* ---------- compact marketplace on phones ---------- */
@media (max-width: 520px) {
  .grid-prod, .grid-brand, .grid-brand.small { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .prod-body { padding: 8px 10px 10px; } .brand-body { padding: 8px 10px 10px; }
  .prod-foot { flex-direction: column; align-items: flex-start; gap: 4px; }
  .product { grid-template-columns: 1fr; } .product-img { max-height: 300px; }
}

/* ---------- appearance: "Match my phone" follows the device ---------- */
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --brand: #2cc3cf; --brand-ink: #4fd3dd; --brand-deep: #8fe6ec; --brand-soft: #12383d; --on-brand: #052e32;
    --ink: #e6f3f4; --muted: #8fb0b5; --line: #1f3f44; --bg: #0b1a1d; --surface: #112a2e; --surface-2: #0f2428;
    --ok: #6fd391; --ok-bg: #123a22; --warn: #f3c15c; --warn-bg: #3b2f10; --bad: #ff8b82; --bad-bg: #421a17; --info: #7fdbe4; --info-bg: #0f3a40;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  }
}
html { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] { color-scheme: dark; } }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 10px 16px; font: 600 14px var(--font); cursor: pointer; }
.seg button.on { background: var(--brand); color: var(--on-brand); }
.theme-btn .ic { width: 18px; height: 18px; }
.theme-btn .ic-sun { display: none; } html[data-theme="dark"] .theme-btn .ic-sun { display: block; } html[data-theme="dark"] .theme-btn .ic-moon { display: none; }

/* ---------- maps ---------- */
.map { height: 320px; width: 100%; border-radius: 14px; border: 1px solid var(--line); overflow: hidden; background: var(--brand-soft); z-index: 0; }
.mapbox { display: flex; flex-direction: column; gap: 8px; }
.map-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.mapbox.has-pin .map { border-color: var(--brand); }
.leaflet-container { font: 14px var(--font); }
.pin span { position: relative; display: block; width: 24px; height: 24px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--brand); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); margin: 0 2px; }
.pin span::after { content: ''; position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #fff; top: 8px; left: 8px; }
