/* ─── Design tokens ─────────────────────────────────────── */
:root {
    --bg:           #f1f3f7;
    --surface:      #ffffff;
    --surface-2:    #eaecf0;
    --ink:          #0d1117;
    --ink-2:        #5c6370;
    --line:         #d8dce4;
    --accent:       #5b4cfa;
    --accent-hover: #4838e0;
    --accent-dim:   rgba(91,76,250,.1);
    --teal:         #0891b2;
    --danger:       #e53e3e;
    --success:      #0f9d58;
    --nav-bg:       #0d1117;
    --nav-border:   #1e2430;
    --radius-sm:    3px;
    --radius:       4px;
    --radius-lg:    6px;
    --shadow-sm:    0 1px 2px rgba(0,0,0,.06);
    --shadow:       0 2px 8px rgba(0,0,0,.10);
    --font:         "Inter", system-ui, -apple-system, sans-serif;
    --mono:         "JetBrains Mono", "Fira Mono", monospace;
    --text-sm:      0.8125rem;
    --text-xs:      0.71rem;
}

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 0.9375rem;
    line-height: 1.55;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    margin: 0 0 0.25em;
    font-weight: 600;
    line-height: 1.25;
}

p { margin: 0 0 0.5em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font: inherit; }

/* ─── Shell / topbar ─────────────────────────────────────── */
.shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0 1.25rem;
    height: 44px;
    flex-shrink: 0;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    text-transform: uppercase;
}
.brand:hover { text-decoration: none; color: var(--accent); }

.nav {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    flex-wrap: wrap;
}

.nav a {
    color: #8b92a5;
    font-size: var(--text-xs);
    font-weight: 500;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    transition: background 0.12s, color 0.12s;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }

/* ─── Layout ─────────────────────────────────────────────── */
.container {
    width: min(1140px, 100%);
    margin: 0 auto;
    padding: 1rem 1.25rem 2.5rem;
    flex: 1;
}

/* ─── Session page: full viewport, no outer scroll ───────── */
body.page-session {
    overflow: hidden;
    height: 100vh;
}

body.page-session .shell {
    height: 100vh;
    overflow: hidden;
}

body.page-session .container {
    height: calc(100vh - 44px);
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

body.page-session .session-live-grid {
    flex: 1;
    min-height: 0;
    margin-bottom: 0;
    align-items: stretch;
}

body.page-session .comments-panel {
    max-height: none;
    height: 100%;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.actions-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-shrink: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.grid-two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.audit-tabs {
    display: grid;
    gap: 1rem;
}

.audit-tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.audit-tab-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink-2);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
}

.audit-tab-button:hover {
    background: var(--surface-2);
    text-decoration: none;
    color: var(--ink);
}

.audit-tab-button.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.audit-tab-panels {
    display: grid;
}

.audit-tab-panel {
    display: none;
}

.audit-tab-panel.is-active {
    display: block;
}

.session-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0;
    flex-shrink: 0;
    border-bottom: 1px solid var(--line);
    margin-bottom: 0.625rem;
}

.session-bar-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.session-bar-info h1 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ink);
}

.session-live-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(220px, 0.75fr);
    gap: 0.75rem;
    margin-bottom: 0;
    align-items: start;
}

.session-bar-actions,
.live-display-form {
    display: flex;
    align-items: end;
    gap: 0.4rem;
}

.session-bar-actions { flex-shrink: 0; }

.live-display-form label span {
    margin-bottom: 0.1rem;
    font-size: 0.62rem;
}

.live-display-form select {
    min-height: 30px;
    padding: 0.2rem 1.8rem 0.2rem 0.45rem;
    font-size: var(--text-xs);
}

.live-comments-stage {
    position: relative;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    border-radius: var(--radius);
}

.facebook-live-player {
    overflow: hidden;
    min-width: 0;
    min-height: 0;
    border-radius: var(--radius);
    background: #050505;
}

.facebook-live-player iframe {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 360px;
    border: 0;
}

