:root {
  --bg: #f4f5f7; --card: #fff; --ink: #15171a; --muted: #6b7280; --line: #e5e7eb;
  --accent: #111; --accent-ink: #fff; --brand: #e7f6ee; --brand-ink: #0f9d58;
  --ok: #0f9d58; --warn: #d97706; --off: #9ca3af; --blue: #2563eb;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0e0f11; --card: #17191c; --ink: #eceef1; --muted: #9aa0a8; --line: #2a2d32; --accent: #f2f2f2; --accent-ink: #111; --shadow: none; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* header + nav */
header.top { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; gap: 16px; height: 56px; }
.logo { font-weight: 800; letter-spacing: -.02em; font-size: 18px; text-decoration: none; }
.logo span { color: var(--brand); }
nav.tabs { display: flex; gap: 4px; margin-left: auto; }
nav.tabs a { text-decoration: none; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; position: relative; white-space: nowrap; }
nav.tabs a.on { background: var(--bg); color: var(--ink); }
.badge { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); font-size: 11px; line-height: 18px; text-align: center; margin-left: 4px; vertical-align: 1px; }
@media (max-width: 720px) {
  nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; margin: 0; background: var(--card); border-top: 1px solid var(--line); justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 30; }
  nav.tabs a { display: flex; flex-direction: column; align-items: center; font-size: 11px; padding: 4px 6px; gap: 2px; }
  nav.tabs a .ic { font-size: 20px; line-height: 1; }
  nav.tabs a.on { background: none; color: var(--ink); }
  .badge { position: absolute; top: -2px; right: 2px; margin: 0; }
  main { padding-bottom: 90px; }
}
@media (min-width: 721px) { nav.tabs a .ic { display: none; } }

main { padding: 20px 0 40px; }
h1 { font-size: 24px; margin: 0 0 4px; letter-spacing: -.02em; }
h2 { font-size: 18px; margin: 24px 0 10px; }
.sub { color: var(--muted); margin: 0 0 16px; }

/* toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; align-items: center; }
.toolbar input[type=search] { flex: 1 1 200px; min-width: 0; }
.toolbar select { flex: 0 1 auto; }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 3px; overflow-x: auto; max-width: 100%; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }

input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); outline: none; }
input:focus, select:focus, textarea:focus { border-color: #3ddc97; box-shadow: 0 0 0 3px rgba(61,220,151,.18); }
textarea { min-height: 80px; resize: vertical; }
.toolbar input, .toolbar select { width: auto; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--card); padding: 9px 14px; border-radius: 10px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }

/* grid of cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; text-decoration: none; display: block; position: relative; }
.card .ph { aspect-ratio: 4/3; background: var(--bg) center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 34px; }
.card .bd { padding: 12px 14px 14px; }
.card .ttl { font-weight: 700; font-size: 16px; }
.card .meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.price { font-weight: 800; font-size: 17px; }
.new-dot { position: absolute; top: 10px; left: 10px; background: var(--brand); color: var(--brand-ink); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; z-index: 2; }

.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 20px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.pill.sale, .pill.active { background: #e7f6ee; color: var(--ok); }
.pill.reserved, .pill.progress { background: #fdf3e1; color: var(--warn); }
.pill.sold, .pill.closed { background: var(--bg); color: var(--off); }
.pill.import { background: #e8efff; color: var(--blue); }
@media (prefers-color-scheme: dark) {
  .pill.sale, .pill.active { background: #10301f; } .pill.reserved, .pill.progress { background: #33260b; } .pill.import { background: #142246; }
}
.owner { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.av { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 700; flex: none; }

/* request list */
.list { display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-decoration: none; display: block; box-shadow: var(--shadow); position: relative; }
.item .head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.item .ttl { font-weight: 700; font-size: 16px; margin-top: 6px; }
.item .meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.item .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 8px; flex-wrap: wrap; }
.item .new-dot { position: static; }
.hit { color: var(--ok); font-weight: 700; font-size: 13px; }

