/* p2pcars.in seller kit: calm, phone-first. No inline styles (CSP style-src 'self'). */
:root { --ink: #17212b; --muted: #5a6672; --line: #dfe4ea; --bg: #f5f7f9; --card: #fff; --brand: #1f3a5f;
    --brand-dark: #152a46; --tint: #e7edf4; --wa: #128c4a; --bad: #b42318; --radius: 10px; }
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink);
    background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
main { width: 100%; max-width: 1140px; margin: 0 auto; padding: 1.5rem 1rem 2.5rem; flex: 1; }
main.narrow { max-width: 40rem; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 .75rem; }
h2 { font-size: 1.2rem; margin: 1.75rem 0 .5rem; }
a { color: var(--brand); text-underline-offset: 2px; }
.faint { color: var(--muted); }
.small { font-size: .875rem; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 1rem;
    background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 800; letter-spacing: .06em;
    text-transform: uppercase; color: var(--brand); text-decoration: none; font-size: 1.15rem; }
.mark { width: 1.4rem; height: 1.4rem; }
.foot { max-width: 1000px; margin: 0 auto; width: 100%; padding: 1.25rem 1rem 2rem; border-top: 1px solid var(--line);
    display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; font-size: .875rem; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; }
.foot span { color: var(--muted); margin-left: auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .6rem 1.1rem;
    border-radius: 8px; border: 1px solid var(--brand); background: var(--brand); color: #fff; font: inherit;
    font-weight: 600; text-decoration: none; cursor: pointer; min-height: 2.75rem; }
