/* REKAP navigation: phone/app bottom bar + desktop left sidebar (no Tailwind needed). */
:root {
    --rkn-bar-h: 62px;
    --rkn-side-w: 240px;
    --rkn-safe-bottom: env(safe-area-inset-bottom, 0px);
    --rkn-orange: #ff7300;
    --rkn-grad: linear-gradient(135deg, #F5B82E 0%, #FF7300 45%, #E4362E 100%);
}

.rkn-ic { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; display: block; }   /* Lucide outline */
.rkn-ic-wrap { position: relative; display: inline-flex; }
.rkn-badge {
    position: absolute; top: -6px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
    background: #ff3040; color: #fff; font: 700 11px/18px -apple-system, system-ui, sans-serif; text-align: center;
    box-shadow: 0 0 0 2px #000;
}
.rkn-badge[hidden] { display: none; }

/* ---------- bottom bar (phones, app) ---------- */
/* Five equal columns: REKAPS · Search · + · Inbox · Profile (+ exactly centred).
   The + sits ON the bar: vertically centred in the same row as the other icons,
   never above the bar's top border. Home-bar safe area below. */
.rkn-side { display: none; }
.rkn-bar {
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
    height: calc(var(--rkn-bar-h) + var(--rkn-safe-bottom)); padding-bottom: var(--rkn-safe-bottom);
    padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: stretch;
    background: #000; border-top: 1px solid rgba(255, 255, 255, .08);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.rkn-bar[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rkn-tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: var(--rkn-bar-h);
    color: rgba(255, 255, 255, .5); font-size: 10px; font-weight: 600; letter-spacing: .02em; text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.rkn-tab.is-active { color: #FF7300; }
/* Active tab: filled + accent. (Live keeps its outline; only the centre dot fills.) */
.rkn-tab.is-active .rkn-ic, .rkn-item.is-active .rkn-ic { fill: currentColor; }
.rkn-tab.is-active[data-nav-live] .rkn-ic, .rkn-item.is-active[data-nav-live] .rkn-ic { fill: none; stroke-width: 2.2; }
.rkn-tab:focus-visible, .rkn-item:focus-visible, .rkn-plus-wrap:focus-visible .rkn-plus {
    outline: 2px solid #FF9A3C; outline-offset: 2px; }
.rkn-tab .rkn-ic { width: 26px; height: 26px; }
.rkn-tab-label { line-height: 12px; height: 12px; }
.rkn-plus {
    width: 48px; height: 40px; border-radius: 13px; display: flex; align-items: center; justify-content: center; flex: none;
    background: var(--rkn-grad); color: #fff;
    box-shadow: 0 6px 16px -6px rgba(255, 90, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .28);
    transition: transform .12s ease;
}
.rkn-plus .rkn-ic { width: 26px; height: 26px; stroke: #fff; stroke-width: 2.4; }
.rkn-plus-wrap:active .rkn-plus { transform: scale(.93); }

/* ---------- desktop sidebar ---------- */
@media (min-width: 1024px) {
    .rkn-bar { display: none; }
    /* Room for the sidebar. The class is set by rekap_nav.html, so this works
       without :has() (older Firefox); :has() covers pages before that script runs. */
    html.rkn-has-side body, body:has(.rkn-side) { padding-left: var(--rkn-side-w) !important; }
    html.rkn-has-side, html.rkn-has-side body { overflow-x: clip; }     /* nothing scrolls sideways under the sidebar */
    .rkn-side, .rkn-side * { box-sizing: border-box; }
    .rkn-side {
        position: fixed !important; z-index: 60; top: 0; bottom: 0; left: 0 !important; right: auto !important;
        width: var(--rkn-side-w); min-width: var(--rkn-side-w); max-width: var(--rkn-side-w);
        margin: 0 !important; transform: none !important; translate: none !important; overflow-x: hidden;
        display: flex; flex-direction: column; gap: 4px; padding: 22px 12px 20px calc(12px + env(safe-area-inset-left, 0px));
        background: #000; border-right: 1px solid rgba(255, 255, 255, .1); overflow-y: auto;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    }
    .rkn-logo { display: flex; align-items: center; height: 44px; padding: 0 12px; margin-bottom: 18px; }
    .rkn-logo-full { height: 30px; width: auto; display: block; }
    .rkn-logo-mark { display: none; }
    .rkn-item {
        display: flex; align-items: center; gap: 16px; height: 50px; padding: 0 12px; border-radius: 12px;
        color: #fff; text-decoration: none; font-size: 16px; font-weight: 500; transition: background .12s ease;
    }
    .rkn-item:hover { background: rgba(255, 255, 255, .08); }
    .rkn-item.is-active { font-weight: 800; }
    .rkn-item.is-active { color: #FF7300; }
    .rkn-create { margin-top: 6px; font-weight: 700; }
    .rkn-create-tile {
        width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
        background: var(--rkn-grad); box-shadow: 0 6px 16px -6px rgba(255, 90, 0, .7); margin-left: -4px;
    }
    .rkn-create-tile .rkn-ic { width: 22px; height: 22px; stroke: #fff; stroke-width: 2.4; }
    .rkn-create .rkn-label {
        background: var(--rkn-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
    }
    .rkn-spacer { flex: 1; }
    .rkn-avatar { width: 28px; height: 28px; border-radius: 999px; object-fit: cover; flex: none; }
    .rkn-avatar-letter {
        display: flex; align-items: center; justify-content: center; background: var(--rkn-grad);
        color: #000; font-weight: 800; font-size: 13px;
    }
    .rkn-item.is-active .rkn-avatar { box-shadow: 0 0 0 2px #fff; }
}

/* compact: icons only */
@media (min-width: 1024px) and (max-width: 1279px) {
    :root { --rkn-side-w: 72px; }
    .rkn-side { padding: 22px 10px 20px calc(10px + env(safe-area-inset-left, 0px)); align-items: center; }
    .rkn-logo { padding: 0; justify-content: center; }
    .rkn-logo-full { display: none; }
    .rkn-logo-mark { display: block; width: 32px; height: 32px; }
    .rkn-item { width: 50px; justify-content: center; padding: 0; }
    .rkn-label { display: none; }
    .rkn-create-tile { margin-left: 0; }
}

/* ---------- avatars (all pages): photo, or initials on the REKAP gradient ---------- */
.rk-av { display: inline-flex; flex: none; border-radius: 999px; object-fit: cover; overflow: hidden; vertical-align: middle; }
.rk-initials {
    align-items: center; justify-content: center; background: var(--rkn-grad); color: #000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-weight: 800; line-height: 1;
    letter-spacing: -.02em; text-transform: uppercase; user-select: none;
}

/* ---------- REKAP Live (only rendered while Live is on) ---------- */
.rkn-live-dot {
    position: absolute; top: -2px; right: -4px; width: 9px; height: 9px; border-radius: 999px;
    background: #ff3040; box-shadow: 0 0 0 2px #000; animation: rkn-pulse 1.6s ease-in-out infinite;
}
@keyframes rkn-pulse { 50% { transform: scale(.75); opacity: .7; } }
@media (prefers-reduced-motion: reduce) { .rkn-live-dot { animation: none; } }
.rkn-sheet-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .55); }
.rkn-sheet {
    position: fixed; z-index: 81; left: 50%; bottom: 0; width: 100%; max-width: 480px; transform: translateX(-50%);
    padding: 0 16px calc(18px + var(--rkn-safe-bottom)); box-sizing: border-box; background: #1c1c22; color: #fff;
    border-radius: 22px 22px 0 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.rkn-sheet[hidden], .rkn-sheet-backdrop[hidden] { display: none; }
.rkn-sheet-grab { display: flex; justify-content: center; padding: 10px 0 4px; }
.rkn-sheet-grab span { width: 40px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .3); }
.rkn-sheet h2 { margin: 6px 4px 10px; font-size: 20px; font-weight: 800; }
.rkn-sheet-row { display: flex; align-items: center; gap: 14px; padding: 12px 8px; border-radius: 14px; color: #fff; text-decoration: none; }
.rkn-sheet-row:hover { background: rgba(255, 255, 255, .06); }
.rkn-sheet-row b { display: block; font-size: 16px; }
.rkn-sheet-row small { display: block; margin-top: 2px; color: rgba(255, 255, 255, .55); font-size: 13px; }
.rkn-sheet-ic { width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex: none; }
.rkn-sheet-ic-plus { background: var(--rkn-grad); }
.rkn-sheet-ic-live { background: rgba(255, 48, 64, .16); color: #ff5a66; }
@media (min-width: 1024px) {
    .rkn-sheet { top: 50%; bottom: auto; width: 420px; border-radius: 16px; transform: translate(-50%, -50%); padding-bottom: 16px; }
    .rkn-sheet-grab { display: none; }
    .rkn-sheet h2 { margin-top: 16px; }
}