.live-mode-background .facebook-live-player {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.live-mode-background .facebook-live-player iframe {
    min-height: 100%;
}

.live-mode-background .comments-panel {
    position: relative;
    z-index: 1;
    border-color: rgba(255,255,255,.45);
    background: transparent;
    box-shadow: none;
}

.live-mode-background .comments-panel .panel-head {
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,.65);
    backdrop-filter: blur(3px);
}

.live-mode-background .comments-list .comment-item {
    background: rgba(255,255,255,.5);
    border-color: rgba(255,255,255,.55);
    backdrop-filter: blur(3px);
}

.live-mode-background .feed-footer {
    position: relative;
    z-index: 2;
}

.live-mode-background .feed-jump-button {
    background: rgba(255,255,255,.8);
}

.live-mode-side {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(340px, 1fr);
    gap: 0.75rem;
}

.live-mode-side .facebook-live-player,
.live-mode-side .comments-panel {
    height: 100%;
}

.live-mode-off .comments-panel {
    height: 100%;
}

/* ─── Cards / panels ─────────────────────────────────────── */
.stat-card,
.panel,
.auth-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.stat-card,
.panel {
    padding: 0.875rem 1rem;
}

.stat-card {
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.stat-card strong {
    display: block;
    margin-top: 0.25rem;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--accent);
}

.auth-card {
    width: min(400px, calc(100% - 2rem));
    margin: 10vh auto 0;
    padding: 2rem;
    border-top: 3px solid var(--accent);
}

/* ─── Forms ──────────────────────────────────────────────── */
.stack { display: grid; gap: 0.75rem; }

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.filter-actions {
    display: flex;
    align-items: end;
    gap: 0.5rem;
}

label span {
    display: block;
    margin-bottom: 0.25rem;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ink);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    background: var(--surface);
    color: var(--ink);
    transition: border-color 0.12s, box-shadow 0.12s;
    outline: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-dim);
}

/* ─── Buttons ────────────────────────────────────────────── */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.45rem 0.875rem;
    border: none;
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s;
    text-decoration: none;
    letter-spacing: 0.01em;
}
.button:hover { background: var(--accent-hover); text-decoration: none; color: #fff; }

.button-secondary {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line);
}
.button-secondary:hover { background: var(--surface-2); border-color: #bbc0cc; color: var(--ink); }

.button-danger {
    border-color: #dc2626;
    background: #dc2626;
    color: #fff;
}

.button-danger:hover {
    border-color: #b91c1c;
    background: #b91c1c;
    color: #fff;
}

.button-small {
    padding: 0.3rem 0.625rem;
    font-size: var(--text-xs);
}

.button[disabled], .button:disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

/* ─── Typography helpers ─────────────────────────────────── */
.subtitle,
.muted,
.small {
    color: var(--ink-2);
    font-size: var(--text-sm);
}

.eyebrow {
    margin: 0 0 0.25rem;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--ink-2);
}

/* ─── Lists ──────────────────────────────────────────────── */
.list { display: grid; gap: 0.375rem; }

.list-item {
    display: grid;
    gap: 0.15rem;
    border: 1px solid var(--line);
    border-left: 2px solid transparent;
    border-radius: var(--radius);
    padding: 0.625rem 0.875rem;
    background: var(--surface);
    transition: border-left-color 0.12s;
}
.list-item:hover { border-left-color: var(--accent); }

.list-item span { color: var(--ink-2); font-size: var(--text-sm); }

.comments-list .list-item p { margin: 0; }

.session-create-panel,
.sessions-list-panel {
    width: 100%;
}

.session-create-panel { margin-bottom: 1rem; }

.session-create-form {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    align-items: end;
    gap: 0.75rem;
}

.session-create-form label { margin: 0; }

.session-create-locked {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.session-create-locked p { margin: 0; }

.sessions-full-list {
    display: grid;
    gap: 0.625rem;
}

.session-list-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 72px;
    padding: 0.875rem 1rem;
    border: 1px solid var(--line);
    border-left-width: 6px;
    border-radius: var(--radius);
    color: var(--ink);
    transition: transform 0.12s, box-shadow 0.12s;
}

