*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; }

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
}

a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; }
hr { border: 0; border-top: 1px solid var(--line); }

/* Shell */
.app-header {
    display: flex;
    flex-wrap: wrap; /* on a phone the nav drops below the brand rather than widening the page */
    align-items: center;
    gap: .5rem 1rem;
    padding: .6rem 1.25rem;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}
.app-brand { display: flex; align-items: center; gap: .75rem; color: var(--ink); text-decoration: none; }
.app-brand img { display: block; height: 40px; width: auto; }
.app-name { font-weight: 600; }
.app-nav { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .5rem .75rem; min-width: 0; }
.app-nav form { margin: 0; }
.app-nav a { text-decoration: none; overflow-wrap: anywhere; }
.app-main { max-width: 72rem; margin: 0 auto; padding: 1.5rem 1.25rem; }

/* Light/dark logo swap */
.logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: inline; }

/* Controls */
.btn, .theme-toggle {
    display: inline-block;
    padding: .45rem .9rem;
    font: inherit;
    color: var(--ink);
    background: var(--tile);
    border: 1px solid var(--line);
    border-radius: .5rem;
    cursor: pointer;
    text-decoration: none;
}
.btn:hover, .theme-toggle:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-link { background: none; border: 0; color: var(--accent); padding: 0; }
.w-100 { width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.form-control, .form-select {
    display: block;
    width: 100%;
    padding: .5rem .75rem;
    font: inherit;
    color: var(--ink);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: .5rem;
}
.form-floating { display: flex; flex-direction: column; margin-bottom: 1rem; }
.form-floating > label { color: var(--dim); font-size: .85rem; order: -1; }
.form-floating > .form-control::placeholder { color: transparent; }
.form-check, .checkbox { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1rem; }
.mt-3 { margin-top: 1rem; }

/* Validation and alerts */
.text-danger, .validation-message { color: var(--danger); }
.invalid { outline: 1px solid var(--danger); }
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--accent2); }
.alert { padding: .75rem 1rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--tile); }
.alert-danger { border-color: var(--danger); color: var(--danger); }
.alert-success { border-color: var(--accent2); }

/* Identity layout helpers */
.row { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.col-lg-3 { flex: 1 1 14rem; max-width: 16rem; }
.col-lg-9 { flex: 3 1 20rem; }
.col-lg-6, .col-md-4, .col-md-6 { flex: 1 1 20rem; max-width: 32rem; }
.nav { list-style: none; margin: 0; padding: 0; }
.nav-pills .nav-link { display: block; padding: .4rem .75rem; border-radius: .5rem; color: var(--ink); text-decoration: none; }
.nav-pills .nav-link.active { background: var(--tile); color: var(--accent); }
table { border-collapse: collapse; }
td, th { padding: .4rem .75rem; border-bottom: 1px solid var(--line); text-align: left; }

/* Blazor error banner */
#blazor-error-ui {
    display: none;
    position: fixed;
    inset: auto 0 0 0;
    padding: .6rem 1.25rem;
    background: var(--danger);
    color: #fff;
    z-index: 1000;
}
#blazor-error-ui a { color: #fff; margin-left: .5rem; }
#blazor-error-ui .dismiss { cursor: pointer; float: right; }

