@font-face { font-family: 'Schibsted Grotesk'; src: url('fonts/SchibstedGrotesk.ttf') format('truetype'); font-weight: 400 900; }
@font-face { font-family: 'Archivo'; src: url('fonts/Archivo.ttf') format('truetype'); font-weight: 100 900; font-stretch: 62% 125%; }

:root {
    --accent: #ef4444;
    --accent-rgb: 239, 68, 68;
    --scale: 1;

    --win: rgba(15, 16, 20, .95);
    --well: rgba(255, 255, 255, .035);
    --well2: rgba(255, 255, 255, .06);
    --hair: rgba(255, 255, 255, .07);
    --text: #f2f3f5;
    --muted: #9097a1;
    --faint: #6b717b;
    --ok: #4ade80;
    --amber: #fbbf24;
    --red: #f87171;

    --font: 'Schibsted Grotesk', system-ui, sans-serif;
    --display: 'Archivo', 'Arial Narrow', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: calc(100vh / 67.5 * var(--scale)); }
html, body { width: 100%; height: 100%; background: transparent; overflow: hidden; }
body { font-family: var(--font); color: var(--text); font-size: .875rem; -webkit-font-smoothing: antialiased; user-select: none; }
[hidden] { display: none !important; }
button { font-family: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select { font: inherit; color: inherit; }
svg { display: block; flex: none; }
.num { font-family: var(--display); font-stretch: 82%; font-weight: 700; font-variant-numeric: tabular-nums; }

::-webkit-scrollbar { width: .3rem; height: .3rem; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .1); border-radius: .2rem; }
::-webkit-scrollbar-track { background: transparent; }

/* shared pieces */
.shell, #receipt .panel { position: relative; border-radius: 1.5rem; overflow: hidden; background: var(--win); box-shadow: 0 2.5rem 6rem rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .07), inset 0 0 0 1px rgba(255, 255, 255, .04); }
.shell::before, #receipt .panel::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(38rem 24rem at 0 0, rgba(var(--accent-rgb), .16), transparent 70%); }
.shell > *, #receipt .panel > * { position: relative; }