.session-list-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.session-list-card-open {
    border-left-color: #0f9d58;
    background: #ecfdf5;
}

.session-list-card-draft {
    border-left-color: #d97706;
    background: #fffbeb;
}

.session-list-card-closed {
    border-left-color: #9ca3af;
    background: #f3f4f6;
}

.session-list-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.session-list-main strong { overflow-wrap: anywhere; }

.session-list-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem 0.85rem;
    color: var(--ink-2);
    font-size: var(--text-sm);
}

/* ─── Live feed panels ───────────────────────────────────── */
.comments-panel {
    max-height: calc(100vh - 10rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

.panel-head h2 {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--ink-2);
    margin: 0;
}

.feed-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

.comments-feed,
.likes-feed {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
    gap: 0.25rem;
    display: flex;
    flex-direction: column;
}

.feed-footer {
    display: flex;
    justify-content: center;
    padding-top: 0.375rem;
    flex-shrink: 0;
}

.feed-jump-button.is-hidden { display: none; }

.feed-jump-button {
    border-color: #0f766e;
    background: #0f766e;
    color: #fff;
}

.feed-jump-button:hover {
    border-color: #115e59;
    background: #115e59;
    color: #fff;
}

.comments-view-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
    position: sticky;
    top: 0;
    z-index: 4;
    padding-bottom: 0.3rem;
    background: var(--surface);
}

.comments-view-tab {
    min-height: 34px;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--ink-2);
    font: inherit;
    font-size: var(--text-xs);
    font-weight: 700;
    cursor: pointer;
}

.comments-view-tab span {
    display: inline-flex;
    min-width: 1.35rem;
    min-height: 1.35rem;
    align-items: center;
    justify-content: center;
    margin-left: 0.2rem;
    border-radius: 999px;
    background: rgba(0,0,0,.06);
    font-size: 0.65rem;
}

.comments-view-tab.is-active {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.comments-view-panel:not(.is-active) { display: none; }
.comments-view-panel.is-active {
    display: block;
    width: 100%;
    min-height: 3rem;
}
.comments-empty { padding: 0.75rem 0.35rem; text-align: center; }

.removed-comments-report {
    display: block;
    border-top: 1px solid var(--line);
}

.removed-report-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    padding: 0.3rem 0;
}

.removed-report-toolbar label {
    color: var(--ink-2);
    font-size: var(--text-xs);
    font-weight: 600;
}

.removed-report-toolbar select {
    width: auto;
    min-height: 32px;
    padding: 0.25rem 1.8rem 0.25rem 0.5rem;
    font-size: var(--text-xs);
}

.removed-user-report {
    display: block;
    border-bottom: 1px solid var(--line);
}

.removed-report-head {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.3rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
}

.removed-report-head img,
.removed-report-head > span {
    display: flex;
    width: 26px;
    height: 26px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    object-fit: cover;
    background: var(--line);
}

.removed-report-head strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: var(--text-sm);
}

.removed-report-head small {
    min-width: 1.5rem;
    padding: 0.1rem 0.3rem;
    border-radius: 999px;
    background: var(--surface);
    text-align: center;
    font-weight: 700;
}

.removed-report-comments {
    padding: 0;
    gap: 0;
}

.removed-report-comments .comment-item {
    grid-template-columns: 42px minmax(0, 1fr);
    border: 0;
    border-bottom: 1px solid #eef0f4;
    border-radius: 0;
    box-shadow: none;
}

.removed-report-comments .comment-item:last-child {
    border-bottom: 0;
}

.removed-report-comments .comment-item-reply {
    grid-template-columns: 34px minmax(0, 1fr);
    border-left: 3px solid #9ca3af;
}

.comment-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.625rem;
    min-width: 0;
    width: 100%;
}

.comment-author-avatar-slot {
    align-self: start;
}

.comment-author-avatar {
    display: flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface-2);
    color: var(--ink-2);
    font-weight: 700;
}

