:root {
    --sl-cyan: #00eaff;
    --sl-magenta: #ff00a8;
    --sl-purple: #a855f7;
    --sl-bg: #090a10;
    --sl-bg-2: #0b0d17;
    --bs-primary: var(--sl-purple);
    --bs-link-color: var(--sl-cyan);
    --bs-body-bg: var(--sl-bg);
    --bs-body-color: #e6e6f0;
    --bs-border-color: #27293a;
}

/* Background + global */
html, body {
    min-height: 100%
}

body {
    background: radial-gradient(1200px 600px at 80% -10%, rgba(168, 85, 247, .15), transparent 70%),
    radial-gradient(1000px 500px at -10% 20%, rgba(0, 234, 255, .12), transparent 65%),
    linear-gradient(180deg, var(--sl-bg), var(--sl-bg-2));
}

/* Reusable vibes */
.neon-text {
    text-shadow: 0 0 .4rem rgba(168, 85, 247, .8), 0 0 .8rem rgba(255, 0, 168, .35)
}

.neon-border {
    box-shadow: 0 0 0 .1rem rgba(168, 85, 247, .35), 0 0 1.25rem rgba(0, 234, 255, .18) inset;
    border: 1px solid rgba(168, 85, 247, .3) !important
}

.glass {
    background: rgba(15, 17, 30, .55);
    backdrop-filter: blur(6px)
}

.brand-gradient {
    background: linear-gradient(90deg, var(--sl-cyan), var(--sl-magenta) 50%, var(--sl-purple));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent
}

.hero-gradient {
    background: radial-gradient(900px 450px at 20% 10%, rgba(255, 0, 168, .12), transparent 60%),
    radial-gradient(900px 450px at 80% 0%, rgba(0, 234, 255, .10), transparent 60%);
}

/* Navbar tweaks */
.navbar.glass {
    background: rgba(15, 17, 30, .55)
}

.navbar .nav-link {
    color: #cfe4ff
}

.navbar .nav-link:hover {
    color: #fff;
    text-shadow: 0 0 6px rgba(58, 167, 255, .9)
}

/* Forms */
.form-label {
    color: #e6e6f0
}

.form-control.glass {
    background: rgba(255, 255, 255, .04);
    color: #eaf2ff
}

.form-control.glass:focus {
    border-color: #3aa7ff;
    box-shadow: 0 0 0 .2rem rgba(58, 167, 255, .25);
    background: rgba(255, 255, 255, .06)
}

.invalid-feedback {
    display: block
}

/* ensure field errors show */

/* ===== SLAMLab Potree encapsulation ===== */

.sl-pview {
    /* The "card" height; tweak as you like */
    height: 70vh;
    position: relative;
    overflow: hidden; /* clip sidebar & toolbar to the glass card */
}

/* Potree expects absolute children; we anchor them to the card */
.sl-pview #potree_render_area,
.sl-pview #potree_sidebar_container {
    position: absolute;
    inset: 0; /* top/right/bottom/left = 0 relative to .sl-pview */
}

/* Sidebar gets a fixed width & scroll inside the card */
.sl-pview #potree_sidebar_container {
    width: 320px; /* adjust to taste */
    right: auto; /* ensure it sticks to the left */
    left: 0;
    overflow: auto; /* scroll within the card, not the page */
    border-right: 1px solid rgba(168, 85, 247, .25);
}

/* Render area occupies the remaining space to the right of the sidebar */
.sl-pview #potree_render_area {
    left: 320px; /* same as sidebar width */
    right: 0;
    top: 0;
    bottom: 0;
}

/* Keep the toolbar inside the card at the very top */
.sl-pview .potree_toolbar {
    position: absolute !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10; /* ensure it sits above canvas */
}

/* Optional: tweak Potree UI colors to match your theme */
.sl-pview .potree_toolbar {
    background: rgba(15, 17, 30, .75);
    border-bottom: 1px solid rgba(168, 85, 247, .25);
}

.sl-pview #potree_sidebar_container {
    background: rgba(15, 17, 30, .65);
}

/* ── front page (teaser) ─────────────────────────────────────────────
   A few sentences and a strip of snapshots. Mobile first; every rule is scoped under .fs so nothing here touches
   another page. The snapshot is the viewer's own kiosk page in an iframe (static/viewer/kiosk.mjs). */
.fs { --fs-rule: #1c1e2b; --fs-label: #8a90aa; }

.fs-band {
    padding-block: clamp(2rem, 6vw, 4.5rem);
}

.fs-eyebrow {
    font-family: var(--bs-font-monospace);
    font-size: .6875rem;
    text-transform: uppercase;
    letter-spacing: .24em;
    color: var(--sl-cyan);
    margin-bottom: .75rem;
}

.fs h1 {
    font-size: clamp(2rem, 6vw, 3.25rem);
    font-weight: 600;
    letter-spacing: -.02em;
    line-height: 1.05;
    margin-bottom: 1rem;
}

.fs-lead {
    font-size: 1.0625rem;
    line-height: 1.65;
    max-width: 56ch;
    color: #b9bdd0;
    margin-bottom: 0;
}

/* The snapshot stage: one frame, arrows over its edges, a caption line under it. */
.fs-stage {
    position: relative;
}

.fs-frame {
    border: 1px solid var(--fs-rule);
    border-radius: 1rem;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: rgba(15, 17, 30, .55);
    position: relative;
}

@media (min-width: 768px) {
    .fs-frame {
        aspect-ratio: 16 / 9;
    }
}

.fs-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    opacity: 0;
    transition: opacity .35s ease;
}