.card { position: relative; padding: 1.15rem 1.25rem; border-radius: 1.1rem; background: var(--well); box-shadow: inset 0 0 0 1px var(--hair); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .9rem; gap: .6rem; }
.card-head h3 { font-family: var(--display); font-stretch: 80%; font-size: 1.35rem; font-weight: 800; display: flex; align-items: center; gap: .55rem; }
.card-head h3 svg { color: #ff8a8a; }
.card-note { color: var(--muted); font-size: .82rem; line-height: 1.6; }
.card-note code, .f small code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .74rem; background: rgba(0, 0, 0, .3); border-radius: .35rem; padding: .1rem .4rem; color: #d3d6db; }
.card-note b { color: var(--text); font-weight: 600; }

.pill { display: inline-flex; align-items: center; gap: .4rem; font-size: .72rem; font-weight: 600; padding: .22rem .55rem; border-radius: .45rem; white-space: nowrap; }
.pill.green { color: #86efac; background: rgba(74, 222, 128, .14); }
.pill.red { color: #fca5a5; background: rgba(var(--accent-rgb), .18); }
.pill.grey { color: #c9cdd3; background: rgba(0, 0, 0, .45); }

.btn { height: 2.6rem; padding: 0 1rem; border-radius: .9rem; font-size: .875rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; white-space: nowrap; flex: none; background: var(--well); box-shadow: inset 0 0 0 1px var(--hair); transition: background .12s, filter .12s; }
.btn:hover { background: var(--well2); }
.btn.full { width: 100%; }
.btn.sm { height: 2.15rem; padding: 0 .8rem; font-size: .8rem; border-radius: .7rem; }
.btn-primary { color: #fff; background: linear-gradient(180deg, #f45b5b, var(--accent)); box-shadow: 0 .6rem 1.75rem rgba(var(--accent-rgb), .35), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn-primary:hover { filter: brightness(1.08); background: linear-gradient(180deg, #f45b5b, var(--accent)); }
.btn-primary:disabled { background: var(--well); color: var(--faint); box-shadow: inset 0 0 0 1px var(--hair); filter: none; cursor: default; }
.btn-ghost { color: var(--text); }
.btn-icon { width: 2.4rem; height: 2.4rem; padding: 0; color: var(--muted); border-radius: .75rem; }
.btn-icon:hover { color: var(--text); }
.btn-soft svg { color: var(--muted); }
.btn-danger { color: #fca5a5; }
.btn-danger:hover { background: rgba(var(--accent-rgb), .14); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .35); }
.btn-danger.sure { color: #fff; background: var(--accent); box-shadow: 0 .5rem 1.4rem rgba(var(--accent-rgb), .35); }
.btn-ok { background: var(--ok); color: #04130a; }

.input { width: 100%; min-width: 0; height: 2.6rem; background: rgba(0, 0, 0, .28); border: 0; box-shadow: inset 0 0 0 1px var(--hair); border-radius: .8rem; padding: 0 .85rem; color: var(--text); font-size: .875rem; outline: none; }
.input::placeholder { color: var(--faint); }
.input:focus { box-shadow: inset 0 0 0 1px var(--accent); }
.input[readonly] { color: var(--muted); }
.input[type=number] { font-variant-numeric: tabular-nums; }
.input::-webkit-outer-spin-button, .input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
select.input { appearance: none; cursor: pointer; padding-right: 1.9rem;
    background: rgba(0, 0, 0, .28) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239097a1' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right .8rem center; }
select.input option { background: #1e2126; color: #f3f4f6; }

.bar { position: relative; height: .3rem; border-radius: .2rem; background: rgba(255, 255, 255, .08); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: .2rem; background: linear-gradient(90deg, rgba(var(--accent-rgb), .6), var(--accent)); box-shadow: 0 0 .6rem rgba(var(--accent-rgb), .6); }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(.5rem); } }
.empty { color: var(--faint); font-size: .82rem; padding: .4rem 0; }

/* windows */
.screen { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: center; }
.shell { width: 78rem; max-width: 94vw; height: 46rem; max-height: 90vh; display: flex; animation: rise .22s cubic-bezier(.2, .8, .2, 1); }
.rail { width: 15rem; flex-shrink: 0; padding: 1.4rem .9rem 1rem; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.rail nav { display: flex; flex-direction: column; gap: 3px; }
.rail-brand { display: flex; align-items: center; gap: .75rem; padding: .1rem .5rem 1.2rem; }
.mk { width: 2.6rem; height: 2.6rem; flex: none; border-radius: .8rem; display: grid; place-items: center; color: #fff; background: linear-gradient(160deg, #ff6b6b, var(--accent) 55%, #b91c1c); box-shadow: 0 .5rem 1.5rem rgba(var(--accent-rgb), .35), inset 0 1px 0 rgba(255, 255, 255, .35); }
.rail-brand > div:last-child { min-width: 0; }
.rail-brand b { display: block; font-family: var(--display); font-stretch: 78%; font-size: 1.35rem; font-weight: 800; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-brand span { display: block; color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-btn { position: relative; flex: none; display: flex; align-items: center; gap: .7rem; width: 100%; height: 2.65rem; padding: 0 .8rem; border-radius: .8rem; color: #a8aeb7; font-size: .92rem; text-align: left; transition: background .12s; }
.rail-btn svg { color: currentColor; }
.rail-btn:hover { background: rgba(255, 255, 255, .04); color: #fff; }
.rail-btn.active { color: #fff; background: linear-gradient(90deg, rgba(var(--accent-rgb), .2), rgba(var(--accent-rgb), .04)); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .25); }
.rail-btn.active svg { color: #ff8a8a; }
.rail-btn em { margin-left: auto; font-style: normal; font-size: .72rem; font-weight: 600; padding: .1rem .45rem; border-radius: .45rem; background: rgba(255, 255, 255, .06); color: var(--muted); }
.rail-btn em:empty { display: none; }
.rail-btn.active em { background: rgba(var(--accent-rgb), .18); color: #ffb4b4; }
.rail-foot { margin-top: .7rem; }
#r-policy { margin-top: auto; }

.ed-list { width: 18.5rem; flex: none; display: flex; flex-direction: column; box-shadow: inset 1px 0 0 var(--hair), inset -1px 0 0 var(--hair); background: rgba(255, 255, 255, .012); }
.ed-list-head { display: flex; gap: .45rem; padding: 0 .9rem; min-height: 4.6rem; align-items: center; }
.ed-rows { flex: 1; min-height: 0; overflow-y: auto; padding: 0 .7rem .7rem; display: flex; flex-direction: column; gap: 3px; }
.ed-row { flex: none; position: relative; display: flex; align-items: center; gap: .6rem; padding: .65rem .8rem; border-radius: .8rem; text-align: left; transition: background .12s; }
button.ed-row:hover { background: rgba(255, 255, 255, .04); }
.ed-row.on { background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px var(--hair); }
.ed-row > div { flex: 1; min-width: 0; }
.ed-row b { display: block; font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-row span { font-size: .76rem; color: var(--muted); }
.ed-row.locked { opacity: .5; }

.shell-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: rgba(255, 255, 255, .015); }
.shell-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.4rem 1.6rem .4rem 1.8rem; min-height: 4.6rem; }
.shell-title { min-width: 0; }
.shell-title h1 { font-family: var(--display); font-stretch: 72%; font-size: 2.6rem; font-weight: 800; line-height: .95; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell-actions { display: flex; gap: .5rem; align-items: center; }
.shell-body { flex: 1; overflow-y: auto; padding: 1rem 1.8rem 1.6rem; }
.shell-body > * + * { margin-top: .75rem; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.1rem; }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
.f label { display: block; color: #d6d9de; font-size: .85rem; font-weight: 600; margin-bottom: .45rem; }
.f small { display: block; color: var(--faint); font-size: .78rem; margin-top: .4rem; line-height: 1.45; }
.f small.bad { color: var(--red); }
.f small.good { color: var(--ok); }
.f.wide { grid-column: 1 / -1; }
.f-row { display: flex; gap: .5rem; align-items: center; }
.f-row + .f-row { margin-top: .45rem; }
.coord { font-variant-numeric: tabular-nums; font-size: .8rem; color: var(--muted); flex: 1; min-width: 0; height: 2.15rem; display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 .85rem; background: rgba(0, 0, 0, .28); border-radius: .7rem; box-shadow: inset 0 0 0 1px var(--hair); }
.f .coord { height: 2.6rem; border-radius: .8rem; }
.coord.unset { color: var(--faint); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { height: 2.1rem; padding: 0 .85rem; border-radius: .7rem; font-size: .82rem; font-weight: 500; color: var(--muted); background: var(--well); box-shadow: inset 0 0 0 1px var(--hair); transition: background .12s; }
.chip:hover { color: var(--text); }
.chip.on { color: #fff; background: linear-gradient(90deg, rgba(var(--accent-rgb), .24), rgba(var(--accent-rgb), .08)); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .4); }
.switch { position: relative; width: 2.6rem; height: 1.55rem; flex-shrink: 0; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: rgba(255, 255, 255, .12); border-radius: 1rem; cursor: pointer; transition: background .2s; }
.switch span::before { content: ''; position: absolute; width: 1.15rem; height: 1.15rem; left: .2rem; top: .2rem; border-radius: 50%; background: #c5c9cf; transition: transform .2s, background .2s; }
.switch input:checked + span { background: var(--accent); box-shadow: 0 0 .9rem rgba(var(--accent-rgb), .45); }
.switch input:checked + span::before { transform: translateX(1.05rem); background: #fff; }
.list-actions { display: flex; gap: .5rem; margin-top: .8rem; }
.ed-empty { margin: 4rem auto 0; max-width: 28rem; text-align: center; }
.color-row { display: flex; align-items: center; gap: .7rem; }
.color-pick { width: 2.8rem; height: 2.6rem; padding: 0; border: 0; background: none; cursor: pointer; }
.color-pick::-webkit-color-swatch-wrapper { padding: 3px; }
.color-pick::-webkit-color-swatch { border: 0; border-radius: .6rem; }
.swatches { display: flex; gap: .4rem; }
.swatch { width: 1.65rem; height: 1.65rem; border-radius: .5rem; }
.swatch:hover { box-shadow: 0 0 0 2px #15161b, 0 0 0 3px var(--muted); }
#ad-save:not(.dirty) { color: var(--muted); background: var(--well); box-shadow: inset 0 0 0 1px var(--hair); filter: none; }
.dirty::after { content: ''; width: .45rem; height: .45rem; border-radius: 50%; background: #fff; }

/* rental desk */
#rent .shell { width: 86rem; height: 37rem; }
.rent-body { flex: 1; min-height: 0; display: flex; }
.fleet { flex: 1; min-width: 0; overflow-y: auto; padding: .8rem 1.2rem 1.4rem 1.8rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; align-content: start; }
.fleet .empty { grid-column: 1 / -1; padding: 2rem 0; text-align: center; }
.car { position: relative; display: block; padding: .75rem .9rem .85rem; border-radius: 1.1rem; cursor: pointer; background: var(--well); box-shadow: inset 0 0 0 1px var(--hair); animation: rise .25s ease-out both; transition: background .15s, box-shadow .15s; }
.car:hover { background: var(--well2); }
.car.on { background: radial-gradient(14rem 8rem at 50% 30%, rgba(var(--accent-rgb), .18), transparent 70%), var(--well2); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .55), 0 0 2rem rgba(var(--accent-rgb), .18); }
.car.off { opacity: .45; cursor: default; }
.car.off:hover { background: var(--well); }
.car .shot { position: relative; height: 6.8rem; display: grid; place-items: center; overflow: hidden; }
.car .shot img, .hero img { position: relative; max-width: 100%; max-height: 100%; object-fit: contain; }
.car .shot svg, .hero svg { position: relative; color: var(--faint); }
.car .tag { position: absolute; top: .7rem; left: .8rem; z-index: 1; }
.car .name { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-top: .35rem; }
.car .name b { font-size: .98rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.car .name span { font-family: var(--display); font-stretch: 82%; font-size: 1.15rem; font-weight: 700; color: var(--text); flex: none; }
.car .meta { color: var(--muted); font-size: .78rem; margin-top: .1rem; }

.detail { width: 27rem; flex: none; padding: 1rem 1.6rem 1.5rem; display: flex; flex-direction: column; overflow-y: auto; box-shadow: inset 1px 0 0 var(--hair); }
.detail > * { animation: fade .2s ease-out; }
.hero { position: relative; height: 9rem; display: grid; place-items: center; flex: none; }
.hero::before { content: ''; position: absolute; left: 10%; right: 10%; bottom: 0; height: 40%; background: radial-gradient(closest-side, rgba(var(--accent-rgb), .22), transparent); filter: blur(4px); }
.hero.sm { height: 7rem; }
.hero img, .car .shot img { width: 100%; height: 100%; min-height: 0; }
.hero, .car .shot { grid-template-rows: 100%; grid-template-columns: 100%; justify-items: center; }
.d-name { font-family: var(--display); font-stretch: 74%; font-size: 2.4rem; font-weight: 800; line-height: .95; margin-top: .4rem; }
.hero.sm + .d-name, .duo + .d-name { font-size: 2rem; }
.d-sub { color: var(--muted); font-size: .85rem; margin-top: .35rem; }
.meters { margin-top: 1rem; display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1.1rem; }
.meter-top { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-bottom: .4rem; }
.meter-top b { font-size: .8rem; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.deal { margin-top: 1rem; padding: .95rem 1.1rem; border-radius: 1.1rem; background: var(--well); box-shadow: inset 0 0 0 1px var(--hair); }
.deal-row { display: flex; justify-content: space-between; align-items: baseline; }
.deal-row span { color: var(--muted); font-size: .85rem; }
.deal-row b { font-family: var(--display); font-stretch: 80%; font-size: 1.9rem; font-weight: 800; line-height: 1; }
.deal-row b.ok { color: var(--ok); }
.deal p { color: var(--muted); font-size: .8rem; line-height: 1.55; margin-top: .5rem; }
.deal p b { color: var(--text); font-weight: 600; }
.go { flex: 1; height: 3rem; font-size: .95rem; border-radius: 1rem; }
.detail .go { flex: none; margin-top: auto; width: 100%; }
.detail .gap { flex: 1; min-height: .8rem; }
.detail .note { color: var(--muted); font-size: .8rem; line-height: 1.5; text-align: center; margin-top: .6rem; }
.detail .btn-ghost.full { margin-top: .5rem; }
.pair { display: flex; gap: .5rem; margin-top: .5rem; flex: none; }
.pair .btn { flex: 1; }
.duo { display: flex; align-items: center; gap: .9rem; flex: none; }
.duo .hero { flex: 1; min-width: 0; height: 6.8rem; }

.scale-wrap { position: relative; margin-top: .5rem; }
.scale { position: relative; height: .35rem; border-radius: .2rem; margin: 1.4rem 0; background: linear-gradient(90deg, var(--red), var(--amber) 50%, var(--ok)); }
.scale-wrap .pin { position: absolute; top: 1.225rem; width: .7rem; height: .7rem; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgba(15, 16, 20, .95), 0 0 .8rem rgba(255, 255, 255, .5); transform: translateX(-50%); }
.scale-wrap .ticks { display: flex; justify-content: space-between; margin-top: -.9rem; font-size: .74rem; color: var(--faint); }

.gauge { position: relative; width: 10rem; height: 10rem; margin: .6rem auto .4rem; flex: none; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.gauge svg circle { stroke-linecap: round; }
.gauge svg circle:first-child { stroke: rgba(255, 255, 255, .08); }
.gauge .inner { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.gauge .inner b { display: block; font-family: var(--display); font-stretch: 78%; font-size: 2.8rem; font-weight: 800; line-height: 1; }
.gauge .inner span { display: block; font-size: .75rem; color: var(--muted); margin-top: .2rem; }
.detail .gauge { width: 6.8rem; height: 6.8rem; }
.detail .gauge .inner b { font-size: 1.75rem; }

.policy { margin: .9rem .1rem 0; padding: .85rem .85rem .7rem; border-radius: 1rem; background: var(--well); box-shadow: inset 0 0 0 1px var(--hair); }
.policy small { display: block; color: var(--text); font-size: .82rem; font-weight: 600; margin-bottom: .35rem; }
.policy div { display: flex; justify-content: space-between; gap: .5rem; font-size: .78rem; color: var(--muted); padding: .22rem 0; }
.policy div b { color: var(--text); font-weight: 600; white-space: nowrap; }
.wallet { display: flex; justify-content: space-between; align-items: baseline; padding: .7rem .85rem; border-radius: 1rem; background: rgba(0, 0, 0, .25); color: var(--muted); font-size: .82rem; }
.wallet b { font-family: var(--display); font-stretch: 82%; font-size: 1.25rem; font-weight: 700; color: var(--text); }

/* receipt */
#receipt .panel { width: 40rem; max-width: 94vw; padding: 1.9rem 2rem 1.6rem; animation: rise .22s ease-out; }
.verdict { display: flex; align-items: center; gap: 1.6rem; }
.verdict .gauge { margin: 0; width: 8.5rem; height: 8.5rem; }
.verdict .gauge .inner b { font-size: 2.3rem; }
.stamp { font-family: var(--display); font-stretch: 72%; font-size: 3rem; font-weight: 800; line-height: .95; }
.verdict p { color: var(--muted); font-size: .9rem; line-height: 1.6; margin-top: .5rem; }
.lines { margin-top: 1.4rem; padding: .3rem 1.1rem; border-radius: 1.1rem; background: var(--well); box-shadow: inset 0 0 0 1px var(--hair); }
.lines div { display: flex; justify-content: space-between; align-items: baseline; padding: .65rem 0; border-bottom: 1px solid var(--hair); font-size: .88rem; color: var(--muted); }
.lines div b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.lines div.total { border-bottom: 0; color: var(--text); }
.lines div.total b { font-family: var(--display); font-stretch: 80%; font-weight: 800; color: var(--ok); font-size: 1.6rem; }
.rc-foot { display: flex; justify-content: flex-end; margin-top: 1.1rem; }
.rc-foot .btn { height: 2.9rem; padding: 0 1.8rem; font-size: .92rem; }