.comment-copy,
.comment-meta {
    min-width: 0;
}

.comment-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.2rem 0.35rem;
}

.comment-meta > a {
    min-width: 0;
    max-width: 100%;
}

.comment-meta strong {
    display: block;
    max-width: 100%;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
}

.comment-meta .comment-time {
    white-space: nowrap;
    font-size: var(--text-xs);
}

.comment-item-reply {
    position: relative;
    width: calc(100% - 1.25rem);
    margin-left: 1.25rem;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    border-left: 3px solid #9ca3af;
    background: #f8fafc;
}

.comment-item-reply::before {
    content: "";
    position: absolute;
    top: 1.1rem;
    left: -0.8rem;
    width: 0.65rem;
    border-top: 2px solid #9ca3af;
}

.comment-item-reply .comment-author-avatar {
    width: 34px;
    height: 34px;
}

.comment-item-reply .comment-meta strong {
    font-size: 0.78rem;
}

.comment-item-reply p {
    font-size: 0.82rem;
}

.comment-reply-mark {
    flex: 0 0 auto;
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1;
}

.comment-item-printed {
    background: #f8fafc;
}

.comment-item-printed .comment-author-avatar-slot,
.comment-item-printed .comment-copy {
    opacity: 0.58;
    filter: saturate(0.45);
}

.comment-item-printed:hover .comment-author-avatar-slot,
.comment-item-printed:hover .comment-copy,
.comment-item-printed:focus-within .comment-author-avatar-slot,
.comment-item-printed:focus-within .comment-copy {
    opacity: 0.72;
}

.comment-ids,
.comment-times {
    display: block;
    word-break: break-word;
}

.comment-time,
.comment-item p {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.comment-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    width: 76px;
    min-width: 76px;
    flex-shrink: 0;
}

.comment-actions .button {
    min-height: 40px;
    padding-inline: 0.45rem;
}

.comment-print-form-reprint {
    display: grid;
    gap: 0.2rem;
}

.comment-reprint-button {
    border-color: #86efac;
    background: #d1fae5;
    color: #065f46;
}

.comment-reprint-button:hover {
    background: #bbf7d0;
    border-color: #4ade80;
    color: #065f46;
}

.comment-reprint-button.is-armed {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.likes-list { gap: 0.25rem; }

.like-item {
    padding: 0.45rem 0.75rem;
    font-size: var(--text-sm);
}

/* ─── Side column (right panel) ─────────────────────────── */
.side-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-self: start;
}

body.page-session .side-column {
    align-self: start;
    max-height: calc(100vh - 44px - 52px);
    min-height: 0;
    overflow: hidden;
}

.price-form {
    display: grid;
    gap: 0.6rem;
}

.price-manual-label {
    color: var(--ink-2);
    font-size: var(--text-xs);
}

.price-keypad-display {
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--accent);
    text-align: center;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.price-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
}

.price-key {
    min-height: 44px;
    padding: 0.35rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 1rem;
    font-weight: 750;
    cursor: pointer;
}

.price-key:hover,
.price-key:active {
    border-color: var(--accent);
    background: var(--accent-dim);
    color: var(--accent);
}

.price-key-action {
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: var(--text-xs);
}

.price-auto-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.price-confirm-button {
    min-width: 112px;
}

.price-save-status {
    color: #047857;
    font-size: var(--text-xs);
    font-weight: 600;
}

.price-save-status[data-state="saving"] { color: var(--ink-2); }
.price-save-status[data-state="error"] { color: #b91c1c; }

.price-current {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.02em;
}

.price-empty {
    font-size: 1.125rem;
    color: var(--ink-2);
}

.price-head-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-price-close,
.mobile-price-launcher,
.mobile-price-toggle,
.mobile-price-backdrop {
    display: none;
}

/* ─── Likes counter card ─────────────────────────────────── */
.likes-counter-card {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.likes-counter-card .panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.likes-panel-head {
    border-bottom: 2px solid var(--accent);
}

.likes-head-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.likes-big {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xs);
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.06em;
    color: var(--accent);
    text-transform: uppercase;
    padding: 0;
}

.likes-summary {
    margin-top: 0;
}

.likes-tabs {
    display: flex;
    gap: 0.35rem;
    margin-top: 0;
    flex-wrap: wrap;
}

.likes-tab-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--ink-2);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.likes-tab-button.is-active {
    color: var(--accent);
}