.btn:hover { background: var(--brand-dark); }
.btn.small { padding: .35rem .8rem; min-height: 2.25rem; font-size: .9rem; }
.btn.big { padding: .8rem 1.4rem; font-size: 1.05rem; min-height: 3.1rem; }
.btn.ghost { background: var(--card); color: var(--brand); }
.btn.ghost:hover { background: var(--tint); }
.btn.wa { background: var(--wa); border-color: var(--wa); }
.btn.wa:hover { background: #0e723c; }
.btn[disabled] { opacity: .6; cursor: progress; }
button.link { background: none; border: 0; padding: 0; color: var(--brand); text-decoration: underline; font: inherit; cursor: pointer; }
button.link.danger { color: var(--bad); }
.hero { padding: 2rem 0 1rem; max-width: 44rem; }
.hero h1 { font-size: 2.1rem; }
.lead { font-size: 1.1rem; color: #33404c; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; margin: 1rem 0; }
.card h2 { margin-top: 0; }
.note { background: var(--tint); border-radius: 8px; padding: .7rem .9rem; }
.error { background: #fdecea; color: var(--bad); border-radius: 8px; padding: .7rem .9rem; margin: .5rem 0; }
.ok { color: #0e723c; }
.form fieldset { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); margin: 0 0 1rem; padding: .9rem 1rem 1rem; }
.form legend { font-weight: 700; padding: 0 .3rem; }
.form label, .stack label { display: flex; flex-direction: column; gap: .25rem; font-weight: 500; margin: 0 0 .8rem; flex: 1; min-width: 0; }
.row { display: flex; gap: .8rem; flex-wrap: wrap; }
.row > label { min-width: 9rem; }
input, select, textarea { font: inherit; padding: .55rem .65rem; border: 1px solid #c2cad3; border-radius: 8px; background: #fff;
    color: var(--ink); width: 100%; font-weight: 400; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; }
.top form { margin: 0; }
.chip.warn { border-color: #e3b341; color: #7a5600; background: #fff8e6; }
.chip.good { border-color: #9bd3ae; color: #0e723c; background: #eef9f1; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .actions { justify-content: center; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.actions form { margin: 0; }
.btn.danger { background: var(--card); color: var(--bad); border-color: #e7b4ae; }
.btn.danger:hover { background: #fdecea; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: .5rem; margin: .6rem 0; }
.photos figure { margin: 0; position: relative; }
.photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block; cursor: zoom-in; background: #dde3e9; }
.photos figure.is-cover img { outline: 3px solid var(--brand); outline-offset: -3px; }
.photos .ph-actions { position: absolute; top: .25rem; right: .25rem; display: flex; gap: .25rem; }
.photos .ph-actions form { margin: 0; }
.photos .ph-actions button { background: rgba(23, 33, 43, .75); color: #fff; border: 0; border-radius: 6px; padding: .1rem .45rem; font: inherit; font-size: .8rem; cursor: pointer; }
.photos .cover-tag { position: absolute; left: .25rem; bottom: .25rem; background: var(--brand); color: #fff; font-size: .72rem; border-radius: 4px; padding: 0 .35rem; }
.pick { display: flex; align-items: center; justify-content: center; border: 2px dashed #c2cad3; border-radius: var(--radius); padding: 1rem;
    cursor: pointer; font-weight: 600; color: var(--brand); background: var(--card); }
.pick input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.status-line { min-height: 1.4rem; font-size: .9rem; color: var(--muted); }
.saved { font-size: .85rem; color: var(--muted); }
.layout2 { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.25rem; align-items: start; }
.facts { list-style: none; padding: 0; margin: .4rem 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .3rem .8rem; }
.facts li span { display: block; font-size: .8rem; color: var(--muted); }
.big-price { font-size: 1.5rem; font-weight: 800; margin: .2rem 0; }
dialog { border: 0; border-radius: var(--radius); padding: 1.1rem 1.2rem; max-width: 28rem; width: calc(100% - 2rem); box-shadow: 0 10px 40px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(23, 33, 43, .45); }
dialog h2 { margin-top: 0; }
video.reel { width: 100%; max-width: 22rem; aspect-ratio: 9 / 16; background: #000; border-radius: var(--radius); display: block; }
.hero { padding: 1.5rem 0 .5rem; max-width: 44rem; }
.hero h1 { font-size: 2rem; }
.lead { font-size: 1.1rem; color: #33404c; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; }
.hint { font-size: .88rem; color: var(--muted); min-height: 1.3rem; margin: -.4rem 0 .6rem; }
.hint.bad { color: var(--bad); }
.sticky-submit { position: sticky; bottom: 0; background: var(--bg); padding: .7rem 0; border-top: 1px solid var(--line); }
.sticky-submit .btn { width: 100%; }
table.list { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table.list th, table.list td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { font-size: .85rem; color: var(--muted); font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .5rem 1rem; border-radius: 8px; font-size: .92rem; }
[hidden] { display: none !important; }
@media (max-width: 760px) {
    .layout2 { grid-template-columns: 1fr; }
    .hero h1 { font-size: 1.6rem; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); }
}

/* ---- home (2026-11-24 redesign) ---- */
.ic { width: 1.1rem; height: 1.1rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.top-in { width: 100%; max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.top:has(.top-in) { padding: .9rem 1.5rem; }
.top-in nav { display: flex; gap: .6rem; align-items: center; }
.top-in .brand { text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 1.35rem; gap: .7rem; }
.top-in .mark { width: 2.4rem; height: 2.4rem; border-radius: 8px; }
.top-tags { display: flex; align-items: center; gap: 1.5rem; font-size: .95rem; }
.with-icon { display: inline-flex; align-items: center; gap: .4rem; font-weight: 500; }
main.home { max-width: 1200px; padding: 3rem 1.5rem 3rem; }
.home-hero, .home-forms { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1.75rem; align-items: start; }
.home-forms { margin-top: 2.5rem; align-items: stretch; }
.home .hero { padding: 0; max-width: none; }
.pill { display: inline-flex; align-items: center; gap: .5rem; background: #e9ecef; border-radius: 999px; padding: .4rem 1rem; font-size: .95rem; font-weight: 500; margin: 0 0 1.75rem; }
.home .hero h1 { font-size: 3.1rem; line-height: 1.12; letter-spacing: -.02em; margin: 0 0 1.5rem; max-width: 17ch; }
.home .lead { color: var(--muted); font-size: 1.15rem; line-height: 1.75; margin: 0 0 1.75rem; max-width: 36rem; }
.ticks { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; font-weight: 500; }
.ticks li { display: inline-flex; align-items: center; gap: .45rem; }
.home .card { margin: 0; border-radius: 14px; padding: 1.75rem 2rem; box-shadow: 0 1px 3px rgba(23, 33, 43, .06); }
.home .card h2 { margin: 0; font-size: 1.05rem; }
.home .card p { margin: .2rem 0 0; }
.intake { padding: 1.5rem 1.5rem 1.6rem; }
.intake-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--line); margin-bottom: 1.4rem; }
.numbered { list-style: none; counter-reset: n; padding: 0; margin: 0; display: grid; gap: 1.1rem; }
.numbered li { counter-increment: n; position: relative; background: #eceef1; border-radius: 10px; padding: 1rem 1rem 1rem 4.4rem; display: flex; flex-direction: column; }
.numbered li::before { content: counter(n); position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); width: 2.4rem; height: 2.4rem;
    border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: .95rem; display: flex; align-items: center; justify-content: center; }
.numbered strong { font-weight: 600; font-size: 1.05rem; }
.numbered span { color: var(--muted); font-size: .95rem; }
.tile-icon { width: 2.9rem; height: 2.9rem; border-radius: 8px; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.tile-icon .ic { width: 1.35rem; height: 1.35rem; }
.tile-icon.soft { background: #e9ecef; color: var(--ink); }
.panel-head { display: flex; gap: 1.1rem; align-items: flex-start; margin-bottom: 2rem; }
.home .panel h2 { font-size: 1.65rem; letter-spacing: -.01em; }
.home .panel .open-title { margin-top: 1.6rem; }
.home .panel > .faint { font-size: 1.05rem; margin-bottom: 1.6rem; }
.home .panel-head .faint { font-size: 1.05rem; }
.home .panel label { display: flex; flex-direction: column; gap: .55rem; font-weight: 500; margin: 0 0 1rem; flex: 1; min-width: 12rem; }
.home .panel .row { gap: 1.75rem; }
.home .panel input { background: #f6f7f9; border-color: var(--line); padding: .8rem 1rem; }
.home .hint { margin: .2rem 0 1.4rem; font-size: .92rem; }
.home .hint.ok { color: #0e723c; }
.btn.wide { width: 100%; }
.home .btn.ghost { color: var(--ink); border-color: var(--line); }
@media (max-width: 860px) {
    .home-hero, .home-forms { grid-template-columns: 1fr; }
    .home .hero h1 { font-size: 2.1rem; }
    .top-tags .faint { display: none; }
    main.home { padding: 1.75rem 1rem 2rem; }
    .home .card { padding: 1.4rem 1.25rem; }
}

/* ---- agency pages (2026-11-26): the home page's look on the catalog, car, login and sell pages ---- */
.top-in { max-width: 1140px; }
.top:has(.brand) .top-in { max-width: 1200px; }
.agency-name { display: inline-flex; align-items: center; gap: .75rem; font-size: 1.35rem; font-weight: 800; color: var(--ink);
    text-decoration: none; letter-spacing: -.01em; min-width: 0; }
.agency-name > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-icon.sm { width: 2.3rem; height: 2.3rem; border-radius: 9px; }
.tile-icon.sm .ic { width: 1.25rem; height: 1.25rem; }
.top button.link { color: var(--brand); font-weight: 500; }
main:not(.home) { padding: 2rem 1.5rem 3rem; }
main.narrow:has(.login) { max-width: 30rem; }
main:not(.home) .card { border-radius: 14px; padding: 1.4rem 1.5rem; box-shadow: 0 1px 3px rgba(23, 33, 43, .06); }
.card h2 { font-size: 1.2rem; }
.center { text-align: center; }
.forgot { margin: 1rem 0 0; }
.login h1 { font-size: 1.6rem; margin-bottom: .3rem; }
.login > .faint { margin: 0 0 1.4rem; }
main.narrow { padding-top: 3rem; }
.inline-form { display: flex; gap: .4rem; align-items: center; margin: 0; }
.inline-form input { max-width: 11rem; padding: .35rem .55rem; }

.tabs { display: flex; gap: 1.6rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 0 0 1.5rem; }
.tabs a { display: inline-flex; align-items: center; gap: .5rem; padding: .6rem .2rem .7rem; text-decoration: none; color: var(--muted);
    border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; font-size: 1.05rem; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-color: var(--brand); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 1.45rem; height: 1.45rem; padding: 0 .4rem;
    border-radius: 999px; background: #e9ecef; color: var(--ink); font-size: .78rem; font-weight: 700; }
.badge.hot { background: var(--brand); color: #fff; }

.toolbar { display: flex; gap: .75rem; flex-wrap: wrap; margin: 0 0 1.75rem; align-items: stretch; }
.toolbar > form { margin: 0; display: flex; }
.toolbar .search { gap: .75rem; flex: 1 1 22rem; }
.search-box { position: relative; flex: 1; display: flex; align-items: center; min-width: 0; }
.search-box .ic { position: absolute; left: .9rem; color: var(--muted); pointer-events: none; }
.search-box input { padding: .65rem .9rem .65rem 2.6rem; border-color: var(--line); background: var(--card); height: 100%; }
.toolbar .btn { padding-left: 1.3rem; padding-right: 1.3rem; }
.linkbar { display: flex; align-items: center; gap: .6rem; background: var(--card); border: 1px solid var(--line); border-radius: 10px;
    padding: .3rem .3rem .3rem .9rem; flex: 0 1 auto; min-width: 0; }
.linkbar > .ic { color: var(--muted); }
.linkbar code { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.linkbar .btn { min-height: 2.4rem; padding: .3rem .9rem; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.3rem; height: 2.3rem; border: 0; border-radius: 8px;
    background: none; color: var(--ink); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--tint); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1.4rem; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-decoration: none; color: inherit;
    display: flex; flex-direction: column; box-shadow: 0 1px 3px rgba(23, 33, 43, .06); transition: box-shadow .15s, transform .15s; }
.tile:hover { box-shadow: 0 6px 20px rgba(23, 33, 43, .1); transform: translateY(-1px); }
.tile .cover { aspect-ratio: 4 / 3; width: 100%; background: linear-gradient(135deg, #e6eaee, #d9dfe5); display: block; overflow: hidden; }
.tile .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .cover.none { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .9rem; }
.tile .body { padding: 1.1rem 1.25rem 1.25rem; display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.tile .name { font-weight: 700; font-size: 1.12rem; line-height: 1.3; }
.tile .price { font-weight: 800; font-size: 1.3rem; margin-top: .45rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }
.chip { font-size: .8rem; border: 1px solid var(--line); background: #f3f5f7; border-radius: 999px; padding: .12rem .65rem; color: var(--muted); }

/* car page */
.layout2 { gap: 1.5rem; }
.layout2 > * { min-width: 0; }
.layout2 .card:first-child { margin-top: 0; }
.layout2 aside .card { margin: 0 0 1.25rem; }
.layout2 > div > .card { margin: 0 0 1.25rem; }
.share-text { white-space: pre-line; overflow-wrap: anywhere; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
    padding: .8rem .9rem; font-size: .92rem; margin: 0 0 .4rem; }
.photos { grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .6rem; }
.photos img { border-radius: 10px; background: linear-gradient(135deg, #e6eaee, #d9dfe5); }
.photos .ph-actions { top: .35rem; right: .35rem; opacity: 0; transition: opacity .12s; }
.photos figure:hover .ph-actions, .photos figure:focus-within .ph-actions { opacity: 1; }
@media (hover: none) { .photos .ph-actions { opacity: 1; } }
.photos .ph-actions button { background: rgba(23, 33, 43, .78); padding: .15rem .5rem; }
.photos .cover-tag { left: .35rem; bottom: .35rem; font-size: .75rem; font-weight: 600; border-radius: 6px; padding: .05rem .45rem; }
.photos figure.is-cover img { outline: 3px solid var(--brand); outline-offset: -3px; }
.pick { border-radius: 12px; padding: 1.1rem; }
.pick:hover { background: var(--tint); }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.1rem 0; }

/* photo viewer: full screen, photo centred and fitted, arrows on the sides */
dialog.viewer { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border-radius: 0;
    background: rgba(12, 15, 19, .96); box-shadow: none; overflow: hidden; }
dialog.viewer::backdrop { background: rgba(12, 15, 19, .96); }
.v-img { position: absolute; inset: 3.5rem 4.5rem; width: calc(100% - 9rem); height: calc(100% - 7rem); object-fit: contain; display: block;
    transition: filter .2s; user-select: none; }
.v-img.soft { filter: blur(6px); }
.v-btn { position: absolute; border: 0; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; border-radius: 999px;
    width: 3rem; height: 3rem; font-size: 1.8rem; line-height: 1; display: flex; align-items: center; justify-content: center; }
.v-btn:hover { background: rgba(255, 255, 255, .24); }
.v-close { top: .9rem; right: .9rem; font-size: 1.2rem; width: 2.6rem; height: 2.6rem; }
.v-prev, .v-next { top: 50%; transform: translateY(-50%); }
.v-prev { left: .9rem; }
.v-next { right: .9rem; }
dialog.viewer.single .v-prev, dialog.viewer.single .v-next { display: none; }
.v-count { position: absolute; bottom: .7rem; left: 0; right: 0; text-align: center; color: #c9d1d9; font-size: .9rem; margin: 0; }
@media (max-width: 760px) {
    .v-img { inset: 3.5rem .5rem; width: calc(100% - 1rem); }
    .v-prev, .v-next { top: auto; bottom: .4rem; transform: none; width: 2.6rem; height: 2.6rem; }
    .toolbar .linkbar { flex: 1 1 100%; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; }
    .tabs { gap: .9rem; }
    .tabs a { font-size: .98rem; }
    main:not(.home) { padding: 1.4rem 1rem 2.5rem; }
    .top:has(.top-in) { padding: .8rem 1rem; }
    .agency-name { font-size: 1.15rem; }
}
