/* Revalio look (the reference is the public /demo): sticky white header, icon tabs, gradient hero and price cards, soft shadows, one button language.
   Loaded LAST on the seller app; it only restyles - no behaviour, no markup of its own except the hero strip drawn by seller.js. */
:root { --grad: linear-gradient(132deg,#0d2451 0%,#123d91 55%,#126cfb 100%); --grad-soft: linear-gradient(132deg,#0d2451,#2448b6 70%,#5a66ef); --blue-hover:#0f49d0; }
body { background: var(--bg); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }

/* header */
.topbar:not(.d-head) { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); padding: max(8px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 8px max(14px, env(safe-area-inset-left)); }
.topbar .brand-logo { font-size: 16px; }
.topbar .muted { font-size: 12px; color: var(--soft); max-width: 55vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wrap { max-width: 940px; }

/* tabs: icon cards */
.tabs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; margin: 0 0 10px; border: 0; overflow: visible; }
.tabs [role="tab"] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; padding: 6px 2px; border: 1px solid var(--line); background: #fff; border-radius: 12px; font-size: 12px; font-weight: 700; color: var(--soft); box-shadow: none; }
.tabs [role="tab"]::before { content: none; width: 19px; height: 19px; background: currentColor; -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.tabs [role="tab"][id]::before, .tabs [role="tab"][data-tab]::before { content: ""; }
.tabs [data-tab="login"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 4h4v16h-4M10 8l4 4-4 4M14 12H4'/%3E%3C/svg%3E"); }
.tabs [data-tab="register"] { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10' cy='8' r='4'/%3E%3Cpath d='M3 20c0-4 3-6 7-6M18 8v6M15 11h6'/%3E%3C/svg%3E"); }
.tabs [role="tab"]:hover:not([aria-selected="true"]) { background: #f3f7ff; border-color: #cfdcf7; color: var(--blue-d); }
.tabs [role="tab"][aria-selected="true"] { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 4px 12px rgba(22,91,247,.28); }
.tabs [role="tab"]:active { transform: scale(.98); }
#tab-sale, #c-tab-sale { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 7h12l-1 13H7L6 7Z'/%3E%3Cpath d='M9 7a3 3 0 0 1 6 0'/%3E%3C/svg%3E"); }
#tab-buyback, #c-tab-buyback { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E"); }
#tab-trade_in, #c-tab-trade_in { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9h14M14 5l4 4-4 4M20 15H6M10 11l-4 4 4 4'/%3E%3C/svg%3E"); }
#tab-compare, #c-tab-compare { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 4v16M17 4v16M4 9h6M14 15h6'/%3E%3C/svg%3E"); }
#tab-deals { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='4' width='14' height='17' rx='2'/%3E%3Cpath d='M9 9h6M9 13h6M9 17h3'/%3E%3C/svg%3E"); }
#tab-settings { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 7h8M17 7h2M5 17h2M11 17h8'/%3E%3Ccircle cx='15' cy='7' r='2'/%3E%3Ccircle cx='9' cy='17' r='2'/%3E%3C/svg%3E"); }

/* cards and fields */
:where(.card, .fold) { border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
input[type=text], input[type=tel], input[type=search], input[type=number], input[type=email], input[type=password], select, textarea { border: 1px solid var(--border-strong); border-radius: 12px; background: #fff; color: var(--ink); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
h2, h3 { letter-spacing: -.2px; }
:where(.muted) { color: var(--soft); }

/* one button language: default / hover / active / focus / disabled */
button, .btn { border: 1px solid #d5ddec; background: #fff; color: var(--ink); font-weight: 720; transition: transform .06s; }
button:hover:not(:disabled), .btn:hover { background: #f3f7ff; border-color: #b9ccf3; color: var(--blue-d); }
button:active:not(:disabled), .btn:active { transform: translateY(1px) scale(.99); }
button:focus-visible, .btn:focus-visible, [role=button]:focus-visible, [role=tab]:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
button.primary, .btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 4px 12px rgba(22,91,247,.25); }
button.primary:hover:not(:disabled), .btn.primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: #fff; box-shadow: 0 6px 16px rgba(22,91,247,.32); }
button.primary:active:not(:disabled) { background: #0c3aa8; border-color: #0c3aa8; color: #fff; box-shadow: none; }
button:disabled, .btn[aria-disabled="true"] { opacity: 1; cursor: not-allowed; background: #e9eef8; border-color: #dbe3f2; color: #7d8aa5; box-shadow: none; }
button.primary:disabled { background: #cdd9f4; border-color: #cdd9f4; color: #55648a; }
button.danger { color: #b3261e; border-color: #f0b8b4; background: #fff; }
button.danger:hover:not(:disabled) { background: #fdecea; border-color: #e5958f; color: #8f1d17; }
.picker-opt-btn, .picker-mem, .chip-btn { border-radius: 999px; }
.picker-opt-btn:hover:not(.sel), .chip-btn:not(.on):hover { background: #f3f7ff; border-color: #b9ccf3; color: var(--blue-d); }
.picker-opt-btn.sel, .picker-opt-btn[aria-pressed="true"], .chip-btn.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.picker-opt-btn.sel:hover, .chip-btn.on:hover { background: var(--blue-hover); color: #fff; }

/* search results (smart rows) */
.smart-rows { display: grid; gap: 8px; border: 0; }
.smart-rows .smart-row { border: 1px solid var(--line) !important; border-radius: 14px !important; background: #fff; box-shadow: var(--shadow); transition: transform .06s; }
.smart-rows .smart-row[role=button]:hover { border-color: #b9ccf3 !important; box-shadow: 0 10px 26px rgba(28,54,108,.12); }
.smart-rows .smart-row[role=button]:active { transform: scale(.995); }
.smart-row .smart-price { color: var(--blue-d); font-weight: 850; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.smart-row .smart-noprice { color: #7a4b00; letter-spacing: -.2px; font-weight: 700; }
.smart-row.smart-bad .smart-price { color: #8a1c1c; }
.smart-name { font-weight: 780; letter-spacing: -.2px; }
.smart-title { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; font-weight: 800; color: var(--soft); margin: 10px 2px 6px; }
.smart-filter { margin: 6px 0 10px; }

/* the price card of the chosen model = the demo's gradient result card */
.picker-price .picker-price-row { color: #fff; }
.picker-price:has(.picker-price-row) { background: var(--grad); border-radius: 16px; padding: 14px 16px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.picker-price .amount { color: #fff; font-size: 2.2rem; font-weight: 850; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.picker-price .picker-price-row .muted { color: #c4d8fa; }

/* the demo has no bottom navigation */
.hb-nav { display: none !important; }

@media (max-width: 640px) {
  .tabs [role="tab"] { min-height: 50px; font-size: 11px; }
  .smart-rows .smart-row { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) { button, .btn, .smart-row { transition: none; } }

/* ---- the demo's own components (copied from demo.css: header, modes, card, search, result, buttons) ---- */
.d-head { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); display: block; }
.d-head-in { max-width: 920px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.d-logo { order: 1; display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 15px; letter-spacing: -.3px; flex: none; color: var(--ink); }
.d-logo img { width: 26px; height: 26px; border-radius: 7px; display: block; }
.d-modes { order: 3; flex: 1 1 100%; min-width: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; background: #eef2fa; border-radius: 10px; padding: 2px; }
.d-service { order: 2; margin-left: auto; display: flex; align-items: center; gap: 4px; min-width: 0; }
.d-org { font-size: 11px; color: var(--soft); max-width: 22vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-right: 2px; }
@media (min-width: 640px) { .d-modes { order: 2; flex: 0 1 240px; margin-left: 12px; } .d-service { order: 3; } .d-org { max-width: 200px; font-size: 12px; } }
.d-mode { border: 0; background: transparent; border-radius: 8px; min-height: var(--ctl-sm); padding: 0 8px; font-size: 12px; font-weight: 700; color: var(--soft); white-space: nowrap; box-shadow: none; }
.d-mode:hover:not([aria-current="page"]) { background: rgba(255,255,255,.7); color: var(--blue-d); border: 0; }
.d-mode[aria-current="page"] { background: #fff; color: var(--blue-d); box-shadow: 0 1px 4px rgba(20,40,90,.12); }
.d-small { min-height: var(--ctl-sm); padding: 0 10px; border: 0; border-radius: var(--r-ctl); background: transparent; color: var(--soft); font-size: 12px; font-weight: 750; box-shadow: none; }
.d-small:hover:not(:disabled) { background: #eef3ff; color: var(--blue-d); border: 0; }
.d-small[aria-current="page"] { background: var(--blue); color: #fff; }
.wrap { max-width: 920px; padding: 12px max(12px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.d-note { margin-top: 14px; text-align: center; font-size: 11px; color: #6b7891; }
.d-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px; margin-bottom: var(--sp-3); box-shadow: var(--shadow); }
.d-card h2 { font-size: var(--fs-title); letter-spacing: -.2px; margin: 0 0 2px; }
.d-hint { font-size: var(--fs-small); color: var(--soft); line-height: 1.45; margin: 0 0 8px; }
.d-search { position: relative; }
.d-search input { width: 100%; min-height: var(--ctl); border: 1px solid var(--border-strong); border-radius: var(--r-ctl); padding: 0 12px; font: inherit; font-size: var(--fs-input); font-weight: 600; background: #fff; color: var(--ink); }

/* the blue result card of the chosen goods (the demo's .d-result) */
.picker-price:has(.d-result) { background: none; padding: 0; box-shadow: none; border-radius: 0; }
.d-result { border-radius: 16px; padding: 14px; color: #fff; background: linear-gradient(132deg,#0d2451 0%,#123d91 55%,#126cfb 100%); margin: 10px 0; position: relative; overflow: hidden; }
.d-result:after { content: ""; position: absolute; width: 180px; height: 180px; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; right: -70px; top: -70px; pointer-events: none; }
.d-r-name { font-size: 19px; line-height: 1.2; font-weight: 820; letter-spacing: -.4px; overflow-wrap: anywhere; position: relative; z-index: 1; }
.d-r-specs { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 8px; position: relative; z-index: 1; }
.d-r-specs span { font-size: 11px; font-weight: 650; background: rgba(255,255,255,.14); border-radius: 20px; padding: 2px 8px; color: #dbe9ff; }
.d-r-label { font-size: 11px; color: #c4d8fa; font-weight: 650; position: relative; z-index: 1; }
.d-r-price { font-size: 32px; line-height: 1.1; font-weight: 850; letter-spacing: -1px; font-variant-numeric: tabular-nums; position: relative; z-index: 1; color: #fff; }
.d-r-sub { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.16); display: grid; gap: 3px; font-size: 12px; color: #d4e3fc; position: relative; z-index: 1; }
.d-r-sub div { display: flex; justify-content: space-between; gap: 10px; } .d-r-sub b { color: #fff; font-variant-numeric: tabular-nums; }
.d-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; position: relative; z-index: 1; }
.d-actions button { min-height: var(--ctl-sm); padding: 0 var(--sp-3); font-size: var(--fs-small); border-radius: var(--r-ctl); }
button.white { background: #fff; border-color: #fff; color: var(--blue-d); box-shadow: none; }
button.white:hover:not(:disabled) { background: #eaf1ff; border-color: #eaf1ff; color: var(--blue-d); }
button.line { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.34); color: #fff; box-shadow: none; }
button.line:hover:not(:disabled) { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.5); color: #fff; }
button.white:disabled { background: rgba(255,255,255,.55); color: #4a5b86; border-color: transparent; }
.picker-price .d-result .amount { color: #fff; }

/* «Подробнее»: one quiet fold instead of three panels */
.d-more { margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.d-more > summary { cursor: pointer; padding: 8px 12px; font-size: 12px; font-weight: 750; color: var(--soft); min-height: 36px; display: flex; align-items: center; }
.d-more[open] > summary { border-bottom: 1px solid var(--line); }
.d-more > :not(summary) { margin: 10px 12px; }

/* client mode */
.d-clist { display: grid; gap: 6px; margin-top: 8px; }
.d-copt { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; text-align: left; min-height: 48px; padding: 8px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.d-copt b { font-size: 14px; } .d-copt span { grid-column: 1; font-size: 12px; color: var(--soft); font-weight: 500; } .d-copt strong { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 16px; color: var(--blue-d); font-variant-numeric: tabular-nums; }
.pin-box { max-width: 340px; }
@media (min-width: 720px) { .d-card { padding: 16px; } .d-r-price { font-size: 38px; } }
.msup-list { display: grid; gap: 6px; max-height: 420px; overflow-y: auto; }
.msup-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; }
.msup-name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.msup-name input { width: 18px; height: 18px; flex: none; }
.msup-place { min-height: 36px; font-size: 14px; }
@media (max-width: 520px) { .msup-row { grid-template-columns: 1fr; } }
.cl-overlay:has(.pin-box) { background: rgba(13,36,81,.45); display: grid; place-items: center; padding: 16px; }
.pin-box { background: #fff; border-radius: 16px; padding: 16px 18px; box-shadow: 0 18px 50px rgba(8,20,50,.35); width: min(360px, 100%); }
.pin-box h3 { margin: 0 0 8px; font-size: 16px; } .pin-box input[type=password] { width: 100%; }
.d-logo { margin: 0; }
@media (max-width: 520px) { .d-org { display: none; } .d-small { padding: 0 7px; } }
@media (max-width: 520px) { .d-small { padding: 0 5px; font-size: 11px; } .d-service { gap: 0; flex: 1 1 auto; justify-content: flex-end; } .d-head-in { gap: 4px 6px; } }

/* the price card above the tabs, the demo's pills / fold / compare table / chips */
.d-top { margin: 0 0 10px; }
.d-top:empty { display: none; }
.d-top .d-result { margin: 0; box-shadow: 0 8px 22px rgba(13,36,81,.22); }
.d-result.empty .d-r-price { opacity: .55; }
.d-r-reason { margin-top: 6px; font-size: 12px; color: #cad8fa; line-height: 1.4; }
.d-label { display: block; font-size: 11px; font-weight: 700; color: var(--muted, #8d99ad); margin: 12px 0 4px; text-transform: uppercase; letter-spacing: .4px; }
.d-row { display: flex; flex-wrap: wrap; gap: 6px; }
.d-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 1px solid var(--border-strong); background: #fff; border-radius: 999px; font-size: 14px; font-weight: 650; color: var(--ink); }
.d-pill[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.d-dot { width: 13px; height: 13px; border-radius: 50%; border: 1px solid rgba(0,0,0,.22); flex: none; }
.d-fold { border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px 12px; margin-top: 10px; background: #fff; }
.d-fold > summary { cursor: pointer; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-size: 13px; min-height: 32px; list-style: none; }
.d-fold > summary::-webkit-details-marker { display: none; }
.d-fold > summary span { color: var(--blue-d); font-weight: 700; text-align: right; }
.d-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.d-chip { min-height: 30px; padding: 0 10px; border-radius: 999px; font-size: 12px; background: #eef3ff; border-color: #cfdcf7; color: var(--blue-d); }
.d-cmp { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 11.5px; }
.d-cmp th, .d-cmp td { padding: 6px 3px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.d-cmp th { font-weight: 700; color: var(--soft); width: 22%; font-size: 10px; overflow-wrap: normal; }
.d-cmp thead th { color: var(--ink); font-size: 11px; }
.d-cmp td.best { color: #0ba974; font-weight: 850; }
.d-cmp .pr { font-size: 12.5px; font-weight: 820; white-space: nowrap; letter-spacing: -.3px; }
@media (min-width: 480px) { .d-cmp .pr { font-size: 15px; } .d-cmp { font-size: 12.5px; } }
.d-hero { border-radius: 16px; padding: 14px; color: #fff; background: linear-gradient(132deg,#0d2451,#2448b6 70%,#5a66ef); margin-bottom: 10px; }
.d-hero h2 { font-size: 19px; line-height: 1.2; letter-spacing: -.5px; color: #fff; margin-bottom: 4px; } .d-hero p { font-size: 12px; color: #cad8fa; line-height: 1.5; }
.d-list-n { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.d-list-n li { display: grid; grid-template-columns: 28px 1fr; gap: 8px; font-size: 13px; line-height: 1.45; color: var(--soft); }
.d-list-n li i { font-style: normal; width: 26px; height: 26px; border-radius: 8px; background: #e8f0ff; color: var(--blue); display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.d-list-n b { color: var(--ink); display: block; }
.d-pub { display: inline-flex; gap: 6px; margin-left: auto; }
.brand-logo + .muted:empty { display: none; }
.topbar:not(.d-head) { display: flex; align-items: center; gap: 8px; }
.ar-row { border-top: 1px solid var(--line); padding: 8px 0; }

/* the customer's forms are the demo's compact pills, not big touch cards */
.cl .choice-row { display: flex; flex-wrap: wrap; gap: 6px; }
.cl .choice { flex: none; min-width: 0; min-height: 36px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 650; }
.cl .bigchecks { display: flex; flex-wrap: wrap; gap: 6px; }
.cl .bigcheck { min-height: 36px; padding: 0 12px; gap: 8px; border-radius: 999px; font-size: 13px; }
.cl .bigcheck input { width: 16px; height: 16px; }
.cl .assess { gap: 4px; margin: 6px 0; }
.d-pub .d-access { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 4px 12px rgba(22,91,247,.25); }
.d-pub .d-access:hover:not(:disabled) { background: var(--blue-hover); border-color: var(--blue-hover); color: #fff; }

/* the price stays in view while the form is scrolled: a slim bar under the header, shown only when the blue card has scrolled out */
.d-mini { position: fixed; left: 0; right: 0; z-index: 40; display: none; justify-content: space-between; align-items: center; gap: 12px; padding: 6px max(16px, calc((100vw - 940px) / 2 + 16px)); background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(13,36,81,.25); }
.d-mini.show { display: flex; }
.d-mini b { font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-mini strong { font-size: 1.25rem; letter-spacing: -.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* the access light in the header: green = safe client view, red = seller access open */
.d-lock { display: inline-flex; align-items: center; gap: 6px; min-height: var(--ctl-sm, 32px); padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.d-lock .d-led { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.d-lock.safe { border-color: #b8e6cd; background: #eefaf3; color: #0b6b3f; }
.d-lock.safe .d-led { background: #14a35c; box-shadow: 0 0 0 3px rgba(20,163,92,.2); }
.d-lock.open { border-color: #f2b8b4; background: #fff0ef; color: #9c1c14; }
.d-lock.open .d-led { background: #e03126; box-shadow: 0 0 0 3px rgba(224,49,38,.2); }
.d-lock.safe:hover:not(:disabled) { background: #e2f6ea; border-color: #9ad8b8; color: #0b6b3f; }
.d-lock.open:hover:not(:disabled) { background: #ffe3e0; border-color: #e99a95; color: #8f1d17; }
.d-service { margin-left: auto; }
@media (max-width: 520px) { .d-service { flex-wrap: wrap; row-gap: 4px; } .d-lock { padding: 0 8px; } .d-head-in { flex-wrap: wrap; } }

/* a chosen device folded into one compact line: name + characteristics, price on the right, expand, × */
.d-sel { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 8px; }
.d-sel-main { min-width: 0; }
.d-sel-main b { display: block; font-size: 14px; letter-spacing: -.2px; }
.d-sel-main small { display: block; font-size: 11px; color: var(--soft); margin-top: 2px; }
.d-sel-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.d-sel-chips span { font-size: 11px; font-weight: 650; background: #eef3ff; color: var(--blue-d); border-radius: 999px; padding: 2px 8px; }
.d-sel-price { font-size: 1.2rem; font-weight: 850; letter-spacing: -.5px; color: var(--blue-d); white-space: nowrap; font-variant-numeric: tabular-nums; }
.d-sel-open, .d-sel-x { width: 32px; height: 32px; min-height: 32px; padding: 0; border-radius: 50%; font-size: 14px; line-height: 1; }
.d-sel-x { font-size: 18px; }
.d-fold-btn { margin-top: 8px; }
.d-fold-body > .d-model { display: block; margin: 8px 0 0; font-size: 13px; }

.d-sel-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 8px; }
.d-sel-row .picker-name { font-size: 14px; min-width: 0; }

/* Trade-In (seller): the three numbers sit in the blue card above the tabs */
#price-top .ti-customer { background: var(--grad); border: 0; color: #fff; border-radius: 16px; padding: 14px 16px; margin: 0; box-shadow: 0 8px 22px rgba(13,36,81,.22); }
#price-top .ti-customer .ti-label { color: #cad8fa; }
#price-top .ti-customer .ti-num, #price-top .ti-customer .ti-hero { color: #fff; }
#price-top .ti-customer .ti-range { color: #cad8fa; }
#price-top .ti-customer .ti-step { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #fff; }
#price-top .ti-customer .ti-step:hover:not(:disabled) { background: rgba(255,255,255,.24); color: #fff; }
#price-top:has(> [hidden]:only-child) { display: none; }
#price-top .ti-customer:not([hidden]) + .econ-top { display: none; }
#price-top:has(> .picker-price:empty:only-child) { display: none; }

/* the compact line: an unmistakable chevron and cross, big enough for a thumb */
.d-sel, .d-sel-row { grid-template-columns: minmax(0, 1fr) auto auto auto; }
.d-sel-open, .d-sel-x { position: relative; width: 44px; height: 44px; min-height: 44px; border-radius: 12px; padding: 0; font-size: 0; line-height: 0; background: #eef3ff; border: 1px solid #c6d6f7; color: var(--blue-d); }
.d-sel-open:hover:not(:disabled), .d-sel-x:hover:not(:disabled) { background: #dfe9ff; border-color: #9fb8ee; color: var(--blue-d); }
.d-sel-open::before { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; border-right: 3px solid currentColor; border-bottom: 3px solid currentColor; transform: translate(-50%, -70%) rotate(45deg); transition: none; }
.d-sel-open[aria-expanded="true"]::before { transform: translate(-50%, -30%) rotate(-135deg); }
.d-sel-x::before, .d-sel-x::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 3px; border-radius: 2px; background: currentColor; }
.d-sel-x::before { transform: translate(-50%, -50%) rotate(45deg); }
.d-sel-x::after { transform: translate(-50%, -50%) rotate(-45deg); }
.d-sel-x { background: #fff0ef; border-color: #f2c4c0; color: #b3261e; }
.d-sel-x:hover:not(:disabled) { background: #ffe1de; border-color: #e99a95; color: #8f1d17; }
.d-sel-price { font-size: 1.25rem; }

/* Trade-In: the old phone on the LEFT, the new one on the RIGHT; on a phone one under the other (old first) */
.ti-cols { display: grid; gap: 10px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 760px) { .ti-cols { grid-template-columns: 1fr 1fr; } }
.ti-cols > .d-card { margin-bottom: 0; }

/* the access light: a coloured dot button, no words */
.d-lock { width: 36px; height: 36px; min-height: 36px; padding: 0; justify-content: center; border-radius: 50%; }
.d-lock .d-led { width: 14px; height: 14px; }

/* ---- freshness of data (real timestamps), the header indicator, the seller card under the shared calculator */
.d-r-fresh { margin-top: 4px; font-size: 12px; color: #d4e3fc; position: relative; z-index: 1; }
.fresh { font-variant-numeric: tabular-nums; }
.fresh.stale { color: #b45309; font-weight: 600; }
.d-r-fresh .fresh.stale { color: #ffd9a0; }
.d-fresh { position: relative; display: inline-flex; }
.d-fresh-btn { font-size: 12px; min-height: 32px; padding: 0 8px; border-radius: 10px; background: transparent; color: var(--soft); border: 1px solid var(--line); }
.d-fresh-pop { position: absolute; right: 0; top: 36px; z-index: 30; min-width: 250px; padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 12px; display: grid; gap: 4px; }
.d-fresh-pop[hidden] { display: none; }
.d-seller { margin-top: 12px; overflow-x: auto; }
.d-seller h4 { margin: 10px 0 4px; }
@media (max-width: 719px) { .d-fresh-btn { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }

/* the access-mode label (Клиент · PIN / Продавец) must never push the header out of a phone screen: the service row wraps */
@media (max-width: 520px) { .d-service { flex-wrap: wrap; row-gap: 6px; justify-content: flex-end; } .d-fresh-btn { max-width: 118px; } .d-lock { padding: 0 8px; } }
/* the light carries a text label (Клиент · PIN / Продавец): a pill, not the 36px circle of line 257 */
.d-lock { width: auto; min-width: 36px; padding: 0 12px; border-radius: 999px; gap: 7px; }
.d-lock .d-led { width: 11px; height: 11px; }
.d-lock span { font-size: 12px; line-height: 1; }

/* mode switch «Клиент | Продавец»: one compact segmented control, the active side filled (green = client view, red = seller access) */
.d-mode { display: inline-flex; align-items: center; padding: 2px; gap: 2px; border: 1px solid var(--line, #dfe5f0); border-radius: 999px; background: #f3f5fa; flex: none; }
.d-seg { appearance: none; border: 0; background: transparent; color: var(--soft, #5b6577); font: inherit; font-size: 12px; font-weight: 750; line-height: 1; min-height: 30px; padding: 0 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.d-seg:not(.on):hover { background: #e6eaf3; color: var(--ink, #14213d); }
.d-seg.on.client { background: #14a35c; color: #fff; cursor: default; }
.d-seg.on.seller { background: #e03126; color: #fff; cursor: default; }
.d-mode.only { padding: 2px; }
.d-seg:focus-visible { outline: 2px solid #1557ff; outline-offset: 2px; }
/* freshness line + its panel */
.d-fresh-btn.bad { border-color: #f2b8b4; background: #fff0ef; color: #9c1c14; }
.d-fresh-btn .fr-extra { color: inherit; opacity: .8; }
.d-fresh-pop .fr-src { padding: 6px 0; border-bottom: 1px solid var(--line, #dfe5f0); }
.d-fresh-pop .warn-text { color: #9c1c14; font-weight: 700; }
@media (max-width: 520px) { .d-fresh-btn .fr-extra { display: none; } .d-fresh-btn { max-width: 140px; } .d-seg { padding: 0 10px; min-height: 30px; } .d-fresh-pop { min-width: 270px; max-width: calc(100vw - 28px); } }

/* phone: the freshness panel spans the header width instead of hanging off its button (it was cut off on the left) */
@media (max-width: 520px) { .d-fresh { position: static; } .d-fresh-pop { position: absolute; left: 12px; right: 12px; top: calc(100% - 4px); min-width: 0; max-width: none; } }

.d-fresh-btn, .d-small { white-space: nowrap; }
