/*
 * NaviSpace — "Lamp over the floor".
 *
 * A study-hall at night: deep green-black ground, one warm lamp glow at
 * the top of every page, a serif voice (Newsreader) for what we say and a
 * monospace instrument (IBM Plex Mono) for what we measure. Brass is the
 * only decorative accent and is spent on actions. Seat states keep fixed,
 * distinct meanings everywhere and always come with a word:
 *   free = sage, taken = soft vermilion, stepped away = amber.
 */

/* --- Fonts: served from NaviSpace itself, trimmed to Latin and to the weights
   the site uses, so no page waits on a second server before it can draw. --- */
@font-face {
    font-family: "Newsreader";
    font-style: normal;
    font-weight: 400 500;
    font-display: swap;
    src: url("/fonts/newsreader.woff2") format("woff2");
}

@font-face {
    font-family: "Newsreader";
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("/fonts/newsreader-italic.woff2") format("woff2");
}

@font-face {
    font-family: "Public Sans";
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url("/fonts/public-sans.woff2") format("woff2");
}

@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("/fonts/ibm-plex-mono-400.woff2") format("woff2");
}

@font-face {
    font-family: "IBM Plex Mono";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("/fonts/ibm-plex-mono-500.woff2") format("woff2");
}

:root {
    /* Ground & ink */
    --ground: #121614;
    --ground-2: #171d1a;
    --surface: rgba(236, 230, 214, 0.035);
    --surface-2: rgba(236, 230, 214, 0.065);
    --line: rgba(236, 230, 214, 0.1);
    --line-strong: rgba(236, 230, 214, 0.2);
    --text: #ece6d6;
    --muted: #a3aa9c;
    --faint: #737b72;

    /* Accent */
    --brass: #c4a35f;
    --brass-hi: #d6b878;
    --on-brass: #141812;

    /* Seat states */
    --free: #8cc5a4;
    --free-dim: rgba(140, 197, 164, 0.13);
    --taken: #e38c70;
    --taken-dim: rgba(227, 140, 112, 0.13);
    --away: #dcae63;
    --away-dim: rgba(220, 174, 99, 0.14);

    /* Type */
    --font-serif: "Newsreader", "Iowan Old Style", Georgia, serif;
    --font-body: "Public Sans", system-ui, -apple-system, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

    /* Older names still used by page-level styles, mapped onto the system. */
    --ink: var(--ground);
    --panel: var(--surface);
    --panel-raised: var(--surface-2);
    --paper: var(--text);
    --slate: var(--muted);
    --slate-dim: var(--faint);
    --green: var(--free);
    --green-dim: var(--free-dim);
    --vermilion: var(--taken);
    --vermilion-dim: var(--taken-dim);
    --amber: var(--away);
    --amber-dim: var(--away-dim);
    --accent: var(--brass);
    --on-accent: var(--on-brass);
    --glass-bg: var(--surface);
    --glass-strong: var(--surface-2);
    --glass-border: var(--line);
    --well: rgba(0, 0, 0, 0.28);
    --font-display: var(--font-serif);
    --font-heading: var(--font-serif);

    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

html {
    /* Keep text its designed size when an iPhone turns sideways, and drop
       the grey flash mobile browsers paint over every tapped link. */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(ellipse 55% 38% at 50% -6%, rgba(228, 192, 118, 0.11), transparent 72%) no-repeat,
        var(--ground);
    color: var(--text);
    font: 400 16px/1.55 var(--font-body);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
}

a,
button,
input,
label {
    touch-action: manipulation;
}

button {
    font-family: var(--font-body);
}

:focus-visible {
    outline: 2px solid var(--brass);
    outline-offset: 3px;
}

::selection {
    background: rgba(196, 163, 95, 0.35);
}

/* --- Top bar ---------------------------------------------------------- */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px 24px;
    padding: max(20px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) 20px max(20px, env(safe-area-inset-left, 0px));
    border-bottom: 1px solid var(--line);
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font: 500 19px/1 var(--font-serif);
    letter-spacing: 0.005em;
    text-decoration: none;
    color: var(--text);
    white-space: nowrap;
    /* A comfortable tap target without moving anything. */
    padding: 12px 0;
    margin: -12px 0;
}