.likes-tab-panels {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.likes-tab-panel {
    display: none;
    min-height: 0;
}

.likes-tab-panel.is-active {
    display: flex;
    min-height: 0;
}

.likes-feed {
    margin-top: 0.5rem;
    max-height: none;
    min-height: 0;
    padding: 0 0.1rem 0.85rem 0;
}

.likes-summary-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    justify-content: flex-start;
}

.likes-summary-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.42rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--ink);
    font-size: var(--text-xs);
    font-weight: 600;
    line-height: 1;
}

button.likes-summary-pill {
    cursor: pointer;
}

.likes-summary-pill.is-active {
    border-color: var(--accent);
    background: var(--accent-dim);
    color: var(--accent);
}

.likes-summary-emoji {
    font-size: 0.92rem;
    line-height: 1;
}

.likes-inline-list {
    gap: 0.22rem;
}

.like-inline-item {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.45rem;
    padding: 0.38rem 0.55rem;
}

.like-inline-item strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: var(--text-sm);
}

.like-inline-emoji {
    font-size: 0.95rem;
    line-height: 1;
}

.like-inline-date {
    white-space: nowrap;
    font-size: var(--text-xs);
}

.likes-people-list {
    gap: 0.3rem;
}

.likes-person-item {
    gap: 0.35rem;
    padding: 0.45rem 0.55rem;
}

.likes-person-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: center;
}

.likes-person-head strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: var(--text-sm);
}

.likes-person-total {
    color: var(--accent);
    font-size: var(--text-xs);
    font-weight: 700;
}

.likes-person-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.is-filtered-out {
    display: none !important;
}

/* ─── Inventory / labels ─────────────────────────────────── */
.inventory-item {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.is-hidden { display: none !important; }

.labels-page-header { margin-bottom: 0.75rem; }

.labels-inventory-panel { margin-bottom: 0.75rem; }

.labels-search {
    display: block;
    margin-bottom: 0.625rem;
}

.labels-search input {
    min-height: 42px;
    background: var(--surface-2);
}

.labels-list { gap: 0.3rem; }

.labels-list .inventory-item { padding: 0.5rem 0.625rem; }

.label-title-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.label-title,
.label-context {
    display: block;
    margin-top: 0.1rem;
    font-size: var(--text-xs) !important;
}

.labels-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.labels-disclosure { padding: 0; }

.labels-disclosure > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem 0.875rem;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
}

.labels-disclosure > summary::-webkit-details-marker { display: none; }
.labels-disclosure > summary::after { content: "+"; color: var(--accent); font-size: 1.2rem; }
.labels-disclosure[open] > summary::after { content: "−"; }
.labels-disclosure > summary span { margin-left: auto; color: var(--ink-2); font-size: var(--text-xs); }
.labels-disclosure > form,
.labels-disclosure > .list,
.labels-disclosure > p { margin: 0 0.875rem 0.875rem; }

/* ─── Status pills ───────────────────────────────────────── */
.status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius-sm);
    padding: 0.15rem 0.45rem;
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--surface-2);
    color: var(--ink-2);
}