/* Sign-in logo and admin screen */
.login-logo { text-align: center; margin-bottom: 1rem; }
.login-logo img { max-width: min(100%, 24rem); height: auto; }
.login-logo .logo-dark { display: none; }
[data-theme="dark"] .login-logo .logo-light { display: none; }
[data-theme="dark"] .login-logo .logo-dark { display: block; }
.login-logo .logo-light { display: block; }
.link-box { display: flex; gap: .5rem; align-items: center; margin: .5rem 0; }
.link-box input { flex: 1; font-family: ui-monospace, monospace; }
.qr-code { width: 12rem; height: 12rem; background: #fff; padding: .5rem; border-radius: .5rem; }
.qr-code svg { width: 100%; height: 100%; display: block; }
.table-wrap { overflow-x: auto; }
.invite-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.invite-row .form-control { flex: 1 1 16rem; width: auto; }
.invite-row .form-select { width: auto; }
.muted { color: var(--dim); }

/* Meeting screens: join, lobby and room. Always dark, centred, and usable at phone width. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
.meeting-shell { min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--ink); }
.join-flow { min-height: inherit; display: flex; flex-direction: column; }
.emblem img { display: block; height: auto; max-width: 100%; }
.screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    width: 100%;
    max-width: 30rem;
    margin: auto;
    padding: 2.5rem 1rem;
    text-align: center;
    overflow-wrap: anywhere;
}
.screen-eyebrow { margin: .5rem 0 0; color: var(--accent); font-weight: 600; }
.screen-title { margin: 0; font-size: 1.6rem; }
.screen p { margin: 0; }
.screen-form { display: flex; flex-direction: column; gap: .75rem; width: 100%; margin-top: .5rem; }
.screen-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: .75rem; }
.join-bar, .room-bar {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1rem;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    min-width: 0;
}
.join-bar-title, .room-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-pulse {
    width: .75rem;
    height: .75rem;
    margin: .5rem;
    border-radius: 50%;
    background: var(--accent);
    animation: lobby-pulse 1.6s ease-in-out infinite;
}
@keyframes lobby-pulse {
    0%, 100% { opacity: .35; transform: scale(.8); }
    50% { opacity: 1; transform: scale(1.2); }
}
@media (prefers-reduced-motion: reduce) { .lobby-pulse { animation: none; } }
/* The meeting room itself is styled in meeting.css. */

/* Scheduling: the schedule and edit-one-meeting forms, and the invitee picker. */
.schedule-heading { margin-top: 0; }
.schedule-form { display: flex; flex-direction: column; gap: 1.1rem; max-width: 44rem; }
.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; margin: 0; padding: 0; border: 0; }
.field > label, .field > legend, .field-label, .schedule-ends > legend { font-weight: 600; font-size: .9rem; padding: 0; }
.field-row { display: flex; flex-wrap: wrap; gap: .75rem 1rem; }
.field-row > .field { flex: 1 1 10rem; }
.field-error { margin: 0; color: var(--danger); font-size: .9rem; }
.choices { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; }
.choice, .check { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem; cursor: pointer; }
.choice input[type=radio], .check input, .day-toggle input { width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }
.choice .form-control { width: auto; }
.form-control.narrow { display: inline-block; width: 5.5rem; }
.inline-field { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .5rem; }
.day-toggles { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.day-toggle { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .6rem; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.day-toggle:has(input:checked) { border-color: var(--accent); }
.schedule-ends { margin: .75rem 0 0; padding: 0; border: 0; min-width: 0; }
.schedule-access { gap: .5rem; }
.check input:disabled + span { color: var(--dim); }
.schedule-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.schedule-danger { padding-top: 1rem; border-top: 1px solid var(--line); }
.schedule-confirm p { margin: 0 0 .75rem; }
.schedule-result { display: flex; flex-direction: column; gap: .5rem; max-width: 44rem; padding: 1rem 1.25rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--panel); }
.schedule-result p { margin: 0; }
.schedule-failed { margin: 0; padding-left: 1.25rem; overflow-wrap: anywhere; }
.schedule-result-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .25rem; }
.invitee-picker { display: flex; flex-direction: column; gap: .5rem; }
.invitee-chips, .invitee-options { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.invitee-options { flex-direction: column; border: 1px solid var(--line); border-radius: .5rem; background: var(--panel); }
.invitee-chip { display: inline-flex; align-items: center; gap: .4rem; max-width: 100%; padding: .2rem .3rem .2rem .7rem; border: 1px solid var(--line); border-radius: 999px; background: var(--tile); }
.invitee-name { overflow-wrap: anywhere; }
.invitee-email { color: var(--dim); font-size: .85rem; overflow-wrap: anywhere; }
.invitee-remove { min-width: 1.75rem; min-height: 1.75rem; font: inherit; line-height: 1; color: var(--ink); background: none; border: 0; border-radius: 50%; cursor: pointer; }
.invitee-remove:hover { background: var(--panel); }
.invitee-option { display: flex; flex-wrap: wrap; gap: .1rem .6rem; width: 100%; padding: .5rem .75rem; font: inherit; text-align: left; color: var(--ink); background: none; border: 0; cursor: pointer; }
.invitee-option:hover, .invitee-option:focus-visible { background: var(--tile); }

/* Recordings: the library and one recording's page. Rows wrap at phone width; the player fills the content width. */
.recordings, .recording-page { display: flex; flex-direction: column; gap: .75rem; max-width: 56rem; min-width: 0; }
.recordings-heading, .recording-heading { margin: 0; overflow-wrap: anywhere; }
.recording-list, .recording-people { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.recording-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem 1.25rem;
    padding: .9rem 1.1rem;
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: .75rem;
    background: var(--panel);
}
.recording-row-main { display: flex; flex-direction: column; gap: .15rem; min-width: 0; flex: 1 1 16rem; }
.recording-title { font-weight: 600; overflow-wrap: anywhere; }
.recording-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .9rem; margin: 0; }
.recording-row-tags { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; }
.recording-status {
    padding: .1rem .55rem;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--dim);
    border: 1px solid var(--line);
    border-radius: 999px;
}
.recording-status-ready { color: var(--accent); border-color: var(--accent); }
.recording-status-failed { color: var(--danger); border-color: var(--danger); }
.recording-player { display: block; width: 100%; max-height: 70vh; background: #000; border-radius: .75rem; }
.recording-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.recording-actions .btn { overflow-wrap: anywhere; }
.recording-deleted { margin: 0; padding: .75rem 1rem; border: 1px dashed var(--line); border-radius: .5rem; background: var(--panel); }
.recording-confirm { padding: .9rem 1rem; border: 1px solid var(--danger); border-radius: .75rem; background: var(--panel); }
.recording-confirm p { margin: 0 0 .75rem; }
.recording-section { display: flex; flex-direction: column; gap: .5rem; margin-top: .75rem; min-width: 0; }
.recording-subheading { margin: 0; font-size: 1.05rem; }
.recording-person { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; padding: .5rem .75rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--panel); }
.recording-person-name { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.recording-person .muted { overflow-wrap: anywhere; min-width: 0; }
.recording-remove { margin-left: auto; }

@media (max-width: 600px) {
    .recording-actions .btn { flex: 1 1 100%; text-align: center; }
}