.wordmark-mark {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--free);
    box-shadow: 0 0 0 4px rgba(140, 197, 164, 0.14), 0 0 14px rgba(140, 197, 164, 0.45);
    flex-shrink: 0;
}

.topnav {
    display: flex;
    gap: 6px 26px;
    flex-wrap: wrap;
}

.topnav a {
    font: 400 12px/1 var(--font-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    padding: 6px 0;
    min-width: 24px; /* "MAP" alone is narrower than a fingertip */
    flex-shrink: 0; /* never squeezed narrower than its words (large text) */
    text-align: center;
    white-space: nowrap;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.topnav a:hover {
    color: var(--text);
}

.topnav a.current {
    color: var(--text);
    border-bottom-color: var(--brass);
}

@media (max-width: 560px) {
    .topbar {
        padding-top: max(16px, env(safe-area-inset-top, 0px));
        padding-bottom: 14px;
    }

    .topnav {
        order: 3;
        width: 100%;
        flex-wrap: nowrap;
        gap: 22px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .topnav::-webkit-scrollbar {
        display: none;
    }
}

/* Small phones (iPhone SE and narrower): all four sections still fit on one line. */
@media (max-width: 380px) {
    .topnav {
        gap: 16px;
    }

    .topnav a {
        font-size: 11px;
        letter-spacing: 0.06em;
    }
}

/* --- Page shell ---------------------------------------------------------- */

main {
    max-width: 760px;
    margin: 0 auto;
    padding: 34px max(20px, env(safe-area-inset-right, 0px)) 72px max(20px, env(safe-area-inset-left, 0px));
}

.page-title {
    font: 400 clamp(38px, 7vw, 58px)/1.02 var(--font-serif);
    letter-spacing: -0.012em;
    margin: 0 0 12px;
    text-wrap: balance;
}

.page-title em {
    color: var(--brass);
}

.page-subtitle {
    color: var(--muted);
    font-size: 15.5px;
    max-width: 52ch;
    margin: 0 0 32px;
}

.eyebrow {
    font: 400 11.5px/1 var(--font-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

/* The library a page belongs to, and the way back to the picker. */
.context-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
    max-width: 760px;
    margin: 0 auto;
    padding: 18px max(20px, env(safe-area-inset-right, 0px)) 0 max(20px, env(safe-area-inset-left, 0px));
}

.context-bar .library-name {
    font: 400 11.5px/1 var(--font-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brass);
}

.context-bar a {
    font: 400 11.5px/1 var(--font-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
    padding: 10px 0;
    margin: -10px 0;
}

.context-bar a:hover {
    color: var(--text);
}

/* --- Readouts: the instrument panel ------------------------------------- */

.readout {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 36px;
    font: 400 11px/1.2 var(--font-mono);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.readout b {
    display: block;
    text-transform: none;
    font: 500 26px/1.15 var(--font-mono);
    letter-spacing: -0.01em;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    margin-bottom: 4px;
}

.readout b.free {
    color: var(--free);
}

/* --- Lost & Found -------------------------------------------------------- */

.lf-grid {
    display: grid;
    /* One card per row on phones, so its buttons have room. */
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
    gap: 16px;
}

.lf-card {
    border: 1px solid var(--line);
    background: var(--surface);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.lf-card.is-claimed {
    opacity: 0.55;
}

.lf-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    background: var(--surface-2);
}

@media (max-width: 520px) {
    .lf-card img {
        aspect-ratio: 4 / 3;
    }
}

.lf-card-body {
    padding: 12px 14px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lf-card-desc {
    font: 400 17px/1.25 var(--font-serif);
}

.lf-card-meta {
    font: 400 11.5px/1.4 var(--font-mono);
    color: var(--muted);
}

.lf-chip {
    align-self: flex-start;
    font: 400 10.5px/1 var(--font-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 6px 8px;
    border: 1px solid rgba(196, 163, 95, 0.5);
    color: var(--brass);
}

.lf-empty {
    text-align: center;
    color: var(--muted);
    font: 400 italic 18px/1.4 var(--font-serif);
    padding: 48px 0;
    grid-column: 1 / -1;
}

.lf-form {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 22px;
    margin-bottom: 28px;
}

.lf-form label {
    display: block;
    font: 400 11px/1 var(--font-mono);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 18px 0 8px;
}

.lf-form label:first-child {
    margin-top: 0;
}

.lf-form input[type="text"],
.lf-form textarea {
    width: 100%;
    font-family: var(--font-body);
    resize: vertical;
}

.lf-form input[type="file"] {
    font: 400 13px var(--font-body);
    color: var(--muted);
    max-width: 100%;
}

.lf-form input[type="file"]::file-selector-button {
    font: 400 11.5px var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-right: 12px;
    padding: 10px 14px;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.lf-photo-preview {
    width: 100%;
    max-width: 240px;
    margin-top: 12px;
    display: none;
}

/* --- Modal ----------------------------------------------------------------- */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(6, 8, 7, 0.78);
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 10;
}

.modal-box {
    background: var(--ground-2);
    border: 1px solid var(--line-strong);
    padding: 28px;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.modal-box p {
    margin: 0 0 18px;
    font: 400 19px/1.35 var(--font-serif);
}

/* --- Seat states ------------------------------------------------------------- */

.signal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.signal-AVAILABLE {
    background: var(--free);
    box-shadow: 0 0 10px rgba(140, 197, 164, 0.6);
}

.signal-OCCUPIED {
    background: var(--taken);
}

.signal-STEPPED_AWAY {
    background: var(--away);
}

/* --- Buttons ---------------------------------------------------------------- */

.btn {
    display: block;
    width: 100%;
    padding: 15px 18px;
    margin: 10px 0;
    font: 500 12.5px/1 var(--font-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.btn:hover {
    border-color: var(--brass);
}

.btn:active {
    transform: scale(0.985);
}

.btn[aria-busy="true"] {
    opacity: 0.6;
    pointer-events: none;
}

.btn-primary {
    background: var(--brass);
    border-color: var(--brass);
    color: var(--on-brass);
    font-weight: 500;
}

.btn-primary:hover {
    background: var(--brass-hi);
    border-color: var(--brass-hi);
}

.btn-tinted {
    background: var(--surface-2);
    border-color: var(--line);
}

.btn-quiet {
    background: none;
    border: none;
    color: var(--muted);
    font: 400 italic 15px var(--font-serif);
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 4px;
    padding: 6px 0;
    width: auto;
    display: inline-block;
    cursor: pointer;
}

.btn-quiet:hover {
    color: var(--text);
}

/* The "→" link-style action used across pages. */
.cta-link {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border: 1px solid var(--brass);
    color: var(--text);
    text-decoration: none;
    font: 500 12.5px/1 var(--font-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: background 0.2s ease, color 0.2s ease;
}

.cta-link::after {
    content: "→";
    color: var(--brass);
    transition: transform 0.2s ease, color 0.2s ease;
}

.cta-link:hover {
    background: var(--brass);
    color: var(--on-brass);
}

.cta-link:hover::after {
    color: var(--on-brass);
    transform: translateX(3px);
}

/* --- Form controls ---------------------------------------------------------- */

input[type="text"],
textarea {
    /* 16px: iPhones zoom the whole page into any smaller field on tap. */
    font: 400 16px var(--font-body);
    background: var(--well);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 0;
    padding: 13px 14px;
}

input[type="text"]:focus,
textarea:focus {
    border-color: var(--brass);
    outline: none;
    /* A clear ring, not just a 1px colour change. */
    box-shadow: 0 0 0 2px rgba(196, 163, 95, 0.45);
}

input[type="text"]::placeholder {
    color: var(--faint);
}

/* --- "How NaviSpace works": the way into the guide (/guide) -------------------
 * A card near the top of the home page, and a small chip on the seat page for
 * someone who's never opened it. A light sweeps across now and then to catch
 * the eye; it stays still for anyone who asks for less motion. */
.guide-card {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    margin: 0 0 26px;
    border: 1px solid var(--brass);
    background: linear-gradient(110deg, rgba(196, 163, 95, 0.16), rgba(196, 163, 95, 0.04) 60%), var(--surface);
    color: var(--text);
    text-decoration: none;
    transition: background 0.25s ease, transform 0.2s ease;
}

.guide-top {
    position: relative;
    overflow: hidden;
}

.guide-card::after,
.guide-top::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 30%, rgba(236, 210, 150, 0.22) 50%, transparent 70%);
    transform: translateX(-100%);
    animation: guide-sweep 7s ease-in-out 1.2s infinite;
    pointer-events: none;
}

@keyframes guide-sweep {
    0%, 70% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.guide-card:hover {
    background: linear-gradient(110deg, rgba(196, 163, 95, 0.24), rgba(196, 163, 95, 0.08) 60%), var(--surface);
}

.guide-card:active {
    transform: scale(0.99);
}

.guide-seats {
    display: grid;
    grid-template-columns: repeat(3, 9px);
    gap: 4px;
}

.guide-seats i {
    width: 9px;
    height: 9px;
    border-radius: 2px;
    background: rgba(236, 230, 214, 0.18);
}

.guide-seats i.f {
    background: var(--free);
    box-shadow: 0 0 8px rgba(140, 197, 164, 0.7);
}

.guide-text {
    display: grid;
    gap: 3px;
}

.guide-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font: 500 11px/1.2 var(--font-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brass-hi);
}

.guide-eyebrow i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--free);
    animation: guide-pulse 2.2s ease-in-out infinite;
}

@keyframes guide-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(140, 197, 164, 0.6); }
    50% { box-shadow: 0 0 0 6px rgba(140, 197, 164, 0); }
}

.guide-text b {
    font: 400 clamp(20px, 2.4vw, 24px)/1.15 var(--font-serif);
}

.guide-text small {
    font-size: 13.5px;
    color: var(--muted);
}

.guide-arrow {
    font: 400 26px/1 var(--font-serif);
    color: var(--brass-hi);
    transition: transform 0.2s ease;
}

.guide-card:hover .guide-arrow {
    transform: translateX(4px);
}

.guide-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    padding: 12px 14px;
    border: 1px solid var(--brass);
    background: rgba(196, 163, 95, 0.1);
    color: var(--text);
    text-decoration: none;
    font-size: 14.5px;
}

.guide-chip[hidden] {
    display: none;
}

.guide-chip b {
    font-weight: 500;
}

.guide-chip span:last-child {
    margin-left: auto;
    color: var(--brass-hi);
}

.guide-card.seen .guide-eyebrow i,
.guide-chip.seen .guide-eyebrow i {
    animation: none;
    background: var(--brass);
}

@media (prefers-reduced-motion: reduce) {
    .guide-top::after,
    .guide-card::after,
    .guide-eyebrow i {
        animation: none;
    }
}

/* --- Toast ------------------------------------------------------------------- */

.toast {
    margin-top: 14px;
    font: 400 italic 16px/1.45 var(--font-serif);
    color: var(--muted);
    min-height: 1.4em;
}

/* --- Footer ------------------------------------------------------------------ */

.sitefoot {
    border-top: 1px solid var(--line);
    padding: 22px max(20px, env(safe-area-inset-right, 0px)) max(30px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px 24px;
    font: 400 11px/1.4 var(--font-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--faint);
}

.sitefoot a {
    display: inline-block;
    padding: 6px 0;
    margin: -6px 0;
    color: inherit;
    text-underline-offset: 3px;
}

.sitefoot a:hover {
    color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* --- Polish ---------------------------------------------------------------- */

html {
    scroll-behavior: smooth;
}

p {
    text-wrap: pretty;
}

h1,
h2,
h3 {
    text-wrap: balance;
}

/* A fine grain over everything, so the dark ground reads as paper under a
   lamp rather than a flat screen. */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* One header on every page: name left, sections centred, actions right. */
@media (min-width: 561px) {
    .topbar {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
    }

    .topbar > .wordmark {
        justify-self: start;
    }

    .topbar > .topnav {
        justify-self: center;
    }

    .topbar > .nav-actions {
        justify-self: end;
    }
}

/* Pages settle in rather than appearing all at once. */
@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
}

main > *,
.context-bar {
    animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

main > :nth-child(2) { animation-delay: 0.06s; }
main > :nth-child(3) { animation-delay: 0.12s; }
main > :nth-child(4) { animation-delay: 0.18s; }
main > :nth-child(5) { animation-delay: 0.24s; }
main > :nth-child(n + 6) { animation-delay: 0.3s; }

/* Empty pages: a composed invitation instead of a lone grey sentence. */
.empty-state {
    display: grid;
    justify-items: center;
    gap: 12px;
    margin-top: 28px;
    padding: 40px 24px 36px;
    border: 1px dashed var(--line-strong);
    background: radial-gradient(ellipse 70% 90% at 50% 0%, rgba(196, 163, 95, 0.07), transparent 70%);
    text-align: center;
}

.empty-state[style*="display: none"] {
    display: none;
}

.empty-state h2 {
    margin: 0;
    font: 400 clamp(24px, 4vw, 30px)/1.15 var(--font-serif);
    letter-spacing: -0.01em;
}

.empty-state p {
    margin: 0;
    max-width: 42ch;
    color: var(--muted);
}

.empty-state .cta-link {
    margin-top: 8px;
}

/* Faint placeholder rows hinting at what will fill the space. */
.ghost-rows {
    display: grid;
    gap: 10px;
    width: min(100%, 340px);
    margin-bottom: 10px;
}

.ghost-rows span {
    display: grid;
    grid-template-columns: 28px 1fr 24px;
    align-items: center;
    gap: 14px;
    font: 400 12px/1 var(--font-mono);
    color: var(--brass);
    opacity: 0.55;
}

.ghost-rows span::before {
    content: "";
    grid-column: 2;
    grid-row: 1;
    height: 10px;
    background: linear-gradient(90deg, rgba(236, 230, 214, 0.1), rgba(236, 230, 214, 0.02));
}

.ghost-rows span:nth-child(2)::before { margin-right: 18%; }
.ghost-rows span:nth-child(3)::before { margin-right: 34%; }

.ghost-rows span::after {
    content: "·";
    grid-column: 3;
    color: var(--faint);
    text-align: right;
}

/* --- Welcome: the first-visit nickname card ----------------------------- */

.welcome {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(6, 8, 7, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: welcome-in 0.35s ease both;
}

.welcome.leaving {
    opacity: 0;
    transition: opacity 0.25s ease;
}

html.welcome-open {
    overflow: hidden;
}

@keyframes welcome-in {
    from {
        opacity: 0;
    }
}

.welcome-card {
    position: relative;
    width: min(100%, 420px);
    display: grid;
    gap: 10px;
    padding: 34px 28px 22px;
    background:
        radial-gradient(ellipse 80% 55% at 50% 0%, rgba(228, 192, 118, 0.12), transparent 70%),
        #181c1a;
    border: 1px solid var(--line-strong);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.welcome-mark {
    justify-self: start;
    font: 500 italic 34px/1 var(--font-serif);
    color: var(--brass);
    margin-bottom: 4px;
}

.welcome-eyebrow {
    margin: 0;
    font: 400 11.5px/1 var(--font-mono);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--brass);
}

.welcome-card h2 {
    margin: 2px 0 0;
    font: 400 clamp(28px, 6vw, 34px)/1.08 var(--font-serif);
    letter-spacing: -0.01em;
}

.welcome-text {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 15px;
}

.welcome-label {
    font: 400 11px/1 var(--font-mono);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.welcome-card input {
    width: 100%;
    font-size: 18px;
}

.welcome-error {
    margin: 0;
    color: var(--taken);
    font-size: 13.5px;
}

.welcome-card .btn-primary {
    margin: 8px 0 0;
}

.welcome-later {
    justify-self: center;
    background: none;
    border: 0;
    padding: 10px 12px;
    color: var(--muted);
    font: 400 italic 15px/1 var(--font-serif);
    cursor: pointer;
}

.welcome-later:hover {
    color: var(--text);
}

/* --- "Tell me when a seat frees up" (mountWaitCard in client.js) ---------- */

.wait {
    margin: 22px 0 0;
    padding: 18px 20px;
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--brass);
    background: var(--surface);
    max-width: 520px;
}

.wait[hidden] {
    display: none;
}

.wait[data-state="waiting"] {
    border-left-color: var(--free);
}

.wait-title {
    margin: 0 0 6px;
    font: 400 21px/1.2 var(--font-serif);
    color: var(--text);
}

.wait-sub {
    margin: 0 0 14px;
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--muted);
}

.wait-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.wait-row .btn {
    width: auto;
    margin: 0;
    flex: 0 0 auto;
}

.wait-area {
    flex: 1 1 180px;
    display: flex;
}

.wait-area select {
    width: 100%;
    min-height: 44px;
    padding: 0 36px 0 14px;
    font: 400 15px var(--font-body);
    color: var(--text);
    background: var(--ground-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23c4a35f' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 14px center;
    border: 1px solid var(--line-strong);
    border-radius: 0;
    appearance: none;
    -webkit-appearance: none;
}

.wait-area select:focus-visible {
    outline: 2px solid var(--brass);
    outline-offset: 2px;
}

.wait-msg {
    margin: 12px 0 0;
    font: 400 italic 15px/1.45 var(--font-serif);
    color: var(--text);
}

.wait-msg a {
    color: var(--brass);
}

.wait-pulse {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin: 0 10px 2px 0;
    border-radius: 50%;
    background: var(--free);
    box-shadow: 0 0 0 0 rgba(140, 197, 164, 0.6);
    animation: wait-pulse 2s ease-out infinite;
}

@keyframes wait-pulse {
    70% { box-shadow: 0 0 0 9px rgba(140, 197, 164, 0); }
    100% { box-shadow: 0 0 0 0 rgba(140, 197, 164, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .wait-pulse { animation: none; }
}

@media (max-width: 420px) {
    .wait-row .btn { flex: 1 1 100%; }
}

/* --- Announcements and closing early (showLibraryNotices in client.js) ---- */

.lib-notices[hidden] {
    display: none;
}

.lib-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    padding: 10px max(20px, env(safe-area-inset-right, 0px)) 10px max(20px, env(safe-area-inset-left, 0px));
    border-bottom: 1px solid var(--line);
    background: rgba(196, 163, 95, 0.09);
    font-size: 14.5px;
    line-height: 1.45;
    color: var(--text);
}

.lib-notice[data-kind="close"] {
    background: rgba(220, 174, 99, 0.14);
}

.lib-notice b {
    font-weight: 600;
}

.lib-notice-dot {
    flex: 0 0 auto;
    align-self: flex-start;
    margin-top: 0.5em; /* level with the first line, however many lines follow */
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brass);
}

.lib-notice[data-kind="close"] .lib-notice-dot {
    background: var(--away);
}

.lib-notice-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

/* On a phone a long announcement shows two lines, with More for the rest:
   the seat card (just scanned) must stay on screen. */
@media (max-width: 560px) {
    .lib-notice-text.clamped {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

.lib-notice-more {
    border: 0;
    background: none;
    padding: 0;
    margin-left: 4px;
    color: var(--brass);
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.lib-notice-x {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    margin: -8px -10px -8px 0;
    border: 0;
    background: none;
    color: var(--muted);
    font: 400 22px/1 var(--font-body);
    cursor: pointer;
}

.lib-notice-x:hover,
.lib-notice-x:focus-visible {
    color: var(--text);
}

/* --- Pill buttons in the top bar (home: your seat, Add to Home Screen; staff: Sign out) */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line-strong);
    border-radius: 0;
    background: transparent;
    color: var(--text);
    padding: 9px 14px;
    font: 400 11.5px/1 var(--font-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    -webkit-appearance: none;
    appearance: none;
}

.pill:hover {
    border-color: var(--brass);
}

.pill[hidden] {
    display: none;
}

/* Placeholders in every text field, not only one-line ones. */
textarea::placeholder {
    color: var(--faint);
}

/* High Contrast / forced colours: keep the colour keys, or nothing on the
   page says which colour means free, taken or stepped away. */
@media (forced-colors: active) {
    .signal-dot,
    .model-legend i,
    .lib-notice-dot,
    .wait-pulse {
        forced-color-adjust: none;
    }
}

/* Read by screen readers, not shown. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Focus moved here by script (after a dialog closes): no ring on the whole page. */
[tabindex="-1"]:focus {
    outline: none;
}
