/* =====================================================================
   Roadster — customer account area. Dark (default) and light themes via html.dark / html.light.
   Re-skins the existing UI kit (mj-ui.css) and provides the shell: top bar, icon rail, bottom bar.
   ===================================================================== */

html.dark {
    color-scheme: dark;
    --a-bg: #050505; --a-surface: #0D0D0E; --a-surface-2: #141416; --a-raised: #18181B;
    --a-line: rgba(255,255,255,.08); --a-line-2: rgba(255,255,255,.16);
    --a-ink: #F4F4F5; --a-ink-2: #A1A1AA; --a-ink-3: #63636B;
    --a-red: #E0183A; --a-red-2: #C8102E; --a-red-soft: rgba(224,24,58,.14); --a-glow: rgba(224,24,58,.45);
    --a-ok: #4ADE80; --a-wait: #FBBF24; --a-bad: #F87171;
    --a-shadow: none; --a-hero-veil: rgba(0,0,0,.35); --a-topbar: rgba(5,5,5,.82);
}
html.light {
    color-scheme: light;
    --a-bg: #F3F3F5; --a-surface: #FFFFFF; --a-surface-2: #F8F8FA; --a-raised: #FFFFFF;
    --a-line: rgba(10,10,20,.08); --a-line-2: rgba(10,10,20,.16);
    --a-ink: #111114; --a-ink-2: #5F5F68; --a-ink-3: #9C9CA5;
    --a-red: #E0183A; --a-red-2: #C8102E; --a-red-soft: rgba(224,24,58,.08); --a-glow: rgba(224,24,58,.28);
    --a-ok: #16A34A; --a-wait: #B45309; --a-bad: #DC2626;
    --a-shadow: 0 1px 2px rgba(10,10,20,.04), 0 10px 30px rgba(10,10,20,.05); --a-hero-veil: rgba(0,0,0,.18); --a-topbar: rgba(255,255,255,.86);
}
html, body { background: var(--a-bg); color: var(--a-ink); }
body { margin: 0; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing: antialiased; transition: background-color .3s ease, color .3s ease; }
.rs-wordmark { font-family: 'Archivo', 'Inter', sans-serif; font-stretch: 125%; font-weight: 400; letter-spacing: .42em; text-transform: uppercase; }