.fs-frame iframe.is-shown {
    opacity: 1;
}

.fs-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem;
    color: var(--fs-label);
}

.fs-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: 1px solid var(--fs-rule);
    background: rgba(9, 10, 16, .6);
    color: var(--bs-body-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease;
}

.fs-arrow:hover, .fs-arrow:focus-visible {
    color: var(--sl-cyan);
    border-color: var(--sl-cyan);
}

.fs-arrow:focus-visible {
    outline: 2px solid var(--sl-cyan);
    outline-offset: 2px;
}

.fs-arrow-prev {
    left: .5rem;
}

.fs-arrow-next {
    right: .5rem;
}

.fs-meta.fs-meta-dots {
    justify-content: center;
}

.fs-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem 1rem;
    margin-top: .75rem;
}

.fs-caption {
    margin: 0;
    color: var(--fs-label);
    font-size: .9375rem;
}

.fs-dots {
    display: flex;
    gap: .25rem;
}

.fs-dot {
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    position: relative;
}

.fs-dot::after {
    content: "";
    position: absolute;
    inset: .5rem;
    border-radius: 50%;
    background: var(--fs-label);
    opacity: .55;
}

.fs-dot[aria-current="true"]::after {
    background: var(--sl-cyan);
    opacity: 1;
}

.fs-dot:focus-visible {
    outline: 2px solid var(--sl-cyan);
    outline-offset: 1px;
}

.fs-open {
    font-size: .9375rem;
}

.fs-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1.25rem;
}

.fs-small {
    font-size: .875rem;
    color: var(--fs-label);
    max-width: 60ch;
}

@media (prefers-reduced-motion: reduce) {
    .fs-frame iframe {
        transition: none;
    }
}


/* The session last opened from the project page (static/js/project-sessions.js): outlined and
   labelled, so coming Back the owner sees where he was (owner, 2026-10-26). */
.ready-card.session-row-visited > .card,
.list-group-item.session-row-visited {
    box-shadow: 0 0 0 2px var(--bs-info), 0 0 18px rgba(13, 202, 240, .35);
}
.ready-card.session-row-visited > .card::after,
.list-group-item.session-row-visited::after {
    content: "Last opened";
    position: absolute;
    top: -.6rem;
    right: .75rem;
    padding: 0 .4rem;
    font-size: .7rem;
    line-height: 1.2rem;
    border-radius: .25rem;
    color: #000;
    background: var(--bs-info);
    pointer-events: none;
}
.list-group-item.session-row-visited { position: relative; }

/* ===== Live job rows: they fit the phone (owner, 2026-10-03) =====
   A running job's row on the project page was a non-wrapping flex row whose
   right-hand group held a 140 px progress bar beside the status badge and
   the delete button: on a 390 px phone the group ran 186 px past the edge,
   the page became 576 px wide and the browser let the reader pinch-zoom the
   whole page. A job row is now three parts that WRAP:
     .job-row-main      the name + summary: takes the room, breaks anywhere,
                        never forces the row wider than its line;
     .job-row-actions   badge / buttons / bar: right-aligned on a wide line,
                        on its own line when the name needs the room, and it
                        wraps inside itself on the narrowest phones;
     .job-row-progress  the bar: 140 px beside the badge, the whole line when
                        it wraps onto one (its label wraps, never widens it).
   Used by templates/projects/_inprogress_row.html and the Recent jobs rows
   project_detail.html renders in JS (static/js/project-detail.js injects the
   same .job-row-progress). Pinned at 390 and 360 px in headless Chromium by
   projects/test_page_overflow_browser.py. */
.job-row-main {
    flex: 1 1 12rem;
    min-width: 0;
    overflow-wrap: anywhere;
}

.job-row-actions {
    margin-left: auto;
    max-width: 100%;
}

/* A badge is nowrap by default; in a job row a long one (a verdict with its
   let-go time) wraps rather than pushing the row past the screen. */
.job-row-actions > .badge {
    white-space: normal;
}

.job-row-progress {
    flex: 1 1 8.75rem;
    width: 8.75rem;          /* its share of the row's intrinsic width */
    min-width: 0;
}

/* OPEN IN ANOTHER TAB (owner, 2026-10-26; static/js/open-sessions.mjs). A session row whose session is open in another
   tab of this browser gets the viewer rail's OUTLINE state -- "open, but behind another window" -- in the rail's own
   token and colour (static/viewer/rail.mjs RAIL_TOKENS["--rail-outline"], #6db3cc), so it reads as the same idea.
   2 px, as the rail draws its own flash ring (rail.mjs `flash`; a 1.5 px outline snaps to 1 px on a 1x screen). An
   `outline`, not a box-shadow: the cards' .neon-border glow is a box-shadow and stays. */
.session-open-elsewhere {
    outline: 2px solid var(--rail-outline, #6db3cc);
    outline-offset: 2px;
}
.open-tab-badge {
    background: transparent;
    color: #e6e9ee;
    border: 1px solid var(--rail-outline, #6db3cc);
    font-weight: 500;
    align-self: center;
}