.status-open     { background: #d1fae5; color: #065f46; }
.status-draft    { background: #fef3c7; color: #92400e; }
.status-free     { background: #d1fae5; color: #065f46; }
.status-reserved { background: #fef3c7; color: #92400e; }
.status-applied  { background: #ede9fe; color: #4c1d95; }
.status-closed   { background: #f3f4f6; color: #6b7280; }

.session-draft-notice {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #fffbeb;
    color: #92400e;
    border-color: #fcd34d;
}

@media (max-width: 680px) {
    .session-create-form {
        grid-template-columns: 1fr;
    }

    .session-create-locked,
    .session-draft-notice,
    .session-list-card {
        align-items: stretch;
        flex-direction: column;
    }

    .session-list-main { align-items: flex-start; }
    .session-list-meta { justify-content: flex-start; }
}

.status-print-pending  { background: #f3f4f6; color: #6b7280; }
.status-print-printing { background: #fef3c7; color: #92400e; }
.status-print-printed  { background: #d1fae5; color: #065f46; }
.status-print-failed   { background: #fee2e2; color: #991b1b; }

/* ─── Flash messages ─────────────────────────────────────── */
.flash {
    margin-bottom: 0.875rem;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius);
    font-size: var(--text-sm);
    font-weight: 500;
    border-left: 3px solid;
}

.flash-success { background: #d1fae5; color: #065f46; border-color: #34d399; }
.flash-error   { background: #fee2e2; color: #991b1b; border-color: #f87171; }

/* ─── Tables ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

.pagination-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

th {
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid var(--accent);
    text-align: left;
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--ink-2);
    white-space: nowrap;
}

td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    color: var(--ink);
    font-size: var(--text-sm);
}

tr:last-child td { border-bottom: none; }

/* ─── Telemetry ──────────────────────────────────────────── */
.telemetry-list { display: grid; gap: 0.5rem; }

.telemetry-item {
    border: 1px solid var(--line);
    border-left: 3px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 0.625rem 0.875rem;
    transition: border-left-color 0.12s;
}
.telemetry-item:hover { border-left-color: var(--teal); }

.telemetry-item-open { background: var(--surface-2); border-left-color: var(--teal); }

.telemetry-item summary {
    display: grid;
    gap: 0.2rem;
    cursor: pointer;
    list-style: none;
}

.telemetry-body { margin-top: 0.875rem; }

.telemetry-payload {
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
    background: #090e1a;
    color: #a9b1d6;
    border-radius: var(--radius);
    padding: 0.875rem 1rem;
    font-family: var(--mono);
    font-size: var(--text-xs);
    line-height: 1.7;
    border-left: 3px solid var(--accent);
}

.telemetry-payload-large { min-height: 320px; }

.facebook-test-coverage {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.facebook-test-coverage span {
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-2);
    font-size: 0.82rem;
}

.facebook-author-avatar {
    display: block;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface-2);
}

.facebook-link-unavailable,
.facebook-attachment-link {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.72rem;
}

.facebook-link-unavailable { color: var(--ink-2); }

.facebook-test-links {
    min-width: 180px;
}

.facebook-test-links code {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.7rem;
    word-break: break-all;
}

.detail-grid { display: grid; gap: 1.25rem; margin-bottom: 1.25rem; }

/* ─── Responsive: mobile-first ───────────────────────────── */
@media (max-width: 680px) {
    .container { padding: 0.75rem 0.625rem 2rem; }

    .topbar {
        padding: 0 0.625rem;
        gap: 0.375rem;
        height: 42px;
    }

    .brand { font-size: 0.75rem; }

    .nav {
        flex: 1;
        min-width: 0;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .nav::-webkit-scrollbar { display: none; }
    .nav a { padding: 0.3rem 0.42rem; }
    .nav .button { width: auto; }
    .nav form { flex: 0 0 auto; }

    .page-header,
    .actions-row,
    .pagination-row,
    .filter-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .panel-head {
        align-items: flex-start;
        flex-direction: row;
        gap: 0.5rem;
    }

    .button { justify-content: center; }

    .session-live-grid,
    .inventory-item,
    .side-column {
        grid-template-columns: 1fr;
    }

    .audit-tab-nav {
        flex-direction: column;
    }

    .side-column { max-height: none; overflow: visible; align-self: auto; }
    .likes-big { font-size: var(--text-sm); }

    .session-bar {
        display: flex;
        align-items: center;
        flex-direction: row;
        gap: 0.3rem;
        margin-bottom: 0.3rem;
        padding: 0.2rem 0;
    }

    .session-bar-info,
    .session-bar-actions {
        flex-wrap: nowrap;
    }

    .session-bar-info { flex: 1 1 auto; gap: 0.3rem; }
    .session-bar-actions {
        flex: 0 0 auto;
        justify-content: flex-end;
        gap: 0.25rem;
    }

    .session-bar-info > .small { display: none; }
    .session-bar-info h1 { font-size: 0.78rem; }
    .session-bar .status-pill { padding: 0.12rem 0.32rem; font-size: 0.58rem; }
    .session-bar .button {
        width: auto;
        min-height: 30px;
        padding: 0.2rem 0.4rem;
        font-size: 0.62rem;
    }
    .live-display-form { gap: 0.2rem; }
    .live-display-form label span { display: none; }
    .live-display-form select {
        min-height: 30px;
        max-width: 92px;
        padding-block: 0.15rem;
        font-size: 0.65rem;
    }

    .live-mode-side {
        display: flex;
        flex-direction: column;
        overflow: visible;
    }

    .live-mode-side .facebook-live-player {
        aspect-ratio: 16 / 9;
    }

    .facebook-live-player iframe {
        min-height: 240px;
    }

    .stat-card,
    .panel { padding: 0.625rem; }

    .comment-item {
        grid-template-columns: 32px minmax(0, 1fr) 50px;
        gap: 0.3rem;
        padding: 0.3rem 0.2rem;
    }

    .comment-author-avatar {
        width: 32px;
        height: 32px;
    }

    .comment-item-reply {
        width: calc(100% - 0.9rem);
        margin-left: 0.9rem;
        grid-template-columns: 27px minmax(0, 1fr) 48px;
        padding-block: 0.25rem;
    }

    .comment-item-reply::before {
        top: 0.95rem;
        left: -0.62rem;
        width: 0.5rem;
    }

    .comment-item-reply .comment-author-avatar {
        width: 27px;
        height: 27px;
    }

    .comment-item-reply .comment-meta strong { font-size: 0.68rem; }
    .comment-item-reply p { font-size: 0.75rem; line-height: 1.25; }

    .feed-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .comment-actions {
        width: 50px;
        min-width: 50px;
    }

    .comment-actions .button {
        width: 100%;
        min-height: 36px;
        padding: 0.2rem;
        font-size: 0.64rem;
    }

    .comment-meta {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 0.25rem;
    }

    .comment-meta strong {
        max-width: 100%;
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
        font-size: 0.72rem;
        font-weight: 600;
    }

    .comment-meta .comment-time { font-size: 0.62rem; }

    .comments-view-tabs {
        margin-inline: -0.05rem;
        padding-bottom: 0.25rem;
        top: 42px;
    }

    .comments-view-tab {
        min-height: 32px;
        font-size: 0.68rem;
    }

    .removed-report-head {
        grid-template-columns: 24px minmax(0, 1fr) auto;
        padding-inline: 0.2rem;
    }

    .removed-report-toolbar {
        position: sticky;
        top: 74px;
        z-index: 3;
        padding: 0.25rem 0.15rem;
        background: var(--surface);
    }

    .removed-report-head img,
    .removed-report-head > span {
        width: 24px;
        height: 24px;
    }

    .removed-report-comments .comment-item {
        grid-template-columns: 32px minmax(0, 1fr);
        padding-inline: 0.2rem;
    }

    .removed-report-comments .comment-item-reply {
        grid-template-columns: 27px minmax(0, 1fr);
    }

    .comment-item p {
        font-size: 0.82rem;
        line-height: 1.3;
        margin-top: 0.08rem;
    }

    .comments-panel,
    .likes-panel { max-height: none; }

    .comments-feed,
    .likes-feed { max-height: 55vh; }

    .stat-card strong { font-size: 1.6rem; }

    body.page-session { overflow: auto; height: auto; }
    body.page-session .shell { height: auto; overflow: visible; }
    body.page-session .container { height: auto; overflow: visible; padding-top: 0.35rem; padding-bottom: 1rem; display: block; }
    body.page-session .session-live-grid {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    body.page-session .side-column { display: contents; }
    body.page-session .price-card {
        display: block;
        position: fixed;
        left: 50%;
        bottom: 0;
        width: min(480px, 100%);
        max-width: 100%;
        max-height: calc(100dvh - 52px);
        z-index: 210;
        border-radius: 12px 12px 0 0;
        padding: 0.75rem;
        box-shadow: 0 -8px 30px rgba(13,17,23,.2);
        transform: translate(-50%, 110%);
        visibility: hidden;
        overflow-y: auto;
        transition: transform .18s ease, visibility .18s;
    }
    body.page-session .price-card.is-mobile-open {
        transform: translate(-50%, 0);
        visibility: visible;
    }
    body.page-session .comments-panel {
        order: -1;
        display: block;
        height: auto;
        max-height: none;
        overflow: visible;
        padding: 0.3rem 0.2rem;
        border-inline: 0;
        box-shadow: none;
    }
    body.page-session .comments-panel .panel-head {
        margin-bottom: 0.2rem;
        padding: 0 0.15rem 0.25rem;
    }
    body.page-session .likes-counter-card { display: none !important; }
    body.page-session .comments-feed {
        max-height: none;
        min-height: 0;
        overflow: visible;
        padding-right: 0;
        padding-bottom: 4.75rem;
    }

    body.page-session .feed-footer {
        display: block;
        padding: 0;
    }

    body.page-session .feed-jump-button {
        position: fixed;
        left: 0.65rem;
        bottom: max(0.65rem, env(safe-area-inset-bottom));
        z-index: 180;
        width: auto;
        min-height: 40px;
        padding: 0.35rem 0.6rem;
        border-radius: 999px;
        border-color: #0f766e;
        background: #0f766e;
        color: #fff;
        box-shadow: 0 4px 14px rgba(15,118,110,.3);
        font-size: 0.68rem;
        font-weight: 700;
    }

    .price-card .panel-head { padding-bottom: 0.3rem; margin-bottom: 0.35rem; }

    .mobile-price-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: var(--surface-2);
        color: var(--ink);
        font-size: 1.5rem;
        line-height: 1;
        cursor: pointer;
    }

    .mobile-price-launcher {
        display: block;
        position: fixed;
        right: 0.65rem;
        bottom: max(0.65rem, env(safe-area-inset-bottom));
        z-index: 190;
    }

    .mobile-price-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        min-width: 104px;
        min-height: 42px;
        padding: 0.35rem 0.7rem;
        border: 0;
        border-radius: 999px;
        background: var(--accent);
        color: #fff;
        box-shadow: 0 6px 20px rgba(72,56,224,.35);
        font: inherit;
        cursor: pointer;
    }

    .mobile-price-toggle-label {
        display: inline;
        font-size: 0.68rem;
        opacity: 0.85;
    }

    .mobile-price-toggle strong {
        overflow: hidden;
        font-size: 0.82rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-price-backdrop {
        position: fixed;
        inset: 0;
        z-index: 200;
        border: 0;
        background: rgba(13,17,23,.42);
    }

    body.is-price-panel-open .mobile-price-backdrop { display: block; }
    body.is-price-panel-open .mobile-price-launcher {
        opacity: 0;
        pointer-events: none;
    }

    body.page-session .price-keypad-display {
        padding-block: 0.35rem;
        font-size: 1.55rem;
    }

    body.page-session .price-key {
        min-height: 46px;
        font-size: 1rem;
    }
    body.is-price-panel-open { overflow: hidden; }

    .labels-page-header h1 { font-size: 1.25rem; }
    .labels-page-header .muted { display: none; }
    .labels-inventory-panel { padding: 0.625rem; }
    .labels-list .inventory-item {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.4rem;
    }
    .labels-list .actions-row { flex-direction: row; }
    .labels-list .actions-row .button { width: auto; min-height: 38px; }
    .labels-tools-grid { grid-template-columns: 1fr; gap: 0.5rem; }
}

@media (max-width: 390px) {
    .brand { display: none; }
}