/* ---------- UI kit (mj-ui.css) mapped onto the account tokens ---------- */
html .ui {
    --sidebar: var(--a-bg); --choc: var(--a-red); --brown: var(--a-red-2); --mocha: var(--a-ink); --bronze: var(--a-ink-2); --gold: var(--a-ink); --sand: var(--a-ink-2);
    --card: var(--a-surface); --ink: var(--a-ink); --muted: var(--a-ink-2); --line: var(--a-line); --soft: var(--a-surface-2); --hover: var(--a-surface-2); --input: var(--a-surface);
    --pos: var(--a-ok); --neg: var(--a-bad); --warn: var(--a-wait);
}
html.dark .ui { --pos-bg: rgba(74,222,128,.1); --neg-bg: rgba(248,113,113,.1); --warn-bg: rgba(251,191,36,.1); }
html.light .ui { --pos-bg: #E9F7EE; --neg-bg: #FDECEC; --warn-bg: #FDF3E4; }
.ui .ui-eyebrow { color: var(--a-ink-2); letter-spacing: .18em; font-weight: 500; }
.ui .ui-h1 { font-family: 'Archivo', 'Inter', sans-serif; font-stretch: 118%; font-weight: 500; letter-spacing: .02em; }
.ui .ui-card { border-radius: 10px; box-shadow: var(--a-shadow); }
.ui .ui-hero { background: var(--a-surface); color: var(--a-ink); border: 1px solid var(--a-line); border-radius: 10px; box-shadow: var(--a-shadow); }
.ui .ui-hero::before { display: none; }
.ui .ui-btn { border-radius: 6px; font-weight: 500; box-shadow: none; }
.ui .ui-btn:hover { transform: none; }
.ui .ui-btn-dark { background: var(--a-red); color: #fff; }
.ui .ui-btn-dark:hover { background: var(--a-red-2); }
.ui .ui-btn-gold { background: var(--a-ink); color: var(--a-bg); box-shadow: none; }
.ui .ui-btn-ghost { background: transparent; border-color: var(--a-line-2); }
.ui .ui-input, .ui .ui-select, .ui .ui-textarea { border-radius: 6px; border-color: var(--a-line-2); }
.ui .ui-input:focus, .ui .ui-select:focus, .ui .ui-textarea:focus { border-color: var(--a-ink); box-shadow: none; }
.ui .ui-status { background: none !important; padding: 0; border-radius: 0; font-weight: 500; }
.ui .ui-bar > span { background: var(--a-red); }
main.mj-cine .ui-head::before, main.mj-cine .mj-head::before, main.mj-cine .mj-tx-head::before { background: rgba(0,0,0,.5) !important; }
main.mj-cine .ui-head::after, main.mj-cine .mj-head::after, main.mj-cine .mj-tx-head::after { background: var(--a-red) !important; height: 1px !important; }
main.mj-cine .ui-head, main.mj-cine .mj-head, main.mj-cine .mj-tx-head { border-radius: 10px !important; box-shadow: none !important; background-color: #0D0D0E !important; }
/* Legacy helpers on a few older pages */
.card { background: var(--a-surface) !important; border: 1px solid var(--a-line) !important; border-radius: 10px !important; color: var(--a-ink); }
.btn-primary { background: var(--a-red) !important; color: #fff !important; border-radius: 6px !important; }

/* =====================================================================
   Shell
   ===================================================================== */
.ra-top { position: sticky; top: 0; z-index: 50; height: 60px; display: flex; align-items: center; gap: 8px; padding: 0 14px; background: var(--a-topbar); border-bottom: 1px solid var(--a-line); -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px); }
@media (min-width: 1024px) { .ra-top { height: 64px; padding: 0 24px 0 0; } }
.ra-logo { display: inline-flex; align-items: center; height: 100%; padding: 0 6px; font-size: 15px; color: var(--a-ink); text-decoration: none; white-space: nowrap; }
@media (min-width: 1024px) { .ra-logo { width: 220px; padding-left: 28px; font-size: 16px; } }
.ra-logo img { height: 24px; width: auto; }
.ra-nav { display: none; align-items: stretch; height: 100%; gap: 6px; margin-left: 24px; }
@media (min-width: 1100px) { .ra-nav { display: flex; } }
.ra-nav a { position: relative; display: inline-flex; align-items: center; padding: 0 14px; font-size: 11.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--a-ink-2); text-decoration: none; transition: color .15s ease; }
.ra-nav a:hover { color: var(--a-ink); }
.ra-nav a.is-on { color: var(--a-ink); }
.ra-nav a.is-on::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; background: var(--a-red); box-shadow: 0 0 12px var(--a-glow); }
.ra-nav-dot { width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--a-red); box-shadow: 0 0 8px var(--a-glow); }
.ra-spacer { flex: 1; }
.ra-search { position: relative; display: none; width: 280px; }
@media (min-width: 1280px) { .ra-search { display: block; } }
.ra-search input { width: 100%; height: 38px; padding: 0 14px 0 38px !important; border-radius: 999px !important; background: var(--a-surface-2) !important; border: 1px solid var(--a-line) !important; color: var(--a-ink) !important; font-size: 13px !important; outline: none; }
.ra-search input::placeholder { color: var(--a-ink-3); }
.ra-search input:focus { border-color: var(--a-line-2) !important; }
.ra-search > svg { position: absolute; left: 14px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); color: var(--a-ink-3); pointer-events: none; }
.ra-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 80; max-height: 360px; overflow-y: auto; padding: 6px; background: var(--a-raised); border: 1px solid var(--a-line); border-radius: 10px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.ra-results a { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 6px; font-size: 13px; color: var(--a-ink); text-decoration: none; }
.ra-results a span:last-child { color: var(--a-ink-3); font-size: 11px; }
.ra-results a:hover, .ra-results a.is-focus { background: var(--a-surface-2); }
.ra-icon-btn { position: relative; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--a-ink-2); cursor: pointer; text-decoration: none; transition: background-color .15s ease, color .15s ease; }
.ra-icon-btn:hover { background: var(--a-surface-2); color: var(--a-ink); }
.ra-icon-btn.is-boxed { border-color: var(--a-line); }
.ra-icon-btn svg { width: 18px; height: 18px; }
.ra-dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--a-red); box-shadow: 0 0 0 2px var(--a-bg), 0 0 8px var(--a-glow); }
.ra-theme .i-sun { display: none; }
html.dark .ra-theme .i-sun { display: block; }
html.dark .ra-theme .i-moon { display: none; }
.ra-profile { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border: 0; border-radius: 8px; background: transparent; color: var(--a-ink); cursor: pointer; text-align: left; }
.ra-profile:hover { background: var(--a-surface-2); }
.ra-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--a-surface-2); color: var(--a-ink); font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; object-fit: cover; flex-shrink: 0; border: 1px solid var(--a-line-2); }
.ra-profile-t { display: none; line-height: 1.2; }
@media (min-width: 640px) { .ra-profile-t { display: block; } }
.ra-profile-t b { display: block; font-size: 13px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ra-profile-t span { font-size: 11px; color: var(--a-ink-3); }
.ra-profile > svg { width: 14px; height: 14px; color: var(--a-ink-3); }
.ra-dd { position: absolute; right: 0; top: calc(100% + 8px); z-index: 80; min-width: 260px; background: var(--a-raised); border: 1px solid var(--a-line); border-radius: 10px; box-shadow: 0 24px 60px rgba(0,0,0,.3); overflow: hidden; }
.ra-dd-head { padding: 14px 16px; border-bottom: 1px solid var(--a-line); }
.ra-dd-head p { margin: 0; }
.ra-dd a, .ra-dd button.ra-dd-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 16px; border: 0; background: none; font: inherit; font-size: 13.5px; color: var(--a-ink-2); text-decoration: none; cursor: pointer; text-align: left; }
.ra-dd a:hover, .ra-dd button.ra-dd-item:hover { background: var(--a-surface-2); color: var(--a-ink); }
.ra-dd a svg, .ra-dd button svg { width: 16px; height: 16px; }
.ra-dd-sep { border-top: 1px solid var(--a-line); }
.ra-notif { padding: 12px 16px; border-bottom: 1px solid var(--a-line); }
.ra-notif:last-child { border-bottom: 0; }
.ra-notif.is-new { background: var(--a-red-soft); }
.ra-notif p { margin: 0; }
.ra-top .gtw { height: 38px; border-radius: 8px; --gtw-bg: transparent; --gtw-line: var(--a-line); --gtw-ink: var(--a-ink); }
.ra-top .gtw .goog-te-combo option { color: #111; background: #fff; }
@media (max-width: 1279px) { .ra-top .gtw { display: none; } }

/* Icon rail (desktop) */
.ra-rail { display: none; }
@media (min-width: 1024px) {
    .ra-rail { position: fixed; top: 64px; bottom: 0; left: 0; z-index: 40; width: 84px; display: flex; flex-direction: column; align-items: stretch; padding: 14px 0; background: var(--a-bg); border-right: 1px solid var(--a-line); overflow-y: auto; }
    .ra-shell { margin-left: 84px; }
}
.ra-rail a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 4px; font-size: 11px; font-weight: 500; color: var(--a-ink-3); text-decoration: none; transition: color .15s ease; }
.ra-rail a svg { width: 21px; height: 21px; }
.ra-rail a:hover { color: var(--a-ink); }
.ra-rail a.is-on { color: var(--a-red); }
.ra-rail a.is-on::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 2px; background: var(--a-red); box-shadow: 0 0 10px var(--a-glow); }
.ra-rail a.is-on span { color: var(--a-ink); }
.ra-rail-foot { margin-top: auto; }
@media (min-width: 1024px) and (max-height: 860px) { .ra-rail { padding: 8px 0; } .ra-rail a { padding: 9px 4px; gap: 4px; } }

