/* Kaizen portal — "game garage" UI */
body.portal { background: radial-gradient(ellipse at 50% -20%, #1a1d26 0%, var(--bg) 55%) fixed, var(--bg); min-height: 100svh; }
.boot { min-height: 100svh; display: grid; place-content: center; justify-items: center; gap: 20px; }
.boot-bar { width: 160px; height: 4px; background: var(--panel-3); border-radius: 2px; overflow: hidden; transform: skewX(-20deg); }
.boot-bar i { display: block; height: 100%; width: 40%; background: var(--orange); animation: boot 1s infinite ease-in-out; }
@keyframes boot { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 40; background: rgba(7,8,10,.86); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 16px; height: 66px; }
.topbar .brand .k { height: 30px; }
.topbar .brand .wm { height: 22px; }
.top-nav { display: flex; gap: 4px; margin-left: 12px; }
.top-nav a { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; font-weight: 600; color: var(--muted); padding: 8px 12px; border-radius: 8px; }
.top-nav a:hover { color: var(--text); background: var(--panel-2); }
.top-nav a.active { color: var(--text); background: var(--panel-3); box-shadow: inset 0 -2px 0 var(--orange); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.xp-mini { display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.xp-mini .row { display: flex; justify-content: space-between; font-family: var(--font-display); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.xp-mini .row b { color: var(--orange); }
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); display: grid; place-items: center; cursor: pointer; color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .dot { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--orange); color: #000; font: 700 .68rem var(--font-display); display: grid; place-items: center; }
.avatar { width: 42px; height: 42px; border-radius: 10px; background: linear-gradient(135deg, var(--orange), #9a2e00); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; color: #000; overflow: hidden; border: 1px solid var(--line-2); cursor: pointer; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.dropdown { position: absolute; right: 0; top: calc(100% + 10px); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); width: 320px; max-width: calc(100vw - 24px); z-index: 60; overflow: hidden; animation: pop .15s; }
.dropdown .dd-head { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-family: var(--font-display); text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; }
.dropdown .dd-list { max-height: 380px; overflow-y: auto; }
.dropdown a.dd-item, .dropdown button.dd-item { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border: 0; background: none; width: 100%; text-align: left; cursor: pointer; border-bottom: 1px solid var(--line); font-size: .9rem; }
.dropdown .dd-item:hover { background: var(--panel-3); }
.dropdown .dd-item svg { width: 18px; height: 18px; color: var(--muted); flex-shrink: 0; }
.notif { display: block !important; }
.notif strong { display: block; font-size: .88rem; }
.notif span { color: var(--muted); font-size: .8rem; display: block; }
.notif.unread { background: rgba(255,81,0,.06); box-shadow: inset 3px 0 0 var(--orange); }
.rel { position: relative; }
@media (max-width: 1080px) { .top-nav { display: none; } }
@media (max-width: 640px) { .xp-mini { display: none; } .topbar .brand .wm { display: none; } }

/* bottom nav (mobile) */
.bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 45; background: rgba(12,13,17,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font: 600 .62rem var(--font-display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 8px; border-radius: 8px; flex: 1; }
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a.active { color: var(--orange); }
@media (max-width: 1080px) { .bottom-nav { display: flex; } body.portal main.view { padding-bottom: 100px; } .fab-stack { bottom: 84px; } .ai-widget { bottom: 156px; } }

main.view { padding: 28px 0 80px; min-height: calc(100svh - 66px); }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); text-transform: uppercase; font-style: italic; margin: 6px 0 0; }
.back { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-family: var(--font-display); text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; margin-bottom: 8px; }
.back:hover { color: var(--orange); }
.back svg { width: 16px; height: 16px; }

/* driver card */
.driver { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; padding: 22px; background: linear-gradient(110deg, rgba(255,81,0,.16), rgba(11,31,74,.35) 60%, rgba(17,19,24,.8)), var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius); position: relative; overflow: hidden; }
.driver::after { content: ''; position: absolute; right: -40px; top: -40px; width: 260px; height: 260px; background: url('/assets/img/k-mark-sm.png') center / contain no-repeat; opacity: .07; transform: rotate(-8deg); }
.driver .avatar { width: 68px; height: 68px; border-radius: 16px; font-size: 1.6rem; }
.driver h2 { font-size: clamp(1.3rem, 3vw, 1.9rem); text-transform: uppercase; font-style: italic; margin: 2px 0 8px; }
.level-badge { display: grid; place-items: center; text-align: center; width: 92px; height: 92px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: linear-gradient(160deg, var(--orange), #8a2c00); color: #000; font-family: var(--font-display); }
.level-badge b { font-size: 2rem; line-height: 1; display: block; }
.level-badge span { font-size: .6rem; letter-spacing: .15em; font-weight: 700; }
.xp-bar { height: 10px; background: rgba(0,0,0,.45); border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; transform: skewX(-18deg); max-width: 520px; }
.xp-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), #ffb070); box-shadow: 0 0 14px var(--orange-glow); transition: width 1.2s cubic-bezier(.2,.8,.2,1); }
.xp-meta { display: flex; justify-content: space-between; max-width: 520px; margin-top: 6px; font: 600 .74rem var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 640px) { .driver { grid-template-columns: auto 1fr; } .driver .level-badge { display: none; } .driver .avatar { width: 54px; height: 54px; } }

/* game menu tiles */
.menu-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; grid-template-rows: 230px 190px; gap: 16px; margin-top: 22px; }
.tile { position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line-2); padding: 22px; display: flex; flex-direction: column; justify-content: flex-end; isolation: isolate; cursor: pointer; transition: transform .25s, border-color .25s, box-shadow .25s; background: var(--panel); min-height: 170px; }
.tile:hover, .tile:focus-visible { transform: translateY(-4px) scale(1.01); border-color: var(--orange); box-shadow: 0 20px 50px rgba(0,0,0,.5), 0 0 0 1px var(--orange), 0 0 40px rgba(255,81,0,.25); }
.tile .bg { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center; transition: transform .6s; }
.tile:hover .bg { transform: scale(1.07); }
.tile::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(7,8,10,.95) 0%, rgba(7,8,10,.55) 50%, rgba(7,8,10,.15)); }
.tile .num { position: absolute; top: 14px; left: 18px; font: 700 .72rem var(--font-display); letter-spacing: .2em; color: var(--orange); }
.tile .tag { position: absolute; top: 12px; right: 14px; }
.tile h3 { font-size: clamp(1.25rem, 2.4vw, 1.8rem); font-style: italic; text-transform: uppercase; margin: 0 0 4px; }
.tile p { color: #c4c9d1; margin: 0; font-size: .9rem; max-width: 380px; }
.tile .go { position: absolute; right: 18px; bottom: 18px; width: 40px; height: 40px; border-radius: 50%; background: var(--orange); color: #000; display: grid; place-items: center; transform: translateX(10px); opacity: 0; transition: .25s; }
.tile:hover .go { transform: none; opacity: 1; }
.tile .go svg { width: 20px; height: 20px; }
.tile.main { grid-row: span 2; }
.tile.main h3 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); }
.tile.vinyl .bg { background: radial-gradient(ellipse at 70% 40%, rgba(124, 58, 237, .45), transparent 60%), radial-gradient(ellipse at 20% 60%, rgba(255,81,0,.4), transparent 60%), var(--panel-2); }
.tile.vinyl .car-wrap { position: absolute; right: -30px; top: 6px; width: 320px; z-index: -1; opacity: .9; }
.tile.market .bg { background: var(--carbon), linear-gradient(135deg, #1b1e26, #0b1f4a); }
.tile.ai .bg { background: linear-gradient(135deg, rgba(47,107,255,.35), rgba(255,81,0,.15)), var(--panel-2); }
@media (max-width: 980px) { .menu-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto; } .tile.main { grid-column: span 2; grid-row: auto; min-height: 240px; } }
@media (max-width: 560px) { .menu-grid { grid-template-columns: 1fr; } .tile.main { grid-column: auto; } .tile .go { opacity: 1; transform: none; } }

/* garage carousel */
.section-title { display: flex; justify-content: space-between; align-items: center; margin: 40px 0 16px; gap: 12px; }
.section-title h2 { font-size: 1.3rem; text-transform: uppercase; font-style: italic; margin: 0; display: flex; gap: 10px; align-items: center; }
.section-title h2::before { content: ''; width: 6px; height: 22px; background: var(--orange); transform: skewX(-20deg); }
.garage-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 300px); gap: 16px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.vcard { scroll-snap-align: start; background: linear-gradient(170deg, var(--panel-2), var(--panel)); border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; position: relative; transition: border-color .2s, transform .2s; }
.vcard:hover { border-color: var(--orange); transform: translateY(-3px); }
.vcard .v-media { aspect-ratio: 16/10; background: radial-gradient(ellipse at 50% 90%, rgba(255,81,0,.25), transparent 60%), #0d0f13; display: grid; place-items: center; overflow: hidden; }
.vcard .v-media img { width: 100%; height: 100%; object-fit: cover; }
.vcard .v-media svg.car { width: 86%; }
.vcard .v-body { padding: 14px 16px 16px; }
.vcard .v-brand { font: 600 .72rem var(--font-display); letter-spacing: .2em; text-transform: uppercase; color: var(--orange); }
.vcard h3 { font-size: 1.2rem; text-transform: uppercase; font-style: italic; margin: 2px 0 8px; }
.spec-row { display: flex; gap: 6px; flex-wrap: wrap; }
.vcard .v-actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 6px; }
.vcard .v-actions button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line-2); background: rgba(0,0,0,.6); cursor: pointer; display: grid; place-items: center; color: var(--text); }
.vcard .v-actions svg { width: 15px; height: 15px; }
.vcard.add { display: grid; place-items: center; text-align: center; min-height: 260px; border-style: dashed; cursor: pointer; color: var(--muted); }
.vcard.add svg { width: 40px; height: 40px; color: var(--orange); margin: 0 auto 10px; }

