:root {
  color-scheme: dark;
  --bg: #101018;
  --surface: #171720;
  --edge: #2c2b39;
  --text: #f7f5f4;
  --muted: #c0bdcc;
  --gold: #ffc05b;
  --gold-light: #ffd488;
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
  --heading: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.55 var(--font); }
a { color: inherit; text-underline-offset: .2em; }
a:hover { color: var(--gold-light); }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { font-family: var(--heading); line-height: 1.13; overflow-wrap: anywhere; }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -.045em; }
h3 { font-size: 1.3rem; }
.wrap { width: min(100% - 64px, 1216px); margin-inline: auto; }
.skip { position: fixed; top: .5rem; left: .5rem; z-index: 20; translate: 0 -200%; background: var(--gold); color: #181119; padding: .7rem 1rem; }
.skip:focus { translate: 0; }
.topbar { border-bottom: 1px solid #262532; background: #12121b; }
.topbar-inner { min-height: 79px; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; font-size: .88rem; line-height: 1.2; }
.brand img { width: 64px; height: 51px; object-fit: contain; }
.brand strong { display: block; color: var(--text); font-size: 1.1rem; margin-top: 3px; }
.topbar nav { display: flex; align-items: center; gap: clamp(1rem, 4vw, 3rem); }
.topbar nav a { text-decoration: none; font-weight: 600; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: .5rem; min-height: 48px; padding: .67rem 1.05rem; border: 1px solid transparent; border-radius: 8px; text-decoration: none; font-weight: 700; line-height: 1.25; cursor: pointer; text-align: center; transition: background-color .18s, border-color .18s, color .18s; }
.button-primary { color: #21160a; background: var(--gold); border-color: var(--gold); }
.button-primary:hover { color: #21160a; background: var(--gold-light); border-color: var(--gold-light); }
.button-outline { color: var(--text); background: transparent; border-color: #565261; }
.button-outline:hover, .button-glass:hover { background: #282333; border-color: var(--gold); color: var(--gold-light); }
.button-glass { background: #171420a8; color: var(--text); border-color: #ffffff53; }
.phone-mark { color: var(--gold); }
.hero { background-color: #15121d; background-image: linear-gradient(90deg, #14111c 0%, #14111ce8 24%, #14111c57 53%, #17131d0d 85%), linear-gradient(0deg, #100f19 0%, transparent 30%), url("hero.webp"); background-size: cover; background-position: center, center, center 53%; border-bottom: 1px solid #302838; }
.hero-inner { min-height: clamp(420px, 35vw, 500px); display: flex; align-items: center; }
.hero-copy { width: 100%; padding-block: 43px 48px; }
.eyebrow { display: flex; gap: .65rem; align-items: center; color: var(--gold); font-weight: 750; text-transform: uppercase; letter-spacing: .13em; font-size: .82rem; }
.eyebrow span { width: 19px; height: 2px; flex: 0 0 19px; background: currentColor; }
.hero h1 { margin: 19px 0 17px; font-size: clamp(4rem, 7.5vw, 7.5rem); letter-spacing: -.072em; line-height: .95; }
.hero h1 em { color: var(--gold); font-style: normal; }
.hero-description { color: #e2dce7; font-size: clamp(1rem, 2vw, 1.15rem); max-width: 390px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero .actions { margin-top: 30px; }
.catalog { padding-block: 36px 58px; }
#oferta, #kontakt { scroll-margin-top: 20px; }
.section-heading { margin-bottom: 22px; }
.section-heading h2, .contact h2 { margin-top: 8px; }
.filters { display: grid; grid-template-columns: 1.55fr .9fr .9fr auto; gap: 13px; align-items: end; padding: 16px; background: var(--surface); border: 1px solid var(--edge); border-radius: 12px; margin-bottom: 24px; }
label { display: block; font-size: .95rem; font-weight: 600; }
input:not([type=checkbox]), select, textarea { width: 100%; margin-top: 5px; background: #101019; border: 1px solid #4b485a; border-radius: 7px; color: var(--text); min-height: 48px; padding: .67rem .8rem; }
select { appearance: none; padding-right: 2.25rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23908b9d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #a7a4b5; }
.filters .button { padding-inline: 28px; }
.empty { background: var(--surface); border: 1px dashed #504a61; border-radius: 12px; text-align: center; padding: 30px 20px; }
.empty h1, .empty h3 { margin-bottom: 8px; }
.empty p { color: var(--muted); margin-bottom: 7px; }
.empty a { display: inline-block; margin-top: 6px; color: var(--gold); font-weight: 700; }
.car-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.car-card { background: var(--surface); border: 1px solid var(--edge); border-radius: 13px; overflow: hidden; }
.car-media { display: grid; place-items: center; aspect-ratio: 16 / 10; background: #22202d; color: var(--muted); text-decoration: none; }
.car-media img { width: 100%; height: 100%; object-fit: cover; min-height: 0; }
.car-info { padding: 18px; }
.car-info h3 a { text-decoration: none; }
.car-year { color: var(--gold); margin-bottom: 5px; font-size: .9rem; }
.car-meta { color: var(--muted); margin-top: 7px; }
.car-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--edge); margin-top: 16px; padding-top: 14px; flex-wrap: wrap; }
.car-bottom strong { font-size: 1.28rem; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 25px; flex-wrap: wrap; }
.contact { padding-bottom: 52px; }
.contact-panel { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: clamp(24px, 4vw, 48px); background: radial-gradient(ellipse at 88% 115%, #422a36, transparent 62%), #171620; border: 1px solid var(--edge); border-radius: 14px; }
address { margin-block: 13px 22px; color: var(--muted); font-size: 1.1rem; font-style: normal; }
.contact-logo { border-radius: 13px; width: clamp(130px, 18vw, 210px); height: auto; }
.site-footer { border-top: 1px solid var(--edge); color: var(--muted); }
.footer-inner { padding-block: 23px; display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: 20px; row-gap: 7px; }
.vehicle-page { padding-block: 34px 60px; }
.back-link { display: inline-block; font-weight: 650; margin-bottom: 18px; }
.vehicle-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }
.vehicle-layout > * { min-width: 0; }
.gallery-frame { background: #181822; border: 1px solid var(--edge); border-radius: 13px; }
.gallery-track { display: flex; width: 100%; overflow-x: auto; aspect-ratio: 4 / 3; max-height: 550px; border-radius: 12px; scroll-snap-type: x mandatory; scrollbar-width: thin; overscroll-behavior-x: contain; }
.gallery-track:not([data-single]) { cursor: grab; }
.gallery-track.is-dragging { scroll-snap-type: none; cursor: grabbing; }
.gallery-track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: start; user-select: none; }
.gallery-controls:not([hidden]) { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; }
.gallery-controls .button[aria-disabled=true] { opacity: .5; cursor: default; }
.gallery-count { color: var(--muted); font-size: .9rem; }
.vehicle-summary, .vehicle-section { background: var(--surface); border: 1px solid var(--edge); border-radius: 13px; padding: clamp(18px, 3vw, 30px); }
.vehicle-summary h1 { margin-block: 8px; font-size: clamp(2.1rem, 4vw, 3.7rem); letter-spacing: -.05em; }
.vehicle-price { font-size: 2rem; font-weight: 750; color: var(--gold); margin-block: 10px 16px; }
.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-block: 14px 20px; }
.specs > div { padding: 10px; background: #22202c; border-radius: 8px; overflow-wrap: anywhere; }
.specs dt { color: var(--muted); font-size: .9rem; }
.specs dd { font-weight: 650; }
.specs-wide { grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); }
.vehicle-section { margin-top: 20px; }
.vehicle-section h2 { margin-bottom: 12px; font-size: 1.6rem; }
.muted { color: var(--muted); margin-top: 10px; }
.preserve { white-space: pre-wrap; overflow-wrap: anywhere; }
.equipment-category { margin-block: 17px; }
.equipment-category h3 { font-size: 1.05rem; }
.equipment { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 6px 20px; padding-left: 22px; margin-block: 8px; }
.admin-body { color-scheme: light; --bg: #f4f5f8; --text: #161b28; --muted: #474f62; --gold-light: #243caa; --gold: #324dc9; --edge: #d1d5e0; --surface: #fff; }
.admin-header { background: #fff; border-bottom: 1px solid var(--edge); }
.admin-header-inner { min-height: 68px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.admin-brand { text-decoration: none; }
.admin-wrap { max-width: 1020px; padding-block: 32px 55px; }
.admin-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.admin-body h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.045em; margin-bottom: 8px; }
.admin-body h2, .expandable > summary { font-size: 1.35rem; letter-spacing: -.02em; margin-bottom: 12px; }
.admin-body p { color: var(--muted); }
.admin-body .button { min-height: 50px; padding-inline: 1.1rem; }
.button-admin { background: #2e44b6; border-color: #2e44b6; color: white; }
.button-admin:hover { background: #24378e; color: white; }
.admin-secondary { color: var(--text); background: white; border-color: #a3a9bc; }
.admin-secondary:hover { background: #eef0ff; }
.admin-box, .admin-row { background: #fff; border: 1px solid var(--edge); border-radius: 12px; padding: clamp(17px, 3vw, 25px); margin-bottom: 16px; }
.admin-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.admin-row > img { width: 100px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.admin-car { flex: 1 1 185px; overflow-wrap: anywhere; }
.admin-car h2 { margin-bottom: 4px; }
.state { display: inline-block; background: #e9ecf2; border-radius: 5px; padding: 3px 8px; margin-top: 6px; font-weight: 650; }
.state-live { background: #def4e5; color: #145b34; }
.login { width: min(100% - 40px, 440px); margin: 50px auto; }
.login form { margin-top: 16px; }
.login form button { width: 100%; margin-top: 14px; }
.admin-body input:not([type=checkbox]), .admin-body textarea, .admin-body select { background-color: white; border-color: #9399ad; }
.admin-body input::placeholder, .admin-body textarea::placeholder { color: #666f84; }
.admin-body label { font-size: 1rem; }
.admin-body input[type=checkbox] { width: 21px; height: 21px; flex: 0 0 21px; margin: 0; accent-color: #324dc9; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.editor > p { margin-bottom: 20px; }
.editor .admin-box > p { margin-bottom: 12px; }
.expandable > summary { margin: 0; font-weight: 750; cursor: pointer; min-height: 44px; display: list-item; align-content: center; }
.expandable[open] > summary { margin-bottom: 16px; }
.equipment-group { margin-block: 12px; padding-inline: 12px; border: 1px solid var(--edge); border-radius: 8px; }
.equipment-group > summary { min-height: 44px; align-content: center; font-weight: 700; cursor: pointer; }
.equipment-group > .form-grid { padding-block: 6px 12px; gap: 8px 16px; }
.check { display: flex; gap: 8px; align-items: center; min-height: 36px; }
.editor-actions { margin-block: 20px; }
.editor-actions button:disabled { opacity: .65; cursor: wait; }
#save-progress:not([hidden]) { width: min(100%, 400px); height: 14px; accent-color: #324dc9; }
.error, .success { padding: 12px 15px; border-radius: 8px; margin-block: 12px 16px; }
.admin-body .error, .error p { background: #ffe9e8; color: #831c21; }
.admin-body .success { background: #dbf2e1; color: #174c2a; }
.field-error, .admin-body .field-error { color: #941c23; display: block; margin-top: 5px; }
.saved-photos, .photo-previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 12px; }
.saved-photos { margin: 14px 0; }
.saved-photos label { border: 1px solid var(--edge); border-radius: 8px; overflow: hidden; }
.saved-photos span { display: flex; align-items: center; padding: 8px; gap: 6px; font-size: .88rem; }
.saved-photos img, .photo-previews img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.photo-previews img { border-radius: 7px; }
@media (max-width: 850px) {
  .hero { background-position: center, center, 58% 55%; }
  .hero h1 { font-size: clamp(3.5rem, 10vw, 5.5rem); }
  .vehicle-layout { grid-template-columns: 1fr; }
  .car-grid, .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .wrap { width: calc(100% - 32px); }
  .topbar-inner { min-height: 68px; gap: 8px; flex-wrap: wrap; padding-block: 8px; }
  .brand { gap: 6px; }
  .brand img { width: 46px; height: 39px; }
  .brand strong { font-size: .94rem; }
  .topbar nav { gap: .7rem; font-size: .9rem; }
  .top-call { display: none; }
  .hero { background-image: linear-gradient(90deg,#14111ce8,#14111c26), linear-gradient(0deg,#100f19 0%,transparent 53%),url("hero.webp"); background-size: cover, cover, auto 96%; background-repeat: no-repeat; background-position: center, center, 61% bottom; }
  .hero-inner { min-height: 405px; align-items: flex-end; }
  .hero-copy { padding-block: 42px; }
  .hero h1 { font-size: clamp(3rem, 11vw, 4.6rem); }
  .hero-description { max-width: 280px; }
  .hero .actions { margin-top: 20px; }
  .filters { grid-template-columns: 1fr 1fr; gap: 10px; }
  .filters label:first-child, .filters button { grid-column: 1 / -1; }
  .filters select { min-width: 0; }
  .car-grid, .form-grid { grid-template-columns: 1fr; }
  .contact-panel { flex-wrap: wrap; }
  .contact-logo { width: 130px; }
  .admin-heading { display: grid; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