/* Bottom bar (mobile/tablet) */
.ra-bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); background: var(--a-topbar); border-top: 1px solid var(--a-line); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
@media (min-width: 1024px) { .ra-bottom { display: none; } }
.ra-bottom a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 52px; font-size: 10.5px; font-weight: 500; color: var(--a-ink-3); text-decoration: none; -webkit-tap-highlight-color: transparent; }
.ra-bottom a svg { width: 21px; height: 21px; }
.ra-bottom a.is-on { color: var(--a-red); }
.ra-bottom a.is-on span { color: var(--a-ink); }
.ra-bottom a.is-on::after { content: ''; position: absolute; bottom: 0; width: 34px; height: 2px; background: var(--a-red); box-shadow: 0 0 10px var(--a-glow); }
.ra-bottom-space { height: calc(70px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 1024px) { .ra-bottom-space { display: none; } }

/* Page area */
.ra-page { padding: 14px 12px 32px; }
@media (min-width: 768px) { .ra-page { padding: 20px 24px 48px; } }
.ra-flash { margin: 0 0 16px; padding: 14px 16px; border-left: 2px solid var(--a-ok); background: var(--a-surface); border-radius: 6px; font-size: 14px; }
.ra-flash.is-error { border-left-color: var(--a-bad); }

/* Shared account components (used by dashboard, orders, wallet) */
.ra-eyebrow { margin: 0 0 8px; font-size: 11px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--a-ink-2); }
.ra-h1 { margin: 0; font-family: 'Archivo', 'Inter', sans-serif; font-stretch: 122%; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; font-size: clamp(22px, 2.8vw, 34px); line-height: 1.08; }
.ra-h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: .005em; }
.ra-muted { color: var(--a-ink-2); }
.ra-faint { color: var(--a-ink-3); }
.ra-status { font-size: 12px; font-weight: 500; color: var(--a-ink-2); }
.ra-status.is-ok { color: var(--a-ok); } .ra-status.is-wait { color: var(--a-wait); } .ra-status.is-bad { color: var(--a-bad); } .ra-status.is-red { color: var(--a-red); }
.ra-panel { background: var(--a-surface); border: 1px solid var(--a-line); border-radius: 12px; box-shadow: var(--a-shadow); min-width: 0; }
.ra-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; }
.ra-panel-head + * { border-top: 0; }
.ra-link-sm { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--a-ink-2); text-decoration: none; white-space: nowrap; }
.ra-link-sm svg { width: 13px; height: 13px; }
.ra-link-sm:hover { color: var(--a-ink); }
.ra-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 20px; border: 1px solid transparent; border-radius: 6px; font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease; }
.ra-btn svg { width: 15px; height: 15px; }
.ra-btn-red { background: var(--a-red); color: #fff; box-shadow: 0 8px 24px -8px var(--a-glow); }
.ra-btn-red:hover { background: var(--a-red-2); }
.ra-btn-line { background: transparent; color: var(--a-ink); border-color: var(--a-line-2); }
.ra-btn-line:hover { border-color: var(--a-ink); }
.ra-btn-glass { background: rgba(0,0,0,.35); color: #fff; border-color: rgba(255,255,255,.45); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
html.light .ra-btn-glass { background: rgba(255,255,255,.85); color: #111; border-color: rgba(0,0,0,.08); }
.ra-btn-glass:hover { border-color: #fff; }
.ra-btn-ghost { background: var(--a-surface-2); color: var(--a-ink); border-color: var(--a-line); }
.ra-btn-ghost:hover { border-color: var(--a-line-2); }

/* Responsive photography (includes/roadster_media.php → rsPicture) — account pages don't load rs-site.css */
.rs-pic { display: block; overflow: hidden; }
.rs-pic img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: var(--pos, 50% 50%); }

/* =====================================================================
   Menu bottom sheet (slides up from the bottom; works in dark and light)
   ===================================================================== */
.ra-sheet-back { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.55); opacity: 0; transition: opacity .3s ease; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ra-sheet-back.open { opacity: 1; }
.ra-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 91; max-height: min(88vh, 760px); max-height: min(88dvh, 760px); display: flex; flex-direction: column;
    background: var(--a-surface); color: var(--a-ink); border: 1px solid var(--a-line); border-bottom: 0; border-radius: 24px 24px 0 0;
    box-shadow: 0 -24px 70px rgba(0,0,0,.45); transform: translateY(105%); transition: transform .42s cubic-bezier(.22,1,.36,1); padding-bottom: env(safe-area-inset-bottom, 0px); }
.ra-sheet.open { transform: translateY(0); }
.ra-sheet.dragging { transition: none; }
@media (min-width: 768px) { .ra-sheet { left: 50%; right: auto; width: min(760px, calc(100vw - 48px)); margin-left: calc(min(760px, calc(100vw - 48px)) / -2); } }
@media (min-width: 1024px) { .ra-sheet { margin-left: calc(min(760px, calc(100vw - 48px)) / -2 + 42px); } }
.ra-sheet::before { content: ''; position: absolute; left: 24px; right: 24px; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--a-red), transparent); opacity: .7; }
.ra-sheet-grab { display: flex; justify-content: center; padding: 10px 0 2px; cursor: grab; touch-action: none; }
.ra-sheet-grab span { width: 44px; height: 4px; border-radius: 4px; background: var(--a-line-2); }
.ra-sheet-head { display: flex; align-items: center; gap: 12px; padding: 8px 18px 14px; border-bottom: 1px solid var(--a-line); touch-action: none; }
.ra-sheet-name { margin: 0; font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ra-sheet-sub { margin: 2px 0 0; font-size: 12px; color: var(--a-ink-3); }
.ra-sheet-sub a { color: var(--a-red); text-decoration: none; }
.ra-sheet-theme { display: inline-flex; align-items: center; height: 34px; padding: 0 12px; border: 1px solid var(--a-line-2); border-radius: 999px; background: var(--a-surface-2); color: var(--a-ink); font: 500 12px 'Inter', sans-serif; cursor: pointer; }
.ra-sheet-theme span { display: inline-flex; align-items: center; gap: 6px; }
.ra-sheet-theme svg { width: 15px; height: 15px; }
html.dark .ra-sheet-theme .i-dark, html.light .ra-sheet-theme .i-light { display: none; }
.ra-sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 18px 16px; overscroll-behavior: contain; }
.ra-sheet-h { margin: 16px 2px 8px; font-size: 10.5px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--a-ink-3); }
.ra-sheet-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .ra-sheet-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ra-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 78px; padding: 12px 6px; border-radius: 14px; border: 1px solid var(--a-line); background: var(--a-surface-2);
    color: var(--a-ink-2); text-decoration: none; text-align: center; font-size: 12px; font-weight: 500; line-height: 1.25; transition: border-color .15s ease, color .15s ease, transform .15s ease; -webkit-tap-highlight-color: transparent; }
.ra-tile svg { width: 22px; height: 22px; }
.ra-tile:hover { color: var(--a-ink); border-color: var(--a-line-2); }
.ra-tile:active { transform: scale(.97); }
.ra-tile.is-on { color: var(--a-ink); border-color: var(--a-red); box-shadow: 0 0 0 3px var(--a-red-soft); }
.ra-tile.is-on svg { color: var(--a-red); filter: drop-shadow(0 0 6px var(--a-glow)); }
.ra-sheet-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--a-line); }
.ra-sheet-foot .ra-btn { height: 44px; }
.ra-sheet-out { color: var(--a-bad) !important; }
@media (prefers-reduced-motion: reduce) { .ra-sheet, .ra-sheet-back { transition: none; } }