/* detail */
.back { display: inline-block; color: var(--muted); text-decoration: none; margin-bottom: 10px; font-weight: 600; }
.detail { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) {
  .detail { grid-template-columns: 1fr; gap: 14px; }
  .detail > div { display: contents; }
  .detail > div > * { margin-top: 0 !important; }
  .o1 { order: 1; } .o2 { order: 2; } .o3 { order: 3; } .o4 { order: 4; } .o5 { order: 5; } .o6 { order: 6; }
}
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.gallery .main { aspect-ratio: 4/3; border-radius: 12px; background: var(--bg) center/contain no-repeat; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 40px; }
.thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; padding-bottom: 4px; }
.thumbs .t { position: relative; flex: none; }
.thumbs img { width: 76px; height: 57px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid transparent; display: block; }
.thumbs img.on { border-color: var(--ink); }
.thumbs .x { position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,.6); color: #fff; border: 0; border-radius: 6px; font-size: 11px; padding: 1px 5px; cursor: pointer; }
.thumbs .cv { position: absolute; bottom: 2px; left: 2px; background: rgba(0,0,0,.6); color: #fff; border: 0; border-radius: 6px; font-size: 10px; padding: 1px 5px; cursor: pointer; }
dl.props { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
dl.props dt { color: var(--muted); }
dl.props dd { margin: 0; font-weight: 600; word-break: break-word; }
.private { background: #fff8e6; border: 1px dashed #e8c66a; border-radius: 10px; padding: 10px 12px; margin-top: 12px; font-size: 14px; }
@media (prefers-color-scheme: dark) { .private { background: #2a230f; border-color: #6b5a24; } }
.private b { display: block; font-size: 12px; color: var(--warn); margin-bottom: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.desc { white-space: pre-wrap; margin-top: 12px; }

.comments .c { padding: 10px 0; border-top: 1px solid var(--line); }
.comments .c:first-child { border-top: 0; }
.comments .c .who { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.comments .c .tx { white-space: pre-wrap; margin-top: 4px; }
.comments form { display: flex; gap: 8px; margin-top: 10px; }
.comments form textarea { min-height: 44px; }

.match-group { margin-bottom: 18px; }
.match-group .rq { margin-bottom: 8px; }
.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 260px); gap: 12px; overflow-x: auto; padding-bottom: 6px; }

.empty { text-align: center; color: var(--muted); padding: 40px 16px; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 30px 12px; }
.modal { background: var(--card); border-radius: 18px; width: 100%; max-width: 620px; padding: 20px; }
.modal h3 { margin: 0 0 14px; font-size: 19px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form .full { grid-column: 1 / -1; }
.form label { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.form .hint { font-size: 12px; color: var(--warn); margin-top: 3px; }
.form .chk { display: flex; gap: 8px; align-items: center; color: var(--ink); font-weight: 500; font-size: 14px; }
.form .chk input { width: auto; }
@media (max-width: 520px) { .form { grid-template-columns: 1fr; } }
.modal .foot { display: flex; gap: 8px; justify-content: flex-end; margin: 18px -20px -20px; padding: 12px 20px; position: sticky; bottom: -30px; background: var(--card); border-top: 1px solid var(--line); border-radius: 0 0 18px 18px; }
.err { color: var(--ink); font-weight: 600; font-size: 14px; margin-top: 10px; }

/* auth */
.auth { max-width: 380px; margin: 8vh auto; padding: 0 16px; }
.auth .panel { padding: 24px; }
.auth h1 { margin-bottom: 6px; }
.auth .f { margin-top: 12px; }
.auth .f label { display: block; font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.auth .btn { width: 100%; margin-top: 18px; padding: 12px; }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; z-index: 60; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font-size: 22px; }
.stat span { color: var(--muted); font-size: 13px; }
.copy { display: flex; gap: 8px; } .copy input { flex: 1; }

/* site logo (from automint.ua) */
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.logo .lg { width: 111px; height: 20px; display: block; flex: none; }
.logo .lg-sub { font-weight: 600; font-size: 14px; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line); line-height: 18px; }
.logo-lg .lg { width: 138px; height: 24px; }
.hero .logo { color: #fff; }
@media (max-width: 360px) { .logo .lg-sub { display: none; } }

/* language switch */
.lang { display: inline-flex; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; flex: none; }
.lang button { border: 0; background: none; font: 700 12px/1 inherit; padding: 5px 7px; border-radius: 6px; color: var(--muted); cursor: pointer; }
.lang button.on { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 720px) { header.top .lang { margin-left: auto; } }
.auth-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.hero-top .logo { margin-bottom: 0 !important; }
.hero .lang { border-color: #3a3c42; }
.hero .lang button { color: #b5b8be; }
.hero .lang button.on { background: #fff; color: #0d0d0f; }

/* compact horizontal car cards */
.grid.rows { grid-template-columns: repeat(auto-fill, minmax(min(440px, 100%), 1fr)); gap: 10px; }
.rows .card { display: flex; align-items: stretch; }
.rows .card .ph { flex: none; width: 190px; aspect-ratio: auto; min-height: 128px; font-size: 26px; }
.rows .card .bd { flex: 1; min-width: 0; padding: 10px 14px; display: flex; flex-direction: column; }
.rows .card .ttl { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rows .card .meta { font-size: 12.5px; }
.rows .card .row { margin-top: auto; padding-top: 6px; flex-wrap: wrap; row-gap: 4px; }
.rows .card .price { font-size: 17px; }
@media (max-width: 520px) { .grid.rows { grid-template-columns: 1fr; } .rows .card .ph { width: 128px; min-height: 104px; } .rows .card .bd { padding: 8px 10px; } .rows .card .ttl { font-size: 14px; } .rows .card .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }
.rows .card .row + .row { margin-top: 4px; padding-top: 0; }
.rows .card .new-dot { top: 6px; left: 6px; right: auto; }

/* focus without black outlines */
button:focus, a:focus, .btn:focus { outline: none; }
button:focus-visible, a:focus-visible, .btn:focus-visible, input[type=checkbox]:focus-visible { outline: 2px solid rgba(61,220,151,.6); outline-offset: 2px; }
input[type=checkbox] { accent-color: #3ddc97; }

/* selects: own chevron instead of the browser arrow */
select { -webkit-appearance: none; appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px; }
.toolbar select { min-width: 190px; }
@media (max-width: 520px) { .toolbar select { min-width: 150px; } }

/* "+ add car" — always available */
.btn.add-car { background: #e7f6ee; border-color: #cdebd9; color: var(--ok); font-weight: 700; white-space: nowrap; }
.btn.add-car:hover { background: #d9f0e3; border-color: #b9e2ca; }
.fab { display: none; }
@media (max-width: 720px) {
  .btn.add-car { display: none; }
  .fab { display: flex; align-items: center; justify-content: center; position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 31;
    width: 54px; height: 54px; border-radius: 50%; border: 0; background: #e7f6ee; color: var(--ok); border: 1px solid #cdebd9; font-size: 30px; font-weight: 600; line-height: 1;
    box-shadow: 0 6px 18px rgba(0,0,0,.18); cursor: pointer; padding: 0 0 3px; }
}

/* paint map */
.paintbox { display: flex; gap: 18px; align-items: flex-start; }
.carmap { width: 150px; flex: none; display: block; }
.carmap .part { fill: #eef0f3; stroke: #9ca3af; stroke-width: 1.3; transition: fill .12s; }
.paintbox.edit .part { cursor: pointer; }
.paintbox.edit .part:hover { stroke: #3ddc97; stroke-width: 2.4; }
.carmap .part.on { fill: #f5a524; stroke: #b7791f; }
.carmap .fixed { fill: #d6d9de; stroke: #b4b9c1; stroke-width: 1; }
.carmap .glass { fill: #cdd6e1; }
.carmap .wheel { fill: #3f444c; }
.paint-side { flex: 1; min-width: 0; font-size: 14px; }
.paint-side .legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.paint-side .legend span { display: inline-flex; align-items: center; gap: 6px; }
.paint-side .sw { width: 14px; height: 14px; border-radius: 4px; background: #eef0f3; border: 1px solid #9ca3af; display: inline-block; }
.paint-side .sw.on { background: #f5a524; border-color: #b7791f; }
.paint-list { margin-top: 10px; }
.paint-list ul { margin: 6px 0 0; padding-left: 18px; }
.paint-list li { margin: 2px 0; }
.paint-side .hint { margin-top: 10px; }
@media (prefers-color-scheme: dark) { .carmap .part { fill: #2a2d32; stroke: #6b7280; } .carmap .fixed { fill: #3a3e45; stroke: #555b64; } .carmap .glass { fill: #46505e; } .paint-side .sw { background: #2a2d32; } }
@media (max-width: 420px) { .carmap { width: 120px; } .paintbox { gap: 12px; } }
@media (prefers-color-scheme: dark) {
  :root { --brand: #10301f; --brand-ink: #4fd18b; }
  .btn.add-car, .fab { background: #10301f !important; border-color: #1d4d33 !important; color: #4fd18b !important; }
}

/* paint map v2 */
.carmap { width: 190px; }
.carmap .shadow { fill: rgba(0,0,0,.05); }
.carmap .body { fill: #cfd3d9; stroke: #9aa1ab; stroke-width: 1.4; }
.carmap .part { fill: #f4f5f7; stroke: #fff; stroke-width: 2.2; stroke-linejoin: round; }
.paintbox.edit .part:hover { fill: #e9f8f0; stroke: #fff; stroke-width: 2.2; }
.carmap .part.on, .paintbox.edit .part.on:hover { fill: #f5a524; stroke: #fff; }
.carmap .fixed { fill: #dfe2e6; stroke: #fff; stroke-width: 2; }
.carmap .glass { fill: #aeb9c7; stroke: #fff; stroke-width: 1.6; }
.carmap .lamp { fill: #f7f8fa; stroke: #b4bac3; stroke-width: 1; }
.carmap .lamp.rear { fill: #ead9d9; }
.carmap .mirror { fill: #c3c8cf; stroke: #9aa1ab; stroke-width: 1; }
.carmap .wheel { fill: #2f3339; }
.carmap .handle { stroke: #b4bac3; stroke-width: 2.2; fill: none; }
.carmap .dir { font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; fill: var(--muted); text-anchor: middle; }
@media (prefers-color-scheme: dark) {
  .carmap .body { fill: #3a3e45; stroke: #555b64; } .carmap .part { fill: #2a2d32; stroke: #17191c; }
  .carmap .fixed { fill: #33373d; stroke: #17191c; } .carmap .glass { fill: #46505e; stroke: #17191c; }
  .carmap .part.on { stroke: #17191c; } .paintbox.edit .part:hover { fill: #1d3a2b; stroke: #17191c; }
}
@media (max-width: 420px) { .carmap { width: 140px; } }
.carmap .part, .paintbox.edit .part:hover { stroke: #aab1bb; stroke-width: 1.3; }
.carmap .part.on, .paintbox.edit .part.on:hover { stroke: #c9820f; }
.carmap .fixed { stroke: #aab1bb; stroke-width: 1.2; }
@media (prefers-color-scheme: dark) { .carmap .part, .carmap .fixed, .paintbox.edit .part:hover { stroke: #5b616b; } }
/* paint map v3 */
.carmap { width: 200px; }
.carmap .deco { pointer-events: none; }
.carmap .crease { fill: none; stroke: rgba(0,0,0,.10); stroke-width: 1.2; stroke-linecap: round; }
.carmap .sunroof { fill: #aeb9c7; fill-opacity: .55; stroke: #8c98a8; stroke-width: 1; }
.carmap .handle { stroke: #9aa1ab; stroke-width: 2.4; stroke-linecap: round; fill: none; }
.carmap .lamp { fill: #fff; stroke: #aab1bb; stroke-width: 1; }
.carmap .lamp.rear { fill: #ecdada; }
@media (prefers-color-scheme: dark) { .carmap .crease { stroke: rgba(255,255,255,.12); } .carmap .lamp { fill: #4a4f57; stroke: #5b616b; } }
@media (max-width: 420px) { .carmap { width: 150px; } }
/* paint map: wider car */
.carmap { width: 250px; }
.carmap path, .carmap rect, .carmap ellipse { vector-effect: non-scaling-stroke; }
@media (max-width: 420px) { .carmap { width: 180px; } .paintbox { gap: 10px; } }
/* paint map v4: unfolded body */
.paintbox { flex-wrap: wrap; }
.carmap { width: 340px; max-width: 100%; }
.carmap .part, .paintbox.edit .part:hover { fill: #f4f5f7; stroke: #aab1bb; stroke-width: 1.3; }
.paintbox.edit .part:hover { fill: #e9f8f0; }
.carmap .part.on, .paintbox.edit .part.on:hover { fill: #f5a524; stroke: #c9820f; }
.carmap .fixed { fill: #dfe2e6; stroke: #aab1bb; stroke-width: 1.2; }
.carmap .glass { fill: #c3ccd7; stroke: #aab1bb; stroke-width: 1.2; }
.carmap .win { fill: #c3ccd7; fill-opacity: .7; stroke: none; }
.carmap .wheel { fill: #3a3f46; }
.carmap .hub { fill: #9aa1ab; }
.carmap .handle { stroke: #9aa1ab; stroke-width: 2.4; stroke-linecap: round; fill: none; }
.carmap .lamp { fill: #fff; stroke: #aab1bb; stroke-width: 1; }
.carmap .plabel { font-size: 11px; font-weight: 600; fill: #6b7280; text-anchor: middle; }
.carmap .part.on + .x { }
.carmap .dir { font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; fill: var(--muted); text-anchor: middle; }
.paint-side { min-width: 160px; }
@media (prefers-color-scheme: dark) {
  .carmap .part, .paintbox.edit .part:hover { fill: #2a2d32; stroke: #5b616b; } .paintbox.edit .part:hover { fill: #1d3a2b; }
  .carmap .part.on { fill: #f5a524; } .carmap .fixed { fill: #33373d; stroke: #5b616b; } .carmap .glass, .carmap .win { fill: #46505e; }
  .carmap .plabel { fill: #9aa0a8; }
}
@media (max-width: 420px) { .carmap { width: 100%; } }
/* paint map v5: editor = unfolded, card = real car */
.carmap.unf { width: 340px; }
.carmap.real { width: 260px; }
.carmap .plabel { pointer-events: none; }
.carmap .part.on ~ .deco .plabel { }
@media (max-width: 420px) { .carmap.unf { width: 100%; } .carmap.real { width: 190px; } }
/* paint map v6 */
.carmap .frame { fill: rgba(0,0,0,.028); }
.carmap .bodyg { stroke: #9aa1ab; stroke-width: 1.2; }
.carmap .part, .paintbox.edit .part:hover { fill: #f6f7f8; stroke: #b3b9c2; stroke-width: 1.1; }
.paintbox.edit .part:hover { fill: #eaf7f0; stroke: #8fd3ad; }
.carmap .part.on, .paintbox.edit .part.on:hover { fill: #f4a62a; stroke: #c98213; }
.carmap .fixed { fill: #d9dde2; stroke: #aab1bb; stroke-width: 1; }
.carmap .grille { fill: #8d949e; pointer-events: none; }
.carmap .rim { fill: #c7ccd3; } .carmap .hub { fill: #7d848e; }
.carmap .mirror { fill: #c7ccd3; stroke: #9aa1ab; stroke-width: 1; }
.carmap .lamp { fill: #fbfcfd; stroke: #a9b0b9; stroke-width: .9; }
.carmap .lamp.rear { fill: #e9d3d3; stroke: #c4a9a9; }
.carmap .crease { fill: none; stroke: rgba(0,0,0,.09); stroke-width: 1.1; stroke-linecap: round; }
.carmap .handle { stroke: #a1a8b1; stroke-width: 2.4; stroke-linecap: round; fill: none; }
.carmap .plabel { font-size: 10.5px; font-weight: 600; fill: #6b7280; text-anchor: middle; letter-spacing: .02em; }
.carmap .shadow { fill: rgba(0,0,0,.045); }
.carmap.real { width: 230px; }
@media (prefers-color-scheme: dark) {
  .carmap .frame { fill: rgba(255,255,255,.03); }
  .carmap .part, .paintbox.edit .part:hover { fill: #2a2d32; stroke: #4b5058; } .paintbox.edit .part:hover { fill: #1d3a2b; }
  .carmap .part.on { fill: #f4a62a; } .carmap .fixed { fill: #33373d; stroke: #4b5058; }
}
@media (max-width: 420px) { .carmap.real { width: 175px; } }
/* paint diagram as the last gallery item (client catalog) */
.thumbs .pthumb { flex: none; width: 76px; height: 57px; border-radius: 8px; border: 2px solid transparent; background: var(--bg); cursor: pointer; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.thumbs .pthumb.on { border-color: var(--ink); }
.thumbs .pthumb .carmap.real { width: auto; height: 52px; }
.paint-slide { height: 100%; display: flex; flex-direction: column; padding: 12px 16px; }
.paint-slide .ps-title { font-weight: 700; font-size: 15px; }
.paint-slide .paintbox { flex: 1; min-height: 0; align-items: center; justify-content: center; flex-wrap: nowrap; }
.paint-slide .carmap.real { height: 100%; width: auto; max-width: 55%; }
.paint-slide .paint-side { flex: 0 1 auto; }
@media (max-width: 520px) { .paint-slide { padding: 8px 10px; } .paint-slide .paint-side { font-size: 12px; } .paint-slide .paint-list ul { padding-left: 14px; } }
/* big paint slide: horizontal car fills the photo frame */
.paint-slide { width: 100%; height: 100%; display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; text-align: left; }
.paint-slide .ps-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.paint-slide .legend { display: flex; gap: 12px; color: var(--muted); font-size: 12px; }
.paint-slide .legend span { display: inline-flex; align-items: center; gap: 5px; }
.paint-slide .sw { width: 12px; height: 12px; border-radius: 3px; background: #f6f7f8; border: 1px solid #b3b9c2; display: inline-block; }
.paint-slide .sw.on { background: #f4a62a; border-color: #c98213; }
.paint-slide .ps-car { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.paint-slide .carmap.real.h { width: 100%; height: 100%; max-width: none; }
.paint-slide .ps-list { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; justify-content: center; font-size: 12.5px; }
.paint-slide .chip { background: #fdf0d9; color: #8a5a0b; border-radius: 999px; padding: 2px 9px; font-weight: 600; }
@media (prefers-color-scheme: dark) { .paint-slide .chip { background: #3a2a0e; color: #f4c06a; } }
@media (max-width: 520px) { .paint-slide { padding: 8px 10px; gap: 4px; } .paint-slide .ps-head { font-size: 13px; } .paint-slide .legend { display: none; } .paint-slide .ps-list { font-size: 11.5px; } }
.thumbs .pthumb .carmap.real.h { width: 70px; height: auto; max-width: none; }
/* 3D car in the gallery */
car-3d { display: block; position: relative; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
car-3d.drag { cursor: grabbing; }
car-3d svg { display: block; width: 100%; height: 100%; }
car-3d .c3-hint { position: absolute; right: 2px; bottom: 0; font-size: 11px; color: var(--muted); pointer-events: none; }
/* many photos: the thumbnail strip scrolls instead of stretching the column */
.detail { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.detail > *, .gallery, .gallery .thumbs { min-width: 0; }
.gallery .thumbs { max-width: 100%; scrollbar-width: thin; }
@media (max-width: 860px) { .detail { grid-template-columns: minmax(0, 1fr); } }
.thumbs > * { flex: none; }

/* gallery arrows + full-screen viewer */
.gm-wrap { position: relative; }
.gm-wrap > .main:not(.is-paint), .gm-wrap > .big-ph:not(.is-paint) { cursor: zoom-in; }
.gnav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; width: 40px; height: 40px; border-radius: 50%; border: 0; padding: 0;
  display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.92); color: #15171a; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.18); transition: opacity .15s, background-color .15s; }
.gnav:hover { background: #fff; }
.gnav.prev { left: 10px; } .gnav.next { right: 10px; }
.gm-wrap .gnav { opacity: 0; }
.gm-wrap:hover .gnav, .gm-wrap .gnav:focus-visible { opacity: 1; }
@media (hover: none) { .gm-wrap .gnav { opacity: .9; width: 36px; height: 36px; } }
.lb { position: fixed; inset: 0; z-index: 200; background: rgba(8,9,11,.94); display: flex; align-items: center; justify-content: center; }
.lb-stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 56px 70px; box-sizing: border-box; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.lb-paint { background: #fff; border-radius: 14px; width: min(1000px, 100%); aspect-ratio: 16 / 10; max-height: 100%; overflow: hidden; }
.lb .gnav { position: fixed; } .lb .gnav.prev { left: 16px; } .lb .gnav.next { right: 16px; }
.lb-x { position: fixed; top: 12px; right: 14px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lb-x:hover { background: rgba(255,255,255,.25); }
.lb-count { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); color: #cfd3d8; font-size: 13px; letter-spacing: .04em; }
@media (max-width: 600px) { .lb-stage { padding: 56px 6px; } .lb .gnav { width: 36px; height: 36px; } .lb .gnav.prev { left: 6px; } .lb .gnav.next { right: 6px; } .lb-paint { aspect-ratio: 3 / 4; } }
/* realistic WebGL car */
car-3d .c3gl, car-3d .c3gl canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
car-3d .c3gl canvas { touch-action: pan-y; }
car-3d .c3-load { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); pointer-events: none; }
car-3d .c3-credit { position: absolute; right: 2px; top: 0; font-size: 10px; color: var(--muted); opacity: .75; text-decoration: none; }
car-3d .c3-credit:hover { opacity: 1; text-decoration: underline; }
/* painted parts summary under the 3D car */
.paint-slide .ps-list { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.paint-slide .ps-count { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.paint-slide .ps-count b { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #f4a62a; color: #fff; font-size: 12px; letter-spacing: 0; display: inline-flex; align-items: center; justify-content: center; }
.paint-slide .ps-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.paint-slide .chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 9px; border-radius: 999px; background: var(--card); border: 1px solid #f0d2a0; color: #6f4508; font-size: 12.5px; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.paint-slide .chip i { width: 8px; height: 8px; border-radius: 50%; background: #f4a62a; box-shadow: 0 0 0 3px rgba(244,166,42,.18); }
.paint-slide .ps-ok { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: #e7f6ee; color: #0f7a45; font-size: 13px; font-weight: 600; }
@media (prefers-color-scheme: dark) { .paint-slide .chip { border-color: #6b4a14; color: #f4c06a; } .paint-slide .ps-ok { background: #10301f; color: #4fd18b; } }
@media (max-width: 520px) { .paint-slide .chip { font-size: 11.5px; padding: 3px 9px 3px 7px; } }
/* the 3D slide in the card frame grows with its content; the car keeps a fixed height */
.gm-wrap > .is-paint { aspect-ratio: auto !important; max-height: none !important; height: auto !important; display: block; }
.gm-wrap .paint-slide { height: auto; }
.gm-wrap .paint-slide .ps-car { flex: none; height: clamp(210px, 46vw, 300px); }
/* drag & drop photos */
.dropzone { border: 1.5px dashed #c6ccd4; border-radius: 12px; padding: 16px; text-align: center; cursor: pointer; background: var(--bg); transition: border-color .15s, background-color .15s; }
.dropzone:hover { border-color: #8fd3ad; }
.dropzone .dz-icon { font-size: 24px; line-height: 1; }
.dropzone .dz-text { margin-top: 6px; font-size: 14px; color: var(--muted); }
.dropzone .dz-text u { color: var(--ink); text-underline-offset: 2px; }
.dropzone .dz-prev { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.dropzone .dz-prev:empty { display: none; }
.dz-th { position: relative; width: 64px; height: 48px; border-radius: 6px; overflow: hidden; background: #ddd; }
.dz-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dz-th button { position: absolute; top: 2px; right: 2px; border: 0; border-radius: 5px; background: rgba(0,0,0,.6); color: #fff; font-size: 10px; padding: 1px 4px; cursor: pointer; }
.drag-over { outline: 2px dashed #3ddc97; outline-offset: -2px; background-color: #eaf7f0 !important; }
.panel.gallery.drag-over { position: relative; }
.panel.gallery.drag-over::after { content: attr(data-drop); }
.dz-hint { font-size: 12px; }
@media (prefers-color-scheme: dark) { .drag-over { background-color: #10301f !important; } .dropzone { border-color: #3a3e45; } }
/* number fields without spinner arrows */
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
/* compact checkboxes row in the car form */
.form .chk { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; padding: 6px 0; }
.form .chk input { width: 18px; height: 18px; margin: 0; flex: none; }
/* own suggestion dropdown right under the field */
.suggest { position: absolute; z-index: 60; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.14); max-height: 240px; overflow-y: auto; padding: 4px; }
.suggest .sg { padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest .sg:hover, .suggest .sg.on { background: var(--bg); }
datalist { display: none; }
/* 3D car: just a turntable — no grabbing, the page scrolls freely over it */
car-3d, car-3d.drag { cursor: default; }
car-3d .c3gl canvas { pointer-events: none; }
car-3d .c3-hint { display: none; }
/* summary card under the 3D car */
.paint-slide .ps-sum { display: flex; align-items: center; gap: 16px; padding: 12px 16px; margin-top: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.04); text-align: left; }
.paint-slide .ps-num { display: flex; align-items: center; gap: 10px; flex: none; padding-right: 16px; border-right: 1px solid var(--line); }
.paint-slide .ps-num b { font-size: 30px; line-height: 1; font-weight: 800; color: #e8901a; display: inline-flex; }
.paint-slide .ps-num span { font-size: 11px; line-height: 1.3; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); max-width: 92px; }
.paint-slide .ps-parts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.paint-slide .ps-parts li { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink); }
.paint-slide .ps-parts li::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: #f4a62a; box-shadow: 0 0 0 3px rgba(244,166,42,.16); flex: none; }
.paint-slide .ps-sum.ok { justify-content: center; }
.paint-slide .ps-sum.ok .ps-num { border-right: 0; padding-right: 0; }
.paint-slide .ps-sum.ok .ps-num b { color: #12a05c; }
.paint-slide .ps-sum.ok .ps-num span { max-width: none; }
@media (max-width: 520px) {
  .paint-slide .ps-sum { gap: 12px; padding: 10px 12px; }
  .paint-slide .ps-num { padding-right: 12px; }
  .paint-slide .ps-num b { font-size: 26px; }
  .paint-slide .ps-num span { font-size: 10px; max-width: 74px; }
  .paint-slide .ps-parts { flex-direction: column; gap: 5px; }
  .paint-slide .ps-parts li { font-size: 13px; }
}
/* smaller model credit (licence requires it to stay visible) */
car-3d .c3-credit { font-size: 8px; opacity: .5; letter-spacing: .01em; }
/* custom select */
.cs { position: relative; display: block; }
.toolbar .cs { display: inline-block; min-width: 190px; flex: 0 1 auto; }
.cs > select { display: none !important; }
.cs-btn { width: 100%; text-align: left; padding: 10px 38px 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font: inherit; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center / 12px 8px; transition: border-color .15s, box-shadow .15s; }
.cs-btn:hover { border-color: #c9ced6; }
.cs.open .cs-btn, .cs-btn:focus-visible { outline: none; border-color: #3ddc97; box-shadow: 0 0 0 3px rgba(61,220,151,.18); }
.cs.open .cs-btn { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 6.5l5-5 5 5' fill='none' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.cs-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 100%; z-index: 70; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.14); padding: 5px; max-height: 280px; overflow-y: auto; }
.cs-menu.up { top: auto; bottom: calc(100% + 6px); }
.cs-opt { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; font-size: 14px; }
.cs-opt:hover, .cs-opt.act { background: var(--bg); }
.cs-opt.sel { font-weight: 600; }
.cs-opt.sel::after { content: ""; width: 12px; height: 9px; flex: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='9' viewBox='0 0 12 9'%3E%3Cpath d='M1 4.5l3.5 3.5L11 1' fill='none' stroke='%2312a05c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center; }
@media (max-width: 520px) { .toolbar .cs { min-width: 150px; } }
/* two checkboxes stacked in one form cell */
.form .chk-group { display: flex; flex-direction: column; gap: 2px; }
.form .chk-group .chk { padding: 3px 0; }
/* checkboxes sit next to «Входная цена» (same row), aligned with its input */
.form .chk-group:not(.full) { padding-top: 20px; }
@media (max-width: 520px) { .form .chk-group:not(.full) { padding-top: 0; } }
/* import by link */
.import-box { background: #eaf7f0; border: 1px solid #cdebd9; border-radius: 12px; padding: 12px; }
.import-box label { color: #0f7a45 !important; }
.import-box .imp-row { display: flex; gap: 8px; }
.import-box .imp-row input { flex: 1; min-width: 0; background: var(--card); }
.import-box .imp-go { flex: none; background: #fff; }
.import-box .imp-st { margin-top: 6px; font-size: 13px; }
.import-box .imp-st:empty { display: none; }
.import-box .imp-st.ok { color: #0f7a45; }
.import-box .imp-st.err { color: var(--ink); font-weight: 600; }
@media (prefers-color-scheme: dark) { .import-box { background: #10301f; border-color: #1d4d33; } .import-box label, .import-box .imp-st.ok { color: #4fd18b !important; } }