/* list rows */
.list { display: grid; gap: 10px; }
.row-card { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 14px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; transition: border-color .2s; }
.row-card:hover { border-color: var(--line-2); }
a.row-card:hover { border-color: var(--orange); }
.row-card .ric { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--panel-3); color: var(--orange); }
.row-card .ric svg { width: 22px; height: 22px; }
.row-card .r-title { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.row-card .r-sub { color: var(--muted); font-size: .85rem; }
@media (max-width: 560px) { .row-card { grid-template-columns: auto 1fr; } .row-card > :last-child { grid-column: 1 / -1; justify-self: start; } }
.empty { text-align: center; padding: 50px 20px; border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--muted); }
.empty svg { width: 46px; height: 46px; color: var(--dim); margin: 0 auto 12px; display: block; }

/* wizard */
.wizard { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
@media (max-width: 980px) { .wizard { grid-template-columns: 1fr; } .summary { position: static; } }
.steps { display: flex; gap: 6px; margin-bottom: 22px; }
.steps .s { flex: 1; height: 44px; background: var(--panel); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 8px; font: 700 .72rem var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); clip-path: polygon(0 0, 90% 0, 100% 50%, 90% 100%, 0 100%, 10% 50%); padding: 0 14px; transition: .3s; min-width: 0; }
.steps .s:first-child { clip-path: polygon(0 0, 90% 0, 100% 50%, 90% 100%, 0 100%); }
.steps .s span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps .s.done { background: rgba(255,81,0,.15); color: #ff9a5c; border-color: rgba(255,81,0,.4); }
.steps .s.now { background: var(--orange); color: #000; }
@media (max-width: 760px) { .steps .s span.t { display: none; } .steps .s { padding: 0; } }
.panel { background: linear-gradient(170deg, var(--panel-2), var(--panel)); border: 1px solid var(--line-2); border-radius: var(--radius); padding: clamp(18px, 3vw, 28px); }
.panel + .panel { margin-top: 18px; }
.panel h2 { font-size: 1.4rem; text-transform: uppercase; font-style: italic; }
.panel h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; margin-top: 8px; }
.wiz-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.choice { position: relative; border: 1px solid var(--line-2); border-radius: 12px; padding: 18px; background: var(--bg-2); cursor: pointer; text-align: left; transition: .2s; display: block; width: 100%; }
.choice:hover { border-color: var(--silver); }
.choice.on, .choice:has(input:checked) { border-color: var(--orange); background: rgba(255,81,0,.08); box-shadow: 0 0 0 1px var(--orange) inset; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice svg.big { width: 42px; height: 42px; color: var(--orange); margin-bottom: 10px; }
.choice strong { display: block; font-family: var(--font-display); text-transform: uppercase; font-size: 1rem; }
.choice span { color: var(--muted); font-size: .84rem; }
.choice .tick { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; }
.choice.on .tick, .choice:has(input:checked) .tick { background: var(--orange); border-color: var(--orange); color: #000; }
.choice .tick svg { width: 14px; height: 14px; opacity: 0; }
.choice.on .tick svg, .choice:has(input:checked) .tick svg { opacity: 1; }
.mods-group { margin-bottom: 22px; }
.mods-group .label { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.mods-group .label svg { width: 18px; height: 18px; color: var(--orange); }
.mod-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mod-chip { padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); cursor: pointer; font-size: .9rem; font-weight: 500; transition: .15s; display: inline-flex; align-items: center; gap: 8px; }
.mod-chip:hover { border-color: var(--silver); }
.mod-chip.on { background: var(--orange); color: #000; border-color: var(--orange); font-weight: 600; }
.mod-chip.on::before { content: '✓'; font-weight: 700; }
.budget-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 640px) { .budget-grid { grid-template-columns: 1fr 1fr; } }
.budget-grid .choice { text-align: center; padding: 16px 8px; }
.budget-grid .choice strong { font-size: .95rem; }
.budget-meter { display: flex; gap: 3px; justify-content: center; margin-top: 8px; }
.budget-meter i { width: 8px; height: 14px; background: var(--line-2); transform: skewX(-20deg); }
.budget-meter i.f { background: var(--orange); }

/* dropzone */
.drop { border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 20px; text-align: center; color: var(--muted); cursor: pointer; transition: .2s; background: var(--bg-2); display: block; }
.drop:hover, .drop.drag { border-color: var(--orange); color: var(--text); }
.drop svg { width: 30px; height: 30px; margin: 0 auto 6px; display: block; color: var(--orange); }
.drop input { display: none; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.thumbs .th { width: 74px; height: 74px; border-radius: 8px; overflow: hidden; position: relative; border: 1px solid var(--line-2); background: var(--panel-3); display: grid; place-items: center; font-size: .7rem; color: var(--muted); }
.thumbs .th img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .th button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.75); color: #fff; cursor: pointer; font-size: .8rem; line-height: 1; }

/* summary sidebar */
.summary { position: sticky; top: 86px; }
.summary .kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.summary .kv span:first-child { color: var(--muted); }
.summary .kv span:last-child { text-align: right; font-weight: 500; }
.summary .total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; font-family: var(--font-display); }
.summary .total b { font-size: 1.6rem; color: var(--orange); font-style: italic; }
.reward { display: flex; gap: 10px; align-items: center; padding: 12px; margin-top: 14px; border-radius: 10px; background: rgba(47,107,255,.1); border: 1px solid rgba(47,107,255,.35); font-size: .85rem; color: #c7d5ff; }
.reward svg { width: 22px; height: 22px; color: #9db8ff; flex-shrink: 0; }

/* parts table */
.parts-table { display: grid; gap: 8px; }
.part-line { display: grid; grid-template-columns: 1fr 90px 150px 42px; gap: 8px; align-items: center; }
@media (max-width: 640px) { .part-line { grid-template-columns: 1fr 70px; } .part-line .select { grid-column: 1; } }
.link-list { display: grid; gap: 6px; margin-top: 10px; }
.link-item { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; font-size: .85rem; }
.link-item a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; color: #c4c9d1; }
.link-item button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1.1rem; }

/* vinyl catalog in app */
.vinyl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; max-height: 470px; overflow-y: auto; padding: 2px; }
.vc { border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; cursor: pointer; background: var(--bg-2); text-align: left; padding: 0; transition: .15s; }
.vc:hover { border-color: var(--silver); }
.vc.on { border-color: var(--orange); box-shadow: 0 0 0 2px var(--orange); }
.vc .sw { height: 70px; background-size: cover; background-position: center; }
.vc .vc-b { padding: 8px 10px; }
.vc strong { font-size: .8rem; display: block; line-height: 1.25; }
.vc span { font-size: .74rem; color: var(--orange); font-family: var(--font-display); font-weight: 600; }
.warn { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: rgba(245,179,1,.1); border: 1px solid rgba(245,179,1,.4); color: #fcd34d; font-size: .9rem; margin-top: 12px; }

/* timeline */
.track { display: grid; grid-template-columns: repeat(var(--n, 6), 1fr); gap: 0; margin: 10px 0 6px; }
.track .tp { position: relative; text-align: center; padding-top: 34px; font: 600 .7rem var(--font-display); text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.track .tp::before { content: ''; position: absolute; top: 12px; left: 0; right: 0; height: 4px; background: var(--line-2); }
.track .tp:first-child::before { left: 50%; } .track .tp:last-child::before { right: 50%; }
.track .tp::after { content: ''; position: absolute; top: 4px; left: 50%; transform: translateX(-50%) rotate(45deg); width: 18px; height: 18px; background: var(--panel-3); border: 2px solid var(--line-2); }
.track .tp.done { color: var(--text); } .track .tp.done::before { background: var(--orange); } .track .tp.done::after { background: var(--orange); border-color: var(--orange); }
.track .tp.now::after { box-shadow: 0 0 0 6px rgba(255,81,0,.25); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(255,81,0,.05); } }
@media (max-width: 640px) { .track { grid-template-columns: 1fr; gap: 0; } .track .tp { text-align: left; padding: 8px 0 8px 34px; } .track .tp::before { top: 0; bottom: 0; left: 11px; right: auto; width: 3px; height: auto; } .track .tp:first-child::before { left: 11px; top: 50%; } .track .tp:last-child::before { right: auto; bottom: 50%; } .track .tp::after { top: 50%; left: 12px; transform: translate(-50%, -50%) rotate(45deg); } }
.log { display: grid; gap: 0; }
.log div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.log time { color: var(--dim); font-size: .8rem; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px 20px; }
.kv-grid .label { display: block; margin-bottom: 2px; }
.gallery { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery a { width: 110px; height: 110px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); display: grid; place-items: center; background: var(--panel-3); color: var(--muted); font-size: .75rem; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }

/* success */
.success { text-align: center; max-width: 620px; margin: 30px auto; }
.success .medal { width: 120px; height: 120px; margin: 0 auto 20px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); background: linear-gradient(160deg, var(--orange), #8a2c00); display: grid; place-items: center; color: #000; animation: medal .8s cubic-bezier(.2,1.6,.4,1); }
.success .medal svg { width: 56px; height: 56px; }
@keyframes medal { from { transform: scale(0) rotate(-40deg); } }
.success .ref { font: 700 clamp(1.6rem, 5vw, 2.4rem) var(--font-display); letter-spacing: .08em; color: var(--orange); margin: 6px 0 14px; }
.xp-pop { display: inline-block; font: 700 1.1rem var(--font-display); color: #9db8ff; padding: 6px 16px; border: 1px solid rgba(47,107,255,.5); border-radius: 999px; background: rgba(47,107,255,.12); margin-bottom: 20px; animation: pop .5s .4s both; }

/* auth */
.auth-wrap { min-height: calc(100svh - 66px); display: grid; grid-template-columns: 1fr 1fr; }
.auth-art { background: linear-gradient(0deg, rgba(7,8,10,.95), rgba(7,8,10,.3)), url('/assets/img/hero-car.jpg') 40% center / cover; display: flex; flex-direction: column; justify-content: flex-end; padding: 48px; }
.auth-art h2 { font-size: clamp(2rem, 4vw, 3.2rem); text-transform: uppercase; font-style: italic; }
.auth-box { display: grid; place-items: center; padding: 40px 16px; }
.auth-card { width: min(420px, 100%); }
.auth-card h1 { font-size: 2rem; text-transform: uppercase; font-style: italic; }
.or { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: .8rem; text-transform: uppercase; letter-spacing: .15em; margin: 18px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line-2); }
.gbtn-wrap { min-height: 44px; display: flex; justify-content: center; }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } .auth-art { display: none; } }

/* tables (admin) */
.admin-layout { display: grid; grid-template-columns: 230px 1fr; gap: 24px; align-items: start; }
.side { position: sticky; top: 86px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; display: grid; gap: 2px; }
.side a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 8px; color: var(--muted); font: 600 .82rem var(--font-display); text-transform: uppercase; letter-spacing: .08em; }
.side a svg { width: 18px; height: 18px; }
.side a:hover { color: var(--text); background: var(--panel-2); }
.side a.active { color: #000; background: var(--orange); }
.side .count { margin-left: auto; background: var(--panel-3); color: var(--text); border-radius: 999px; padding: 0 8px; font-size: .7rem; }
.side a.active .count { background: rgba(0,0,0,.25); color: #000; }
@media (max-width: 980px) { .admin-layout { grid-template-columns: 1fr; } .side { position: static; display: flex; overflow-x: auto; } .side a { white-space: nowrap; } }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
table.t { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 640px; }
table.t th { text-align: left; font: 600 .7rem var(--font-display); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--line-2); background: var(--panel-2); white-space: nowrap; }
table.t td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--panel-2); }
table.t .num { text-align: right; font-variant-numeric: tabular-nums; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.kpi { background: linear-gradient(160deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: 12px; padding: 18px; position: relative; overflow: hidden; }
.kpi .label { display: block; }
.kpi b { display: block; font: 700 2rem var(--font-display); margin-top: 6px; font-style: italic; }
.kpi small { color: var(--muted); }
.kpi::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--orange); }
.kpi.blue::after { background: var(--blue); } .kpi.green::after { background: var(--green); } .kpi.silver::after { background: var(--silver); }
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: 150px 1fr 40px; gap: 10px; align-items: center; font-size: .85rem; }
.hbar .tr { height: 10px; background: var(--panel-3); border-radius: 5px; overflow: hidden; }
.hbar .tr i { display: block; height: 100%; background: var(--orange); border-radius: 5px; }
.cols { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 10px; }
.cols .c { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; font-size: .72rem; color: var(--muted); }
.cols .c i { width: 100%; max-width: 46px; background: linear-gradient(0deg, var(--orange), var(--orange-2)); border-radius: 6px 6px 2px 2px; min-height: 3px; }
.two-col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .two-col { grid-template-columns: 1fr; } }
.note { padding: 10px 12px; border-left: 3px solid var(--blue); background: var(--bg-2); border-radius: 0 8px 8px 0; margin-bottom: 8px; font-size: .9rem; }
.note small { display: block; color: var(--dim); margin-bottom: 4px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.toolbar .input, .toolbar .select { width: auto; min-width: 200px; }
.modal-bg { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.7); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: pop .15s; }
.modal { width: min(560px, 100%); max-height: calc(100svh - 32px); overflow-y: auto; }
.color-dot { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-2); display: inline-block; vertical-align: middle; }
