:root {
    --page: #f3f6f9;
    --surface: #ffffff;
    --surface-alt: #f7f9fb;
    --surface-strong: #edf2f6;
    --line: #cfd7df;
    --line-strong: #aebbc7;
    --text: #1c2733;
    --muted: #667789;
    --primary: #246b9e;
    --primary-dark: #194f77;
    --primary-soft: #e8f2f9;
    --success: #247855;
    --success-soft: #e5f5ed;
    --warning: #9b6700;
    --warning-soft: #fff4d5;
    --danger: #a6373f;
    --danger-soft: #fdebed;
    --shadow: 0 8px 24px rgba(29, 50, 69, .08);
    --shadow-soft: 0 2px 8px rgba(29, 50, 69, .07);
    --radius: 10px;
    --radius-small: 6px;
    --page-top: #eef3f7;
    --accent: #d19822;
    --topbar-bg: #ffffff;
    --topbar-text: #162738;
    --brand-font: "Segoe UI", Arial, sans-serif;
    --brand-logo-max-height: 40px;
    font-family: var(--brand-font);
    color-scheme: light;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--page); }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background: linear-gradient(180deg, var(--page-top) 0, var(--page) 240px);
    font-size: 14px;
    line-height: 1.42;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }

/* Shell */
.topbar {
    min-height: 62px;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 8px 22px;
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 2px 12px rgba(24, 48, 68, .07);
    position: sticky;
    top: 0;
    z-index: 40;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--topbar-text);
    font-size: 20px;
    font-weight: 750;
    letter-spacing: .1px;
    white-space: nowrap;
}
.brand:hover { text-decoration: none; color: var(--topbar-text); }
.brand-mark {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(145deg, var(--primary), var(--primary-dark));
    box-shadow: var(--shadow-soft);
    font-size: 14px;
    font-weight: 800;
}
.nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}
.nav a {
    color: var(--topbar-text);
    padding: 8px 9px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}
.nav a:hover {
    color: var(--primary-dark);
    background: var(--primary-soft);
    text-decoration: none;
}
.userbox {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    color: var(--muted);
}
.user-identity { display: flex; flex-direction: column; line-height: 1.15; text-align: right; }
.user-identity strong { color: var(--text); font-size: 13px; }
.user-identity span { font-size: 11px; }
.userbox form, .inline, .clip-actions form, .button-row form, .toolbar form { display: inline-flex; margin: 0; }
.link-button { border: 0; background: none; color: var(--primary); padding: 4px; cursor: pointer; }
.page-shell { width: min(1680px, calc(100% - 28px)); margin: 20px auto 52px; }
.footer { padding: 20px; text-align: center; color: var(--muted); border-top: 1px solid var(--line); background: var(--surface); }

h1, h2, h3 { line-height: 1.18; margin: 0 0 8px; color: var(--text); }
h1 { font-size: 28px; font-weight: 680; }
h2 { font-size: 18px; font-weight: 680; }
h3 { font-size: 14px; font-weight: 700; }
p { margin: 0 0 11px; }
.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}
.page-heading p { color: var(--muted); }
.compact-heading { margin-bottom: 10px; }
.compact-heading h1 { font-size: 25px; }
.breadcrumbs { color: var(--muted); margin-bottom: 7px; font-size: 12px; }

/* Surfaces and common layout */
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.compact-panel { padding: 12px 14px; }
.narrow { max-width: 690px; margin: 38px auto; }
.wide { max-width: 1120px; }
.form-panel { max-width: 920px; margin-left: auto; margin-right: auto; }
.table-panel { padding: 0; overflow: auto; }
.table-panel > table { min-width: 820px; }
.panel-title-row, .section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 10px;
}
.panel-title-row h2, .section-heading h2 { margin-bottom: 2px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.two-wide { grid-template-columns: minmax(0, 1.45fr) minmax(330px, .75fr); }
.detail-grid { align-items: stretch; }
.muted, .help { color: var(--muted); font-size: 12.5px; }
.empty, .empty-state { padding: 24px; color: var(--muted); text-align: center; }
.empty-state { border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--surface-alt); }
.top-gap { margin-top: 11px !important; }
.grow { flex: 1; min-width: 0; }
.sr-only {
    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;
}

/* Buttons */
.button {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid #9eacb9;
    background: linear-gradient(var(--surface), var(--surface-strong));
    color: var(--text);
    border-radius: 6px;
    padding: 7px 12px;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(22, 39, 56, .06);
}
.button:hover { background: var(--surface-strong); border-color: var(--primary); text-decoration: none; color: var(--text); }
.button.primary { color: #fff; background: linear-gradient(var(--primary), var(--primary-dark)); border-color: var(--primary-dark); }
.button.primary:hover { background: var(--primary-dark); color: #fff; }
.button.danger { color: #8b252d; background: var(--danger-soft); border-color: #d9a6aa; }
.button.danger:hover { background: #f8d9dc; color: #751e25; }
.button.small { min-height: 29px; padding: 4px 9px; font-size: 12px; }
.button.tiny { min-height: 24px; padding: 2px 7px; font-size: 11px; }
.button.wide { width: 100%; }
.button[disabled], .button:disabled { cursor: not-allowed; opacity: .55; }
.button-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.button-column { display: flex; flex-direction: column; gap: 3px; }
.action-column { display: flex; flex-direction: column; gap: 8px; }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 16px; margin-bottom: 17px; }
.span-2 { grid-column: 1 / -1; }
label { display: block; color: var(--text); font-weight: 650; margin-bottom: 5px; }
input, select, textarea {
    width: 100%;
    min-height: 34px;
    border: 1px solid var(--line-strong);
    background: #fff;
    color: var(--text);
    border-radius: 5px;
    padding: 6px 8px;
    outline: none;
}
input:focus, select:focus, textarea:focus { border-color: #5b9cca; box-shadow: 0 0 0 3px rgba(41, 118, 170, .12); }
input[readonly], input:disabled, select:disabled, textarea:disabled { background: #eef2f5; color: #6b7885; }
textarea { resize: vertical; }
.check, .compact-check {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 500;
    margin: 0;
    padding: 5px 0;
}
.check input, .compact-check input, .checkbox-form input, .exclude-check input { width: auto; min-height: 0; }
.inline-form, .search-form, .compact-inline { display: flex; align-items: center; gap: 7px; }
.compact-inline input, .compact-inline select { min-height: 30px; padding: 4px 7px; }
.time-fields { border: 1px solid var(--line); border-radius: 7px; padding: 9px; display: flex; align-items: center; gap: 5px; }
.time-fields legend { color: var(--muted); padding: 0 5px; }
.time-fields input { width: 68px; text-align: center; }
.review-note-field { min-width: 220px; flex: 1; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th {
    text-align: left;
    color: #4b6072;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .045em;
    background: #edf2f6;
}
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f7fafc; }
.compact th, .compact td { padding: 7px 9px; }
.result-cell { max-width: 450px; white-space: normal; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 10px; }

/* Badges and tags */
.badge { display: inline-block; padding: 3px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #e8edf1; color: #405364; }
.badge.succeeded { background: var(--success-soft); color: var(--success); }
.badge.pending, .badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.running { background: var(--primary-soft); color: var(--primary-dark); }
.badge.failed { background: var(--danger-soft); color: var(--danger); }
.badge.canceled, .badge.neutral { background: #e8edf1; color: #526374; }
.status-stack { display: flex; gap: 5px; flex-wrap: wrap; }
.status-stack.inline { margin-top: 7px; }
.tag-list { display: flex; gap: 5px; flex-wrap: wrap; }
.tag-list.large { gap: 7px; }
.tag { display: inline-flex; align-items: center; gap: 5px; background: var(--primary-soft); border: 1px solid #b7d4e7; color: #245b7c; border-radius: 999px; padding: 3px 8px; font-size: 12px; }
.tag-x { border: 0; background: none; color: #326f94; cursor: pointer; padding: 0; font-size: 15px; }

/* Messages and login */
.alert { border-radius: 7px; padding: 10px 13px; margin-bottom: 14px; }
.alert.success { background: var(--success-soft); border: 1px solid #aad8c2; color: #1f6749; }
.alert.error { background: var(--danger-soft); border: 1px solid #e0aeb2; color: #8f2c34; }
.alert.info { background: var(--primary-soft); border: 1px solid #b7d4e7; color: var(--primary-dark); }
.login-card { width: min(440px, calc(100% - 28px)); margin: 80px auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.login-card h1 { font-size: 31px; }
.login-card label { margin-top: 14px; }

/* Dashboard and main-menu cards */
.stat-grid { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 11px; margin-bottom: 16px; }
.stat-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--text); box-shadow: var(--shadow-soft); }
.stat-card:hover { border-color: #7faed0; text-decoration: none; transform: translateY(-1px); }
.stat-card strong { font-size: 27px; color: var(--primary-dark); }
.stat-card span { color: var(--muted); }
.action-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.action-card { display: flex; flex-direction: column; gap: 4px; padding: 13px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-alt); color: var(--text); }
form.action-card { align-items: flex-start; }
.action-card:hover { border-color: #7faed0; background: var(--primary-soft); text-decoration: none; }
.action-card span { color: var(--muted); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 13px; }
.collection-card { display: flex; flex-direction: column; justify-content: space-between; min-height: 165px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px; box-shadow: var(--shadow-soft); }

/* Generic details/lists */
.details { display: grid; grid-template-columns: 150px 1fr; gap: 8px 13px; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; }
.clip-list, .list-stack { display: flex; flex-direction: column; gap: 7px; }
.clip-card { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; background: var(--surface-alt); border: 1px solid var(--line); border-radius: 7px; padding: 11px; }
.clip-card.disabled, .job-clip.disabled { opacity: .58; }
.clip-main { flex: 1; min-width: 0; }
.clip-main p { margin: 4px 0 7px; }
.clip-actions { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.time { font-family: Consolas, monospace; color: #245b7c; margin-left: 7px; }
.priority { color: var(--muted); margin-left: 7px; font-size: 12px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 11px; background: var(--surface-alt); border: 1px solid var(--line); border-radius: 7px; padding: 9px 10px; }
.job-clip { display: flex; align-items: center; gap: 9px; background: var(--surface-alt); border: 1px solid var(--line); border-radius: 7px; padding: 9px; }
.order-box { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; background: #dfeaf2; font-weight: 800; color: #31546d; }
.danger-zone { border-color: #e2b7ba; background: #fffafa; }

/* Toolbars and tabs */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.toolbar.wrap, .button-row.wrap { flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--surface); color: var(--text); font-weight: 600; }
.tabs a.active { border-color: #76a8cb; color: #184d72; background: var(--primary-soft); }

/* Files / Set Cut Scenes workbench */
.workbench-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px;
    margin-bottom: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}
.workbench-filter { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; flex: 1; }
.workbench-filter select { width: auto; min-width: 180px; }
.workbench-filter input[type="search"], .workbench-filter input[name="search"] { min-width: 260px; }
.file-workbench { display: grid; grid-template-columns: minmax(250px, 31%) minmax(0, 1fr); gap: 12px; align-items: start; }
.file-selector-panel { padding: 0; overflow: hidden; position: sticky; top: 76px; }
.file-selector-panel .panel-title-row { padding: 11px 12px 8px; border-bottom: 1px solid var(--line); margin: 0; background: var(--surface-alt); }
.file-selector-list { max-height: calc(100vh - 180px); overflow-y: auto; }
.file-selector-item { display: block; padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--text); background: var(--surface); }
.file-selector-item:nth-child(even) { background: var(--surface-alt); }
.file-selector-item:hover { background: var(--primary-soft); text-decoration: none; }
.file-selector-item.active { background: var(--primary-soft); box-shadow: inset 4px 0 0 var(--primary); }
.file-selector-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file-selector-meta { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; margin-top: 2px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #98a7b4; }
.status-dot.reviewed { background: var(--success); }
.status-dot.later { background: var(--warning); }
.status-dot.missing { background: var(--danger); }
.status-dot.shortened { background: var(--primary); }
.workbench-main { min-width: 0; }
.file-state-panel { padding: 10px 12px; }
.file-state-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.file-state-form .status-options { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.workbench-upper-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(310px, .75fr); gap: 12px; }
.category-transfer-card, .priority-panel { margin-bottom: 12px; }
.dual-list-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 9px; }
.dual-list-grid > div > h3 { margin: 0 0 5px; }
.transfer-list { min-height: 126px; max-height: 190px; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: var(--radius-small); background: var(--surface); }
.transfer-list.tall, .tall-list { min-height: 205px; max-height: 360px; }
.transfer-list form { margin: 0; }
.transfer-item { width: 100%; min-height: 27px; display: flex; justify-content: space-between; align-items: center; text-align: left; padding: 4px 7px; border: 0; border-bottom: 1px solid #e2e7eb; background: #fff; color: var(--text); cursor: pointer; }
.transfer-item:hover { background: var(--primary-soft); }
.transfer-item.assigned, .assigned { background: var(--primary-soft); }
.transfer-arrow-column { display: none; }
.priority-tools { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.priority-tools select { min-width: 220px; width: auto; }
.marker-legend { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; color: var(--muted); font-size: 11px; margin-top: 8px; }
.marker { width: 11px; height: 11px; border-radius: 3px; display: inline-block; border: 1px solid rgba(0,0,0,.2); }
.marker.yellow, .marker-button.yellow { background: #f1df27; }
.marker.blue, .marker-button.blue { background: #2e8fd0; }
.marker.green, .marker-button.green { background: #2ca779; }
.marker.red, .marker-button.red { background: #df3948; }
.source-clip-note { background: var(--warning-soft); border: 1px solid #ecd58f; color: #75520d; border-radius: 5px; padding: 5px 8px; margin-top: 7px; }
.clip-editor-panel { padding: 0; overflow: hidden; }
.clip-editor-panel .panel-title-row { padding: 10px 12px; margin: 0; border-bottom: 1px solid var(--line); background: var(--surface-alt); }
.clip-grid-table { overflow-x: auto; }
.clip-grid-header, .clip-grid-row {
    min-width: 940px;
    display: grid;
    grid-template-columns: 58px 58px 58px 58px 58px minmax(300px, 1fr) 255px 58px;
    align-items: center;
    column-gap: 5px;
    padding: 4px 7px;
}
.clip-grid-header { min-height: 30px; background: var(--surface-strong); color: var(--muted); border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 700; }
.clip-grid-row { min-height: 39px; border-bottom: 1px solid #dde3e8; }
.clip-grid-row:nth-child(even) { background: var(--surface-alt); }
.clip-grid-row:hover { background: var(--primary-soft); }
.clip-grid-row input[type="number"] { min-height: 29px; padding: 3px 5px; text-align: center; }
.clip-grid-row .clip-description { min-height: 29px; padding: 3px 6px; }
.clip-id-link { font-weight: 700; color: #2b5878; text-align: center; }
.clip-row-actions { display: flex; align-items: center; gap: 4px; min-width: 0; }
.clip-row-actions form { margin: 0; display: inline-flex; }
.icon-button, .marker-button {
    width: 25px;
    height: 25px;
    min-width: 25px;
    padding: 0;
    border-radius: 5px;
    border: 1px solid #8899a7;
    background: linear-gradient(#fff, #e6ebef);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    color: #3d4f5f;
    font-size: 11px;
    text-decoration: none;
}
.icon-button:hover { background: #dce5eb; text-decoration: none; }
.icon-button.save { background: var(--success-soft); color: #176847; border-color: #78b99b; font-weight: 800; }
.marker-button { border-color: rgba(35, 52, 66, .5); }
.marker-button:hover { filter: brightness(.92); text-decoration: none; }
.exclude-check { display: inline-flex; align-items: center; gap: 3px; margin: 0 0 0 3px; font-size: 10px; color: var(--muted); font-weight: 500; }
.priority-number { text-align: center; font-weight: 700; color: #4c6072; }
.clip-category-panel { margin-top: 0; }
.clip-category-transfer { grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr); }
.clip-category-transfer .transfer-arrow-column { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; color: #4f687b; }

/* Shortened videos */
.shortened-table-panel { overflow: hidden; padding: 0; }
.shortened-table { width: 100%; }
.shortened-table th, .shortened-table td { padding: 6px 9px; }
.shortened-table tbody tr:nth-child(even) { background: #eef1f3; }
.shortened-table .checkbox-column { width: 42px; text-align: center; }
.checkbox-form { display: inline-flex; align-items: center; justify-content: center; margin: 0; }
.process-single-button { width: 25px; height: 25px; min-height: 25px; padding: 0; border-radius: 5px; }

/* Collections */
.collection-create-bar { display: grid; grid-template-columns: minmax(230px, 360px) auto; gap: 8px; align-items: end; margin-bottom: 13px; }
.collection-workspace { display: block; }
.collection-list {
    min-height: 205px;
    max-height: 580px;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
}
.collection-transfer-form {
    margin: 0;
    padding: 0;
    border: 0;
}
.collection-transfer-item {
    appearance: none;
    width: 100%;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    padding: 6px 8px;
    border: 0;
    border-radius: 0;
    background: var(--primary-soft);
    color: var(--text);
    font: inherit;
    line-height: 1.25;
    text-align: left;
    box-shadow: none;
}
button.collection-transfer-item {
    cursor: pointer;
}
.collection-transfer-item-readonly {
    cursor: default;
}
.collection-transfer-item:hover {
    background: color-mix(in srgb, var(--primary) 18%, var(--primary-soft));
    color: var(--text);
}
.collection-transfer-item:focus-visible {
    position: relative;
    z-index: 1;
    outline: 1px solid color-mix(in srgb, var(--primary) 62%, var(--line));
    outline-offset: -1px;
}
.collection-transfer-item[aria-busy="true"] {
    opacity: .68;
    cursor: wait;
}
.collection-transfer-item > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.collection-selector-row { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.collection-selector-form { display: flex; align-items: end; gap: 7px; flex: 0 1 auto; }
.collection-selector-form select { min-width: 240px; }
.collection-select-field { min-width: 225px; }
.collection-search-field { min-width: 220px; }
.collection-name-form { display: flex; align-items: end; gap: 7px; flex: 1 1 360px; min-width: 300px; }
.collection-name-field { flex: 1; min-width: 220px; }
.collection-selector-row > form { margin: 0; }
.collection-metadata-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 9px; align-items: end; margin-bottom: 12px; }
.collection-transfer-grid { display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); gap: 10px; }
.large-transfer-arrows { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: #4f687b; font-size: 17px; }
.transfer-heading { margin-bottom: 6px; }

/* Jobs workbench */
.jobs-workbench { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 12px; }
.job-selected-list, .job-available-list { max-height: 620px; overflow-y: auto; }
.job-clip.compact-row { padding: 7px; }
.job-clip .clip-title { font-weight: 650; }

@media (max-width: 1280px) {
    .stat-grid { grid-template-columns: repeat(3, 1fr); }
    .topbar { align-items: flex-start; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
    .nav { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
    .userbox { margin-left: auto; }
    .workbench-upper-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
    .page-shell { width: min(100% - 18px, 1680px); }
    .grid.two, .grid.two-wide, .file-workbench, .collection-workspace, .jobs-workbench { grid-template-columns: 1fr; }
    .file-selector-panel { position: static; }
    .file-selector-list { max-height: 300px; }
    .collection-name-form { flex: 1 1 100%; }
    .page-heading { flex-direction: column; }
}

@media (max-width: 720px) {
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .action-grid, .form-grid, .dual-list-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .workbench-toolbar, .workbench-filter, .file-state-form, .collection-selector-row, .collection-selector-form, .collection-name-form { align-items: stretch; flex-direction: column; }
    .workbench-filter input[type="search"], .workbench-filter input[name="search"], .workbench-filter select, .collection-selector-form select { width: 100%; min-width: 0; }
    .clip-category-transfer, .collection-transfer-grid { grid-template-columns: 1fr; }
    .clip-category-transfer .transfer-arrow-column, .large-transfer-arrows { flex-direction: row; min-height: 30px; }
    .collection-create-bar { grid-template-columns: 1fr; }
    .details { grid-template-columns: 120px 1fr; }
    .clip-card { flex-direction: column; }
    .userbox { width: 100%; justify-content: flex-end; }
}

@media (max-width: 500px) {
    .page-shell { width: calc(100% - 12px); margin-top: 10px; }
    .panel { padding: 12px; border-radius: 7px; }
    .stat-grid { grid-template-columns: 1fr; }
    .toolbar, .search-form, .inline-form, .compact-inline { align-items: stretch; flex-direction: column; }
    .button-row { align-items: stretch; }
    .button { width: 100%; }
    .details { grid-template-columns: 1fr; }
    .details dt { margin-top: 7px; }
    .details dd { padding-bottom: 6px; border-bottom: 1px solid var(--line); }
    h1 { font-size: 24px; }
}
.status-dot.success, .status-dot.reviewed { background: var(--success); }
.status-dot.warning, .status-dot.later { background: var(--warning); }
.status-dot.danger, .status-dot.missing { background: var(--danger); }
.status-dot.pending { background: #8d9ba8; }
.clip-grid-row.selected { box-shadow: inset 4px 0 0 var(--primary); background: var(--primary-soft); }
.clip-grid-row.excluded { opacity: .62; }


.maintenance-block {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border, #d6dbe1);
}

.maintenance-block h2 {
    margin-top: 0;
}

.alert.warning {
    background: var(--warning-soft);
    border: 1px solid #e3c36d;
    color: #75520d;
}

.disabled-card {
    cursor: not-allowed;
    opacity: .68;
    background: #f3f5f7;
    border-style: dashed;
}


/* Settings-driven branding */
.brand-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.08; }
.brand-name { font-weight: 750; overflow: hidden; text-overflow: ellipsis; }
.brand-tagline { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10px; font-weight: 500; margin-top: 2px; }
.brand-logo { display: block; max-height: var(--brand-logo-max-height); max-width: 210px; width: auto; object-fit: contain; }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.login-brand h1 { margin-bottom: 4px; }
.login-brand p { color: var(--muted); margin: 0; }
.login-logo { display: block; max-height: 76px; max-width: 180px; width: auto; object-fit: contain; }
.login-mark { width: 54px; height: 54px; min-width: 54px; font-size: 20px; border-radius: var(--radius); }
.branding-settings-grid > h3 { margin-top: 4px; }
.branding-upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.color-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 9px; }
.color-grid label { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 9px; background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius-small); font-size: 12px; }
.color-grid input[type="color"] { width: 42px; min-height: 30px; padding: 2px; border-radius: 5px; }
.branding-preview { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.branding-preview-header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; color: var(--topbar-text); background: var(--topbar-bg); border-bottom: 1px solid var(--line); }
.branding-preview-mark { width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--radius-small); color: #fff; background: linear-gradient(145deg, var(--primary), var(--primary-dark)); font-size: 11px; font-weight: 800; }
.branding-preview-body { padding: 14px; color: var(--text); background: var(--surface); }
.branding-preview-body p { color: var(--muted); }

@media (max-width: 760px) {
    .branding-upload-grid { grid-template-columns: 1fr; }
    .brand-tagline { display: none; }
    .brand-logo { max-width: 130px; }
}

.settings-feature-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1rem 1.1rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--primary-soft);
}
.settings-feature-card h2 { margin: 0 0 .25rem; }
.settings-feature-card p { margin: 0; }
.sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding: .8rem;
    margin: 1rem -.25rem -.25rem;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border-top: 1px solid var(--line);
}
@media (max-width: 720px) {
    .settings-feature-card { align-items: stretch; flex-direction: column; }
}

/* Compact density and asynchronous Set Cut Scenes revision */
body { font-size: 13px; line-height: 1.3; }
.topbar { min-height: 52px; gap: 11px; padding: 5px 14px; }
.brand { gap: 7px; font-size: 18px; }
.brand-mark { width: 28px; height: 28px; border-radius: 6px; font-size: 12px; }
.nav a { padding: 5px 7px; font-size: 12px; }
.userbox { gap: 7px; }
.page-shell { width: min(1760px, calc(100% - 16px)); margin: 10px auto 30px; }
.footer { padding: 11px; }
h1, h2, h3 { margin-bottom: 5px; }
h1 { font-size: 23px; }
h2 { font-size: 16px; }
h3 { font-size: 12.5px; }
p { margin-bottom: 7px; }
.page-heading { gap: 10px; margin-bottom: 8px; }
.compact-heading { margin-bottom: 6px; }
.compact-heading h1 { font-size: 22px; }
.panel { padding: 11px 12px; margin-bottom: 9px; box-shadow: var(--shadow-soft); }
.compact-panel { padding: 7px 9px; }
.panel-title-row, .section-heading { gap: 8px; margin-bottom: 6px; }
.grid { gap: 9px; }
.grid.two-wide { grid-template-columns: minmax(0, 1.6fr) minmax(280px, .65fr); }
.empty, .empty-state { padding: 14px; }
.top-gap { margin-top: 6px !important; }
.button { min-height: 29px; gap: 4px; padding: 4px 9px; border-radius: 5px; }
.button.small { min-height: 25px; padding: 2px 7px; font-size: 11.5px; }
.button.tiny { min-height: 21px; padding: 1px 5px; }
.button-row { gap: 5px; }
.action-column { gap: 5px; }
.form-grid { gap: 8px 10px; margin-bottom: 10px; }
label { margin-bottom: 3px; font-size: 12.5px; }
input, select, textarea { min-height: 29px; padding: 4px 6px; border-radius: 4px; }
.check, .compact-check { gap: 5px; padding: 2px 0; }
.inline-form, .search-form, .compact-inline { gap: 5px; }
.compact-inline input, .compact-inline select { min-height: 27px; padding: 3px 5px; }
.time-fields { padding: 6px; gap: 4px; }
.time-fields input { width: 58px; }
th, td { padding: 6px 8px; }
.compact th, .compact td { padding: 4px 6px; }
.badge { padding: 2px 6px; font-size: 10.5px; }
.alert { padding: 7px 9px; margin-bottom: 8px; }
.login-card { margin: 42px auto; padding: 19px; }
.login-card h1 { font-size: 26px; }
.login-card label { margin-top: 9px; }
.stat-grid { gap: 7px; margin-bottom: 10px; }
.stat-card { padding: 9px 11px; }
.stat-card strong { font-size: 23px; }
.action-grid { gap: 7px; }
.action-card { gap: 2px; padding: 9px; }
.card-grid { gap: 8px; }
.collection-card { min-height: 130px; padding: 11px; }
.details { grid-template-columns: 135px 1fr; gap: 5px 9px; }
.clip-list, .list-stack { gap: 4px; }
.clip-card { gap: 8px; padding: 7px; }
.list-row, .job-clip { gap: 7px; padding: 6px 7px; }
.toolbar { gap: 6px; margin-bottom: 8px; }
.tabs a { padding: 4px 7px; }

.workbench-toolbar { padding: 6px 7px; margin-bottom: 7px; }
.workbench-filter {
    display: grid;
    grid-template-columns: minmax(150px, 190px) minmax(330px, 2fr) minmax(145px, .65fr) minmax(170px, .75fr) auto;
    align-items: start;
    gap: 5px 7px;
}
.filter-field { min-width: 0; display: flex; flex-direction: column; align-self: start; }
.filter-field label { min-height: 16px; margin-bottom: 2px; line-height: 16px; }
.video-filter-field select { width: 100%; min-width: 0; }
.search-filter-field input { min-width: 0 !important; }
.compact-field select { width: 100%; min-width: 0; }
.filter-count { display: block; margin-top: 1px; color: var(--muted); font-size: 10px; line-height: 1.1; }
.toolbar-actions { display: flex; align-items: center; align-self: start; gap: 5px; margin-top: 18px; padding-bottom: 0; }
.file-workbench, .file-workbench-wide { display: block; }
.workbench-main { width: 100%; }
.file-state-panel { padding: 7px 9px; }
.file-state-form { gap: 5px 9px; }
.review-note-field { min-width: 180px; }
.workbench-upper-grid { grid-template-columns: minmax(0, 1.55fr) minmax(260px, .6fr); gap: 8px; }
.category-transfer-card, .priority-panel { margin-bottom: 8px; }
.dual-list-grid { gap: 6px; }
.transfer-list { min-height: 105px; max-height: 160px; }
.transfer-list.tall, .tall-list { min-height: 170px; max-height: 280px; }
.transfer-item { min-height: 23px; padding: 2px 5px; font-size: 12px; }
.transfer-empty { padding: 7px; color: var(--muted); font-size: 11px; }
.priority-tools { gap: 5px; }
.priority-tools select { min-width: 185px; }
.marker-legend { gap: 6px; margin-top: 5px; font-size: 10px; }
.source-clip-note { padding: 3px 6px; margin-top: 4px; }
.clip-editor-panel .panel-title-row { padding: 6px 8px; }
.clip-grid-header, .clip-grid-row {
    min-width: 875px;
    grid-template-columns: 50px 48px 48px 48px 48px minmax(280px, 1fr) 222px 48px;
    column-gap: 3px;
    padding: 2px 5px;
}
.clip-grid-header { min-height: 25px; }
.clip-grid-row { min-height: 33px; }
.clip-grid-row input[type="number"], .clip-grid-row .clip-description { min-height: 25px; padding: 2px 4px; }
.clip-row-actions { gap: 2px; }
.icon-button, .marker-button { width: 22px; height: 22px; min-width: 22px; border-radius: 4px; }
.exclude-check { margin-left: 1px; font-size: 9.5px; }
.clip-category-transfer { grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1fr); }
.clip-category-transfer .transfer-arrow-column { gap: 3px; }
.clip-category-panel.is-loading { opacity: .6; pointer-events: none; }
.clip-category-status { min-height: 0; color: var(--danger); font-size: 11px; }
.shortened-table th, .shortened-table td { padding: 4px 6px; }
.collection-create-bar { gap: 5px; margin-bottom: 8px; }
.collection-workspace, .collection-transfer-grid { gap: 7px; }
.collection-selector-row { gap: 5px; margin-bottom: 7px; }
.collection-metadata-form { gap: 5px; margin-bottom: 7px; }
.file-transfer-item { padding: 4px 6px; }
.jobs-workbench { gap: 8px; }
.job-clip.compact-row { padding: 5px; }
.branding-upload-grid { gap: 8px; }
.color-grid { gap: 5px; }
.color-grid label { gap: 5px; padding: 4px 6px; }
.branding-preview-header { padding: 6px 8px; }
.branding-preview-body { padding: 9px; }
.settings-feature-card { gap: .7rem; padding: .65rem .75rem; margin-bottom: .75rem; }
.sticky-actions { padding: .5rem; margin-top: .6rem; }
.maintenance-block { margin-top: .8rem; padding-top: .7rem; }

@media (max-width: 1180px) {
    .workbench-filter { grid-template-columns: minmax(150px, .65fr) minmax(280px, 1.5fr) minmax(150px, .65fr) minmax(170px, .7fr); }
    .toolbar-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 760px) {
    .page-shell { width: calc(100% - 10px); margin-top: 6px; }
    .workbench-filter { display: grid; grid-template-columns: 1fr; }
    .toolbar-actions { grid-column: auto; }
    .workbench-upper-grid { grid-template-columns: 1fr; }
}

/* Inline clip creation */
.clip-grid-row.new-clip-row {
    background: color-mix(in srgb, var(--primary-soft) 65%, var(--surface));
    border-bottom: 2px solid var(--line-strong);
}
.clip-grid-row.new-clip-row:hover { background: color-mix(in srgb, var(--primary-soft) 75%, var(--surface)); }
.new-clip-label { text-align: center; font-weight: 800; color: var(--primary); }
.new-clip-actions { justify-content: flex-start; }
.new-clip-actions .button { white-space: nowrap; min-height: 25px; padding: 3px 8px; }
.clip-grid-status { margin-left: auto; font-size: 11px; font-weight: 700; }
.clip-grid-status.success { color: var(--success); }
.clip-grid-status.error { color: var(--danger); }
#clip-grid-container.is-loading { opacity: .62; pointer-events: none; }

/* Video upload dialog */
.upload-dialog {
    width: min(560px, calc(100vw - 24px));
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 18px 60px rgba(18, 35, 52, .28);
}
.upload-dialog::backdrop { background: rgba(12, 24, 36, .45); }
.upload-dialog form { display: grid; gap: 8px; padding: 12px; }
.upload-dialog input[type="file"] { width: 100%; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.dialog-heading h2 { margin: 0; }
.dialog-heading p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.dialog-close {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
}
.dialog-actions { justify-content: flex-end; margin-top: 2px; }
.upload-limit { font-size: 11px; }
.upload-progress-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.upload-progress-wrap progress { width: 100%; height: 12px; accent-color: var(--primary); }
.upload-progress-wrap span { min-width: 92px; text-align: right; font-size: 11px; color: var(--muted); }
.upload-status { min-height: 17px; font-size: 12px; font-weight: 700; }
.upload-status.success { color: var(--success); }
.upload-status.error { color: var(--danger); }

/* Concise processing results */
.task-result-summary { font-weight: 600; white-space: pre-line; }
.task-log { margin-top: 3px; font-size: 10px; color: var(--muted); overflow-wrap: anywhere; }
.task-log summary { cursor: pointer; color: var(--primary); }
.task-log code { display: block; margin-top: 2px; white-space: normal; }


/* Processing log modal viewer */
.task-log-trigger {
    display: inline-block;
    margin-top: 3px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    font: inherit;
    font-size: 10.5px;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}
.task-log-trigger:hover { color: var(--primary-strong); }
.task-log-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.processing-log-dialog {
    width: min(1100px, calc(100vw - 24px));
    max-width: none;
    max-height: calc(100vh - 24px);
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 18px 60px rgba(18, 35, 52, .32);
}
.processing-log-dialog::backdrop { background: rgba(12, 24, 36, .48); }
.processing-log-shell { display: grid; grid-template-rows: auto auto minmax(220px, 1fr) auto; gap: 7px; padding: 11px; }
.processing-log-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.processing-log-heading h2 { margin: 0; font-size: 19px; }
.processing-log-heading p { margin: 2px 0 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.processing-log-status { min-height: 17px; font-size: 11.5px; font-weight: 700; }
.processing-log-status.loading { color: var(--muted); }
.processing-log-status.success { color: var(--success); }
.processing-log-status.warning { color: var(--warning); }
.processing-log-status.error { color: var(--danger); }
.processing-log-content {
    box-sizing: border-box;
    width: 100%;
    min-height: 280px;
    max-height: min(68vh, 720px);
    margin: 0;
    padding: 9px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface-alt);
    color: var(--text);
    font-family: Consolas, "Cascadia Mono", "Courier New", monospace;
    font-size: 11px;
    line-height: 1.35;
    white-space: pre;
    tab-size: 4;
}
.processing-log-shell .dialog-actions { margin-top: 0; }
@media (max-width: 760px) {
    .processing-log-dialog { width: calc(100vw - 10px); max-height: calc(100vh - 10px); }
    .processing-log-shell { padding: 8px; }
    .processing-log-content { min-height: 220px; max-height: 65vh; }
}

/* Access-compatible filename proposal and rename panel */
.rename-proposal { margin-bottom: .65rem; }
.rename-proposal .inline-form { align-items: center; }
.rename-proposal .inline-form input { flex: 1 1 28rem; }
.field-help { margin-top: .22rem; color: var(--muted, #667789); font-size: .78rem; line-height: 1.25; }
.notice.info { margin: .55rem 0; border-left: 3px solid var(--primary, #246b9e); background: var(--primary-soft, #e8f2f9); padding: .45rem .6rem; }

/* Left sidebar application shell - revision 4 */
body.sidebar-layout {
    background: var(--page);
    overflow-x: hidden;
}
.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
}
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--topbar-bg);
    color: var(--topbar-text);
    border-right: 1px solid var(--line);
    box-shadow: 5px 0 22px rgba(25, 49, 70, .045);
    z-index: 80;
}
.sidebar-header {
    min-height: 68px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
}
.sidebar-brand {
    min-width: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--topbar-text);
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -.2px;
}
.sidebar-brand:hover { color: var(--topbar-text); text-decoration: none; }
.sidebar-logo {
    width: auto;
    max-width: 48px;
    max-height: min(42px, var(--brand-logo-max-height));
    object-fit: contain;
}
.sidebar-brand-mark {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(145deg, var(--primary), var(--primary-dark));
    box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 24%, transparent);
    font-size: 13px;
}
.sidebar-brand-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-close {
    display: none;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 24px;
    cursor: pointer;
}
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 10px 9px;
    scrollbar-width: thin;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    margin: 2px 0;
    padding: 7px 10px;
    border-radius: 8px;
    color: color-mix(in srgb, var(--topbar-text) 88%, var(--muted));
    font-size: 12.5px;
    font-weight: 650;
    transition: background .14s ease, color .14s ease, transform .14s ease;
}
.sidebar-link:hover {
    color: var(--primary-dark);
    background: color-mix(in srgb, var(--primary-soft) 76%, var(--surface));
    text-decoration: none;
    transform: translateX(1px);
}
.sidebar-link.active {
    color: var(--primary-dark);
    background: var(--primary-soft);
    box-shadow: inset 3px 0 0 var(--primary);
}
.sidebar-icon {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    display: grid;
    place-items: center;
    color: currentColor;
    font-size: 16px;
    line-height: 1;
}
.sidebar-divider {
    height: 1px;
    margin: 9px 8px;
    background: var(--line);
}
.sidebar-footer {
    padding: 10px;
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-alt) 74%, var(--surface));
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin-bottom: 7px;
}
.sidebar-user-avatar {
    width: 31px;
    height: 31px;
    flex: 0 0 31px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(145deg, var(--primary), var(--primary-dark));
    font-size: 12px;
    font-weight: 800;
}
.sidebar-user-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.16;
}
.sidebar-user-copy strong,
.sidebar-user-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-user-copy strong { font-size: 11.5px; }
.sidebar-user-copy small { color: var(--muted); font-size: 10px; }
.sidebar-footer form { margin: 0; }
.sidebar-signout {
    width: 100%;
    min-height: 30px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border: 0;
    border-radius: 6px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    text-align: left;
    font-size: 11.5px;
    font-weight: 650;
}
.sidebar-signout:hover { color: var(--danger); background: var(--danger-soft); }
.app-content {
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--page-top) 0, var(--page) 230px);
}
.app-content .page-shell {
    width: min(1760px, calc(100% - 28px));
    flex: 1;
    margin: 12px auto 28px;
}
.app-content .footer {
    margin-top: auto;
    padding: 10px 18px;
    text-align: left;
    font-size: 11px;
    background: transparent;
}
.mobile-appbar { display: none; }
.sidebar-overlay { display: none; }

/* Dashboard polish for sidebar layout */
.sidebar-layout .stat-grid {
    grid-template-columns: repeat(6, minmax(125px, 1fr));
    gap: 9px;
}
.sidebar-layout .stat-card {
    position: relative;
    min-height: 92px;
    justify-content: center;
    padding: 12px 14px 11px 58px;
    overflow: hidden;
}
.sidebar-layout .stat-card::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 50%;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    transform: translateY(-50%);
    background: linear-gradient(145deg, var(--primary-soft), color-mix(in srgb, var(--primary) 22%, #fff));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 18%, transparent);
}
.sidebar-layout .stat-card::after {
    content: '●';
    position: absolute;
    left: 25px;
    top: 50%;
    transform: translateY(-52%);
    color: var(--primary);
    font-size: 14px;
}
.sidebar-layout .stat-card strong { font-size: 24px; line-height: 1; }
.sidebar-layout .stat-card span { margin-top: 5px; font-size: 11px; }
.sidebar-layout .panel { border-color: color-mix(in srgb, var(--line) 90%, transparent); }
.sidebar-layout .action-card { min-height: 74px; justify-content: center; }
.sidebar-layout .page-heading { align-items: center; }

/* Keep dense work areas usable with the narrower content viewport */
.sidebar-layout .workbench-filter {
    grid-template-columns: minmax(130px, 170px) minmax(280px, 1.7fr) minmax(135px, .7fr) minmax(155px, .75fr) auto;
}
.sidebar-layout .clip-grid-header,
.sidebar-layout .clip-grid-row {
    min-width: 850px;
}

/* Unauthenticated shell */
.public-layout { min-height: 100vh; }
.public-header {
    min-height: 58px;
    display: flex;
    align-items: center;
    padding: 8px 18px;
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--line);
}
.public-content { min-height: calc(100vh - 58px); padding: 1px; }

@media (max-width: 1320px) {
    .app-shell { grid-template-columns: 210px minmax(0, 1fr); }
    .sidebar-layout .stat-grid { grid-template-columns: repeat(3, 1fr); }
    .sidebar-layout .workbench-filter {
        grid-template-columns: minmax(130px, .65fr) minmax(250px, 1.5fr) minmax(135px, .65fr) minmax(150px, .72fr);
    }
    .sidebar-layout .toolbar-actions { grid-column: 1 / -1; margin-top: 0; }
}

@media (max-width: 1080px) {
    .app-shell { display: block; }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: min(284px, 86vw);
        transform: translateX(-102%);
        transition: transform .2s ease;
        box-shadow: 14px 0 40px rgba(12, 28, 44, .22);
    }
    body.sidebar-open { overflow: hidden; }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-close { display: block; }
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        display: block;
        z-index: 70;
        background: rgba(12, 24, 36, .44);
    }
    .sidebar-overlay[hidden] { display: none; }
    .mobile-appbar {
        position: sticky;
        top: 0;
        z-index: 50;
        min-height: 48px;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 6px 10px;
        background: var(--topbar-bg);
        border-bottom: 1px solid var(--line);
        box-shadow: 0 2px 10px rgba(24, 48, 68, .07);
    }
    .sidebar-toggle {
        width: 34px;
        height: 34px;
        padding: 0;
        border: 1px solid var(--line);
        border-radius: 7px;
        background: var(--surface);
        color: var(--text);
        cursor: pointer;
        font-size: 18px;
    }
    .mobile-appbar-title { font-weight: 800; }
    .app-content .page-shell { width: calc(100% - 14px); margin-top: 7px; }
}

@media (max-width: 620px) {
    .sidebar-layout .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .sidebar-layout .stat-card { min-height: 82px; padding-left: 50px; }
    .sidebar-layout .stat-card::before { left: 10px; width: 30px; height: 30px; }
    .sidebar-layout .stat-card::after { left: 20px; }
    .sidebar-layout .workbench-filter { grid-template-columns: 1fr; }
    .sidebar-layout .toolbar-actions { grid-column: auto; }
    .sidebar-layout .page-heading { align-items: stretch; }
}

/* Theme-specific form control colors. Kept separate from general page text. */
input, select, textarea { color: var(--input-text); background-color: var(--input-bg); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--input-text) 55%, transparent); }

.sidebar-user-link { color: inherit; text-decoration: none; border-radius: var(--radius-small); padding: 5px; margin: -5px; }
.sidebar-user-link:hover, .sidebar-user-link.active { background: var(--primary-soft); text-decoration: none; }
.field-note { display:block; margin-top:4px; color:var(--muted); font-size:11px; }
.full-width { grid-column: 1 / -1; }


/* File-category selection and missing-file bulk maintenance */
.compact-help { margin-top: 2px; font-size: 11px; }
.file-category-item.selected { background: var(--primary); color: var(--header-text); box-shadow: inset 3px 0 0 var(--accent); }
.file-category-item.selected:hover { background: var(--primary); }
.file-category-remove-form { margin: 0; }
.missing-file-maintenance { margin-bottom: 10px; }
.missing-file-selection-list {
    display: block !important;
    width: 100%;
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 8px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    background: color-mix(in srgb, var(--surface-alt) 42%, transparent);
}
.missing-file-selection-item {
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0;
    min-height: 36px;
    display: grid !important;
    grid-template-columns: 22px minmax(0, 1fr) !important;
    align-items: center !important;
    justify-items: start !important;
    column-gap: 9px !important;
    padding: 7px 10px !important;
    margin: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent) !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--text) !important;
    cursor: pointer;
    text-align: left !important;
}
.missing-file-selection-item:last-child { border-bottom: 0 !important; }
.missing-file-selection-item:hover {
    background: color-mix(in srgb, var(--primary) 8%, transparent) !important;
}
.missing-file-selection-item:has(.missing-file-checkbox:checked) {
    background: color-mix(in srgb, var(--primary) 13%, transparent) !important;
}
.missing-file-selection-item .missing-file-checkbox {
    appearance: auto !important;
    -webkit-appearance: checkbox !important;
    box-sizing: border-box;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    max-width: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    justify-self: start !important;
}
.missing-file-selection-item .missing-file-name {
    display: block !important;
    min-width: 0;
    width: 100%;
    color: var(--text) !important;
    font-weight: 600;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left !important;
}
.compact-empty { padding: 8px; }
.alt-field-add-form { margin-top: 1rem; grid-template-columns: repeat(3, minmax(180px, 1fr)); align-items: end; }
.alt-field-add-form .button-row { margin: 0; }
@media (max-width: 900px) { .alt-field-add-form { grid-template-columns: 1fr; } }

/* Emby API availability indicator */
.emby-availability {
    margin: 0 0 9px;
    padding: 7px 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    background: color-mix(in srgb, var(--surface) 76%, transparent);
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
.emby-status { font-weight: 800; }
.emby-status.checking { color: var(--muted); }
.emby-status.available { color: var(--success); }
.emby-status.unavailable { color: var(--danger); }
.emby-host { color: var(--topbar-text); }
.emby-availability-page {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    margin: 0 0 10px;
    padding: 8px 11px;
    background: var(--surface);
    color: var(--text);
    font-size: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}


/* Keep both File Categories lists visually consistent with the active theme. */
.category-transfer-card .transfer-list {
    background: var(--primary-soft);
}
.category-transfer-card .transfer-item {
    background: var(--primary-soft);
    border-bottom-color: var(--line);
}
.category-transfer-card .transfer-item:hover,
.category-transfer-card .transfer-item:focus-visible {
    background: color-mix(in srgb, var(--primary-soft) 78%, var(--primary) 22%);
}
.category-transfer-card .file-category-item.selected,
.category-transfer-card .file-category-item.selected:hover {
    background: var(--primary);
}

/* Automatic Processing settings */
.automatic-processing-panel {
    margin: 1rem 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}
.automatic-processing-header {
    min-height: 3.25rem;
    padding: .65rem .85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--surface-alt);
}
.automatic-processing-header h2 { margin: 0; }
.automatic-processing-summary { margin: .15rem 0 0; }
.automatic-processing-panel.disabled .automatic-processing-summary { display: none; }
.automatic-master-toggle { margin: 0; white-space: nowrap; font-weight: 700; }
.automatic-processing-body { padding: .85rem; }
.automatic-schedule-help { margin: .75rem 0; }

/* Matrix/chart-style automatic scheduler. All schedule fields line up by task. */
.automatic-settings-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.automatic-status-table-wrap { margin-bottom: .75rem; }
.automatic-settings-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin: 0;
}
.automatic-processing-table { min-width: 1040px; }
.automatic-status-table { min-width: 680px; }
.automatic-settings-table th,
.automatic-settings-table td {
    padding: .62rem .68rem;
    border-bottom: 1px solid var(--line);
    border-right: 1px solid var(--line);
    vertical-align: middle;
    text-align: left;
}
.automatic-settings-table th:last-child,
.automatic-settings-table td:last-child { border-right: 0; }
.automatic-settings-table tbody tr:last-child td { border-bottom: 0; }
.automatic-settings-table thead th {
    background: var(--surface-alt);
    font-weight: 800;
    white-space: nowrap;
}
.automatic-settings-table tbody tr:nth-child(even) td {
    background: color-mix(in srgb, var(--surface-alt) 55%, var(--surface) 45%);
}
.automatic-settings-table tbody tr:hover td {
    background: color-mix(in srgb, var(--primary-soft) 40%, var(--surface) 60%);
}
.automatic-order-column { width: 46px; text-align: center !important; }
.automatic-action-column { width: 27%; }
.automatic-enabled-column { width: 82px; text-align: center !important; }
.automatic-interval-column { width: 26%; }
.automatic-daily-column { width: 33%; }
.automatic-order-cell {
    text-align: center !important;
    font-size: 1.05rem;
    font-weight: 800;
}
.automatic-checkbox-cell { text-align: center !important; }
.automatic-table-check {
    display: inline-flex;
    align-items: center;
    gap: .38rem;
    margin: 0;
    font-weight: 650;
    white-space: nowrap;
}
.automatic-table-check input[type="checkbox"] {
    /* Do not inherit the site's full-width text-input sizing. Keep scheduler
       checkboxes compact and immediately to the left of their related label. */
    appearance: auto;
    -webkit-appearance: checkbox;
    width: 14px !important;
    min-width: 14px !important;
    height: 14px !important;
    min-height: 14px !important;
    padding: 0 !important;
    margin: 0;
    border-radius: 2px;
    box-shadow: none;
    flex: 0 0 14px;
}
.automatic-schedule-cell {
    display: grid;
    gap: .34rem;
}
.automatic-schedule-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: fit-content;
    gap: .35rem;
    margin: 0;
    font-size: .9rem;
    line-height: 1.2;
}
.automatic-inline-setting {
    display: flex;
    align-items: center;
    gap: .38rem;
    min-width: 0;
}
.automatic-inline-setting label {
    margin: 0;
    font-size: .82rem;
    font-weight: 700;
    white-space: nowrap;
}
.automatic-inline-setting input {
    margin: 0;
    min-width: 0;
}
.automatic-inline-setting-number input {
    width: 112px;
    flex: 0 0 112px;
}
.automatic-inline-setting-times input {
    width: 100%;
    flex: 1 1 auto;
}
.automatic-inline-setting > span {
    font-size: .82rem;
    white-space: nowrap;
    color: var(--muted);
}
.automatic-action-description {
    display: block;
    margin-top: .22rem;
    font-size: .82rem;
    line-height: 1.3;
    color: var(--muted);
}
.automatic-status-table th:nth-child(1) { width: 58%; }
.automatic-status-table th:nth-child(2) { width: 90px; }
.automatic-status-table th:nth-child(3) { width: 32%; }

@media (max-width: 760px) {
    .automatic-processing-header { align-items: flex-start; flex-direction: column; }
    .automatic-settings-table-wrap {
        /* Keep the schedule matrix intact on smaller screens instead of collapsing
           unrelated fields into stacked cards. */
        -webkit-overflow-scrolling: touch;
    }
}

/* Set Cut Scenes: collapsible clip grid and targeted priority refresh */
.clip-grid-heading { align-items: center; }
.clip-grid-title-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.clip-grid-collapse-toggle,
.section-collapse-toggle {
    width: 30px;
    min-width: 30px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-alt);
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}
.clip-grid-collapse-toggle:hover,
.section-collapse-toggle:hover { border-color: var(--primary); color: var(--primary); }
.clip-grid-body[hidden] { display: none !important; }
#clip-grid-container.collapsed { padding-bottom: 8px; }

/* Set Cut Scenes: independently collapsible File Categories and Clip Priority panels */
.tool-panel-heading { align-items: center; }
.tool-panel-heading h2 { margin: 0; }
.tool-panel-body[hidden] { display: none !important; }
.collapsible-tool-panel.collapsed { padding-bottom: 0; }
.collapsible-tool-panel.collapsed .tool-panel-heading { margin-bottom: 0; }
.section-collapse-toggle { flex: 0 0 auto; }
.clip-category-scope-note { display: block; margin-top: 2px; font-size: 11px; }
.ajax-priority-form .icon-button:disabled { opacity: .55; cursor: wait; }

/* Set Cut Scenes: quick category creation */
.file-category-heading-actions { align-items: center; justify-content: flex-end; }
.file-category-heading-actions form { margin: 0; }
.quick-category-dialog { width: min(520px, calc(100vw - 28px)); }
.quick-category-dialog input[type="text"],
.quick-category-dialog input:not([type]) { width: 100%; }
#file-category-panel.is-loading,
#clip-category-panel.is-loading { opacity: .65; pointer-events: none; }


/* Compilation job duration/archive/category-overlap enhancements */
.jobs-workbench-three {
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, .72fr) minmax(320px, .85fr);
    align-items: start;
}
.compilation-duration {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.compilation-duration.over-limit {
    border-color: var(--danger, #b42318);
    color: var(--danger, #b42318);
    font-weight: 800;
}
.common-category-panel {
    min-width: 0;
}
.category-summary-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.category-summary-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-alt);
}
.category-summary-row form { flex: 0 0 auto; }
.compilation-time-readonly { max-width: 460px; }

.job-clip-categories { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 4px; }
.job-clip-categories .job-category-badge { padding: 1px 6px; font-size: .78rem; }
@media (max-width: 1250px) {
    .jobs-workbench-three { grid-template-columns: 1fr 1fr; }
    .jobs-workbench-three > .common-category-panel { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
    .jobs-workbench-three { grid-template-columns: 1fr; }
    .jobs-workbench-three > .common-category-panel { grid-column: auto; }
}

/* Main dashboard: collapsible primary sections */
.dashboard-section-heading { align-items: center; }
.dashboard-section-heading > div:first-child { min-width: 0; }
.dashboard-section-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}
.dashboard-section-body[hidden] { display: none !important; }
.dashboard-collapsible-panel.collapsed { padding-bottom: 8px; }
.dashboard-collapsible-panel.collapsed .dashboard-section-heading { margin-bottom: 0; }
.dashboard-section-toggle { flex: 0 0 auto; }

/* Compilation Jobs allocated-time column */
.allocated-time-column { text-align: right !important; }

/* Dashboard Recent Processing filters */
.dashboard-processing-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    margin: 0 0 12px;
}
.dashboard-processing-filter {
    display: grid;
    gap: 4px;
    min-width: 190px;
}
.dashboard-processing-filter > span {
    font-size: .82rem;
    font-weight: 700;
    color: var(--muted);
}
.dashboard-processing-filter select {
    min-width: 190px;
}
.dashboard-processing-filter-empty {
    margin-bottom: 12px;
}
@media (max-width: 640px) {
    .dashboard-processing-filter {
        flex: 1 1 100%;
        min-width: 0;
    }
    .dashboard-processing-filter select {
        width: 100%;
        min-width: 0;
    }
}

/* Authenticated direct video streaming / Set Cut Scenes preview */
.icon-button.clip-preview-button {
    font-size: 10px;
    font-weight: 800;
    color: var(--primary);
    border-color: color-mix(in srgb, var(--primary) 55%, var(--line));
    background: var(--primary-soft);
}
.video-playback-dialog {
    width: min(1120px, calc(100vw - 28px));
    max-height: calc(100vh - 28px);
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 18px 60px rgba(18, 35, 52, .34);
}
.video-playback-dialog::backdrop { background: rgba(12, 24, 36, .72); }
.video-playback-shell { display: grid; gap: 0; }
.video-playback-heading { padding: 11px 13px; border-bottom: 1px solid var(--line); }
.video-playback-heading h2 { overflow-wrap: anywhere; }
.video-playback-frame {
    display: grid;
    place-items: center;
    background: #000;
    min-height: 240px;
}
.video-playback-frame video {
    display: block;
    width: 100%;
    max-height: calc(100vh - 210px);
    background: #000;
}
.video-playback-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 13px 12px;
    border-top: 1px solid var(--line);
}
.video-playback-status { font-size: 12px; font-weight: 700; }
.video-playback-status.error { color: var(--danger); }
.video-playback-note { margin-top: 2px; font-size: 11px; }
@media (max-width: 700px) {
    .video-playback-dialog { width: calc(100vw - 10px); max-height: calc(100vh - 10px); }
    .video-playback-footer { align-items: stretch; flex-direction: column; }
    .video-playback-footer .dialog-actions { justify-content: flex-start; }
    .video-playback-frame video { max-height: calc(100vh - 250px); }
}


/* User/profile form sub-section heading */
.form-section-heading { margin-top:8px; padding-top:10px; border-top:1px solid var(--line); }
.form-section-heading h2 { margin:0 0 4px; font-size:16px; }
.form-section-heading p { margin:0; }


/* Viewport-aware data/workspace sizing
   Uses the actual browser viewport rather than physical monitor resolution so
   resized windows, browser zoom, tablets, and remote sessions size correctly. */
:root {
    --workspace-page-gutter: clamp(14px, 1.35vw, 34px);
    --workspace-wide-max: 2200px;
}

/* Authenticated application pages can use all practical width available after
   the sidebar. This replaces the old fixed 1760px ceiling on wide displays. */
.app-content .page-shell {
    width: calc(100% - var(--workspace-page-gutter));
    max-width: var(--workspace-wide-max);
}

/* A panel explicitly marked wide must not be pulled back to the generic
   920px form width. Regular create/edit forms retain the original form-panel cap. */
.form-panel.wide,
.responsive-workspace-panel {
    width: 100%;
    max-width: none;
}

/* Data-heavy regions fill the space their page gives them without allowing
   children to push the whole application horizontally. */
.responsive-workspace-panel,
.table-panel,
.automatic-processing-panel,
.automatic-settings-table-wrap,
.clip-grid-table,
.shortened-table-panel {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
}

/* Settings benefits from more width as screens get larger, but its ordinary
   two-column form fields remain readable instead of turning into very long lines. */
.settings-workspace-panel > form {
    width: 100%;
}

/* Let the automatic processing matrix use the viewport before resorting to a
   scrollbar. The fixed 1040px minimum was the primary source of unnecessary
   horizontal scrolling in the previous layout. */
.automatic-processing-table {
    min-width: 900px;
}
.automatic-status-table {
    min-width: min(680px, 100%);
}

/* Standard desktop: compress non-content columns first. */
@media (max-width: 1400px) {
    :root { --workspace-page-gutter: 16px; }
    .automatic-processing-table { min-width: 840px; }
    .automatic-order-column { width: 38px; }
    .automatic-enabled-column { width: 66px; }
    .automatic-action-column { width: 29%; }
    .automatic-interval-column { width: 27%; }
    .automatic-daily-column { width: auto; }
    .automatic-settings-table th,
    .automatic-settings-table td { padding: .52rem .55rem; }
}

@media (max-width: 1080px) {
    .automatic-processing-table { min-width: 760px; }
}

/* Sidebar-free/tablet widths: use essentially the entire viewport. Wide data
   tables may scroll locally, but the page itself never overflows horizontally. */
@media (max-width: 900px) {
    :root { --workspace-page-gutter: 10px; }
    .app-content .page-shell {
        width: calc(100% - var(--workspace-page-gutter));
        max-width: none;
    }
    .responsive-workspace-panel { padding-left: 12px; padding-right: 12px; }
    .automatic-processing-table { min-width: 760px; }
    .automatic-status-table { min-width: 600px; }
}

/* Small phones: preserve readable controls and use contained scrolling only for
   genuinely tabular information. */
@media (max-width: 620px) {
    :root { --workspace-page-gutter: 6px; }
    .responsive-workspace-panel { padding-left: 9px; padding-right: 9px; }
    .automatic-processing-body { padding: .55rem; }
    .automatic-processing-table { min-width: 720px; }
    .automatic-status-table { min-width: 540px; }
    .table-panel { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Large and ultrawide displays: deliberately expand the workspace instead of
   leaving a large unused margin around charts/tables/settings matrices. */
@media (min-width: 1800px) {
    :root { --workspace-page-gutter: 28px; }
    .automatic-processing-table { min-width: 0; }
    .automatic-settings-table th,
    .automatic-settings-table td { padding-left: .78rem; padding-right: .78rem; }
}

@media (min-width: 2400px) {
    :root {
        --workspace-page-gutter: 40px;
        --workspace-wide-max: 3200px;
    }
    .settings-workspace-panel { padding-left: 24px; padding-right: 24px; }
}


/* Compilation job selection workflow: category/clip pickers above the full-width selected list. */
.jobs-selection-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.jobs-selection-tools > .panel,
.selected-clips-panel {
    min-width: 0;
}

.compilation-picker-form {
    display: grid;
    gap: 5px;
}

.compilation-picker-form > label {
    font-weight: 700;
}

.compilation-picker-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.compilation-picker-row select {
    width: 100%;
    min-width: 0;
}

.compilation-picker-row .button {
    white-space: nowrap;
}

.available-clips-panel .empty-state,
.common-category-panel .empty-state {
    min-height: 0;
}

.selected-clips-panel .job-selected-list {
    max-height: none;
}

@media (max-width: 900px) {
    .jobs-selection-tools {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .compilation-picker-row {
        grid-template-columns: 1fr;
    }

    .compilation-picker-row .button {
        justify-self: start;
    }
}

/* Viewing Menu - media-library experience */
.viewing-page {
    width: 100%;
    min-width: 0;
}
.viewing-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr);
    gap: clamp(18px, 3vw, 44px);
    align-items: end;
    margin-bottom: 14px;
    padding: clamp(22px, 4vw, 46px);
    border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
    border-radius: calc(var(--radius) + 4px);
    background:
        radial-gradient(circle at 84% 20%, color-mix(in srgb, var(--accent) 22%, transparent) 0 12%, transparent 36%),
        linear-gradient(135deg,
            color-mix(in srgb, var(--primary-soft) 72%, var(--surface)) 0%,
            var(--surface) 52%,
            color-mix(in srgb, var(--surface-alt) 80%, var(--primary-soft)) 100%);
    box-shadow: var(--shadow);
}
.viewing-hero-cut-scenes {
    position: absolute;
    z-index: 4;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--line));
    border-radius: 50%;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    color: var(--primary);
    box-shadow: 0 8px 22px rgba(7, 16, 24, .14);
    backdrop-filter: blur(9px);
    text-decoration: none;
    font-size: 21px;
    line-height: 1;
    transition: transform .14s ease, background .14s ease, color .14s ease, border-color .14s ease;
}
.viewing-hero-cut-scenes:hover,
.viewing-hero-cut-scenes:focus-visible {
    transform: scale(1.06);
    border-color: var(--primary);
    background: var(--primary);
    color: var(--primary-text, #fff);
    text-decoration: none;
    outline: none;
}
.viewing-hero-cut-scenes:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 24%, transparent), 0 8px 22px rgba(7, 16, 24, .14);
}
.viewing-hero.has-cut-scenes-shortcut .viewing-hero-copy {
    padding-right: 52px;
}
.viewing-hero-copy,
.viewing-hero-stats {
    position: relative;
    z-index: 1;
}
.viewing-eyebrow,
.viewing-kicker {
    display: block;
    margin-bottom: 4px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.viewing-hero h1 {
    max-width: 780px;
    margin: 0 0 8px;
    font-size: clamp(30px, 4vw, 54px);
    line-height: 1.03;
    letter-spacing: -.025em;
}
.viewing-hero p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    font-size: clamp(14px, 1.3vw, 17px);
}
.viewing-alt-notice {
    max-width: 760px;
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--warning) 36%, var(--line));
    border-radius: var(--radius-small);
    background: var(--warning-soft);
    color: color-mix(in srgb, var(--warning) 85%, var(--text));
}
.viewing-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.viewing-stat {
    min-width: 0;
    padding: 13px 10px;
    border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    backdrop-filter: blur(8px);
    text-align: center;
}
.viewing-stat span {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: clamp(20px, 2.4vw, 30px);
    font-weight: 850;
    text-overflow: ellipsis;
}
.viewing-stat small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.viewing-destinations {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 18px;
}
.viewing-destination {
    min-width: 0;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: center;
    min-height: 68px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-soft);
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.viewing-destination:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--primary) 50%, var(--line));
    background: color-mix(in srgb, var(--primary-soft) 42%, var(--surface));
    color: var(--text);
    text-decoration: none;
}
.viewing-destination-primary {
    border-color: color-mix(in srgb, var(--primary) 55%, var(--line));
    background: color-mix(in srgb, var(--primary-soft) 58%, var(--surface));
}
.viewing-destination-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--surface-strong);
    color: var(--primary);
    font-size: 16px;
    font-weight: 850;
}
.viewing-destination-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.viewing-destination-copy strong {
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.viewing-destination-copy small {
    overflow: hidden;
    color: var(--muted);
    font-size: 10.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.viewing-destination-arrow {
    color: var(--muted);
    font-size: 16px;
}

.viewing-shelf {
    margin-bottom: 20px;
}
.viewing-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 12px;
    margin-bottom: 9px;
}
.viewing-section-heading h2 {
    margin: 0;
    font-size: 20px;
}
.viewing-section-heading a {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 750;
}
.viewing-filter-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.viewing-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
    gap: 11px;
}
.viewing-card-grid-browse {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
}
.viewing-media-card {
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.viewing-media-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--primary) 38%, var(--line));
    box-shadow: var(--shadow);
}
.viewing-media-art {
    position: relative;
    min-height: 118px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 72% 30%, color-mix(in srgb, var(--accent) 26%, transparent) 0 8%, transparent 34%),
        linear-gradient(145deg,
            color-mix(in srgb, var(--primary) 76%, var(--surface)) 0%,
            color-mix(in srgb, var(--primary-dark) 78%, var(--surface)) 100%);
    color: #fff;
}
.viewing-media-art::before {
    content: "";
    position: absolute;
    width: 120%;
    height: 54%;
    left: -24%;
    bottom: -30%;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 50%;
    transform: rotate(-8deg);
}
.viewing-media-glyph {
    position: relative;
    z-index: 1;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.55);
    border-radius: 50%;
    background: rgba(0,0,0,.14);
    font-size: 18px;
    padding-left: 3px;
}
.viewing-media-id {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
    padding: 3px 6px;
    border-radius: 999px;
    background: rgba(0,0,0,.28);
    color: #fff;
    font-size: 9.5px;
    font-weight: 750;
    letter-spacing: .04em;
    backdrop-filter: blur(6px);
}
.viewing-media-body {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
}
.viewing-media-title {
    overflow: hidden;
    min-height: 32px;
    max-height: 32px;
    height: 32px;
    color: var(--text);
    font-size: 13px;
    font-weight: 780;
    line-height: 16px;
    white-space: normal;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}
.viewing-media-length {
    margin-top: -4px;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 650;
    line-height: 1.2;
}
.viewing-media-tags {
    min-height: 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.viewing-media-tags span,
.viewing-media-tags a {
    max-width: 100%;
    overflow: hidden;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 680;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.viewing-media-tags a {
    cursor: pointer;
    text-decoration: none;
}
.viewing-media-tags a:hover,
.viewing-media-tags a:focus-visible {
    background: color-mix(in srgb, var(--primary-soft) 72%, var(--surface-strong));
    color: var(--primary);
    text-decoration: none;
}
.viewing-media-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.viewing-media-footer small {
    min-width: 0;
    color: var(--muted);
    font-size: 9.5px;
}
.viewing-play-disabled {
    flex: 0 0 auto;
    padding: 3px 7px;
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 720;
}
.viewing-empty {
    display: grid;
    place-items: center;
    gap: 5px;
    min-height: 180px;
    padding: 24px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface-alt);
    color: var(--muted);
    text-align: center;
}
.viewing-empty > span { font-size: 34px; color: var(--primary); }
.viewing-empty strong { color: var(--text); font-size: 15px; }

.viewing-discovery-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr);
    gap: 12px;
    align-items: start;
}
.viewing-discovery-panel {
    min-width: 0;
}
.viewing-category-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.viewing-category-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-alt);
    color: var(--text);
    font-size: 11.5px;
    font-weight: 680;
}
.viewing-category-chip:hover,
.viewing-category-chip.active {
    border-color: color-mix(in srgb, var(--primary) 52%, var(--line));
    background: var(--primary-soft);
    color: var(--primary-dark);
    text-decoration: none;
}
.viewing-category-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.viewing-category-chip small {
    min-width: 21px;
    padding: 1px 5px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    text-align: center;
    font-size: 9.5px;
}
.viewing-collection-list {
    display: grid;
    gap: 5px;
}
.viewing-collection-list a {
    min-width: 0;
    display: grid;
    grid-template-columns: 27px minmax(0, 1fr) auto auto;
    gap: 7px;
    align-items: center;
    padding: 7px 8px;
    border-radius: var(--radius-small);
    color: var(--text);
}
.viewing-collection-list a:hover {
    background: var(--surface-alt);
    text-decoration: none;
}
.viewing-collection-mark {
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: var(--primary-soft);
    color: var(--primary);
}
.viewing-collection-name {
    overflow: hidden;
    font-weight: 720;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.viewing-collection-list small {
    color: var(--muted);
    white-space: nowrap;
}

.viewing-player-dialog {
    width: min(1120px, calc(100vw - 28px));
    max-height: calc(100vh - 28px);
    padding: 0;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 3px);
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 24px 80px rgba(0,0,0,.28);
}
.viewing-player-dialog::backdrop {
    background: rgba(10, 18, 26, .72);
    backdrop-filter: blur(3px);
}
.viewing-player-shell {
    padding: 12px;
}
.viewing-player-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 9px;
}
.viewing-player-heading > div {
    min-width: 0;
}
.viewing-player-heading strong {
    display: block;
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.viewing-player-dialog video {
    display: block;
    width: 100%;
    max-height: calc(100vh - 125px);
    border-radius: var(--radius-small);
    background: #000;
}
.viewing-player-message {
    padding: 10px 4px 2px;
    color: var(--warning);
    font-size: 12px;
}

.sidebar-link-viewing .sidebar-icon {
    color: var(--primary);
}
.sidebar-link-viewing.active .sidebar-icon {
    color: currentColor;
}

@media (max-width: 1180px) {
    .viewing-destinations {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 900px) {
    .viewing-hero {
        grid-template-columns: 1fr;
    }
    .viewing-hero-stats {
        max-width: 520px;
    }
    .viewing-discovery-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 680px) {
    .viewing-hero {
        padding: 20px 16px;
    }
    .viewing-hero h1 {
        font-size: 31px;
    }
    .viewing-destinations {
        grid-template-columns: 1fr 1fr;
    }
    .viewing-card-grid,
    .viewing-card-grid-browse {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .viewing-media-art {
        min-height: 96px;
    }
}
@media (max-width: 440px) {
    .viewing-destinations {
        grid-template-columns: 1fr;
    }
    .viewing-card-grid,
    .viewing-card-grid-browse {
        grid-template-columns: 1fr;
    }
    .viewing-hero-stats {
        grid-template-columns: 1fr 1fr 1fr;
    }
    .viewing-stat {
        padding-left: 5px;
        padding-right: 5px;
    }
    .viewing-collection-list a {
        grid-template-columns: 27px minmax(0, 1fr) auto;
    }
    .viewing-collection-list small {
        display: none;
    }
}


/* =====================================================================
   The Goonstache Experience System — cinematic media workspace
   ===================================================================== */
:root {
    --experience-rail: #0b121a;
    --experience-rail-2: #111c27;
    --experience-rail-text: #eef5fb;
    --experience-rail-muted: #8fa3b5;
    --experience-glass: color-mix(in srgb, var(--surface) 90%, transparent);
    --experience-glass-strong: color-mix(in srgb, var(--surface) 96%, transparent);
    --experience-line: color-mix(in srgb, var(--line) 62%, transparent);
    --experience-elevated-shadow: 0 18px 54px rgba(10, 21, 31, .11);
    --experience-soft-shadow: 0 7px 24px rgba(10, 21, 31, .075);
    --experience-inset-highlight: inset 0 1px 0 rgba(255,255,255,.42);
}
html { scroll-behavior: smooth; }
body.sidebar-layout {
    background:
        radial-gradient(circle at 86% -8%, color-mix(in srgb, var(--primary) 11%, transparent) 0 12%, transparent 34%),
        radial-gradient(circle at 42% 0%, color-mix(in srgb, var(--accent) 6%, transparent) 0 7%, transparent 26%),
        var(--page);
}
body.sidebar-layout::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(color-mix(in srgb, var(--text) 2.3%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--text) 2.3%, transparent) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.24), transparent 48%);
}
.app-shell { grid-template-columns: 250px minmax(0, 1fr); }

/* Cinematic left rail */
.sidebar {
    background:
        radial-gradient(circle at 30% 0%, color-mix(in srgb, var(--primary) 20%, transparent) 0 2%, transparent 27%),
        linear-gradient(180deg, var(--experience-rail-2), var(--experience-rail) 45%, #080e14);
    color: var(--experience-rail-text);
    border-right: 1px solid rgba(255,255,255,.055);
    box-shadow: 10px 0 40px rgba(2, 8, 14, .12);
}
.sidebar::after {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 180px;
    pointer-events: none;
    background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 10%, transparent), transparent);
}
.sidebar-header, .sidebar-footer { position: relative; z-index: 1; }
.sidebar-header {
    min-height: 80px;
    padding: 16px 15px 13px;
    border-bottom: 0;
}
.sidebar-brand {
    color: var(--experience-rail-text);
    font-size: 18px;
    letter-spacing: -.35px;
}
.sidebar-brand:hover { color: #fff; }
.sidebar-logo {
    max-width: 52px;
    max-height: min(44px, var(--brand-logo-max-height));
    filter: drop-shadow(0 5px 13px rgba(0,0,0,.16));
}
.sidebar-brand-mark {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--primary), color-mix(in srgb, var(--primary-dark) 72%, #000));
    box-shadow: 0 8px 22px color-mix(in srgb, var(--primary) 28%, transparent);
}
.sidebar-nav { padding: 4px 10px 18px; }
.sidebar-nav-group { margin-top: 13px; }
.sidebar-nav-group:first-child { margin-top: 2px; }
.sidebar-nav-label {
    margin: 0 10px 5px;
    color: var(--experience-rail-muted);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .15em;
    text-transform: uppercase;
}
.sidebar-link {
    position: relative;
    min-height: 39px;
    gap: 9px;
    margin: 2px 0;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #c4d0da;
    font-size: 12px;
    font-weight: 670;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.sidebar-link:hover {
    color: #fff;
    background: rgba(255,255,255,.055);
    border-color: rgba(255,255,255,.055);
    text-decoration: none;
    transform: translateX(2px);
}
.sidebar-link.active {
    color: #fff;
    background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 31%, transparent), color-mix(in srgb, var(--primary) 10%, rgba(255,255,255,.035)));
    border-color: color-mix(in srgb, var(--primary) 42%, rgba(255,255,255,.08));
    box-shadow: inset 3px 0 0 var(--primary), 0 6px 18px rgba(0,0,0,.09);
}
.sidebar-icon {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
    color: color-mix(in srgb, currentColor 88%, var(--primary));
    font-size: 14px;
}
.sidebar-link-copy {
    min-width: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    line-height: 1.12;
}
.sidebar-link-copy strong { font-size: 12px; color: inherit; }
.sidebar-link-copy small {
    margin-top: 3px;
    overflow: hidden;
    color: var(--experience-rail-muted);
    font-size: 9.5px;
    font-weight: 570;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-link-badge {
    flex: 0 0 auto;
    padding: 2px 5px;
    border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent);
    border-radius: 999px;
    color: color-mix(in srgb, var(--primary) 68%, #fff);
    background: color-mix(in srgb, var(--primary) 13%, transparent);
    font-size: 7.5px;
    font-weight: 900;
    letter-spacing: .08em;
}
.sidebar-link-viewing {
    min-height: 58px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 24%, rgba(255,255,255,.04)), rgba(255,255,255,.025));
    border-color: color-mix(in srgb, var(--primary) 28%, rgba(255,255,255,.04));
}
.sidebar-link-viewing .sidebar-icon {
    width: 31px;
    height: 31px;
    flex-basis: 31px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    box-shadow: 0 7px 18px color-mix(in srgb, var(--primary) 28%, transparent);
}
.sidebar-link-viewing.active {
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 48%, #111d27), color-mix(in srgb, var(--primary-dark) 24%, #0d1620));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 44%, transparent), 0 10px 24px rgba(0,0,0,.14);
}
.sidebar-divider { display: none; }
.sidebar-footer {
    padding: 10px;
    border-top: 1px solid rgba(255,255,255,.055);
    background: rgba(0,0,0,.1);
}
.sidebar-user-link {
    margin: 0;
    padding: 7px;
    border: 1px solid transparent;
    border-radius: 11px;
}
.sidebar-user-link:hover, .sidebar-user-link.active {
    background: rgba(255,255,255,.055);
    border-color: rgba(255,255,255,.06);
}
.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    box-shadow: 0 5px 14px color-mix(in srgb, var(--primary) 24%, transparent);
}
.sidebar-user-copy strong { color: #f4f8fb; }
.sidebar-user-copy small { color: var(--experience-rail-muted); }
.sidebar-signout { color: var(--experience-rail-muted); border-radius: 9px; }
.sidebar-signout:hover { color: #ffb2b8; background: rgba(197,56,66,.13); }

/* Desktop media command bar */
.app-content {
    background:
        radial-gradient(circle at 92% 0%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 24%),
        linear-gradient(180deg, color-mix(in srgb, var(--page-top) 83%, var(--page)) 0, var(--page) 330px);
}
.desktop-media-bar {
    position: sticky;
    top: 0;
    z-index: 45;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 8px clamp(16px, 2vw, 28px);
    border-bottom: 1px solid color-mix(in srgb, var(--line) 62%, transparent);
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    backdrop-filter: blur(18px) saturate(1.18);
    -webkit-backdrop-filter: blur(18px) saturate(1.18);
}
.desktop-media-context { min-width: 0; display: flex; align-items: center; gap: 10px; }
.desktop-media-pulse {
    width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 11%, transparent);
}
.desktop-media-context > div { min-width: 0; display: flex; flex-direction: column; line-height: 1.12; }
.desktop-media-context small {
    color: var(--muted); font-size: 9px; font-weight: 820; letter-spacing: .12em; text-transform: uppercase;
}
.desktop-media-context strong {
    overflow: hidden; color: var(--text); font-size: 13px; font-weight: 780; text-overflow: ellipsis; white-space: nowrap;
}
.desktop-media-actions { display: flex; align-items: center; gap: 8px; }
.desktop-impersonate-form {
    display: inline-flex; align-items: center; gap: 7px; margin: 0; white-space: nowrap;
}
.desktop-impersonate-form label {
    margin: 0; color: var(--muted); font-size: 11px; font-weight: 800;
}
.desktop-impersonate-select {
    width: clamp(150px, 15vw, 230px); min-height: 34px; margin: 0; padding: 5px 30px 5px 10px;
    border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text);
    font-size: 11px; font-weight: 750; cursor: pointer;
}
.desktop-impersonate-select:hover, .desktop-impersonate-select:focus {
    border-color: var(--primary); outline: none;
}
.desktop-media-watch {
    min-height: 34px; display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px;
    border: 1px solid color-mix(in srgb, var(--primary) 26%, var(--line));
    border-radius: 999px; background: color-mix(in srgb, var(--primary-soft) 63%, var(--surface));
    color: var(--primary-dark); font-size: 11px; font-weight: 800;
}
.desktop-media-watch:hover, .desktop-media-watch.active {
    color: #fff; background: var(--primary); border-color: var(--primary); text-decoration: none;
}
.desktop-media-profile {
    width: 34px; height: 34px; display: grid; place-items: center;
    border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--text);
    font-size: 11px; font-weight: 850; box-shadow: var(--experience-soft-shadow);
}
.desktop-media-profile:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }

/* Workspace hierarchy */
.app-content .page-shell {
    width: min(var(--workspace-wide-max, 3200px), calc(100% - clamp(20px, 3vw, 54px)));
    margin-top: clamp(15px, 2vw, 27px);
}
.page-heading {
    position: relative;
    align-items: center;
    margin-bottom: 20px;
    padding: 3px 0 3px 14px;
}
.page-heading::before {
    content: "";
    position: absolute; inset: 4px auto 4px 0; width: 4px; border-radius: 999px;
    background: linear-gradient(var(--primary), var(--accent));
    box-shadow: 0 0 14px color-mix(in srgb, var(--primary) 25%, transparent);
}
.page-heading h1 {
    margin-bottom: 4px; font-size: clamp(25px, 2.4vw, 36px); font-weight: 780; letter-spacing: -.026em;
}
.compact-heading h1 { font-size: clamp(24px, 2.1vw, 32px); }
.page-heading p { max-width: 860px; margin: 0; color: var(--muted); font-size: 13px; }
.page-kicker {
    display: block; margin-bottom: 4px; color: var(--primary);
    font-size: 9px; font-weight: 900; letter-spacing: .15em; text-transform: uppercase;
}
.breadcrumbs { margin-bottom: 6px; color: var(--muted); font-size: 10.5px; font-weight: 650; }
.breadcrumbs a { font-weight: 720; }
.dashboard-watch-link {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
    color: var(--primary); font-size: 11px; font-weight: 800;
}
.dashboard-watch-link:hover { text-decoration: none; }

/* Layered product-card surfaces */
.panel, .collection-card, .stat-card, .action-card, .clip-card, .list-row, .job-clip {
    border-color: var(--experience-line);
}
.panel {
    position: relative; overflow: clip; padding: clamp(15px, 1.5vw, 21px);
    border-radius: max(var(--radius), 14px);
    background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 98%, #fff) 0%, color-mix(in srgb, var(--surface) 96%, var(--surface-alt)) 100%);
    box-shadow: var(--experience-soft-shadow), var(--experience-inset-highlight);
}
.panel::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
    background: linear-gradient(135deg, rgba(255,255,255,.11), transparent 20%);
}
.panel > * { position: relative; z-index: 1; }
.compact-panel { padding: 13px 15px; }
.table-panel { overflow-x: auto; overflow-y: hidden; padding: 0; }
.form-panel { box-shadow: var(--experience-elevated-shadow), var(--experience-inset-highlight); }
.section-heading, .panel-title-row { align-items: center; margin-bottom: 13px; }
.section-heading h2, .panel-title-row h2 { font-size: 17px; letter-spacing: -.015em; }
.section-heading p, .panel-title-row p { color: var(--muted); }

/* Dashboard studio overview */
.stat-grid { gap: 10px; }
.sidebar-layout .stat-card {
    min-height: 106px; justify-content: flex-end; padding: 14px 15px; border-radius: 15px;
    background: radial-gradient(circle at 84% 18%, color-mix(in srgb, var(--primary) 13%, transparent), transparent 33%),
                linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--surface-alt) 78%, var(--surface)));
    box-shadow: var(--experience-soft-shadow), var(--experience-inset-highlight);
}
.sidebar-layout .stat-card::before {
    left: auto; right: 13px; top: 12px; width: 31px; height: 31px; transform: none; border-radius: 10px;
    background: color-mix(in srgb, var(--primary-soft) 77%, var(--surface));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 16%, transparent);
}
.sidebar-layout .stat-card::after {
    left: auto; right: 24px; top: 19px; transform: none; font-size: 10px;
}
.sidebar-layout .stat-card strong {
    font-size: clamp(25px, 2.2vw, 34px); font-weight: 850; letter-spacing: -.03em;
}
.sidebar-layout .stat-card span {
    margin-top: 6px; font-size: 10px; font-weight: 720; letter-spacing: .035em; text-transform: uppercase;
}
.stat-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--primary) 35%, var(--line));
    box-shadow: 0 14px 30px color-mix(in srgb, var(--primary) 9%, rgba(10,21,31,.12));
}
.dashboard-collapsible-panel { transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.dashboard-collapsible-panel:hover { border-color: color-mix(in srgb, var(--primary) 22%, var(--line)); }
.action-grid { gap: 8px; }
.action-card {
    min-height: 92px; position: relative; justify-content: center; padding: 13px 14px 13px 16px;
    border-radius: 12px; background: color-mix(in srgb, var(--surface-alt) 78%, var(--surface));
}
.action-card::before {
    content: ""; position: absolute; inset: 11px auto 11px 0; width: 3px; border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 72%, var(--accent)); opacity: .75;
}
.action-card:hover {
    transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 32%, var(--line));
    background: color-mix(in srgb, var(--primary-soft) 42%, var(--surface));
    box-shadow: var(--experience-soft-shadow);
}
.action-card b { font-size: 13px; }
.action-card span { font-size: 11px; }

/* Product controls */
.button {
    min-height: 36px; padding: 7px 12px;
    border-color: color-mix(in srgb, var(--line-strong) 74%, transparent);
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface) 92%, var(--surface-alt));
    box-shadow: 0 2px 7px rgba(10,21,31,.055), inset 0 1px 0 rgba(255,255,255,.4);
    font-size: 12px; font-weight: 740;
    transition: transform .13s ease, box-shadow .13s ease, border-color .13s ease, background .13s ease;
}
.button:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--primary) 44%, var(--line));
    background: color-mix(in srgb, var(--primary-soft) 48%, var(--surface));
    box-shadow: 0 6px 15px rgba(10,21,31,.08);
}
.button.primary {
    color: #fff;
    border-color: color-mix(in srgb, var(--primary-dark) 62%, var(--primary));
    background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary-dark) 78%, #000));
    box-shadow: 0 7px 17px color-mix(in srgb, var(--primary) 22%, transparent);
}
.button.primary:hover {
    background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 88%, #fff), var(--primary-dark));
    box-shadow: 0 9px 22px color-mix(in srgb, var(--primary) 29%, transparent);
}
.button.danger {
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 25%, var(--line));
    background: color-mix(in srgb, var(--danger-soft) 76%, var(--surface));
}
.button.small { min-height: 31px; border-radius: 9px; }
.button.tiny { min-height: 27px; border-radius: 8px; }

/* Form controls */
label { margin-bottom: 5px; font-size: 11.5px; font-weight: 760; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
    min-height: 39px;
    border-color: color-mix(in srgb, var(--line-strong) 74%, transparent);
    border-radius: 10px; padding: 7px 10px; background: var(--input-bg);
    box-shadow: inset 0 1px 2px rgba(10,21,31,.035);
    transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
input:not([type="checkbox"]):not([type="radio"]):hover, select:hover, textarea:hover {
    border-color: color-mix(in srgb, var(--primary) 28%, var(--line-strong));
}
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
    border-color: color-mix(in srgb, var(--primary) 78%, #fff);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 10%, transparent), inset 0 1px 2px rgba(10,21,31,.025);
}
input[readonly], input:disabled, select:disabled, textarea:disabled { opacity: .72; }
.check, .compact-check { font-size: 11.5px; }

/* Modern data surfaces */
table { border-collapse: separate; border-spacing: 0; }
th {
    padding: 9px 11px; border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-strong) 74%, var(--surface));
    color: var(--muted); font-size: 9.5px; font-weight: 850; letter-spacing: .08em;
}
td { padding: 10px 11px; border-bottom-color: color-mix(in srgb, var(--line) 68%, transparent); }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: color-mix(in srgb, var(--primary-soft) 29%, var(--surface)); }
.table-panel > table thead th:first-child { border-top-left-radius: 13px; }
.table-panel > table thead th:last-child { border-top-right-radius: 13px; }
.table-panel { border-radius: 14px; box-shadow: var(--experience-soft-shadow); }

/* Badges, tabs, tags */
.badge, .tag { border-radius: 999px; font-weight: 760; }
.badge { padding: 4px 7px; font-size: 10px; }
.tabs {
    padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 11px;
    background: color-mix(in srgb, var(--surface-alt) 72%, var(--surface));
}
.tabs a { border: 0; border-radius: 8px; background: transparent; font-size: 11px; }
.tabs a:hover, .tabs a.active {
    color: var(--primary-dark); background: var(--surface);
    box-shadow: 0 2px 8px rgba(10,21,31,.06); text-decoration: none;
}
.tag {
    border-color: color-mix(in srgb, var(--primary) 20%, var(--line));
    background: color-mix(in srgb, var(--primary-soft) 68%, var(--surface));
    color: var(--primary-dark);
}

/* Lists/editing cards */
.clip-card, .list-row, .job-clip {
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface-alt) 66%, var(--surface));
    box-shadow: 0 2px 8px rgba(10,21,31,.035);
}
.clip-card:hover, .list-row:hover, .job-clip:hover {
    border-color: color-mix(in srgb, var(--primary) 24%, var(--line));
    background: color-mix(in srgb, var(--primary-soft) 24%, var(--surface));
}
.order-box {
    border-radius: 10px;
    background: color-mix(in srgb, var(--primary-soft) 82%, var(--surface));
    color: var(--primary-dark);
}
.collection-card {
    border-radius: 15px;
    box-shadow: var(--experience-soft-shadow), var(--experience-inset-highlight);
}

/* Alerts, empty states, dialogs */
.alert { border-radius: 11px; padding: 11px 13px; box-shadow: 0 3px 10px rgba(10,21,31,.035); }
.empty-state {
    min-height: 90px; display: grid; place-items: center; border-radius: 12px; border-style: dashed;
    background: color-mix(in srgb, var(--surface-alt) 78%, var(--surface));
}
dialog, .upload-dialog, .processing-log-dialog {
    border-radius: 16px !important;
    border-color: color-mix(in srgb, var(--line) 78%, transparent) !important;
    box-shadow: 0 26px 90px rgba(4, 12, 19, .32) !important;
}
dialog::backdrop { background: rgba(4,10,16,.68); backdrop-filter: blur(5px); }
.dialog-heading { align-items: center; }

/* Subtle system status chip */
.emby-availability-page {
    width: fit-content; max-width: 100%; margin: 0 0 12px auto; padding: 5px 9px;
    border: 1px solid color-mix(in srgb, var(--line) 68%, transparent);
    border-radius: 999px; background: color-mix(in srgb, var(--surface) 78%, transparent);
    box-shadow: 0 3px 10px rgba(10,21,31,.04); backdrop-filter: blur(8px); font-size: 10px;
}

/* Viewing Menu gets the strongest cinematic treatment */
body[data-controller="viewing"] .app-content {
    background:
        radial-gradient(circle at 80% -4%, color-mix(in srgb, var(--primary) 15%, transparent), transparent 27%),
        radial-gradient(circle at 30% 4%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 24%),
        linear-gradient(180deg, color-mix(in srgb, var(--page-top) 76%, var(--page)) 0, var(--page) 390px);
}
body[data-controller="viewing"] .desktop-media-bar {
    background: color-mix(in srgb, var(--experience-rail) 84%, transparent);
    border-color: rgba(255,255,255,.07);
}
body[data-controller="viewing"] .desktop-media-context small,
body[data-controller="viewing"] .desktop-media-context strong { color: #edf5fb; }
body[data-controller="viewing"] .desktop-media-profile {
    border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.08); color: #fff;
}
.viewing-hero {
    min-height: 265px; border-radius: 20px;
    box-shadow: 0 24px 64px color-mix(in srgb, var(--primary) 10%, rgba(7,16,24,.16));
}
.viewing-destination, .viewing-media-card { border-radius: 15px; }
.viewing-destination {
    min-height: 76px;
    box-shadow: var(--experience-soft-shadow), var(--experience-inset-highlight);
}
.viewing-media-card { box-shadow: var(--experience-soft-shadow), var(--experience-inset-highlight); }
.viewing-media-card:hover { transform: translateY(-5px); box-shadow: 0 18px 38px rgba(7,16,24,.14); }
.viewing-media-art { min-height: 134px; }

/* Public/login experience */
.public-layout {
    background:
        radial-gradient(circle at 50% -10%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 35%),
        linear-gradient(180deg, var(--page-top), var(--page));
}
.public-header {
    border-bottom-color: color-mix(in srgb, var(--line) 60%, transparent);
    background: color-mix(in srgb, var(--surface) 83%, transparent);
    backdrop-filter: blur(16px);
}
.login-card {
    margin-top: clamp(55px, 10vh, 110px); padding: clamp(24px, 4vw, 38px);
    border-radius: 19px; box-shadow: var(--experience-elevated-shadow), var(--experience-inset-highlight);
}
.app-content .footer {
    padding: 15px clamp(18px, 2vw, 30px);
    color: color-mix(in srgb, var(--muted) 80%, transparent); font-size: 9.5px;
}

/* Responsive */
@media (max-width: 1320px) and (min-width: 1081px) {
    .app-shell { grid-template-columns: 224px minmax(0, 1fr); }
}
@media (max-width: 1080px) {
    .desktop-media-bar { display: none; }
    .sidebar { width: min(306px, 88vw); box-shadow: 20px 0 60px rgba(2,8,14,.34); }
    .mobile-appbar {
        min-height: 54px; padding: 7px 11px;
        border-bottom-color: color-mix(in srgb, var(--line) 62%, transparent);
        background: color-mix(in srgb, var(--surface) 84%, transparent);
        backdrop-filter: blur(16px);
    }
    .sidebar-toggle { border-radius: 10px; box-shadow: 0 2px 8px rgba(10,21,31,.05); }
    .app-content .page-shell { width: calc(100% - 18px); margin-top: 14px; }
}
@media (max-width: 760px) {
    .page-heading { align-items: stretch; padding-left: 11px; }
    .page-heading h1 { font-size: 25px; }
    .page-heading > .button-row { width: 100%; }
    .page-heading > .button-row .button { flex: 1 1 auto; }
    .panel { border-radius: 13px; }
    .stat-grid { gap: 7px; }
    .sidebar-layout .stat-card { min-height: 92px; }
}
@media (max-width: 520px) {
    .app-content .page-shell { width: calc(100% - 12px); }
    .button-row { gap: 5px; }
    .button { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .001ms !important;
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
    }
}



/* Viewing Menu - real video artwork and inline destination browsing */
.viewing-results-surface {
    margin-bottom: 20px;
    padding: clamp(14px, 1.6vw, 20px);
    border: 1px solid var(--experience-line, var(--line));
    border-radius: max(var(--radius), 15px);
    background:
        linear-gradient(180deg,
            color-mix(in srgb, var(--surface) 97%, transparent),
            color-mix(in srgb, var(--surface-alt) 58%, var(--surface)));
    box-shadow: var(--experience-soft-shadow, var(--shadow-soft));
    scroll-margin-top: 78px;
}

.viewing-destination.active {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--primary) 58%, var(--line));
    background: color-mix(in srgb, var(--primary-soft) 62%, var(--surface));
    box-shadow:
        0 10px 24px color-mix(in srgb, var(--primary) 11%, transparent),
        inset 0 0 0 1px color-mix(in srgb, var(--primary) 14%, transparent);
}

.viewing-media-art {
    position: relative;
    isolation: isolate;
    background:
        radial-gradient(circle at 72% 30%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 34%),
        linear-gradient(145deg,
            color-mix(in srgb, var(--primary) 78%, var(--surface)),
            color-mix(in srgb, var(--primary-dark) 80%, var(--surface)));
}

.viewing-media-thumb {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform .22s ease, filter .22s ease;
}

.viewing-media-art::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(0,0,0,.13), transparent 38%, rgba(0,0,0,.35)),
        linear-gradient(90deg, rgba(0,0,0,.12), transparent 48%);
}

.viewing-media-card:hover .viewing-media-thumb {
    transform: scale(1.035);
    filter: saturate(1.05) contrast(1.025);
}

.viewing-hover-preview {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    opacity: 0;
    background: #000;
    transition: opacity .12s ease;
}

.viewing-media-art.viewing-hover-preview-playing .viewing-hover-preview {
    opacity: 1;
}



.viewing-art-play {
    position: absolute;
    z-index: 4;
    right: 9px;
    bottom: 9px;
    width: 37px;
    height: 37px;
    display: grid;
    place-items: center;
    padding: 0 0 0 2px;
    border: 1px solid rgba(255,255,255,.56);
    border-radius: 50%;
    background: rgba(8,15,22,.62);
    color: #fff;
    box-shadow: 0 7px 18px rgba(0,0,0,.22);
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: transform .14s ease, background .14s ease;
}

.viewing-art-play:hover {
    transform: scale(1.08);
    background: var(--primary);
}
.viewing-art-play-shortened {
    left: 9px;
    right: auto;
    width: 30px;
    height: 30px;
    padding-left: 1px;
    background: rgba(8,15,22,.58);
}

.viewing-art-play-shortened::after {
    content: "S";
    position: absolute;
    right: -4px;
    bottom: -3px;
    min-width: 13px;
    height: 13px;
    display: grid;
    place-items: center;
    padding: 0 2px;
    border: 1px solid var(--surface);
    border-radius: 999px;
    background: var(--primary);
    color: var(--primary-text, #fff);
    font-size: 8px;
    font-weight: 850;
    line-height: 1;
}

.viewing-art-play-shortened:hover,
.viewing-art-play-shortened:focus-visible {
    transform: scale(1.08);
    background: color-mix(in srgb, var(--primary) 88%, rgba(8,15,22,.22));
}


.viewing-media-footer-clean {
    justify-content: flex-end;
}

.viewing-media-id,
.viewing-media-glyph {
    display: none !important;
}

.viewing-category-browser {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: 9px;
}

.viewing-category-choice {
    min-width: 0;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 62px;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface-alt) 66%, var(--surface));
    color: var(--text);
    box-shadow: 0 3px 10px rgba(10,21,31,.035);
    transition: transform .14s ease, border-color .14s ease, background .14s ease;
}

.viewing-category-choice:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--primary) 40%, var(--line));
    background: color-mix(in srgb, var(--primary-soft) 42%, var(--surface));
    color: var(--text);
    text-decoration: none;
}

.viewing-category-choice-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 15px;
    font-weight: 850;
}

.viewing-category-choice > span:nth-child(2) {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.viewing-category-choice strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.viewing-category-choice small {
    color: var(--muted);
    font-size: 10px;
}

@media (max-width: 680px) {
    .viewing-results-surface {
        padding: 11px;
    }

    .viewing-art-play {
        width: 34px;
        height: 34px;
    }
}



/* View Only access — consumer viewing shell */
.app-shell.view-only-shell {
    display: block;
    min-height: 100vh;
}

.view-only-shell .app-content {
    min-height: 100vh;
    width: 100%;
}

.view-only-shell .desktop-media-bar {
    display: flex;
    padding-left: clamp(14px, 2.4vw, 34px);
    padding-right: clamp(14px, 2.4vw, 34px);
}

.view-only-shell .view-only-media-bar {
    min-height: 62px;
    background:
        linear-gradient(180deg,
            color-mix(in srgb, var(--experience-rail) 88%, transparent),
            color-mix(in srgb, var(--experience-rail-2) 84%, transparent));
    border-bottom-color: rgba(255,255,255,.07);
    box-shadow: 0 10px 34px rgba(4,10,16,.10);
}

.view-only-shell .view-only-media-bar .desktop-media-context small,
.view-only-shell .view-only-media-bar .desktop-media-context strong {
    color: #edf5fb;
}

.view-only-shell .view-only-media-bar .desktop-media-pulse {
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 18%, transparent);
}

.view-only-page-shell {
    width: min(2400px, calc(100% - clamp(18px, 3vw, 52px))) !important;
    margin-inline: auto !important;
}

.view-only-account-menu {
    position: relative;
}

.view-only-account-menu > summary {
    list-style: none;
}

.view-only-account-menu > summary::-webkit-details-marker {
    display: none;
}

.view-only-account-trigger {
    cursor: pointer;
    user-select: none;
}

.view-only-account-menu[open] .view-only-account-trigger {
    border-color: color-mix(in srgb, var(--primary) 65%, rgba(255,255,255,.18));
    color: #fff;
    background: color-mix(in srgb, var(--primary) 34%, rgba(255,255,255,.10));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent);
}

.view-only-account-popover {
    position: absolute;
    z-index: 120;
    top: calc(100% + 9px);
    right: 0;
    width: min(260px, calc(100vw - 22px));
    overflow: hidden;
    padding: 7px;
    border: 1px solid color-mix(in srgb, var(--line) 68%, rgba(255,255,255,.08));
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    color: var(--text);
    box-shadow: 0 20px 58px rgba(3,9,15,.28);
    backdrop-filter: blur(18px) saturate(1.15);
    -webkit-backdrop-filter: blur(18px) saturate(1.15);
}

.view-only-account-identity {
    min-width: 0;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    margin-bottom: 5px;
    padding: 8px;
    border-bottom: 1px solid var(--line);
}

.view-only-account-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    box-shadow: 0 7px 18px color-mix(in srgb, var(--primary) 22%, transparent);
}

.view-only-account-identity > span:last-child {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.view-only-account-identity strong {
    overflow: hidden;
    color: var(--text);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.view-only-account-identity small {
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.view-only-account-action {
    width: 100%;
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 9px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-size: 11.5px;
    font-weight: 720;
    text-align: left;
}

.view-only-account-action:hover {
    background: color-mix(in srgb, var(--primary-soft) 58%, var(--surface));
    color: var(--primary-dark);
    text-decoration: none;
}

.view-only-account-action > span:first-child {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    background: var(--surface-alt);
    color: var(--primary);
}

.view-only-account-popover form {
    margin: 0;
}

.view-only-account-logout:hover {
    color: var(--danger);
    background: color-mix(in srgb, var(--danger-soft) 66%, var(--surface));
}

.view-only-account-logout:hover > span:first-child {
    color: var(--danger);
    background: var(--danger-soft);
}

@media (max-width: 1080px) {
    .view-only-shell .desktop-media-bar {
        display: flex;
        min-height: 56px;
    }

    .view-only-page-shell {
        width: calc(100% - 16px) !important;
        margin-top: 12px !important;
    }
}

@media (max-width: 560px) {
    .view-only-shell .desktop-media-context small {
        display: none;
    }

    .view-only-shell .desktop-media-context strong {
        max-width: 64vw;
    }

    .view-only-account-popover {
        position: fixed;
        top: 62px;
        right: 8px;
    }
}



/* Password reset choice / theme deletion management */
.reset-password-option {
    margin-top: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface-alt) 72%, var(--surface));
}

.reset-password-force-check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0;
}

.reset-password-force-check > input[type="checkbox"] {
    width: 15px !important;
    min-width: 15px !important;
    height: 15px !important;
    min-height: 15px !important;
    margin: 2px 0 0;
    padding: 0 !important;
    flex: 0 0 15px;
}

.reset-password-force-check > span {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.reset-password-force-check strong {
    color: var(--text);
    font-size: 12px;
}

.reset-password-force-check small {
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 500;
}

.theme-delete-zone {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-top: 18px;
    padding: 14px 15px;
    border: 1px solid color-mix(in srgb, var(--danger) 28%, var(--line));
    border-radius: 13px;
    background: color-mix(in srgb, var(--danger-soft) 55%, var(--surface));
}

.theme-delete-zone > div {
    min-width: 0;
}

.theme-delete-zone h3 {
    margin: 0 0 3px;
    color: var(--danger);
    font-size: 14px;
}

.theme-delete-zone p {
    margin: 0;
}

.theme-delete-zone form {
    flex: 0 0 auto;
    margin: 0;
}

.theme-delete-zone .button[disabled] {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
}

@media (max-width: 680px) {
    .theme-delete-zone {
        align-items: stretch;
        flex-direction: column;
    }

    .theme-delete-zone form,
    .theme-delete-zone .button {
        width: 100%;
    }
}



/* Viewing Menu compilation-library cards */
.viewing-compilation-card .viewing-media-art {
    background:
        radial-gradient(circle at 76% 22%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 32%),
        linear-gradient(145deg,
            color-mix(in srgb, var(--primary-dark) 84%, var(--surface)),
            color-mix(in srgb, var(--primary) 62%, var(--experience-rail, #0b121a)));
}




/* Per-file Viewing thumbnail override + clip-category theme parity */
.thumbnail-time-override-field {
    min-width: 132px;
    display: grid;
    gap: 2px;
}

.thumbnail-time-override-field > label {
    margin: 0;
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.thumbnail-time-input {
    display: grid;
    grid-template-columns: minmax(82px, 1fr) auto;
    align-items: center;
    gap: 5px;
}

.thumbnail-time-input input {
    width: 100%;
    min-width: 0;
    min-height: 31px;
    padding: 4px 7px;
}

.thumbnail-time-input span,
.thumbnail-time-override-field small {
    color: var(--muted);
    font-size: 9.5px;
}

.clip-category-panel .transfer-item.assigned {
    background: var(--primary-soft);
    color: var(--text);
}

.clip-category-panel .transfer-item.assigned:hover {
    background: color-mix(in srgb, var(--primary-soft) 76%, var(--primary));
    color: var(--text);
}

@media (max-width: 720px) {
    .thumbnail-time-override-field {
        width: 100%;
    }
}



/* Login route is always a standalone experience — never expose app navigation. */
.login-only-layout .app-shell,
.login-only-layout .sidebar,
.login-only-layout .sidebar-overlay,
.login-only-layout .mobile-appbar,
.login-only-layout .desktop-media-bar,
.login-only-layout .emby-availability-page,
.login-only-layout .app-content > .footer {
    display: none !important;
}

.login-only-layout .public-header {
    display: none !important;
}

.login-only-layout .public-main {
    min-height: 100vh;
    width: 100%;
    display: grid;
    place-items: center;
    padding: clamp(18px, 4vw, 48px);
}

.login-only-layout .login-card {
    width: min(100%, 470px);
    margin: 0;
}

@media (max-width: 560px) {
    .login-only-layout .public-main {
        padding: 12px;
    }

    .login-only-layout .login-card {
        width: 100%;
    }
}



/* Login viewport centering correction.
   These rules are intentionally last so generic public/login styles cannot move the card. */
html:has(body.login-only-layout),
body.login-only-layout {
    width: 100%;
    min-width: 100%;
    min-height: 100%;
    margin: 0;
}

body.login-only-layout {
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

.login-only-layout .public-content.login-only-main {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}

.login-only-layout .login-only-center {
    width: 100% !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box;
    margin: 0 !important;
    padding: clamp(16px, 4vw, 48px) !important;
}

.login-only-layout .login-only-center > .login-card {
    width: min(470px, 100%) !important;
    max-width: 470px !important;
    margin: 0 !important;
    position: static !important;
    inset: auto !important;
    align-self: center !important;
    justify-self: center !important;
}

@media (max-height: 620px) {
    .login-only-layout .login-only-center {
        align-items: flex-start !important;
        padding-top: 18px !important;
        padding-bottom: 18px !important;
    }
}

@media (max-width: 520px) {
    .login-only-layout .login-only-center {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .login-only-layout .login-only-center > .login-card {
        width: 100% !important;
    }
}



/* Viewing Menu collection cards — four-video artwork mosaic */
.viewing-collection-browser {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

.viewing-collection-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "art art"
        "copy arrow";
    align-items: center;
    gap: 0 10px;
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 2px);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-soft);
    text-decoration: none;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.viewing-collection-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--primary) 56%, var(--line));
    box-shadow: 0 16px 34px rgba(5, 13, 22, .16);
    text-decoration: none;
}

.viewing-collection-art {
    grid-area: art;
    width: 100%;
    aspect-ratio: 16 / 9;
    display: grid;
    gap: 2px;
    overflow: hidden;
    background:
        linear-gradient(145deg,
            color-mix(in srgb, var(--primary-dark) 80%, var(--surface)),
            color-mix(in srgb, var(--primary) 52%, var(--surface-alt)));
}

.viewing-collection-art.count-1 {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
}

.viewing-collection-art.count-2 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: 1fr;
}

.viewing-collection-art.count-3 {
    grid-template-columns: 1.1fr .9fr;
    grid-template-rows: repeat(2, 1fr);
    grid-template-areas:
        "lead top"
        "lead bottom";
}

.viewing-collection-art.count-4,
.viewing-collection-art.is-fallback {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.viewing-collection-art.count-3 .viewing-collection-art-cell:nth-child(1) {
    grid-area: lead;
}

.viewing-collection-art.count-3 .viewing-collection-art-cell:nth-child(2) {
    grid-area: top;
}

.viewing-collection-art.count-3 .viewing-collection-art-cell:nth-child(3) {
    grid-area: bottom;
}

.viewing-collection-art-cell {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 35% 30%,
            color-mix(in srgb, var(--accent) 20%, transparent),
            transparent 48%),
        color-mix(in srgb, var(--surface-alt) 74%, var(--primary-soft));
}

.viewing-collection-art-cell img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform .22s ease, filter .22s ease;
}

.viewing-collection-card:hover .viewing-collection-art-cell img {
    transform: scale(1.035);
    filter: saturate(1.06);
}

.viewing-collection-art-fallback {
    display: grid;
    place-items: center;
    color: color-mix(in srgb, var(--primary) 62%, var(--muted));
    font-size: clamp(18px, 2.4vw, 28px);
}

.viewing-collection-copy {
    grid-area: copy;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 0 12px 13px;
}

.viewing-collection-copy strong {
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.viewing-collection-copy small {
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 650;
}

.viewing-collection-arrow {
    grid-area: arrow;
    padding: 12px 13px 12px 0;
    color: var(--primary);
    font-size: 16px;
    font-weight: 800;
}

@media (max-width: 620px) {
    .viewing-collection-browser {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 10px;
    }
}



/* Viewing player heading actions */
.viewing-player-heading-action {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 1px;
    min-width: 62px;
    padding: 2px 0 2px 10px;
    cursor: pointer;
    font: inherit;
    text-align: right;
}

.viewing-player-heading-action .viewing-kicker {
    margin: 0;
}

.viewing-player-heading-action strong {
    color: var(--text);
    font-size: 22px;
    line-height: 1;
    font-weight: 500;
    transition: color .15s ease, transform .15s ease;
}

.viewing-player-heading-action:hover strong,
.viewing-player-heading-action:focus-visible strong {
    color: var(--primary);
    transform: scale(1.08);
}

.viewing-player-heading-action:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--primary) 72%, transparent);
    outline-offset: 5px;
    border-radius: var(--radius-small);
}



/* Viewing Menu top-centered active theme logo */
.viewing-page-logo {
    width: 100%;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin: 0 0 clamp(12px, 1.6vw, 22px);
    padding: 0;
    text-align: center;
}

.viewing-page-logo img {
    display: block;
    width: 75%;
    max-width: min(75vw, 1100px);
    min-width: min(420px, 75vw);
    height: auto;
    max-height: 30vh;
    object-fit: contain;
    object-position: center top;
}

.viewing-page-logo-fallback {
    display: inline-grid;
    place-items: center;
    min-width: 92px;
    min-height: 58px;
    padding: 8px 18px;
    border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--primary-soft) 66%, var(--surface));
    color: var(--primary);
    font-size: clamp(20px, 3vw, 32px);
    font-weight: 900;
    letter-spacing: .05em;
}

@media (max-width: 900px) {
    .viewing-page-logo img {
        width: 82%;
        max-width: 82vw;
        min-width: 0;
        max-height: 28vh;
    }
}

@media (max-width: 620px) {
    .viewing-page-logo img {
        width: 88%;
        max-width: 88vw;
        min-width: 0;
        max-height: 24vh;
    }
}



/* User account viewer-menu-only preference */
.user-viewer-menu-only-option {
    align-items: flex-start;
    gap: 8px;
}

.user-viewer-menu-only-option > span {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-viewer-menu-only-option strong {
    color: var(--text);
    font-size: 12px;
}



/* ShowViewerMenuOnly navigation affordances */
.view-only-account-action.viewer-menu-home-action {
    margin-bottom: 3px;
    border-bottom: 1px solid var(--line);
    border-radius: 9px 9px 5px 5px;
}

.settings-viewer-mode-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
}

.settings-viewer-exit {
    min-width: 92px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

@media (max-width: 700px) {
    .settings-viewer-mode-actions {
        width: 100%;
        justify-content: flex-start;
        margin-left: 0;
        margin-top: 8px;
    }
}



/* Viewing Menu compact-shell account overlay */
.view-only-shell .desktop-media-bar.viewing-menu-floating-account-bar {
    position: absolute;
    top: 0;
    right: 0;
    left: auto;
    z-index: 90;
    width: auto;
    min-height: 0;
    padding: clamp(9px, 1.15vw, 16px) clamp(10px, 1.45vw, 22px) 0 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    pointer-events: none;
}

.view-only-shell .desktop-media-bar.viewing-menu-floating-account-bar .desktop-media-actions {
    margin-left: 0;
    pointer-events: auto;
}

.view-only-shell .desktop-media-bar.viewing-menu-floating-account-bar .desktop-media-profile {
    background: color-mix(in srgb, var(--experience-rail) 72%, transparent);
    border-color: rgba(255,255,255,.15);
    color: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,.24);
    backdrop-filter: blur(10px) saturate(1.12);
    -webkit-backdrop-filter: blur(10px) saturate(1.12);
}

.view-only-shell .desktop-media-bar.viewing-menu-floating-account-bar .desktop-media-profile:hover,
.view-only-shell .desktop-media-bar.viewing-menu-floating-account-bar .view-only-account-menu[open] .view-only-account-trigger {
    border-color: color-mix(in srgb, var(--primary) 65%, rgba(255,255,255,.24));
    background: color-mix(in srgb, var(--primary) 34%, rgba(20,25,32,.76));
}

.view-only-shell .desktop-media-bar.viewing-menu-floating-account-bar + .page-shell {
    margin-top: 0 !important;
    padding-top: 0;
}

@media (max-width: 560px) {
    .view-only-shell .desktop-media-bar.viewing-menu-floating-account-bar {
        padding-top: 8px;
        padding-right: 8px;
    }

    .view-only-shell .desktop-media-bar.viewing-menu-floating-account-bar .view-only-account-popover {
        top: 52px;
        right: 8px;
    }
}



/* Administrator self-service Viewing Menu mode */
.profile-viewer-menu-mode {
    align-items: flex-start;
    gap: 9px;
    padding: 12px 13px;
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--primary-soft) 40%, var(--surface));
}

.profile-viewer-menu-mode > span {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.profile-viewer-menu-mode strong {
    color: var(--text);
    font-size: 12px;
}



/* Process Shortened Videos — uniform theme rows with subtle separators */
body[data-controller="processing"][data-action="shortened"] table tbody tr,
body[data-controller="processing"][data-action="shortened"] table tbody tr:nth-child(odd),
body[data-controller="processing"][data-action="shortened"] table tbody tr:nth-child(even) {
    background: var(--surface);
}

body[data-controller="processing"][data-action="shortened"] table tbody td {
    border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
}

body[data-controller="processing"][data-action="shortened"] table tbody tr:last-child td {
    border-bottom-color: transparent;
}

body[data-controller="processing"][data-action="shortened"] table tbody tr:hover {
    background: color-mix(in srgb, var(--primary-soft) 28%, var(--surface));
}



/* Recent Processing status badges — theme-derived pill treatment */
body[data-controller="home"] .dashboard-recent-processing .badge,
body[data-controller="home"] .recent-processing .badge,
body[data-controller="home"] #recent-processing .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 3px 10px;
    border: 1px solid color-mix(in srgb, var(--primary) 42%, var(--line));
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary-soft) 56%, var(--surface));
    color: var(--primary);
    font-size: 10px;
    font-weight: 820;
    line-height: 1;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 8%, transparent);
}

body[data-controller="home"] .dashboard-recent-processing .badge.running,
body[data-controller="home"] .recent-processing .badge.running,
body[data-controller="home"] #recent-processing .badge.running {
    border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
    background: color-mix(in srgb, var(--accent) 16%, var(--surface));
    color: var(--accent);
}

body[data-controller="home"] .dashboard-recent-processing .badge.pending,
body[data-controller="home"] .recent-processing .badge.pending,
body[data-controller="home"] #recent-processing .badge.pending {
    border-color: color-mix(in srgb, var(--warning) 48%, var(--line));
    background: color-mix(in srgb, var(--warning) 14%, var(--surface));
    color: var(--warning);
}

body[data-controller="home"] .dashboard-recent-processing .badge.failed,
body[data-controller="home"] .dashboard-recent-processing .badge.failure,
body[data-controller="home"] .recent-processing .badge.failed,
body[data-controller="home"] .recent-processing .badge.failure,
body[data-controller="home"] #recent-processing .badge.failed,
body[data-controller="home"] #recent-processing .badge.failure {
    border-color: color-mix(in srgb, var(--danger) 48%, var(--line));
    background: color-mix(in srgb, var(--danger) 14%, var(--surface));
    color: var(--danger);
}

body[data-controller="home"] .dashboard-recent-processing .badge.canceled,
body[data-controller="home"] .dashboard-recent-processing .badge.cancelled,
body[data-controller="home"] .recent-processing .badge.canceled,
body[data-controller="home"] .recent-processing .badge.cancelled,
body[data-controller="home"] #recent-processing .badge.canceled,
body[data-controller="home"] #recent-processing .badge.cancelled {
    border-color: color-mix(in srgb, var(--muted) 58%, var(--line));
    background: color-mix(in srgb, var(--muted) 10%, var(--surface));
    color: var(--muted);
}



/* Recent Processing final status-pill override — match Watch Library */
body[data-controller="home"] .dashboard-recent-processing table .badge,
body[data-controller="home"] .recent-processing table .badge,
body[data-controller="home"] #recent-processing table .badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 24px !important;
    padding: 3px 10px !important;
    border: 1px solid color-mix(in srgb, var(--primary) 42%, var(--line)) !important;
    border-radius: 999px !important;
    background: color-mix(in srgb, var(--primary-soft) 18%, var(--surface)) !important;
    color: var(--primary) !important;
    font-size: 10px !important;
    font-weight: 820 !important;
    line-height: 1 !important;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 6%, transparent),
                inset 0 0 12px color-mix(in srgb, var(--primary) 5%, transparent) !important;
}

/* All normal/non-failure statuses retain the same Watch Library pill colors. */
body[data-controller="home"] .dashboard-recent-processing table .badge.succeeded,
body[data-controller="home"] .dashboard-recent-processing table .badge.success,
body[data-controller="home"] .dashboard-recent-processing table .badge.running,
body[data-controller="home"] .dashboard-recent-processing table .badge.pending,
body[data-controller="home"] .dashboard-recent-processing table .badge.canceled,
body[data-controller="home"] .dashboard-recent-processing table .badge.cancelled,
body[data-controller="home"] .recent-processing table .badge.succeeded,
body[data-controller="home"] .recent-processing table .badge.success,
body[data-controller="home"] .recent-processing table .badge.running,
body[data-controller="home"] .recent-processing table .badge.pending,
body[data-controller="home"] .recent-processing table .badge.canceled,
body[data-controller="home"] .recent-processing table .badge.cancelled,
body[data-controller="home"] #recent-processing table .badge.succeeded,
body[data-controller="home"] #recent-processing table .badge.success,
body[data-controller="home"] #recent-processing table .badge.running,
body[data-controller="home"] #recent-processing table .badge.pending,
body[data-controller="home"] #recent-processing table .badge.canceled,
body[data-controller="home"] #recent-processing table .badge.cancelled {
    border-color: color-mix(in srgb, var(--primary) 42%, var(--line)) !important;
    background: color-mix(in srgb, var(--primary-soft) 18%, var(--surface)) !important;
    color: var(--primary) !important;
}

/* Failure keeps the same pill, changing only the text color to danger/red. */
body[data-controller="home"] .dashboard-recent-processing table .badge.failed,
body[data-controller="home"] .dashboard-recent-processing table .badge.failure,
body[data-controller="home"] .recent-processing table .badge.failed,
body[data-controller="home"] .recent-processing table .badge.failure,
body[data-controller="home"] #recent-processing table .badge.failed,
body[data-controller="home"] #recent-processing table .badge.failure {
    border-color: color-mix(in srgb, var(--primary) 42%, var(--line)) !important;
    background: color-mix(in srgb, var(--primary-soft) 18%, var(--surface)) !important;
    color: var(--danger) !important;
}



/* Full The Goonstache sidebar — centered logo sized from the live sidebar width */
.sidebar-header {
    --sidebar-logo-width-ratio: 0.78;
}

.sidebar-brand.sidebar-brand-logo-only {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    overflow: hidden;
    text-align: center;
}

.sidebar-brand.sidebar-brand-logo-only .sidebar-logo {
    display: block;
    width: calc(100% * var(--sidebar-logo-width-ratio));
    height: auto;
    max-width: 100%;
    max-height: 58px;
    margin: 0 auto;
    object-fit: contain;
    object-position: center center;
    flex: 0 1 auto;
}

.sidebar-brand.sidebar-brand-logo-only .sidebar-brand-mark {
    margin: 0 auto;
    flex: 0 0 auto;
}

@media (max-width: 1280px) {
    .sidebar-header {
        --sidebar-logo-width-ratio: 0.76;
    }

    .sidebar-brand.sidebar-brand-logo-only .sidebar-logo {
        max-height: 54px;
    }
}

@media (max-width: 1080px) {
    .sidebar-header {
        --sidebar-logo-width-ratio: 0.72;
    }

    .sidebar-brand.sidebar-brand-logo-only .sidebar-logo {
        max-height: 52px;
    }
}



/* Viewing category navigation / related shortened-version playback */
.viewing-previous-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 10.5px;
    font-weight: 760;
    text-decoration: none;
}

.viewing-previous-button:hover,
.viewing-previous-button:focus-visible {
    border-color: color-mix(in srgb, var(--primary) 48%, var(--line));
    background: var(--primary-soft);
    color: var(--primary);
    text-decoration: none;
}

.viewing-related-video {
    min-height: 18px;
    display: flex;
    align-items: center;
}

.viewing-shortened-version-link {
    appearance: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    font: inherit;
    font-size: 10.5px;
    font-weight: 760;
    line-height: 1.25;
    text-align: left;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.viewing-shortened-version-link:hover,
.viewing-shortened-version-link:focus-visible {
    color: var(--primary-dark);
}



.library-path-cell {
    max-width: 340px;
    white-space: normal;
    overflow-wrap: anywhere;
}



/* Viewing Menu browse sorting */
.viewing-sort-form {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin: 0;
}

.viewing-sort-form label {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
    font-weight: 760;
    white-space: nowrap;
}

.viewing-sort-form select {
    width: auto;
    min-width: 176px;
    min-height: 30px;
    padding: 4px 28px 4px 9px;
    font-size: 10.5px;
}



/* Managed Libraries administration and profile uploads */
.library-create-panel {
    margin-bottom: 12px;
}

.library-admin-table .library-path-cell {
    max-width: 360px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.library-row-actions {
    min-width: 250px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.library-row-actions form {
    margin: 0;
}

.library-invite-control {
    position: relative;
}

.library-invite-control > summary {
    list-style: none;
    cursor: pointer;
}

.library-invite-control > summary::-webkit-details-marker {
    display: none;
}

.library-invite-form {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 20;
    width: min(310px, 72vw);
    display: grid;
    gap: 7px;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    background: var(--surface);
    box-shadow: 0 12px 30px rgba(0,0,0,.22);
}

.profile-library-panel {
    margin-top: 12px;
}

.profile-library-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-library-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    background: var(--surface-alt);
}

.profile-library-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-library-copy span,
.profile-library-copy small {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.profile-library-actions form,
.profile-library-upload-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
}

.profile-library-upload-form input[type="file"] {
    width: min(340px, 48vw);
    min-width: 180px;
}

@media (max-width: 760px) {
    .profile-library-row {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-library-upload-form input[type="file"] {
        width: 100%;
    }

    .library-row-actions {
        min-width: 0;
    }
}



/* Viewer Menu — Libraries table destinations */
.viewing-destination-library .viewing-destination-icon {
    font-size: 20px;
}

.viewing-library-media-card .viewing-media-body {
    min-height: 56px;
}



/* Library upload progress / owner invitations / login invitation prompt */
.profile-library-control-stack {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 7px;
    min-width: min(520px, 55vw);
}

.profile-library-invite {
    position: relative;
}

.profile-library-invite > summary {
    list-style: none;
    cursor: pointer;
}

.profile-library-invite > summary::-webkit-details-marker {
    display: none;
}

.profile-library-invite-form {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 30;
    width: min(320px, 78vw);
    display: grid;
    gap: 7px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    background: var(--surface);
    box-shadow: 0 14px 34px rgba(0,0,0,.28);
}

.library-upload-progress {
    flex: 1 0 100%;
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-width: 220px;
}

.library-upload-progress[hidden] {
    display: none;
}

.library-upload-progress progress {
    width: 100%;
    height: 12px;
    accent-color: var(--primary);
}

.library-upload-progress span {
    min-width: 86px;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 760;
    text-align: right;
}

.library-upload-message {
    flex: 1 0 100%;
    min-height: 16px;
    font-size: 10.5px;
    color: var(--muted);
}

.library-upload-message.success {
    color: var(--success);
}

.library-upload-message.error {
    color: var(--danger);
}

.library-invitation-prompt {
    width: min(920px, calc(100vw - 36px));
    margin: clamp(20px, 6vh, 72px) auto;
}

.library-invitation-prompt-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin: 14px 0;
}

.library-invitation-prompt-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
    align-items: center;
    gap: 18px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    background: var(--surface-alt);
}

.library-invitation-decision {
    display: grid;
    gap: 5px;
}

.viewing-invited-libraries {
    margin-top: 12px;
    padding: 14px 16px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.viewing-invited-library-grid {
    margin-top: 9px;
}

.viewing-destination-library.invited {
    border-color: color-mix(in srgb, var(--primary) 42%, var(--line));
}

@media (max-width: 760px) {
    .profile-library-control-stack {
        width: 100%;
        min-width: 0;
        justify-content: stretch;
    }

    .profile-library-upload-form {
        width: 100%;
    }

    .library-invitation-prompt-row {
        grid-template-columns: 1fr;
    }
}



/* Libraries administration — normal panel spacing + unclipped inline Invite */
.library-admin-table.table-panel {
    padding: 14px 16px 16px;
    overflow: visible;
}

.library-admin-table > .panel-title-row {
    margin: 0 0 12px;
}

.library-admin-table-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
}

.library-admin-table-scroll > table {
    min-width: 820px;
}

.library-admin-table-scroll > table thead th:first-child {
    border-top-left-radius: var(--radius-small);
}

.library-admin-table-scroll > table thead th:last-child {
    border-top-right-radius: var(--radius-small);
}

.library-invite-control,
.profile-library-invite {
    position: static;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.library-invite-form,
.profile-library-invite-form {
    position: static;
    z-index: auto;
    flex: 1 0 100%;
    width: min(440px, 100%);
    max-width: 100%;
    display: grid;
    grid-template-columns: minmax(170px, 1fr) auto;
    align-items: end;
    gap: 7px;
    margin-top: 5px;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    background: var(--surface-alt);
    box-shadow: none;
}

.library-invite-form[hidden],
.profile-library-invite-form[hidden] {
    display: none !important;
}

.library-invite-form label,
.profile-library-invite-form label {
    grid-column: 1 / -1;
    margin: 0;
}

.library-invite-form select,
.profile-library-invite-form select {
    min-width: 0;
}

.library-row-actions .library-invite-control {
    flex: 1 0 100%;
}

.library-row-actions .library-invite-control > [data-library-invite-toggle] {
    flex: 0 0 auto;
}

.profile-library-row {
    flex-wrap: wrap;
}

.profile-library-shared-access {
    flex: 1 0 100%;
    display: grid;
    gap: 6px;
    margin-top: 2px;
    padding-top: 9px;
    border-top: 1px solid var(--line);
}

.profile-library-shared-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.profile-library-shared-users {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.profile-library-shared-user {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 6px 5px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
}

.profile-library-shared-user > span {
    font-size: 11px;
    font-weight: 700;
}

.profile-library-shared-user form {
    margin: 0;
}

.account-menu-all-users {
    position: relative;
}

@media (max-width: 760px) {
    .library-admin-table.table-panel {
        padding: 12px;
    }

    .library-invite-form,
    .profile-library-invite-form {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .library-invite-form label,
    .profile-library-invite-form label {
        grid-column: auto;
    }
}


/* Viewer pending library invitation notice */
.viewing-library-invitation-notice {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    margin: 10px 0 14px;
    padding: 11px 13px;
    border: 1px solid color-mix(in srgb, var(--primary) 38%, var(--line));
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--primary-soft) 72%, var(--surface));
    box-shadow: 0 5px 18px color-mix(in srgb, var(--primary) 8%, transparent);
}

.viewing-library-invitation-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--primary-dark);
    background: color-mix(in srgb, var(--primary) 18%, var(--surface));
    font-size: 17px;
    font-weight: 800;
}

.viewing-library-invitation-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.viewing-library-invitation-copy strong {
    color: var(--text);
    font-size: 13px;
}

.viewing-library-invitation-copy span {
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.35;
}

.profile-library-invitations-section {
    scroll-margin-top: 72px;
}

@media (max-width: 700px) {
    .viewing-library-invitation-notice {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .viewing-library-invitation-notice > .button {
        grid-column: 1 / -1;
        justify-self: stretch;
        text-align: center;
    }
}


/* Viewer library header upload */
.viewing-library-upload-form {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
}

.viewing-library-upload-input {
    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;
    opacity: 0;
}

.viewing-library-upload-button {
    min-height: 34px;
    white-space: nowrap;
}

.viewing-library-upload-progress {
    flex: 1 0 100%;
    width: min(240px, 100%);
    min-width: 180px;
    margin-left: auto;
}

.viewing-library-upload-message {
    flex: 1 0 100%;
    min-height: 0;
    max-width: 320px;
    margin-left: auto;
    text-align: right;
}

.viewing-library-upload-message:empty {
    display: none;
}

@media (max-width: 760px) {
    .viewing-filter-actions {
        align-items: stretch;
    }

    .viewing-library-upload-form {
        width: 100%;
    }

    .viewing-library-upload-button {
        width: 100%;
    }

    .viewing-library-upload-progress,
    .viewing-library-upload-message {
        width: 100%;
        max-width: none;
    }
}

/* Viewer library file deletion */
.viewing-library-media-actions {
    min-height: 28px;
}

.viewing-library-delete-form {
    margin: 0 0 0 auto;
}

.viewing-library-delete-form .button {
    white-space: nowrap;
}

/* Library scan telemetry */
.library-scan-status {
    display: grid;
    justify-items: start;
    gap: 3px;
    margin-top: 5px;
    max-width: 520px;
}

.library-scan-status small {
    max-width: 100%;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Library output routing */
.library-routing-editor,
.library-behavior-editor,
.library-routing-summary {
    display: grid;
    gap: 5px;
    margin-top: 7px;
}

.library-routing-editor label {
    display: grid;
    gap: 2px;
    font-size: 10px;
}

.library-routing-editor select {
    min-width: 180px;
}

.library-routing-summary small {
    display: block;
    line-height: 1.25;
}



/* Invitation access levels */
.library-invite-access,
.profile-library-access-form {
    display: inline-grid;
    gap: 3px;
}

.library-invite-access {
    font-size: 10px;
}

.profile-library-access-form {
    grid-template-columns: minmax(150px, auto) auto;
    align-items: center;
}

.profile-library-access-form select {
    min-width: 165px;
}

/* Shared Libraries catalog */
.profile-library-global-view-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.viewing-shared-library-browser {
    display: grid;
    gap: 10px;
}

.viewing-shared-library-choice {
    display: grid;
    grid-template-columns: minmax(120px, .8fr) minmax(180px, 1.6fr) auto auto;
    gap: 14px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    background: var(--surface-raised);
}

.viewing-shared-library-choice:hover {
    transform: translateY(-1px);
}

.viewing-shared-library-handle,
.viewing-shared-library-name {
    font-weight: 700;
}

.viewing-shared-library-count {
    white-space: nowrap;
    opacity: .78;
}

.viewing-shared-library-arrow {
    font-size: 1.2rem;
}

@media (max-width: 760px) {
    .viewing-shared-library-choice {
        grid-template-columns: 1fr auto;
    }

    .viewing-shared-library-name,
    .viewing-shared-library-count {
        grid-column: 1;
    }

    .viewing-shared-library-arrow {
        grid-column: 2;
        grid-row: 1 / span 3;
    }
}

/* Account registration */
.login-account-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .45rem 1rem;
    margin-top: 14px;
    text-align: center;
}

.login-account-links a {
    font-weight: 600;
}

.account-password-reset-card {
    max-width: 560px;
}

.account-password-reset-help {
    margin-top: 12px;
}

.account-create-card {
    max-width: 620px;
}

.registration-name-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.registration-name-grid > div {
    display: grid;
}

.account-verification-help {
    margin-top: 14px;
}

@media (max-width: 620px) {
    .registration-name-grid {
        grid-template-columns: 1fr;
    }
}

/* MFA / two-factor authentication */
.profile-mfa-panel {
    margin-top: 16px;
}

.mfa-method-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.mfa-method-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    background: var(--surface-raised);
}

.mfa-method-card h3 {
    margin-top: 0;
}

.mfa-recovery-row {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.mfa-login-card {
    max-width: 520px;
}

.mfa-login-options {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.mfa-login-options form {
    margin: 0;
}

.mfa-setup-panel {
    max-width: 680px;
}

.mfa-qr-wrap {
    display: flex;
    justify-content: center;
    margin: 18px 0;
}

.mfa-qr {
    width: min(280px, 80vw);
    height: auto;
    background: white;
    padding: 12px;
    border-radius: 10px;
}

.mfa-manual-key {
    display: grid;
    gap: 6px;
    margin-bottom: 18px;
}

.mfa-manual-key code {
    word-break: break-all;
    font-size: 1rem;
}

.mfa-recovery-codes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 18px 0;
}

.mfa-recovery-codes code {
    display: block;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    font-size: 1rem;
}

@media (max-width: 720px) {
    .mfa-method-grid,
    .mfa-recovery-codes {
        grid-template-columns: 1fr;
    }
}

/* Mandatory MFA setup */
.mfa-required-intro {
    margin-bottom: 16px;
}

/* Hard-required MFA shell */
.mfa-required-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.mfa-required-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    background: var(--topbar-bg);
    color: var(--topbar-text);
}

.mfa-required-header-copy {
    display: grid;
    gap: 2px;
}

.mfa-required-header-copy span {
    font-size: .9rem;
    opacity: .82;
}

.mfa-required-logout-form {
    margin: 0;
}

.mfa-required-content {
    width: min(980px, calc(100% - 28px));
    margin: 0 auto;
    padding: 24px 0 40px;
}

.mfa-required-content .mfa-required-intro,
.mfa-required-content .profile-mfa-panel {
    margin-left: auto;
    margin-right: auto;
}

/* Settings sections inside the existing application sidebar */
.sidebar-settings-menu {
    margin: 2px 0;
}

.sidebar-settings-menu > summary {
    list-style: none;
}

.sidebar-settings-menu > summary::-webkit-details-marker {
    display: none;
}

.sidebar-settings-summary {
    cursor: pointer;
    user-select: none;
}

.sidebar-settings-chevron {
    margin-left: auto;
    color: var(--experience-rail-muted);
    font-size: 18px;
    line-height: 1;
    transition: transform .16s ease, color .16s ease;
}

.sidebar-settings-menu[open] .sidebar-settings-chevron {
    transform: rotate(90deg);
    color: #fff;
}

.sidebar-settings-submenu {
    margin: 2px 0 7px 17px;
    padding: 3px 0 3px 10px;
    border-left: 1px solid rgba(255,255,255,.10);
}

.sidebar-settings-subgroup-label {
    margin: 8px 8px 3px;
    color: var(--experience-rail-muted);
    font-size: 8px;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.sidebar-settings-subgroup-label:first-child {
    margin-top: 3px;
}

.sidebar-settings-child {
    display: block;
    margin: 1px 3px;
    padding: 5px 8px;
    border-radius: 8px;
    color: #aebbc7;
    font-size: 10.5px;
    font-weight: 620;
    line-height: 1.2;
    text-decoration: none;
    transition: background .14s ease, color .14s ease, transform .14s ease;
}

.sidebar-settings-child:hover,
.sidebar-settings-child:focus-visible {
    color: #fff;
    background: rgba(255,255,255,.055);
    text-decoration: none;
    transform: translateX(1px);
    outline: none;
}

.sidebar-settings-child.is-active {
    color: #fff;
    background: color-mix(in srgb, var(--primary) 28%, transparent);
    box-shadow: inset 2px 0 0 var(--primary);
    font-weight: 760;
}

.settings-section {
    scroll-margin-top: 76px;
}

.settings-section[hidden] {
    display: none !important;
}

.settings-section.is-active {
    animation: settings-section-enter .12s ease-out;
}

@keyframes settings-section-enter {
    from { opacity: .65; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
}

.settings-form-actions {
    position: sticky;
    bottom: 0;
    z-index: 8;
    margin-top: 12px;
    padding: 8px;
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    backdrop-filter: blur(5px);
}

.email-delivery-option-panel {
    margin-top: 10px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-alt);
}

.email-delivery-option-panel[hidden] {
    display: none !important;
}

.email-delivery-option-panel h3 {
    margin-top: 0;
    font-size: 14px;
}

.email-delivery-mode-status {
    margin-top: 4px;
    font-weight: 650;
}

.settings-section.maintenance-block {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

@media (max-width: 780px) {
    .sidebar-settings-submenu {
        margin-left: 12px;
    }

    .sidebar-settings-child {
        min-height: 30px;
        padding-top: 7px;
        padding-bottom: 7px;
    }
}

/* Device PIN profile controls */
.profile-pin-panel {
    scroll-margin-top: 76px;
}

.profile-pin-status-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.profile-pin-current-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-pin-current-control input {
    width: 128px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: .12em;
}

.profile-pin-current-control form,
.profile-pin-remove-form {
    margin: 0;
}

.profile-pin-update-form {
    margin-top: 8px;
}

.profile-pin-remove-form {
    margin-top: 10px;
}

@media (max-width: 620px) {
    .profile-pin-status-row,
    .profile-pin-current-control {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-pin-current-control input {
        width: 100%;
    }
}


/* Web Chat - Phase 1 */
.chat-unread-badge {
    min-width: 20px;
    height: 20px;
    margin-left: auto;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
}

.chat-unread-badge.is-empty,
.chat-thread-unread.is-empty {
    display: none;
}

.chat-unread-badge-menu {
    margin-left: auto;
}

.chat-page-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
}

.chat-heading-unread {
    min-width: 82px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    background: var(--surface-alt);
    text-align: center;
}

.chat-heading-unread span {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.chat-heading-unread strong {
    display: block;
    margin-top: 2px;
    font-size: 22px;
}

.chat-workspace {
    display: grid;
    grid-template-columns: minmax(270px, 340px) minmax(0, 1fr);
    min-height: 620px;
    margin-top: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}

.chat-thread-panel {
    min-width: 0;
    border-right: 1px solid var(--line);
    background: var(--surface-alt);
}

.chat-start-panel {
    padding: 16px;
    border-bottom: 1px solid var(--line);
}

.chat-start-panel h2,
.chat-section-heading h2 {
    margin: 0;
    font-size: 14px;
}

.chat-start-form {
    margin-top: 12px;
}

.chat-start-form label {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.chat-start-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
}

.chat-start-row select {
    min-width: 0;
}

.chat-thread-list-section {
    padding: 12px 0;
}

.chat-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 8px;
}

.chat-section-heading > span {
    color: var(--muted);
    font-size: 11px;
}

.chat-thread-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 7px;
}

.chat-thread-item {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: var(--radius-small);
    color: var(--text);
    text-decoration: none;
}

.chat-thread-item:hover,
.chat-thread-item:focus-visible {
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    border-color: color-mix(in srgb, var(--primary) 30%, var(--line));
    outline: none;
}

.chat-thread-item.is-selected {
    background: color-mix(in srgb, var(--primary) 14%, var(--surface));
    border-color: color-mix(in srgb, var(--primary) 48%, var(--line));
}

.chat-thread-item.has-unread .chat-thread-copy strong {
    font-weight: 850;
}

.chat-thread-type {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--primary) 18%, var(--surface));
    color: var(--primary);
    font-size: 11px;
}

.chat-thread-copy {
    min-width: 0;
}

.chat-thread-copy strong,
.chat-thread-copy small,
.chat-thread-copy > span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-thread-copy strong {
    font-size: 12px;
}

.chat-thread-copy small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 9px;
}

.chat-thread-copy > span {
    margin-top: 4px;
    color: color-mix(in srgb, var(--text) 72%, var(--muted));
    font-size: 10px;
}

.chat-thread-meta {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    align-items: end;
    justify-content: space-between;
    gap: 5px;
}

.chat-thread-meta time {
    color: var(--muted);
    font-size: 8px;
    white-space: nowrap;
}

.chat-thread-unread {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
}

.chat-empty-list {
    padding: 18px 12px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
}

.chat-conversation-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--surface);
}

.chat-conversation-empty {
    margin: auto;
    max-width: 520px;
    padding: 40px 28px;
    color: var(--muted);
    text-align: center;
}

.chat-empty-icon {
    display: block;
    margin-bottom: 12px;
    font-size: 42px;
    color: var(--primary);
}

.chat-conversation-empty h2 {
    margin: 0 0 6px;
    color: var(--text);
}

.chat-conversation-empty p {
    margin: 0 0 14px;
}

.chat-conversation-empty small {
    display: block;
    line-height: 1.55;
}

.chat-conversation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-alt);
}

.chat-conversation-header h2 {
    margin: 2px 0 0;
    font-size: 17px;
}

.chat-conversation-header p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 10px;
}

.chat-participants {
    max-width: 45%;
    text-align: right;
}

.chat-participants span,
.chat-participants strong {
    display: block;
}

.chat-participants span {
    color: var(--muted);
    font-size: 8px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.chat-participants strong {
    margin-top: 2px;
    overflow: hidden;
    color: var(--text);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-message-list {
    flex: 1 1 auto;
    min-height: 420px;
    max-height: calc(100vh - 330px);
    overflow-y: auto;
    padding: 18px;
}

.chat-no-messages {
    padding: 35px 20px;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}

.chat-message {
    display: flex;
    margin: 0 0 10px;
}

.chat-message.is-own {
    justify-content: flex-end;
}

.chat-message.is-other {
    justify-content: flex-start;
}

.chat-message-bubble {
    max-width: min(72%, 760px);
    padding: 9px 11px 7px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-alt);
    box-shadow: 0 3px 12px rgba(0, 0, 0, .08);
}

.chat-message.is-own .chat-message-bubble {
    border-color: color-mix(in srgb, var(--primary) 50%, var(--line));
    background: color-mix(in srgb, var(--primary) 14%, var(--surface));
}

.chat-message-author {
    margin-bottom: 4px;
    color: var(--primary);
    font-size: 9px;
    font-weight: 800;
}

.chat-message-body {
    color: var(--text);
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.chat-message-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    margin-top: 5px;
    color: var(--muted);
    font-size: 8px;
}

.chat-message-read-status {
    color: color-mix(in srgb, var(--primary) 78%, var(--text));
    font-weight: 750;
}

.chat-compose-form {
    padding: 12px 14px 14px;
    border-top: 1px solid var(--line);
    background: var(--surface-alt);
}

.chat-compose-form textarea {
    width: 100%;
    min-height: 72px;
    resize: vertical;
}

.chat-compose-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 7px;
}

.chat-send-status {
    flex: 1 1 auto;
    color: var(--danger);
    font-size: 10px;
}

.chat-character-count {
    color: var(--muted);
    font-size: 9px;
}

@media (max-width: 900px) {
    .chat-workspace {
        grid-template-columns: 1fr;
    }

    .chat-thread-panel {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .chat-thread-list {
        max-height: 300px;
        overflow-y: auto;
    }

    .chat-message-list {
        max-height: none;
        min-height: 380px;
    }
}

@media (max-width: 620px) {
    .chat-page-heading,
    .chat-conversation-header {
        align-items: stretch;
        flex-direction: column;
    }

    .chat-heading-unread {
        align-self: flex-start;
    }

    .chat-start-row {
        grid-template-columns: 1fr;
    }

    .chat-participants {
        max-width: 100%;
        text-align: left;
    }

    .chat-message-bubble {
        max-width: 88%;
    }
}


/* Administrator user impersonation */
.impersonation-banner {
    position: sticky;
    top: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem 1rem;
    border-bottom: 1px solid var(--warning);
    background: var(--surface-strong);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
}

.impersonation-banner-copy {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.impersonation-banner-copy > strong {
    color: var(--warning);
}

.impersonation-banner-copy > span {
    color: var(--text);
    font-size: .9rem;
}

.impersonation-stop-form {
    flex: 0 0 auto;
    margin: 0;
}

.chat-impersonation-dialog {
    width: min(540px, calc(100vw - 2rem));
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 0;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
}

.chat-impersonation-dialog::backdrop {
    background: rgba(0, 0, 0, .72);
}

.chat-impersonation-dialog-body {
    padding: 1.4rem;
}

.chat-impersonation-dialog-body h2 {
    margin-top: 0;
}

.chat-impersonation-dialog-body .button {
    margin-top: .5rem;
}

@media (max-width: 760px) {
    .impersonation-banner {
        align-items: stretch;
        flex-direction: column;
    }

    .impersonation-stop-form .button {
        width: 100%;
    }
}

/* Goon Chat Phase 2 */
.chat-heading-actions {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.chat-search-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(180px, auto) auto auto;
    gap: .65rem;
    margin-bottom: .85rem;
}
.chat-search-bar input,
.chat-search-bar select,
.chat-control-menu select,
.chat-edit-dialog textarea {
    width: 100%;
}
.chat-search-results {
    margin-bottom: .85rem;
    border: 1px solid var(--border-color, rgba(255,255,255,.12));
    border-radius: 12px;
    padding: .55rem;
    max-height: 280px;
    overflow: auto;
}
.chat-search-result {
    display: grid;
    gap: .2rem;
    padding: .65rem .75rem;
    border-radius: 9px;
    text-decoration: none;
}
.chat-search-result:hover { background: rgba(255,255,255,.06); }
.chat-search-result span { opacity: .78; }
.chat-conversation-controls details { position: relative; }
.chat-conversation-controls summary { cursor: pointer; list-style: none; }
.chat-control-menu {
    position: absolute;
    z-index: 30;
    right: 0;
    top: calc(100% + .35rem);
    min-width: 250px;
    padding: .75rem;
    display: grid;
    gap: .6rem;
    background: var(--panel-color, #171717);
    border: 1px solid var(--border-color, rgba(255,255,255,.14));
    border-radius: 12px;
    box-shadow: 0 14px 35px rgba(0,0,0,.35);
}
.chat-control-menu form { display: grid; gap: .4rem; }
.chat-control-menu button {
    width: 100%;
    text-align: left;
    border: 0;
    border-radius: 8px;
    padding: .55rem .65rem;
    cursor: pointer;
}
.chat-participants-phase2 { display: block; padding: .65rem 1rem; }
.chat-presence-list { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .4rem; }
.chat-presence-person {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .5rem;
    border-radius: 999px;
    background: rgba(255,255,255,.05);
}
.chat-presence-person i {
    display: inline-block;
    width: .55rem;
    height: .55rem;
    border-radius: 50%;
    background: #777;
}
.chat-presence-person.is-online i { background: #38c172; box-shadow: 0 0 0 3px rgba(56,193,114,.12); }
.chat-presence-person small { opacity: .68; }
.chat-typing {
    min-height: 1.35rem;
    padding: .2rem 1rem;
    font-size: .85rem;
    opacity: .75;
    font-style: italic;
}
.chat-message.is-deleted .chat-message-body { opacity: .62; font-style: italic; }
.chat-message-actions { display: inline-flex; gap: .35rem; }
.chat-message-actions button {
    border: 0;
    background: transparent;
    padding: 0;
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
    color: inherit;
    opacity: .72;
}
.chat-edited { opacity: .64; }
.chat-attachments { display: grid; gap: .4rem; margin-top: .55rem; }
.chat-attachment {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    align-items: center;
    gap: .5rem;
    border: 1px solid rgba(255,255,255,.12);
    padding: .5rem .6rem;
    border-radius: 9px;
    text-decoration: none;
    background: rgba(255,255,255,.04);
}
.chat-attachment strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-attachment small { opacity: .68; }
.chat-file-button { cursor: pointer; }
.chat-attachment-name { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .68; font-size: .84rem; }
.chat-edit-dialog {
    width: min(620px, calc(100vw - 2rem));
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 14px;
    padding: 0;
    background: var(--panel-color, #181818);
    color: inherit;
}
.chat-edit-dialog::backdrop { background: rgba(0,0,0,.68); }
.chat-edit-dialog-body { display: grid; gap: .8rem; padding: 1rem; }

@media (max-width: 900px) {
    .chat-search-bar { grid-template-columns: 1fr; }
    .chat-heading-actions { justify-content: flex-start; }
    .chat-control-menu { right: auto; left: 0; }
}

/* Goon Chat Phase 2 - notification preferences, image previews, unread navigation and admin moderation */
.chat-notification-preferences { position: relative; }
.chat-notification-preferences > summary { list-style: none; cursor: pointer; }
.chat-notification-preferences > summary::-webkit-details-marker { display: none; }
.chat-preferences-menu {
    position: absolute;
    right: 0;
    z-index: 40;
    min-width: 310px;
    margin-top: .5rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    background: var(--surface);
    box-shadow: 0 18px 45px rgba(0,0,0,.28);
    display: grid;
    gap: .65rem;
}
.chat-preferences-menu label { display: flex; gap: .55rem; align-items: center; }
.chat-first-unread-link { text-align: center; padding: .35rem .75rem; }
.chat-first-unread-link a { font-size: .88rem; font-weight: 700; }
.chat-unread-divider { display: flex; align-items: center; gap: .75rem; margin: .9rem 0; color: var(--accent); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.chat-unread-divider::before, .chat-unread-divider::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .55; }
.chat-attachment-wrap { display: grid; gap: .4rem; max-width: min(420px, 100%); }
.chat-image-preview-link { display: block; overflow: hidden; border-radius: var(--radius-small); border: 1px solid var(--line); background: var(--surface-alt); }
.chat-image-preview { display: block; width: 100%; max-height: 320px; object-fit: contain; background: rgba(0,0,0,.2); }
.chat-admin-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.chat-admin-stat { display: grid; gap: .2rem; }
.chat-admin-stat > span, .chat-admin-stat > small { color: var(--muted); }
.chat-admin-stat > strong { font-size: 1.8rem; }
.chat-history-details { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: .45rem 1rem; }
.chat-history-details dt { font-weight: 800; color: var(--muted); }
.chat-history-details dd { margin: 0; }
.chat-history-body { white-space: pre-wrap; margin-top: 1rem; padding: 1rem; border-radius: var(--radius-small); background: var(--surface-alt); }
.chat-edit-history-list { display: grid; gap: 1rem; }
.chat-edit-history-entry { border: 1px solid var(--line); border-radius: var(--radius-small); padding: 1rem; }
.chat-edit-history-entry header { margin-bottom: .75rem; color: var(--muted); }
.chat-edit-history-entry > div { display: grid; grid-template-columns: 70px 1fr; gap: .7rem; align-items: start; }
.chat-edit-history-entry > div + div { margin-top: .65rem; }
.chat-edit-history-entry span { font-weight: 800; color: var(--muted); }
.chat-edit-history-entry p { margin: 0; white-space: pre-wrap; }
.button-row.compact { gap: .4rem; flex-wrap: wrap; }
@media (max-width: 700px) {
    .chat-preferences-menu { position: fixed; left: 1rem; right: 1rem; top: 5rem; min-width: 0; }
    .chat-history-details, .chat-edit-history-entry > div { grid-template-columns: 1fr; }
}

/* Goon Chat modernized workspace refresh */
.goon-chat-page {
    display: grid;
    gap: 14px;
}

.goon-chat-masthead {
    display: grid;
    grid-template-columns: minmax(220px, 320px) minmax(280px, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, color-mix(in srgb, var(--surface-alt) 92%, black), var(--surface));
}

.goon-chat-branding {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.goon-chat-brand-mark,
.goon-chat-header-avatar,
.goon-chat-message-avatar,
.goon-chat-thread-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 850;
}

.goon-chat-brand-mark {
    width: 48px;
    height: 48px;
    border: 2px solid color-mix(in srgb, var(--primary) 72%, var(--line));
    background: color-mix(in srgb, var(--primary) 14%, var(--surface));
    color: var(--primary);
    font-size: 22px;
}

.goon-chat-brand-kicker {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.goon-chat-brand-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.goon-chat-brand-title-row h1 {
    margin: 0;
    font-size: 34px;
}

.goon-chat-phase-badge {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-alt);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.goon-chat-top-search input,
.goon-chat-thread-filter {
    width: 100%;
}

.goon-chat-top-search input {
    height: 52px;
    padding-left: 18px;
    border-radius: 16px;
    font-size: 16px;
}

.goon-chat-masthead-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.goon-chat-unread-pill {
    min-width: 90px;
    background: color-mix(in srgb, var(--surface-alt) 88%, black);
}

.goon-chat-watch-link {
    white-space: nowrap;
}

.goon-chat-page .chat-search-bar {
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr) repeat(2, minmax(150px, 180px)) minmax(160px, 190px) auto auto;
    gap: 10px;
    margin-bottom: 0;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--primary) 40%, var(--line));
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--surface) 92%, black);
}

.goon-chat-page.is-filters-collapsed .chat-search-bar {
    grid-template-columns: auto;
}

.goon-chat-page.is-filters-collapsed .chat-search-bar > :not([data-chat-toggle-filters]) {
    display: none;
}

.goon-chat-filter-toggle {
    white-space: nowrap;
}

.goon-chat-page .chat-search-results {
    margin-bottom: 0;
    background: color-mix(in srgb, var(--surface-alt) 90%, black);
}

.chat-workspace {
    display: grid;
    grid-template-columns: 68px minmax(320px, 380px) minmax(0, 1fr);
    min-height: 760px;
    margin-top: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, black), color-mix(in srgb, var(--surface-alt) 84%, black));
}

.goon-chat-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 10px;
    border-right: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-alt) 95%, black);
}

.goon-chat-rail-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: var(--muted);
    text-decoration: none;
    border: 1px solid transparent;
    background: transparent;
    font-size: 18px;
}

.goon-chat-rail-item:hover,
.goon-chat-rail-item:focus-visible,
.goon-chat-rail-item.is-active {
    color: var(--primary);
    border-color: color-mix(in srgb, var(--primary) 35%, var(--line));
    background: color-mix(in srgb, var(--primary) 10%, var(--surface));
    outline: none;
}

.goon-chat-rail-item.is-static {
    cursor: default;
}

.goon-chat-rail-spacer {
    flex: 1 1 auto;
}

.goon-chat-sidebar {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-right: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-alt) 90%, black);
}

.goon-chat-start-panel {
    padding: 18px;
}

.goon-chat-sidebar-heading h2 {
    margin: 4px 0 0;
    font-size: 28px;
}

.goon-chat-sidebar .chat-start-form {
    margin-top: 16px;
}

.goon-chat-sidebar .chat-start-form label {
    margin-bottom: 8px;
    font-size: 12px;
    letter-spacing: .03em;
}

.goon-chat-sidebar .chat-start-row {
    gap: 10px;
}

.goon-chat-list-header {
    align-items: end;
    gap: 10px;
    padding-top: 4px;
}

.goon-chat-list-header > div {
    display: grid;
    gap: 2px;
}

.goon-chat-list-header > div span {
    color: var(--muted);
    font-size: 11px;
}

.goon-chat-thread-filter {
    max-width: 180px;
    height: 38px;
    border-radius: 12px;
}

.chat-thread-list {
    padding: 0 10px 12px;
    overflow-y: auto;
}

.chat-thread-item {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    background: transparent;
}

.goon-chat-thread-avatar {
    width: 44px;
    height: 44px;
    background: color-mix(in srgb, var(--primary) 18%, var(--surface));
    color: var(--primary);
    font-size: 16px;
}

.chat-thread-item .chat-thread-copy small {
    font-size: 10px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.chat-thread-item .chat-thread-copy strong {
    margin-top: 3px;
    font-size: 20px;
    font-weight: 800;
}

.chat-thread-item .chat-thread-copy > span {
    margin-top: 6px;
    font-size: 13px;
}

.chat-thread-meta time {
    font-size: 11px;
}

.chat-thread-unread {
    min-width: 22px;
    height: 22px;
    font-size: 11px;
}

.chat-thread-unread.is-empty {
    visibility: hidden;
}

.goon-chat-phase-card {
    margin: auto 16px 16px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(0,0,0,.16));
}

.goon-chat-phase-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.goon-chat-phase-card-head strong {
    font-size: 13px;
}

.goon-chat-phase-card-head span,
.goon-chat-phase-card p {
    color: var(--muted);
}

.goon-chat-phase-card p {
    margin: 0;
    font-size: 12px;
    line-height: 1.55;
}

.goon-chat-main-panel {
    background: linear-gradient(180deg, rgba(0,0,0,.08), transparent 220px), var(--surface);
}

.goon-chat-empty-state {
    max-width: 620px;
}

.goon-chat-conversation-header {
    align-items: center;
    padding: 18px 20px;
    background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
}

.goon-chat-conversation-person {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.goon-chat-header-avatar {
    width: 52px;
    height: 52px;
    background: color-mix(in srgb, var(--primary) 18%, var(--surface));
    color: var(--primary);
    font-size: 18px;
}

.goon-chat-conversation-header h2 {
    margin: 3px 0 0;
    font-size: 34px;
    line-height: 1.05;
}

.goon-chat-conversation-header p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 15px;
}

.goon-chat-conversation-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.chat-participants-phase2 {
    padding: 12px 20px 4px;
}

.chat-presence-list {
    gap: 8px;
}

.chat-presence-person {
    padding: 8px 12px;
    border: 1px solid color-mix(in srgb, var(--line) 75%, transparent);
    background: color-mix(in srgb, var(--surface-alt) 80%, black);
}

.chat-typing {
    padding: 8px 20px 0;
    min-height: 26px;
}

.chat-message-list {
    min-height: 480px;
    max-height: calc(100vh - 390px);
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.goon-chat-day-divider,
.chat-unread-divider {
    margin: 0;
}

.goon-chat-day-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.goon-chat-day-divider span {
    display: inline-flex;
    padding: 0 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface-alt) 90%, black);
    height: 28px;
    align-items: center;
}

.chat-message {
    align-items: flex-end;
    gap: 10px;
    margin: 0;
}

.goon-chat-message-avatar {
    width: 38px;
    height: 38px;
    margin-bottom: 6px;
    background: color-mix(in srgb, var(--surface-alt) 65%, white);
    color: var(--surface);
    font-size: 13px;
}

.chat-message-bubble {
    max-width: min(72%, 760px);
    padding: 12px 14px 10px;
    border-radius: 18px;
    background: color-mix(in srgb, var(--surface-alt) 94%, black);
}

.chat-message.is-own .chat-message-bubble {
    background: color-mix(in srgb, var(--primary) 20%, var(--surface));
}

.chat-message-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.chat-message-meta-row time {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

.chat-message-author {
    margin-bottom: 0;
    color: var(--text);
    font-size: 14px;
}

.chat-message-body {
    font-size: 15px;
    line-height: 1.5;
}

.chat-message-footer {
    gap: 8px;
    margin-top: 8px;
    justify-content: flex-end;
    font-size: 11px;
}

.chat-message-actions button {
    text-decoration: none;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(255,255,255,.06);
}

.chat-attachments {
    gap: 8px;
    margin-top: 12px;
}

.chat-compose-form {
    padding: 16px 20px 20px;
    background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(0,0,0,.10));
}

.chat-compose-form textarea {
    min-height: 78px;
    border-radius: 16px;
    padding: 14px 16px;
    font-size: 15px;
}

.chat-compose-actions {
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.chat-send-status {
    min-width: 120px;
    font-size: 11px;
}

.chat-character-count {
    font-size: 11px;
}

@media (max-width: 1280px) {
    .goon-chat-masthead {
        grid-template-columns: 1fr;
    }

    .goon-chat-masthead-actions {
        justify-content: flex-start;
    }

    .goon-chat-page .chat-search-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .chat-workspace {
        grid-template-columns: 1fr;
    }

    .goon-chat-rail {
        flex-direction: row;
        justify-content: flex-start;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .goon-chat-rail-spacer {
        display: none;
    }

    .goon-chat-sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .chat-message-list {
        max-height: none;
    }
}

@media (max-width: 700px) {
    .goon-chat-page .chat-search-bar {
        grid-template-columns: 1fr;
    }

    .goon-chat-brand-title-row h1,
    .goon-chat-conversation-header h2 {
        font-size: 28px;
    }

    .chat-thread-item .chat-thread-copy strong {
        font-size: 17px;
    }

    .chat-message-bubble {
        max-width: 92%;
    }

    .chat-compose-actions {
        align-items: flex-start;
    }
}

/* Goon Chat mockup alignment refinements */
.goon-chat-shell {
    display: grid;
    gap: 12px;
}

.goon-chat-masthead {
    grid-template-columns: minmax(320px, auto) minmax(360px, 1fr) auto;
    padding: 10px 16px;
}

.goon-chat-masthead-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.goon-chat-branding {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.goon-chat-brand-copy {
    display: grid;
    gap: 1px;
}

.goon-chat-brand-copy strong {
    font-size: 22px;
    line-height: 1.05;
}

.goon-chat-phase-select {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 46px;
    padding: 0 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface-alt);
    color: var(--text);
    font: inherit;
    cursor: default;
}

.goon-chat-top-search {
    position: relative;
}

.goon-chat-top-search .goon-chat-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 16px;
}

.goon-chat-top-search input {
    padding-left: 42px;
}

.goon-chat-icon-button,
.goon-chat-square-button,
.goon-chat-send-button,
.goon-chat-compose-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-alt) 90%, black);
    color: var(--text);
}

.goon-chat-icon-button,
.goon-chat-user-chip {
    width: 46px;
    height: 46px;
    border-radius: 14px;
}

.goon-chat-user-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 82%, black);
    font-weight: 800;
}

.goon-chat-icon-button.small {
    width: 32px;
    height: 32px;
    border-radius: 10px;
}

.goon-chat-top-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.goon-chat-top-actions .button,
.goon-chat-top-actions form {
    margin: 0;
}

.goon-chat-page .chat-search-bar {
    grid-template-columns: auto minmax(180px, 1.3fr) minmax(160px, 1fr) repeat(2, minmax(150px, .8fr)) minmax(180px, .9fr) auto;
    padding: 10px 12px;
}

.goon-chat-page .chat-search-bar input,
.goon-chat-page .chat-search-bar select,
.goon-chat-page .chat-search-bar button {
    height: 42px;
    border-radius: 12px;
}

.chat-workspace {
    grid-template-columns: 60px 390px minmax(0, 1fr);
    min-height: 820px;
}

.goon-chat-rail {
    gap: 8px;
    padding: 14px 8px;
}

.goon-chat-rail-item {
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

.goon-chat-sidebar {
    padding: 0;
}

.goon-chat-sidebar-hero {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 18px 22px 16px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.goon-chat-sidebar-hero-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: color-mix(in srgb, var(--primary) 14%, var(--surface));
    color: var(--primary);
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--line));
}

.goon-chat-sidebar-hero h1 {
    margin: 0;
    font-size: 24px;
    line-height: 1.1;
}

.goon-chat-sidebar-hero p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.goon-chat-start-panel {
    padding: 14px 22px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.goon-chat-start-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.goon-chat-start-card-head h2 {
    margin: 0;
    font-size: 16px;
}

.goon-chat-sidebar .chat-start-form + .chat-start-form {
    margin-top: 12px;
}

.goon-chat-sidebar .chat-start-form label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.chat-start-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 10px;
}

.goon-chat-square-button {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 16px;
}

.goon-chat-list-header {
    padding: 14px 22px 12px;
    margin: 0;
}

.goon-chat-list-header h2 {
    margin: 0;
    font-size: 14px;
}

.goon-chat-list-header span {
    color: var(--muted);
    font-weight: 700;
    font-size: 12px;
}

.chat-thread-list {
    padding: 0 12px 12px;
}

.chat-thread-item {
    align-items: center;
    min-height: 76px;
}

.chat-thread-item.is-selected {
    background: rgba(255,255,255,.06);
}

.chat-thread-item .chat-thread-copy strong {
    font-size: 15px;
    line-height: 1.2;
}

.chat-thread-item .chat-thread-copy > span {
    color: var(--muted);
    line-height: 1.3;
}

.chat-conversation-panel {
    display: flex;
    flex-direction: column;
}

.goon-chat-conversation-header {
    border-bottom: 1px solid rgba(255,255,255,.06);
    padding: 14px 18px;
}

.goon-chat-conversation-person h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 19px;
}

.goon-chat-title-star {
    color: var(--muted);
    font-size: 18px;
}

.goon-chat-conversation-person p {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 4px 0 0;
    font-size: 13px;
}

.goon-chat-online-dot {
    width: 9px;
    height: 9px;
    margin-right: 6px;
    border-radius: 50%;
    background: #33cc66;
    display: inline-block;
}

.goon-chat-day-divider {
    padding: 10px 18px 0;
}

.chat-message-list {
    flex: 1 1 auto;
    max-height: none;
    min-height: 420px;
    padding-top: 12px;
}

.chat-message {
    max-width: 100%;
}

.chat-message.is-own {
    justify-content: flex-end;
}

.chat-message.is-own .chat-message-bubble {
    margin-left: auto;
}

.chat-message.is-other .chat-message-bubble {
    margin-right: auto;
}

.chat-message-bubble {
    border-radius: 14px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}

.chat-message.is-own .chat-message-bubble {
    background: color-mix(in srgb, var(--primary) 24%, var(--surface));
}

.chat-compose-form {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,.06);
}

.chat-compose-form textarea {
    min-height: 72px;
    resize: vertical;
}

.goon-chat-compose-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 15px;
    cursor: pointer;
}

.goon-chat-send-button {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    margin-left: auto;
    background: color-mix(in srgb, var(--primary) 16%, var(--surface-alt));
    color: var(--primary);
}

.goon-chat-conversation-menu > summary {
    list-style: none;
    cursor: pointer;
}

.goon-chat-conversation-menu > summary::-webkit-details-marker {
    display: none;
}

@media (max-width: 1400px) {
    .goon-chat-top-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 1200px) {
    .goon-chat-masthead {
        grid-template-columns: 1fr;
    }

    .chat-workspace {
        grid-template-columns: 60px 320px minmax(0, 1fr);
    }
}

@media (max-width: 1024px) {
    .chat-workspace {
        grid-template-columns: 1fr;
    }

    .goon-chat-page .chat-search-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .goon-chat-masthead-left,
    .goon-chat-masthead-actions,
    .goon-chat-top-actions {
        flex-wrap: wrap;
    }

    .goon-chat-page .chat-search-bar {
        grid-template-columns: 1fr;
    }
}

/* Keep the impersonated user's account/menu trigger visible on the Viewing Menu. */
.view-only-shell .desktop-media-bar.viewing-menu-floating-account-bar.impersonation-account-bar {
    top: calc(var(--impersonation-banner-height, 68px) + 8px);
    z-index: 1190;
}

.view-only-account-menu.impersonation-target-account .view-only-account-trigger {
    position: relative;
    border-color: color-mix(in srgb, var(--warning) 72%, var(--line));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--warning) 18%, transparent), 0 8px 24px rgba(0,0,0,.24);
}

.view-only-account-menu.impersonation-target-account .view-only-account-trigger::after {
    content: "";
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 10px;
    height: 10px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: var(--warning);
}

@media (max-width: 560px) {
    .view-only-shell .desktop-media-bar.viewing-menu-floating-account-bar.impersonation-account-bar {
        top: calc(var(--impersonation-banner-height, 92px) + 6px);
    }
}

/* Administrator top-right Settings landing list */
.settings-menu-page-heading {
    align-items: end;
}

.settings-menu-page {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.settings-menu-page-group {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, color-mix(in srgb, var(--surface-alt) 94%, black), var(--surface));
}

.settings-menu-page-group h2 {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.settings-menu-page-links {
    display: grid;
    gap: 7px;
}

.settings-menu-page-links > a {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 12px 13px;
    border: 1px solid transparent;
    border-radius: var(--radius-small);
    color: var(--text);
    text-decoration: none;
    background: color-mix(in srgb, var(--surface-alt) 72%, transparent);
    transition: background .12s ease, border-color .12s ease, transform .12s ease;
}

.settings-menu-page-links > a:hover,
.settings-menu-page-links > a:focus-visible {
    border-color: color-mix(in srgb, var(--primary) 45%, var(--line));
    background: color-mix(in srgb, var(--primary) 10%, var(--surface-alt));
    transform: translateX(2px);
    outline: none;
}

.settings-menu-page-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: color-mix(in srgb, var(--primary) 14%, var(--surface));
    color: var(--primary);
    font-size: 16px;
    font-weight: 850;
}

.settings-menu-page-links strong,
.settings-menu-page-links small {
    display: block;
}

.settings-menu-page-links strong {
    font-size: 14px;
}

.settings-menu-page-links small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

.settings-menu-page-chevron {
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
}

@media (max-width: 900px) {
    .settings-menu-page {
        grid-template-columns: 1fr;
    }
}

/* Theme manager preview and transfer tools */
.theme-manager-picker {
    align-items: end;
    gap: 1rem;
}
.theme-picker-form {
    margin: .35rem 0 0;
}
.theme-picker-form select {
    width: min(520px, 100%);
}
.theme-edit-status {
    margin-top: .55rem;
}
.theme-transfer-zone {
    margin: 1rem 0 1.35rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    background: var(--surface-alt);
}
.theme-transfer-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.theme-transfer-heading-row h2 {
    margin: 0 0 .3rem;
}
.theme-transfer-heading-row p {
    margin: 0;
    max-width: 850px;
}
.theme-import-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}
.theme-import-form input[type="file"] {
    width: 100%;
}
@media (max-width: 700px) {
    .theme-import-form {
        grid-template-columns: 1fr;
    }
}

/* Theme Manager selection stability / explicit management picker */
.theme-manager-picker-v2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: end;
}

.theme-manager-picker-main {
    min-width: 0;
}

.theme-manager-picker-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.theme-manager-picker-heading h2 {
    margin: 2px 0 0;
}

.theme-manager-status-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: flex-end;
}

.theme-status-pill,
.theme-mini-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface-alt) 90%, transparent);
    color: var(--muted);
    font-size: 10px;
    font-weight: 760;
}

.theme-status-pill {
    min-height: 28px;
    padding: 4px 10px;
}

.theme-status-pill strong {
    color: var(--text);
}

.theme-status-pill.is-editing,
.theme-mini-badge.is-editing {
    border-color: color-mix(in srgb, var(--primary) 50%, var(--line));
    background: color-mix(in srgb, var(--primary) 10%, var(--surface));
    color: var(--primary);
}

.theme-picker-form-v2 {
    display: grid;
    grid-template-columns: minmax(260px, 520px) auto;
    gap: 10px;
    align-items: end;
}

.theme-picker-form-v2 label {
    display: block;
    margin-bottom: 5px;
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
}

.theme-picker-form-v2 select {
    width: 100%;
}

.theme-manager-quick-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.theme-manager-quick-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    background: color-mix(in srgb, var(--surface) 92%, var(--surface-alt));
    color: var(--text);
    text-decoration: none;
}

.theme-manager-quick-item:hover,
.theme-manager-quick-item:focus-visible {
    border-color: color-mix(in srgb, var(--primary) 55%, var(--line));
    background: color-mix(in srgb, var(--primary) 7%, var(--surface));
    text-decoration: none;
    outline: none;
}

.theme-manager-quick-item.is-current {
    border-color: color-mix(in srgb, var(--primary) 70%, var(--line));
    box-shadow: inset 3px 0 0 var(--primary);
}

.theme-manager-quick-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 800;
}

.theme-manager-quick-badges {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.theme-mini-badge {
    padding: 2px 6px;
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.theme-create-form-v2 {
    align-self: end;
}

#themePreview {
    --primary: #246B9E;
    --primary-dark: #194F77;
    --primary-soft: #E8F2F9;
    --accent: #D19822;
    --page: #F3F6F9;
    --page-top: #EEF3F7;
    --surface: #FFFFFF;
    --surface-alt: #F7F9FB;
    --surface-strong: #EDF2F6;
    --line: #CFD7DF;
    --text: #1C2733;
    --muted: #667789;
    --input-text: #1C2733;
    --input-bg: #FFFFFF;
    --topbar-bg: #FFFFFF;
    --topbar-text: #162738;
    --success: #247855;
    --warning: #9B6700;
    --danger: #A6373F;
}

#themePreview input {
    color: var(--input-text);
    background: var(--input-bg);
}

@media (max-width: 960px) {
    .theme-manager-picker-v2 {
        grid-template-columns: 1fr;
    }

    .theme-manager-picker-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .theme-manager-status-pills {
        justify-content: flex-start;
    }
}

@media (max-width: 620px) {
    .theme-picker-form-v2 {
        grid-template-columns: 1fr;
    }
}

/* Desktop left navigation collapse / expand */
.sidebar-collapse-toggle {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 9px;
    color: var(--experience-rail-muted, var(--muted));
    background: rgba(255,255,255,.035);
    font: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: color .16s ease, background .16s ease, border-color .16s ease;
}
.sidebar-collapse-toggle:hover,
.sidebar-collapse-toggle:focus-visible {
    color: #fff;
    background: rgba(255,255,255,.075);
    border-color: color-mix(in srgb, var(--primary) 42%, rgba(255,255,255,.12));
    outline: none;
}

@media (min-width: 1100px) {
    body.sidebar-collapsed .app-shell:not(.view-only-shell) {
        grid-template-columns: 72px minmax(0, 1fr);
    }
    body.sidebar-collapsed .sidebar {
        width: 72px;
    }
    body.sidebar-collapsed .sidebar-header {
        min-height: 68px;
        justify-content: center;
        padding: 10px 8px;
    }
    body.sidebar-collapsed .sidebar-brand.sidebar-brand-logo-only {
        display: none;
    }
    body.sidebar-collapsed .sidebar-collapse-toggle {
        margin: 0 auto;
    }
    body.sidebar-collapsed .sidebar-nav {
        padding-left: 8px;
        padding-right: 8px;
    }
    body.sidebar-collapsed .sidebar-nav-group {
        margin-top: 8px;
    }
    body.sidebar-collapsed .sidebar-nav-label,
    body.sidebar-collapsed .sidebar-link-copy,
    body.sidebar-collapsed .sidebar-link-badge,
    body.sidebar-collapsed .sidebar-link > span:not(.sidebar-icon):not(.chat-unread-badge),
    body.sidebar-collapsed .sidebar-user-copy,
    body.sidebar-collapsed .sidebar-signout > span + *,
    body.sidebar-collapsed .sidebar-signout:not(:has(span)) {
        display: none;
    }
    body.sidebar-collapsed .sidebar-link {
        min-height: 44px;
        justify-content: center;
        gap: 0;
        padding: 8px;
        border-radius: 12px;
    }
    body.sidebar-collapsed .sidebar-link-viewing {
        min-height: 48px;
        margin-bottom: 4px;
    }
    body.sidebar-collapsed .sidebar-link .sidebar-icon,
    body.sidebar-collapsed .sidebar-link-viewing .sidebar-icon {
        width: 28px;
        height: 28px;
        flex: 0 0 28px;
        border-radius: 9px;
        font-size: 15px;
    }
    body.sidebar-collapsed .sidebar-link-viewing .sidebar-icon {
        background: var(--primary);
        color: #fff;
    }
    body.sidebar-collapsed .chat-unread-badge {
        position: absolute;
        top: 3px;
        right: 2px;
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        font-size: 8px;
    }
    body.sidebar-collapsed .sidebar-footer {
        padding: 8px;
    }
    body.sidebar-collapsed .sidebar-user-link {
        justify-content: center;
        padding: 5px;
    }
    body.sidebar-collapsed .sidebar-user-avatar {
        margin: 0;
    }
    body.sidebar-collapsed .sidebar-signout {
        justify-content: center;
        min-height: 36px;
        padding: 5px;
        font-size: 0;
    }
    body.sidebar-collapsed .sidebar-signout > span {
        display: inline-flex;
        font-size: 16px;
    }
    body.sidebar-collapsed .sidebar-link:hover {
        transform: none;
    }
}

@media (max-width: 1099px) {
    .sidebar-collapse-toggle { display: none; }
    body.sidebar-collapsed .app-shell,
    body.sidebar-collapsed .app-shell:not(.view-only-shell) {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (min-width: 1100px) {
    .app-shell:not(.view-only-shell) {
        transition: grid-template-columns .18s ease;
    }
}


/* Viewing Menu: permanently suppress oversized decorative hero play glyph. */
.viewing-hero::after {
    content: none !important;
    display: none !important;
}

/* Compact empty user-library prompt on Viewer Menu */
.viewing-empty-library-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.viewing-empty-library-copy {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 auto;
    color: inherit;
    text-decoration: none;
}

.viewing-empty-library-copy:hover strong,
.viewing-empty-library-copy:focus-visible strong {
    color: var(--primary);
}

.viewing-empty-library-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--surface-elevated) 86%, transparent);
    color: var(--primary);
    font-size: 18px;
}

.viewing-empty-library-copy span:last-child {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.viewing-empty-library-copy strong {
    overflow: hidden;
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.viewing-empty-library-copy small {
    color: var(--text-muted);
}

.viewing-empty-library-upload-form {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    flex: 0 0 auto;
    margin: 0;
}

.viewing-empty-library-upload-pill {
    min-height: 30px;
    padding-inline: 14px;
    border-radius: 999px;
    white-space: nowrap;

    background: var(--pill-primary);
    color: var(--pill-primary-text);
    border-color: var(--pill-primary);
}

.viewing-empty-library-upload-progress {
    width: 120px;
    min-width: 100px;
}

.viewing-empty-library-upload-message {
    max-width: 180px;
    color: var(--text-muted);
    font-size: 12px;
}

.viewing-empty-library-upload-message:empty {
    display: none;
}

@media (max-width: 620px) {
    .viewing-empty-library-row {
        gap: 8px;
    }

    .viewing-empty-library-upload-progress,
    .viewing-empty-library-upload-message {
        display: none;
    }
}

@media (max-width: 900px) {
    .desktop-impersonate-form { display: none; }
}

/* SyncFiles diagnostics: keep long failed-library path/reason details readable. */
.task-result-summary {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* SQL56: compact Viewer Menu library display-order editor. */
.library-display-order-field { display:flex; align-items:center; gap:.5rem; font-size:.82rem; color:var(--muted); }
.library-display-order-field input { width:6rem; min-width:6rem; }

/* Settings usage reports */
.report-tabs { margin: 0 0 14px; }
.report-filter-panel { margin-bottom: 14px; }
.report-filter-form {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(150px, 190px) minmax(150px, 190px) auto;
    gap: 12px;
    align-items: end;
}
.report-filter-form .filter-field { min-width: 0; }
.report-filter-form label { display: block; margin-bottom: 5px; font-weight: 700; }
.report-filter-form input { width: 100%; }
.report-filter-actions { display: flex; gap: 8px; align-items: center; }
.report-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 12px;
}
.report-section-heading h2 { margin-bottom: 4px; }
.report-result-count { white-space: nowrap; color: var(--muted); }
.report-table-panel .table-wrap { overflow-x: auto; }
.report-table { min-width: 900px; }
.report-table .nowrap { white-space: nowrap; }
.report-user-agent {
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.report-summary-card { display: grid; gap: 6px; }
.report-summary-card span { color: var(--muted); font-size: 0.9rem; }
.report-summary-card strong { font-size: clamp(1.35rem, 2.4vw, 2rem); }
@media (max-width: 980px) {
    .report-filter-form { grid-template-columns: 1fr 1fr; }
    .report-search-field { grid-column: 1 / -1; }
    .report-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
    .report-filter-form { grid-template-columns: 1fr; }
    .report-search-field { grid-column: auto; }
    .report-filter-actions { flex-wrap: wrap; }
    .report-summary-grid { grid-template-columns: 1fr; }
    .report-section-heading { flex-direction: column; }
}

/* GoonTown device-location map */
.goontown-page { display: grid; gap: 1rem; }
.goontown-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.goontown-hero h1 { margin: .15rem 0 .25rem; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1; }
.goontown-lead { margin: 0; color: var(--muted); max-width: 760px; }
.goontown-status { display: inline-flex; align-items: center; min-height: 2.35rem; padding: .55rem .85rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-weight: 700; }
.goontown-status[data-state="active"] { border-color: var(--success); color: var(--success); }
.goontown-status[data-state="error"] { border-color: var(--danger); color: var(--danger); }
.goontown-toolbar { display: flex; gap: .65rem; align-items: center; flex-wrap: wrap; }
.goontown-follow-control { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.5rem; padding: .45rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-small); background: var(--surface); cursor: pointer; }
.goontown-follow-control input { width: 1.05rem; height: 1.05rem; accent-color: var(--primary); }
.goontown-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; align-items: stretch; }
.goontown-map-card, .goontown-location-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; box-shadow: 0 18px 40px rgba(0,0,0,.08); }
.goontown-map-card { position: relative; min-height: clamp(430px, 66vh, 760px); }
.goontown-map { display: block; width: 100%; height: 100%; min-height: clamp(430px, 66vh, 760px); border: 0; background: #080a0f; }
.goontown-map[hidden] { display: none; }
.goontown-map-placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .55rem; padding: 2rem; text-align: center; color: var(--muted); background: radial-gradient(circle at 50% 42%, var(--primary-soft), transparent 30%), var(--surface-alt); }
.goontown-map-placeholder[hidden] { display: none; }
.goontown-map-placeholder-icon { display: grid; place-items: center; width: 5rem; height: 5rem; border-radius: 50%; background: var(--primary); color: #fff; font-size: 2.7rem; box-shadow: 0 0 0 10px color-mix(in srgb, var(--primary) 18%, transparent); }
.goontown-location-card { padding: 1.1rem; display: flex; flex-direction: column; gap: 1rem; }
.goontown-location-card h2 { margin: 0; }
.goontown-location-details { display: grid; gap: .6rem; margin: 0; }
.goontown-location-details > div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: .65rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.goontown-location-details dt { color: var(--muted); font-size: .85rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.goontown-location-details dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.goontown-open-map { display: inline-flex; align-items: center; justify-content: center; padding: .65rem .85rem; border: 1px solid var(--line); border-radius: var(--radius-small); text-decoration: none; font-weight: 750; color: var(--text); background: var(--surface-alt); }
.goontown-open-map:hover { border-color: var(--primary); color: var(--primary); }
.goontown-privacy-note { margin-top: auto; padding: .85rem; border-radius: var(--radius-small); background: var(--surface-alt); border: 1px solid var(--line); }
.goontown-privacy-note strong { display: block; margin-bottom: .25rem; }
.goontown-privacy-note p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.45; }
@media (max-width: 900px) {
    .goontown-grid { grid-template-columns: 1fr; }
    .goontown-map-card, .goontown-map { min-height: 56vh; }
    .goontown-location-card { min-height: 0; }
}
@media (max-width: 560px) {
    .goontown-toolbar .button { flex: 1 1 9rem; }
    .goontown-follow-control { width: 100%; }
    .goontown-map-card, .goontown-map { min-height: 54vh; }
    .goontown-location-details > div { grid-template-columns: 92px minmax(0, 1fr); }
}

/* GoonTown dark vector-map refinements */
.goontown-map .maplibregl-canvas { outline: none; }
.goontown-map.is-osm-raster-fallback .maplibregl-canvas { filter: invert(.92) hue-rotate(180deg) brightness(.72) contrast(1.08) saturate(.72); }
.goontown-map .maplibregl-ctrl-group { background: rgba(15, 17, 24, .92); border: 1px solid rgba(255,255,255,.14); box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.goontown-map .maplibregl-ctrl-group button { filter: invert(1) grayscale(1); }
.goontown-map .maplibregl-ctrl-attrib { background: rgba(8, 10, 15, .78); color: #b9bcc7; }
.goontown-map .maplibregl-ctrl-attrib a { color: #cdbfff; }
.goontown-map .maplibregl-ctrl-bottom-right { max-width: 92%; }

/* 2026-08-15: Horizontal application navigation. The former left sidebar is no longer rendered. */
body.topnav-layout {
    min-width: 0;
}

body.topnav-layout .app-shell.topnav-shell {
    display: block !important;
    min-height: 100vh;
    grid-template-columns: minmax(0, 1fr) !important;
}

body.topnav-layout .topnav-app-content {
    min-width: 0;
    width: 100%;
}

.global-topnav {
    position: sticky;
    top: 0;
    z-index: 1200;
    width: 100%;
    border-bottom: 1px solid color-mix(in srgb, var(--primary) 30%, var(--line));
    background:
        linear-gradient(90deg,
            color-mix(in srgb, var(--primary-dark) 82%, #120024) 0%,
            color-mix(in srgb, var(--primary) 72%, #1a0030) 52%,
            color-mix(in srgb, var(--primary-dark) 88%, #0c0018) 100%);
    box-shadow: 0 10px 28px rgba(17, 0, 34, .22);
}

.global-topnav-inner {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-height: 72px;
    margin: 0 auto;
}

.topnav-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 210px;
    max-width: 270px;
    padding: 10px 24px;
    color: #fff;
    text-decoration: none;
    border-right: 1px solid rgba(255,255,255,.08);
}

.topnav-logo img {
    display: block;
    width: auto;
    max-width: 220px;
    max-height: 50px;
    object-fit: contain;
}

.topnav-logo-mark,
.topnav-logo-text {
    color: #fff;
    font-weight: 900;
    letter-spacing: .01em;
}

.topnav-logo-mark { font-size: 1.45rem; }
.topnav-logo-text { font-size: 1.12rem; white-space: nowrap; }

.topnav-primary {
    display: flex;
    align-items: stretch;
    justify-content: center;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}

.topnav-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 72px;
    padding: 0 28px;
    border: 0;
    border-right: 1px solid rgba(255,255,255,.055);
    background: transparent;
    color: rgba(255,255,255,.92);
    font: inherit;
    font-weight: 780;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background .16s ease, color .16s ease;
}

.topnav-item:hover,
.topnav-item:focus-visible,
.topnav-settings[open] > .topnav-settings-trigger {
    color: #fff;
    background: rgba(255,255,255,.08);
    outline: none;
}

.topnav-item.active,
.topnav-settings.active > .topnav-settings-trigger {
    color: #fff;
    background: rgba(255,255,255,.055);
}

.topnav-item.active::after,
.topnav-settings.active > .topnav-settings-trigger::after,
.topnav-settings[open] > .topnav-settings-trigger::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 0;
    height: 4px;
    border-radius: 4px 4px 0 0;
    background: color-mix(in srgb, var(--accent) 72%, #fff);
    box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 48%, transparent);
}

.topnav-settings {
    position: relative;
    display: flex;
    align-items: stretch;
    margin: 0;
}

.topnav-settings > summary {
    list-style: none;
}

.topnav-settings > summary::-webkit-details-marker { display: none; }

.topnav-popout-trigger,
.topnav-popout-trigger:hover,
.topnav-popout-trigger:focus-visible {
    text-decoration: none;
}

.topnav-popout-trigger::after {
    display: none !important;
}

.topnav-settings-mega {
    position: absolute;
    top: calc(100% + 10px);
    right: 10px;
    z-index: 1300;
    display: grid;
    grid-template-columns: repeat(3, minmax(210px, 1fr));
    gap: 0;
    width: min(860px, calc(100vw - 32px));
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
    border-radius: 16px;
    background: color-mix(in srgb, var(--surface) 97%, #fff);
    box-shadow: 0 24px 54px rgba(14, 0, 28, .34);
}

.topnav-settings-section {
    min-width: 0;
    padding: 18px;
}

.topnav-settings-section + .topnav-settings-section {
    border-left: 1px solid var(--line);
}

.topnav-settings-section h2 {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.topnav-settings-section > a {
    display: flex;
    align-items: center;
    min-height: 38px;
    margin: 2px 0;
    padding: 8px 10px;
    border-radius: 9px;
    color: var(--text);
    font-size: .91rem;
    font-weight: 680;
    text-decoration: none;
}

.topnav-settings-section > a:hover,
.topnav-settings-section > a:focus-visible {
    color: var(--primary);
    background: var(--primary-soft);
    outline: none;
}

.topnav-impersonate-form {
    display: grid;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.topnav-impersonate-form label {
    color: var(--muted);
    font-size: .74rem;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.topnav-impersonate-form select {
    width: 100%;
    min-height: 38px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--input-bg);
    color: var(--input-text);
}

.topnav-logout-form {
    display: flex;
    align-items: stretch;
    margin: 0;
}

.topnav-logout {
    min-width: 118px;
}

.topnav-page-shell {
    width: 100%;
    max-width: none;
    margin: 0;
    padding-top: clamp(24px, 3vw, 42px);
}

.topnav-impersonation-banner {
    position: sticky;
    top: 72px;
    z-index: 1150;
}

.community-placeholder-panel {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    max-width: 980px;
    padding: 26px;
}

.community-placeholder-panel h2 { margin-top: 0; }
.community-placeholder-panel p { margin-bottom: 0; color: var(--muted); line-height: 1.6; }
.community-placeholder-icon {
    display: grid;
    place-items: center;
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 1.7rem;
    font-weight: 900;
}

/* The horizontal menu replaces desktop, tablet, and mobile sidebar behavior. */
body.topnav-layout .sidebar,
body.topnav-layout .sidebar-overlay,
body.topnav-layout .mobile-appbar,
body.topnav-layout .desktop-media-bar {
    display: none !important;
}

@media (max-width: 1450px) {
    .topnav-logo { min-width: 180px; padding-inline: 18px; }
    .topnav-logo img { max-width: 184px; }
    .topnav-item { padding-inline: 18px; font-size: .93rem; }
}

@media (max-width: 1160px) {
    .global-topnav-inner {
        min-height: 64px;
        overflow-x: auto;
        overflow-y: visible;
        scrollbar-width: thin;
    }
    .topnav-logo {
        position: sticky;
        left: 0;
        z-index: 3;
        min-width: 160px;
        min-height: 64px;
        background: color-mix(in srgb, var(--primary-dark) 92%, #10001d);
        box-shadow: 8px 0 16px rgba(10,0,20,.12);
    }
    .topnav-logo img { max-width: 164px; max-height: 44px; }
    .topnav-item { min-height: 64px; padding-inline: 16px; }
    .topnav-settings-mega {
        position: fixed;
        top: 74px;
        left: 12px;
        right: 12px;
        width: auto;
        max-height: calc(100vh - 90px);
        overflow-y: auto;
    }
    .topnav-impersonation-banner { top: 64px; }
}

@media (max-width: 760px) {
    .topnav-settings-mega { grid-template-columns: 1fr; }
    .topnav-settings-section + .topnav-settings-section {
        border-left: 0;
        border-top: 1px solid var(--line);
    }
    .topnav-logo { min-width: 132px; padding-inline: 12px; }
    .topnav-logo img { max-width: 132px; }
    .topnav-item { padding-inline: 14px; font-size: .88rem; }
    .topnav-page-shell { padding-top: 20px; }
}

/* 2026-08-15 SQL63: expanded Goonstache profiles, NSFW photo libraries, and nearby profile discovery. */
.profile-page-heading { align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.profile-page-heading p { max-width: 920px; }
.profile-count-badge { display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; margin-left: .35rem; padding: 0 .35rem; border-radius: 999px; background: var(--primary); color: #fff; font-size: .75rem; font-weight: 900; }
.profile-section { padding: clamp(18px, 2.4vw, 28px); margin-bottom: 1rem; }
.profile-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.profile-section-heading h2 { margin: .1rem 0 .2rem; }
.profile-section-heading p { margin: 0; color: var(--muted); max-width: 920px; line-height: 1.5; }
.profile-photo-count { flex: 0 0 auto; padding: .35rem .6rem; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--line); color: var(--muted); font-weight: 800; }
.profile-photo-grid, .profile-album-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.profile-photo-card { display: grid; gap: .6rem; min-width: 0; }
.profile-photo-card.is-primary .profile-photo-frame { box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 42%, transparent); }
.profile-photo-frame { position: relative; overflow: hidden; aspect-ratio: 1 / 1; border-radius: 18px; background: var(--surface-alt); border: 1px solid var(--line); }
.profile-photo-frame.public { min-width: 180px; max-width: 280px; }
.profile-photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-photo-frame.is-nsfw img { filter: blur(26px) brightness(.45); transform: scale(1.08); transition: filter .18s ease, transform .18s ease; }
.profile-photo-frame.is-nsfw.is-revealed img { filter: none; transform: none; }
.profile-nsfw-cover { position: absolute; inset: 0; display: grid; place-items: center; width: 100%; border: 0; background: rgba(11, 4, 18, .44); color: #fff; font: inherit; font-weight: 900; cursor: pointer; }
.profile-photo-frame.is-revealed .profile-nsfw-cover { display: none; }
.profile-primary-badge { position: absolute; top: 10px; left: 10px; padding: .3rem .55rem; border-radius: 999px; background: rgba(18, 7, 28, .86); color: #fff; font-size: .72rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.profile-photo-actions { display: flex; gap: .45rem; flex-wrap: wrap; }
.profile-photo-actions form { margin: 0; }
.profile-photo-upload-card { display: flex; flex-direction: column; justify-content: center; gap: .75rem; min-height: 260px; padding: 1rem; border-radius: 18px; border: 1px dashed color-mix(in srgb, var(--primary) 55%, var(--line)); background: var(--surface-alt); }
.profile-photo-upload-card small, .profile-stack-form small { color: var(--muted); }
.profile-check-row { display: flex; align-items: center; gap: .45rem; color: var(--text); font-size: .9rem; font-weight: 700; line-height: 1.2; }
.profile-check-row input[type="checkbox"] { width: 16px; height: 16px; min-width: 16px; margin: 0; flex: 0 0 16px; accent-color: var(--primary); }
.profile-edit-form { display: block; }
.profile-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.profile-field-wide { grid-column: 1 / -1; }
.profile-autoaccept-card { display: flex; align-items: flex-start; gap: .7rem; margin-top: 1rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-alt); }
.profile-autoaccept-card input { margin-top: .2rem; }
.profile-autoaccept-card span { display: grid; gap: .2rem; }
.profile-autoaccept-card small { color: var(--muted); line-height: 1.4; }
.profile-kink-groups { display: grid; gap: .7rem; }
.profile-kink-group { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface-alt); }
.profile-kink-group > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; cursor: pointer; font-weight: 850; }
.profile-kink-group > summary span { color: var(--muted); font-size: .8rem; }
.profile-kink-table-wrap, .profile-admin-table-wrap { overflow: auto; max-width: 100%; }
.profile-kink-table, .profile-reference-admin table { width: 100%; border-collapse: collapse; }
.profile-kink-table th, .profile-kink-table td, .profile-reference-admin th, .profile-reference-admin td { padding: .7rem .8rem; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.profile-kink-table th:not(:first-child), .profile-kink-table td:not(:first-child) { width: 110px; text-align: center; }
.profile-kink-table td strong { display: block; }
.profile-kink-table td small { display: block; margin-top: .18rem; color: var(--muted); line-height: 1.35; }
.profile-kink-table input[type="radio"] { width: 1.1rem; height: 1.1rem; }
.profile-reference-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; }
.profile-reference-card { display: grid; gap: .4rem; padding: .9rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-alt); }
.profile-reference-card > span, .profile-reference-card small { color: var(--muted); line-height: 1.4; }
.profile-reference-card.selectable { display: flex; align-items: flex-start; gap: .65rem; cursor: pointer; }
.profile-reference-card.selectable input { margin-top: .25rem; }
.profile-reference-card.selectable span { display: grid; gap: .2rem; }
.profile-test-grid input[type="date"] { margin-top: auto; }
.profile-test-set-all { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; margin: 0 0 .85rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-alt); }
.profile-test-set-all label { margin: 0; }
.profile-test-set-all input[type="date"] { width: auto; min-width: 170px; }
.profile-test-set-all .button { width: auto; }
.profile-save-bar { position: sticky; bottom: 14px; z-index: 60; display: flex; justify-content: flex-end; margin: 1rem 0 1.4rem; padding: .75rem; border-radius: 14px; background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line); box-shadow: 0 16px 36px rgba(0,0,0,.16); backdrop-filter: blur(10px); }
.profile-public-hero { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(260px, .9fr); gap: 1rem; padding: clamp(18px, 2.4vw, 28px); margin-bottom: 1rem; }
.profile-public-photo-strip { display: flex; gap: .7rem; overflow-x: auto; padding-bottom: .25rem; }
.profile-public-photo-strip .profile-photo-frame { flex: 0 0 min(240px, 65vw); }
.profile-avatar-fallback { display: grid; place-items: center; width: 180px; aspect-ratio: 1; border-radius: 50%; background: var(--primary); color: #fff; font-size: 4rem; font-weight: 900; }
.profile-public-facts { margin: 0; display: grid; gap: .65rem; }
.profile-public-facts > div { padding-bottom: .6rem; border-bottom: 1px solid var(--line); }
.profile-public-facts dt { color: var(--muted); font-size: .76rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.profile-public-facts dd { margin: .2rem 0 0; font-size: 1.02rem; font-weight: 700; }
.profile-public-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.profile-chip-list { display: flex; flex-wrap: wrap; gap: .45rem; }
.profile-chip { display: inline-flex; padding: .42rem .65rem; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line)); background: var(--primary-soft); color: var(--text); font-size: .84rem; font-weight: 750; }
.profile-chip.curious { background: var(--surface-alt); }
.profile-chip.not-into { opacity: .76; background: transparent; }
.profile-chip.health { border-color: color-mix(in srgb, var(--success) 36%, var(--line)); }
.profile-public-health-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.profile-public-health-grid h3 { margin-top: 0; }
.profile-detail-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.profile-detail-list li { display: flex; justify-content: space-between; gap: .8rem; padding-bottom: .45rem; border-bottom: 1px solid var(--line); }
.profile-detail-list span { color: var(--muted); text-align: right; }
.profile-album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .8rem; }
.profile-album-grid.compact { grid-template-columns: 1fr; }
.profile-album-card { display: grid; gap: .7rem; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-alt); color: var(--text); text-decoration: none; }
.profile-album-card.linked:hover { border-color: var(--primary); transform: translateY(-1px); }
.profile-album-card h3 { margin: 0; }
.profile-album-card p { margin: .25rem 0 0; color: var(--muted); }
.profile-album-meta { color: var(--muted); font-size: .8rem; font-weight: 750; }
.album-create-form { align-items: end; }
.profile-stack-form { display: grid; gap: .8rem; }
.profile-inline-invite { display: flex; align-items: end; gap: .75rem; margin-bottom: 1rem; }
.profile-inline-invite .field { flex: 1 1 360px; }
.profile-access-list { display: grid; gap: .55rem; }
.profile-access-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem .9rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-alt); }
.profile-access-row > div:first-child { display: grid; gap: .18rem; }
.profile-access-row small { color: var(--muted); }
.profile-access-row .button-row { justify-content: flex-end; }
.profile-access-row form { margin: 0; }
.profile-access-gate { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.profile-danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.profile-danger-zone p { margin: .25rem 0 0; color: var(--muted); }
.profile-reference-admin { padding: 0; margin-bottom: .8rem; overflow: hidden; }
.profile-reference-admin > summary { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem; cursor: pointer; font-weight: 900; }
.profile-reference-admin > summary span { color: var(--muted); }
.profile-reference-admin table { min-width: 840px; }
.profile-reference-admin td form { margin: 0; }
.status-pill { display: inline-flex; align-items: center; padding: .34rem .55rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .76rem; font-weight: 850; }

.goontown-radius-control { display: flex; align-items: center; gap: .5rem; margin-left: auto; color: var(--muted); font-weight: 750; }
.goontown-radius-control select { min-height: 38px; }
.goontown-nearby-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .25rem; }
.goontown-nearby-header h2 { margin: 0; }
.goontown-nearby-header span { display: grid; place-items: center; min-width: 1.8rem; height: 1.8rem; border-radius: 999px; background: var(--surface-alt); border: 1px solid var(--line); font-size: .78rem; font-weight: 900; }
.goontown-nearby-list { display: grid; gap: .45rem; max-height: 330px; overflow: auto; padding-right: .15rem; }
.goontown-nearby-profile { display: flex; align-items: center; gap: .65rem; padding: .55rem; border-radius: 12px; color: var(--text); text-decoration: none; border: 1px solid transparent; }
.goontown-nearby-profile:hover { background: var(--surface-alt); border-color: var(--line); }
.goontown-nearby-profile > span:last-child { display: grid; min-width: 0; }
.goontown-nearby-profile strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goontown-nearby-profile small { color: var(--muted); }
.goontown-nearby-avatar, .goontown-profile-marker { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; background: var(--primary); background-size: cover; background-position: center; color: #fff; border: 2px solid #fff; box-shadow: 0 5px 16px rgba(0,0,0,.38); font-weight: 900; }
.goontown-profile-marker { width: 48px; height: 48px; padding: 0; cursor: pointer; border-width: 3px; }
.goontown-profile-marker.is-me { width: 52px; height: 52px; box-shadow: 0 0 0 5px rgba(140,108,242,.28), 0 8px 20px rgba(0,0,0,.42); }
.goontown-profile-marker.has-photo, .goontown-nearby-avatar.has-photo { color: transparent; }

@media (max-width: 900px) {
    .profile-form-grid, .profile-public-grid, .profile-public-health-grid, .profile-public-hero { grid-template-columns: 1fr; }
    .profile-public-photo-strip .profile-photo-frame { flex-basis: min(220px, 70vw); }
    .profile-inline-invite, .profile-access-gate, .profile-danger-zone { align-items: stretch; flex-direction: column; }
    .goontown-radius-control { margin-left: 0; width: 100%; justify-content: space-between; }
}
@media (max-width: 620px) {
    .profile-photo-grid, .profile-album-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .profile-reference-grid { grid-template-columns: 1fr; }
    .profile-test-set-all { align-items: stretch; }
    .profile-test-set-all label { width: 100%; }
    .profile-test-set-all input[type="date"], .profile-test-set-all .button { flex: 1 1 160px; }
    .profile-kink-table { min-width: 680px; }
    .profile-access-row { align-items: stretch; flex-direction: column; }
    .profile-access-row .button-row { justify-content: flex-start; }
    .profile-save-bar { bottom: 8px; }
}

/* 2026-08-15 GoonTown map reliability fix.
   Keep the critical MapLibre positioning rules locally so a delayed/blocked CDN stylesheet
   cannot leave the canvas or profile-marker DOM elements in normal document flow. */
.goontown-map.maplibregl-map { position: relative; overflow: hidden; -webkit-tap-highlight-color: rgba(0,0,0,0); }
.goontown-map .maplibregl-canvas-container { position: absolute; inset: 0; width: 100%; height: 100%; }
.goontown-map .maplibregl-canvas { position: absolute; left: 0; top: 0; }
.goontown-map .maplibregl-marker { position: absolute; top: 0; left: 0; will-change: transform; }
.goontown-map .maplibregl-control-container { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.goontown-map .maplibregl-ctrl-top-left,
.goontown-map .maplibregl-ctrl-top-right,
.goontown-map .maplibregl-ctrl-bottom-left,
.goontown-map .maplibregl-ctrl-bottom-right { position: absolute; pointer-events: none; z-index: 5; }
.goontown-map .maplibregl-ctrl-top-left { top: 0; left: 0; }
.goontown-map .maplibregl-ctrl-top-right { top: 0; right: 0; }
.goontown-map .maplibregl-ctrl-bottom-left { bottom: 0; left: 0; }
.goontown-map .maplibregl-ctrl-bottom-right { right: 0; bottom: 0; }
.goontown-map .maplibregl-ctrl { clear: both; pointer-events: auto; }
.goontown-map .maplibregl-ctrl-top-right .maplibregl-ctrl { float: right; margin: 10px 10px 0 0; }
.goontown-map .maplibregl-ctrl-bottom-right .maplibregl-ctrl { float: right; margin: 0 10px 10px 0; }
.goontown-map .maplibregl-ctrl-group { overflow: hidden; border-radius: 4px; }
.goontown-map .maplibregl-ctrl-group button { display: block; width: 30px; height: 30px; padding: 0; border: 0; cursor: pointer; }

/* 2026-08-15 SQL64: profile basics rows, multi-select Looking for, and always-expanded alphabetical Interests & Kinks. */
.profile-basic-list {
    display: grid;
    border-top: 1px solid var(--line);
}
.profile-basic-row {
    display: grid;
    grid-template-columns: minmax(180px, .42fr) minmax(320px, 1fr);
    align-items: center;
    gap: 1rem;
    min-width: 0;
    padding: .55rem 0;
    border-bottom: 1px solid var(--line);
}
.profile-basic-row select { width: 100%; min-width: 0; }
.profile-basic-label { font-weight: 850; color: var(--text); }
.profile-basic-row-looking-for { align-items: start; }
.profile-basic-row-looking-for > .profile-basic-label { padding-top: .25rem; }
.profile-looking-for-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: .12rem .8rem;
    min-width: 0;
}
.profile-looking-for-option {
    display: flex;
    align-items: center;
    gap: .45rem;
    min-height: 26px;
    padding: .08rem 0;
    cursor: pointer;
    font-size: .9rem;
    line-height: 1.15;
}
.profile-looking-for-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin: 0;
    flex: 0 0 16px;
    accent-color: var(--primary);
}
.profile-album-invitation-settings { display: grid; gap: .7rem; }
.profile-album-invitation-settings .profile-autoaccept-card { margin-top: 0; }
.profile-album-invitation-settings > .button { justify-self: start; }
.profile-kink-expanded-wrap {
    overflow: auto;
    max-width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-alt);
}
.profile-kink-table-expanded { margin: 0; }
.profile-kink-table-expanded thead th {
    padding: .42rem .55rem;
    border-top: 0;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 78%, var(--surface-alt));
    font-size: .78rem;
    line-height: 1.1;
}
.profile-kink-table-expanded .profile-kink-category-row th {
    padding: .48rem .55rem .32rem;
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--primary) 7%, var(--surface-alt));
    text-align: left;
    font-size: .9rem;
    font-weight: 900;
    line-height: 1.15;
}
.profile-kink-table-expanded tbody .profile-kink-category-row:first-child th { border-top: 0; }
.profile-kink-table-expanded .profile-kink-option-row td {
    padding: .28rem .55rem;
    vertical-align: middle;
    line-height: 1.15;
}
.profile-kink-table-expanded .profile-kink-option-row td:first-child { padding-left: 1.35rem; }
.profile-kink-table-expanded .profile-kink-option-row td strong { line-height: 1.15; }
.profile-kink-table-expanded .profile-kink-option-row td small {
    margin-top: .08rem;
    line-height: 1.18;
}
.profile-kink-table-expanded input[type="radio"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--primary);
}

@media (max-width: 900px) {
    .profile-basic-row { grid-template-columns: minmax(130px, .35fr) minmax(260px, 1fr); }
}
@media (max-width: 620px) {
    .profile-basic-row { grid-template-columns: 1fr; gap: .35rem; }
    .profile-basic-row-looking-for > .profile-basic-label { padding-top: 0; }
    .profile-looking-for-list { grid-template-columns: 1fr; }
}

/* Profile Reference Data administration: add/edit controls and collapsed sections. */
.profile-reference-section-body { border-top: 1px solid var(--line); }
.profile-reference-add-form { margin: 0; padding: .9rem 1rem 1rem; background: var(--surface-alt); border-bottom: 1px solid var(--line); }
.profile-reference-editor-fields,
.profile-reference-edit-form { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(360px, 1.8fr) auto auto; gap: .7rem; align-items: end; }
.profile-reference-editor-fields-kink,
.profile-reference-edit-form-kink { grid-template-columns: minmax(180px, .65fr) minmax(220px, .8fr) minmax(360px, 1.5fr) auto auto; }
.profile-reference-editor-fields label,
.profile-reference-edit-form label { display: grid; gap: .3rem; margin: 0; font-size: .78rem; font-weight: 800; color: var(--muted); }
.profile-reference-editor-fields input[type="text"],
.profile-reference-editor-fields textarea,
.profile-reference-edit-form input[type="text"],
.profile-reference-edit-form textarea { width: 100%; min-width: 0; }
.profile-reference-enabled { display: flex !important; flex-direction: row !important; align-items: center; gap: .45rem !important; min-height: 38px; padding: 0 .2rem; color: var(--text) !important; white-space: nowrap; }
.profile-reference-enabled input[type="checkbox"] { width: 16px; height: 16px; min-width: 16px; margin: 0; accent-color: var(--primary); }
.profile-reference-actions { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.profile-reference-actions form { margin: 0; }
.profile-reference-edit-row > td { padding: 0 !important; background: color-mix(in srgb, var(--surface-alt) 86%, var(--primary-soft)); }
.profile-reference-edit-form { padding: .8rem; }
.profile-reference-edit-buttons { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.profile-reference-admin > summary::marker { color: var(--muted); }
.profile-reference-admin > summary:hover { background: var(--surface-alt); }

@media (max-width: 1100px) {
    .profile-reference-editor-fields,
    .profile-reference-edit-form,
    .profile-reference-editor-fields-kink,
    .profile-reference-edit-form-kink { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .profile-reference-editor-fields .wide,
    .profile-reference-edit-form .wide { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
    .profile-reference-editor-fields,
    .profile-reference-edit-form,
    .profile-reference-editor-fields-kink,
    .profile-reference-edit-form-kink { grid-template-columns: 1fr; }
    .profile-reference-editor-fields .wide,
    .profile-reference-edit-form .wide { grid-column: auto; }
}

/* 2026-08-15: GoonTown map reliability + GoonGrid */
.topnav-goontown { position: relative; }
.topnav-goontown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 8px;
    z-index: 1300;
    display: grid;
    min-width: 190px;
    padding: 8px;
    border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface) 97%, #fff);
    box-shadow: 0 20px 44px rgba(14,0,28,.30);
}
.topnav-goontown-menu > a {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text);
    font-size: .92rem;
    font-weight: 720;
    text-decoration: none;
}
.topnav-goontown-menu > a:hover,
.topnav-goontown-menu > a:focus-visible,
.topnav-goontown-menu > a.active {
    color: var(--primary);
    background: var(--primary-soft);
    outline: none;
    text-decoration: none;
}

.goontown-profile-marker {
    display: block;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--primary) center/cover no-repeat;
    box-shadow: 0 4px 14px rgba(0,0,0,.55), 0 0 0 3px color-mix(in srgb, var(--primary) 70%, transparent);
    overflow: hidden;
    cursor: pointer;
}
.goontown-profile-marker.is-me { pointer-events: none; cursor: default; width: 54px; height: 54px; box-shadow: 0 5px 18px rgba(0,0,0,.6), 0 0 0 4px color-mix(in srgb, var(--accent) 70%, transparent); }
.goontown-profile-marker.is-fallback-logo { background-size: 70%; background-color: #14141a; }

.goongrid-page { display: grid; gap: 1.1rem; }
.goongrid-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; }
.goongrid-hero h1 { margin: .12rem 0 .25rem; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1; }
.goongrid-hero p { margin: 0; color: var(--muted); }
.goongrid-summary { display: flex; align-items: baseline; gap: .5rem; padding: .55rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.goongrid-summary strong { color: var(--primary); font-size: 1.25rem; }
.goongrid-summary span { color: var(--muted); font-size: .85rem; }
.goongrid-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 5px; align-items: start; }
.goongrid-profile { min-width: 0; padding: .3rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 6px 16px rgba(0,0,0,.07); cursor: default; user-select: none; }
.goongrid-photo-wrap { position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: visible; }
.goongrid-photo { display: block; width: 100%; height: 100%; border-radius: 10px; object-fit: cover; background: var(--surface-alt); }
.goongrid-photo-fallback { display: grid; place-items: center; border: 1px solid var(--line); }
.goongrid-photo-fallback img { display: block; width: 46%; height: 46%; object-fit: contain; }
.goongrid-handle { position: absolute; top: .35rem; left: .35rem; max-width: calc(100% - .7rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: .18rem .38rem; border-radius: 6px; background: rgba(0,0,0,.68); color: #fff; font-size: .76rem; font-weight: 700; line-height: 1.15; text-align: left; text-shadow: 0 1px 2px rgba(0,0,0,.8); }
.goongrid-live-dot { position: absolute; left: -2px; bottom: -2px; width: 16px; height: 16px; border: 3px solid var(--surface); border-radius: 50%; background: #27ff3f; box-shadow: 0 0 12px rgba(39,255,63,.9); }
.goongrid-profile-meta { display: block; padding: .22rem .08rem .02rem; min-width: 0; text-align: left; }
.goongrid-profile-meta span { display: block; color: var(--muted); font-size: .7rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.goongrid-empty { max-width: 760px; padding: 1.2rem; }
.goongrid-empty h2 { margin-top: 0; }
.goongrid-empty p { color: var(--muted); }
@media (max-width: 700px) {
    /* Mobile GoonGrid: each tile is 75% of the prior two-column tile width. */
    .goongrid-list {
        grid-template-columns: repeat(auto-fill, calc((100% - 5px) * .375));
        gap: 5px;
        justify-content: start;
    }
    .goongrid-profile { padding: .25rem; }
}

/* 2026-08-15: remembered collapsible Interests & Kinks categories (browser-local only). */
.profile-kink-collapsible-groups {
    display: grid;
    gap: .38rem;
}
.profile-kink-collapsible-group {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-alt);
}
.profile-kink-collapsible-group > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .5rem .65rem;
    cursor: pointer;
    list-style: none;
    background: color-mix(in srgb, var(--primary) 7%, var(--surface-alt));
    font-size: .9rem;
    font-weight: 900;
    line-height: 1.15;
    user-select: none;
}
.profile-kink-collapsible-group > summary::-webkit-details-marker { display: none; }
.profile-kink-collapsible-group > summary::after {
    content: "+";
    flex: 0 0 auto;
    min-width: 1rem;
    color: var(--muted);
    font-size: 1rem;
    font-weight: 900;
    text-align: center;
}
.profile-kink-collapsible-group[open] > summary::after { content: "−"; }
.profile-kink-collapsible-group[open] > summary { border-bottom: 1px solid var(--line); }
.profile-kink-collapsible-group .profile-kink-expanded-wrap {
    border: 0;
    border-radius: 0;
}
.profile-kink-collapsible-group .profile-kink-table-expanded thead th { border-top: 0; }
.profile-kink-collapsible-group .profile-kink-table-expanded .profile-kink-option-row td:first-child { padding-left: 1.35rem; }

/* 2026-08-15 GoonTown current-profile marker positioning fix.
   MapLibre positions this neutral host; the circular profile-photo element is its child. */
.goontown-map .goontown-marker-host {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: visible;
    pointer-events: auto;
}
.goontown-map .goontown-marker-host.is-me { pointer-events: none; }
.goontown-map .goontown-marker-host .goontown-profile-marker { flex: 0 0 auto; }

/* 2026-08-15: iOS/touch reliability for horizontal top navigation. */
.topnav-primary,
.topnav-item,
.topnav-popout-trigger {
    -webkit-tap-highlight-color: transparent;
}
.topnav-popout-trigger {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}
.topnav-popout-menu-viewport {
    position: fixed !important;
    top: var(--topnav-popout-top) !important;
    left: var(--topnav-popout-left) !important;
    right: var(--topnav-popout-right, auto) !important;
    z-index: 5000 !important;
}
@media (max-width: 1160px), (hover: none), (pointer: coarse) {
    .global-topnav,
    .global-topnav-inner,
    .topnav-primary {
        -webkit-overflow-scrolling: touch;
    }
    .topnav-goontown-menu.topnav-popout-menu-viewport {
        width: min(260px, calc(100vw - 24px));
        max-width: calc(100vw - 24px);
    }
    .topnav-settings-mega.topnav-popout-menu-viewport {
        width: auto !important;
        max-width: none;
        max-height: calc(100dvh - var(--topnav-popout-top) - 12px);
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }
}

/* 2026-08-15: dedicated mobile/iOS logo-triggered navigation drawer.
   Desktop keeps the horizontal top navigation unchanged. */
.mobile-topnav-drawer,
.mobile-topnav-backdrop { display: none; }

body.mobile-topnav-mode .global-topnav-inner {
    min-height: 64px;
    overflow: visible;
}
body.mobile-topnav-mode .topnav-primary { display: none !important; }
body.mobile-topnav-mode .topnav-logo {
    position: relative;
    left: auto;
    z-index: 1202;
    min-width: 0;
    width: auto;
    min-height: 64px;
    padding: 8px 14px;
    cursor: pointer;
    background: transparent;
    box-shadow: none;
}
body.mobile-topnav-mode .topnav-logo::before {
    content: "☰";
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    margin-right: 9px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 8px;
    color: #fff;
    background: rgba(255,255,255,.08);
    font-size: 21px;
    font-weight: 800;
    line-height: 1;
}
body.mobile-topnav-mode .topnav-logo img { max-width: 150px; max-height: 44px; }
body.mobile-topnav-mode .topnav-logo-mark,
body.mobile-topnav-mode .topnav-logo-text { max-width: min(58vw, 220px); overflow: hidden; text-overflow: ellipsis; }

body.mobile-topnav-mode .mobile-topnav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 4990;
    opacity: 0;
    background: rgba(0,0,0,.52);
    transition: opacity .18s ease;
    -webkit-tap-highlight-color: transparent;
}
body.mobile-topnav-mode .mobile-topnav-backdrop.is-open { opacity: 1; }
body.mobile-topnav-mode .mobile-topnav-drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 5000;
    width: min(88vw, 360px);
    max-width: 360px;
    transform: translate3d(-102%, 0, 0);
    background: var(--surface);
    color: var(--text);
    border-right: 1px solid var(--line);
    box-shadow: 18px 0 48px rgba(0,0,0,.34);
    transition: transform .2s ease;
    overflow: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
body.mobile-topnav-mode .mobile-topnav-drawer.is-open { transform: translate3d(0, 0, 0); }
body.mobile-topnav-open { overflow: hidden; touch-action: none; }

.mobile-topnav-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 0 0 auto;
    min-height: 64px;
    padding: 10px 12px 10px 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: var(--topbar-bg);
    color: var(--topbar-text);
}
.mobile-topnav-drawer-header strong { font-size: 1.05rem; font-weight: 900; }
.mobile-topnav-close {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: rgba(255,255,255,.08);
    color: #fff;
    font: inherit;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.mobile-topnav-links {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    padding: 8px 10px calc(24px + env(safe-area-inset-bottom));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.mobile-topnav-links > a,
.mobile-topnav-submenu > a,
.mobile-topnav-logout-form button {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 45px;
    margin: 2px 0;
    padding: 10px 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: .96rem;
    font-weight: 740;
    line-height: 1.2;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.mobile-topnav-links a.active,
.mobile-topnav-links a:active,
.mobile-topnav-submenu > a:active,
.mobile-topnav-logout-form button:active { color: var(--primary); background: var(--primary-soft); }
.mobile-topnav-section {
    margin: 2px 0;
    border: 0;
    background: transparent;
}
.mobile-topnav-section > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 45px;
    padding: 10px 12px;
    border-radius: 9px;
    list-style: none;
    color: var(--text);
    font-size: .96rem;
    font-weight: 800;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.mobile-topnav-section > summary::-webkit-details-marker { display: none; }
.mobile-topnav-section > summary::after { content: "+"; color: var(--muted); font-size: 1.15rem; font-weight: 900; }
.mobile-topnav-section[open] > summary::after { content: "−"; }
.mobile-topnav-section[open] > summary { color: var(--primary); background: var(--primary-soft); }
.mobile-topnav-submenu {
    display: grid;
    gap: 1px;
    margin: 2px 0 7px 13px;
    padding: 4px 0 5px 10px;
    border-left: 2px solid color-mix(in srgb, var(--primary) 35%, var(--line));
}
.mobile-topnav-submenu > a { min-height: 39px; padding-block: 7px; font-size: .91rem; font-weight: 680; }
.mobile-topnav-group-label {
    display: block;
    margin: 10px 0 3px;
    padding: 4px 12px;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .07em;
    text-transform: uppercase;
}
.mobile-topnav-impersonate-form { display: grid; gap: 5px; margin: 8px 10px 11px; }
.mobile-topnav-impersonate-form label { color: var(--muted); font-size: .76rem; font-weight: 800; }
.mobile-topnav-impersonate-form select { width: 100%; min-height: 42px; }
.mobile-topnav-logout-form { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--line); }
.mobile-topnav-logout-form button { color: var(--danger, #c93646); }

@media (max-width: 900px), (hover: none) and (pointer: coarse) {
    body.topnav-layout:not(.mobile-topnav-mode) .topnav-primary { visibility: hidden; }
}

/* 2026-08-15: Native iOS/mobile navigation. This intentionally requires no JavaScript. */
.mobile-native-nav { display: none; }

@media (max-width: 900px), (hover: none) and (pointer: coarse) {
    body.topnav-layout .global-topnav-inner {
        min-height: 64px;
        overflow: visible !important;
    }
    body.topnav-layout .global-topnav-inner > .topnav-logo,
    body.topnav-layout .topnav-primary,
    body.topnav-layout .mobile-topnav-drawer,
    body.topnav-layout .mobile-topnav-backdrop {
        display: none !important;
    }
    body.topnav-layout .mobile-native-nav {
        display: block;
        position: relative;
        width: 100%;
        margin: 0;
    }
    .mobile-native-nav > summary {
        list-style: none;
    }
    .mobile-native-nav > summary::-webkit-details-marker { display: none; }
    .mobile-native-nav-trigger {
        display: flex;
        align-items: center;
        width: fit-content;
        min-height: 64px;
        margin: 0;
        padding: 8px 14px;
        border: 0;
        color: #fff;
        background: transparent;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        user-select: none;
    }
    .mobile-native-hamburger {
        display: grid;
        place-items: center;
        flex: 0 0 34px;
        width: 34px;
        height: 34px;
        margin-right: 9px;
        border: 1px solid rgba(255,255,255,.2);
        border-radius: 8px;
        background: rgba(255,255,255,.08);
        color: #fff;
        font-size: 21px;
        font-weight: 800;
        line-height: 1;
    }
    .mobile-native-nav-trigger img {
        display: block;
        width: auto;
        max-width: 150px;
        max-height: 44px;
        object-fit: contain;
    }
    .mobile-native-nav-trigger .topnav-logo-mark,
    .mobile-native-nav-trigger .topnav-logo-text {
        max-width: min(58vw, 220px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .mobile-native-nav[open] .mobile-native-hamburger { background: rgba(255,255,255,.18); }
    .mobile-native-nav-panel {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        z-index: 6000;
        max-height: calc(100dvh - 64px);
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding: 8px 10px calc(24px + env(safe-area-inset-bottom));
        border-top: 1px solid rgba(255,255,255,.08);
        border-bottom: 1px solid var(--line);
        background: var(--surface);
        color: var(--text);
        box-shadow: 0 18px 38px rgba(0,0,0,.35);
    }
    .mobile-native-nav-links { display: block; }
    .mobile-native-nav-links > a,
    .mobile-native-nav-links .mobile-topnav-submenu > a,
    .mobile-native-nav-links .mobile-topnav-logout-form button {
        display: flex;
        align-items: center;
        width: 100%;
        min-height: 46px;
        margin: 2px 0;
        padding: 10px 12px;
        border: 0;
        border-radius: 9px;
        background: transparent;
        color: var(--text);
        font: inherit;
        font-size: .96rem;
        font-weight: 740;
        line-height: 1.2;
        text-align: left;
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
    }
    .mobile-native-nav-links a.active,
    .mobile-native-nav-links a:active,
    .mobile-native-nav-links button:active {
        color: var(--primary);
        background: var(--primary-soft);
    }
}

/* My Goonstache Profile landing page */
.profile-landing { display: grid; gap: 18px; }
.profile-landing-hero {
    display: flex; align-items: center; gap: 22px; padding: 22px;
}
.profile-landing-avatar-wrap { flex: 0 0 auto; }
.profile-landing-avatar {
    width: 104px; height: 104px; border-radius: 50%; object-fit: cover; display: block;
    border: 3px solid var(--accent); background: var(--surface-2);
}
.profile-landing-avatar-fallback { display: grid; place-items: center; padding: 18px; }
.profile-landing-avatar-fallback img { width: 100%; height: 100%; object-fit: contain; }
.profile-landing-hero-copy h1 { margin: 3px 0 2px; }
.profile-landing-hero-copy p { margin: 5px 0 0; color: var(--muted); line-height: 1.5; }
.profile-landing-hero-copy .profile-landing-handle { color: var(--text); font-weight: 700; }
.profile-landing-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px;
}
.profile-landing-card {
    display: flex; gap: 14px; min-height: 172px; padding: 18px; color: inherit; text-decoration: none;
    transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.profile-landing-card:hover, .profile-landing-card:focus-visible {
    transform: translateY(-2px); border-color: var(--accent); text-decoration: none;
}
.profile-landing-card-icon {
    flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
    border: 1px solid var(--border); background: var(--surface-2); font-size: 20px; font-weight: 800;
}
.profile-landing-card h2 { margin: 3px 0 6px; font-size: 1.15rem; }
.profile-landing-card p { margin: 0; color: var(--muted); line-height: 1.45; }
.profile-landing-card-meta { margin-top: 10px; font-size: .82rem; color: var(--muted); font-weight: 700; }
@media (max-width: 1050px) { .profile-landing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) {
    .profile-landing-hero { align-items: flex-start; gap: 14px; padding: 16px; }
    .profile-landing-avatar { width: 76px; height: 76px; }
    .profile-landing-grid { grid-template-columns: 1fr; gap: 10px; }
    .profile-landing-card { min-height: 0; padding: 14px; }
}

/* Primary public landing page — centered sign-in with general site introduction. */
.login-only-layout .login-only-center {
    align-items: stretch !important;
    padding: 0 !important;
}

.login-only-layout .login-only-center > .public-landing-page {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}

.public-landing-page {
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(24px, 4vh, 42px);
    padding: clamp(28px, 5vw, 72px) clamp(18px, 5vw, 74px) clamp(24px, 4vw, 52px);
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 14%, color-mix(in srgb, var(--primary) 24%, transparent), transparent 33%),
        radial-gradient(circle at 10% 72%, color-mix(in srgb, var(--primary) 11%, transparent), transparent 26%),
        radial-gradient(circle at 90% 70%, color-mix(in srgb, var(--primary) 10%, transparent), transparent 27%),
        linear-gradient(180deg, color-mix(in srgb, var(--page-top) 96%, #fff 4%), var(--page));
}

.public-landing-page::before,
.public-landing-page::after {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    border: 1px solid color-mix(in srgb, var(--primary) 14%, transparent);
    border-radius: 50%;
    pointer-events: none;
    opacity: .55;
}

.public-landing-page::before { left: -190px; top: -155px; }
.public-landing-page::after { right: -190px; bottom: -175px; }

.public-landing-intro {
    position: relative;
    z-index: 1;
    width: min(850px, 100%);
    margin: 0 auto;
    text-align: center;
}

.public-landing-kicker {
    margin-bottom: 9px;
    color: var(--primary);
    font-size: .74rem;
    font-weight: 900;
    letter-spacing: .22em;
}

.public-landing-intro h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 1.03;
    letter-spacing: -.045em;
}

.public-landing-intro p {
    max-width: 720px;
    margin: 14px auto 0;
    color: var(--muted);
    font-size: clamp(.98rem, 1.6vw, 1.12rem);
    line-height: 1.65;
}

.public-landing-stage {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(230px, 1fr) minmax(360px, 470px) minmax(230px, 1fr);
    align-items: center;
    gap: clamp(18px, 3vw, 42px);
    width: min(1280px, 100%);
    margin: 0 auto;
}

.public-landing-login-card {
    width: 100% !important;
    max-width: 470px !important;
    margin: 0 !important;
    padding: clamp(24px, 3vw, 36px) !important;
    border: 1px solid color-mix(in srgb, var(--line) 72%, var(--primary) 28%);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 28px 90px rgba(0,0,0,.16), var(--experience-inset-highlight);
}

.public-landing-login-brand {
    align-items: center;
}

.public-landing-login-brand h2 {
    margin: 0 0 4px;
    font-size: clamp(1.55rem, 2.5vw, 2rem);
}

.public-landing-logo {
    max-height: 88px;
    max-width: 195px;
}

.public-landing-feature-stack {
    display: grid;
    gap: 16px;
}

.public-landing-feature-card {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 13px;
    align-items: start;
    padding: 17px 18px;
    border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
    border-radius: calc(var(--radius) + 3px);
    background: color-mix(in srgb, var(--surface) 76%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 12px 34px rgba(0,0,0,.06);
}

.public-landing-feature-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--primary-soft) 82%, var(--surface));
    color: var(--primary);
    font-size: 1.15rem;
    font-weight: 900;
}

.public-landing-feature-card h2 {
    margin: 1px 0 5px;
    font-size: .98rem;
    letter-spacing: -.01em;
}

.public-landing-feature-card p {
    margin: 0;
    color: var(--muted);
    font-size: .84rem;
    line-height: 1.5;
}

.public-landing-footer-copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px 12px;
    width: min(900px, 100%);
    margin: 0 auto;
    color: var(--muted);
    text-align: center;
    font-size: .8rem;
}

.public-landing-footer-copy strong { color: var(--text); }
.public-landing-adult-note { color: var(--primary); font-weight: 800; }

@media (max-width: 1050px) {
    .public-landing-stage {
        grid-template-columns: minmax(0, 1fr) minmax(350px, 470px) minmax(0, 1fr);
        gap: 16px;
    }
    .public-landing-feature-card {
        display: block;
        padding: 14px;
    }
    .public-landing-feature-icon { margin-bottom: 9px; }
}

@media (max-width: 820px) {
    .public-landing-page {
        justify-content: flex-start;
        padding: 28px 14px 30px;
        gap: 22px;
    }
    .public-landing-intro h1 { font-size: clamp(2rem, 9vw, 3rem); }
    .public-landing-stage {
        display: flex;
        flex-direction: column;
        width: min(560px, 100%);
    }
    .public-landing-login-card { order: 1; }
    .public-landing-feature-stack-left { order: 2; }
    .public-landing-feature-stack-right { order: 3; }
    .public-landing-feature-stack {
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .public-landing-feature-card {
        display: grid;
        grid-template-columns: 38px minmax(0, 1fr);
    }
    .public-landing-feature-icon { margin-bottom: 0; }
}

@media (max-width: 540px) {
    .public-landing-page { padding-left: 11px; padding-right: 11px; }
    .public-landing-intro { padding: 0 8px; }
    .public-landing-intro p { font-size: .92rem; }
    .public-landing-feature-stack { grid-template-columns: 1fr; }
    .public-landing-login-card { padding: 20px !important; }
    .public-landing-login-brand { gap: 10px; }
    .public-landing-logo { max-width: 150px; max-height: 72px; }
}


/* 2026-08-15 SQL67 GoonTown presence modes / compact GoonGrid overlay */
.goongrid-handle { top: auto; left: auto; right: .35rem; bottom: .35rem; max-width: calc(100% - .7rem); text-align: right; }
.goongrid-profile-meta { display: flex; flex-direction: column; align-items: flex-start; gap: .08rem; }
.goongrid-offline-status { color: #b8bcc5; font-size: .68rem; font-weight: 700; }
.goontown-marker-host { position: relative; }
.goontown-marker-host.is-offline .goontown-profile-marker { filter: grayscale(.85) brightness(.72); }
.goontown-offline-badge { position: absolute; left: 50%; top: calc(100% + 4px); transform: translateX(-50%); white-space: nowrap; padding: 2px 5px; border-radius: 8px; background: rgba(20,20,24,.92); color: #d7d9df; border: 1px solid rgba(255,255,255,.22); font-size: 10px; line-height: 1.15; font-weight: 800; pointer-events: none; box-shadow: 0 2px 8px rgba(0,0,0,.35); }


/* Public profile Kink-Curious combined section */
.profile-section-subgroup {
    margin-top: 1rem;
    padding-top: .85rem;
    border-top: 1px solid rgba(255,255,255,.10);
}
.profile-section-subgroup h3 {
    margin: 0 0 .55rem;
}

/* SQL68 / Profile Setup Wizard */
.profile-wizard { max-width: 1180px; margin: 0 auto; }
.profile-wizard-heading { align-items: flex-start; }
.profile-wizard-progress { margin: 0 0 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.profile-wizard-progress-copy { display:flex; justify-content:space-between; gap:16px; align-items:center; margin-bottom:9px; }
.profile-wizard-progress-copy span { color:var(--muted); }
.profile-wizard-progress-track { height:7px; overflow:hidden; border-radius:999px; background:var(--surface-strong); }
.profile-wizard-progress-track > span { display:block; height:100%; border-radius:inherit; background:var(--primary); }
.profile-wizard-card { padding:22px; }
.profile-wizard-card > h2 { margin-top:4px; }
.profile-wizard-nav { display:flex; justify-content:space-between; gap:12px; margin-top:18px; }
.profile-wizard-nav .button:last-child { margin-left:auto; }
.profile-wizard-choice-list { display:grid; gap:8px; max-width:680px; margin-top:16px; }
.profile-wizard-choice { display:flex; gap:10px; align-items:center; padding:12px 14px; border:1px solid var(--line); border-radius:var(--radius-small); background:var(--surface-alt); cursor:pointer; }
.profile-wizard-choice input { width:16px; height:16px; margin:0; }
.profile-wizard-subsection { margin-top:20px; padding-top:16px; border-top:1px solid var(--line); }
.profile-wizard-check-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 18px; }
.profile-wizard-check-grid .check { margin:0; min-height:32px; align-items:center; }
.profile-wizard-check-grid .check input { width:16px; height:16px; }

/* SQL90: compact responsive Sexual Health Practices / Sexual Positions wizard grids */
.profile-wizard-compact-options-card > h2 { margin-bottom:10px; }
.profile-wizard-responsive-option-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:2px 24px;
    align-items:start;
}
.profile-wizard-responsive-option-grid .check {
    min-height:28px;
    padding:2px 0;
    line-height:1.22;
}
.profile-wizard-responsive-option-grid .check span { min-width:0; }
.profile-wizard-responsive-option-grid .check input[type="checkbox"] {
    flex:0 0 auto;
    margin-top:0;
}
@media (min-width: 1100px) {
    .profile-wizard-responsive-option-grid {
        grid-template-columns:repeat(3,minmax(0,1fr));
        column-gap:28px;
    }
}
.profile-wizard-kinks { display:grid; gap:8px; margin-top:14px; }
.profile-wizard-kink-category { border:1px solid var(--line); border-radius:var(--radius-small); background:var(--surface-alt); }
.profile-wizard-kink-category > summary { cursor:pointer; font-weight:800; padding:10px 12px; }
.profile-wizard-kink-selection-phase,
.profile-wizard-kink-details-phase { display:none; }
.profile-wizard-kink-selection-phase.is-active,
.profile-wizard-kink-details-phase.is-active { display:block; }
.profile-wizard-kink-selection-heading { display:flex; justify-content:space-between; gap:18px; align-items:flex-start; margin:16px 0 10px; padding:12px 14px; border:1px solid var(--line); border-radius:var(--radius-small); background:var(--surface-alt); }
.profile-wizard-kink-selection-heading > div { display:grid; gap:3px; }
.profile-wizard-kink-selection-heading span { color:var(--muted); }
.profile-wizard-kink-selected-count { flex:0 0 auto; font-weight:800; }
.profile-wizard-kink-category-list { display:grid; gap:8px; }
.profile-wizard-kink-category-selector { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:18px; align-items:center; padding:12px 14px; border:1px solid var(--line); border-radius:var(--radius-small); background:var(--surface-alt); }
.profile-wizard-kink-category-selector.is-yes { border-color:color-mix(in srgb, var(--primary) 55%, var(--line)); }
.profile-wizard-kink-category-selector-copy { display:grid; gap:2px; min-width:0; }
.profile-wizard-kink-category-selector-copy > span { color:var(--muted); font-size:.86rem; }
.profile-wizard-kink-category-selector-copy > small { margin-top:3px; color:var(--muted); line-height:1.3; }
.profile-wizard-kink-toggle { display:flex; align-items:center; gap:9px; cursor:pointer; user-select:none; }
.profile-wizard-kink-toggle-label { min-width:26px; font-weight:800; font-size:.88rem; text-align:center; }
.profile-wizard-kink-switch { position:relative; display:inline-block; width:54px; height:28px; flex:0 0 auto; }
.profile-wizard-kink-switch input { position:absolute; inset:0; z-index:2; width:100%; height:100%; margin:0; opacity:0; cursor:pointer; }
.profile-wizard-kink-switch-track { position:absolute; inset:0; display:block; border:1px solid var(--line); border-radius:999px; background:var(--surface-strong); transition:background .16s ease,border-color .16s ease; }
.profile-wizard-kink-switch-thumb { position:absolute; top:3px; left:3px; width:20px; height:20px; border-radius:50%; background:var(--text); box-shadow:0 1px 5px rgba(0,0,0,.28); transition:transform .16s ease; }
.profile-wizard-kink-switch input:checked + .profile-wizard-kink-switch-track { background:var(--primary); border-color:var(--primary); }
.profile-wizard-kink-switch input:checked + .profile-wizard-kink-switch-track .profile-wizard-kink-switch-thumb { transform:translateX(26px); }
.profile-wizard-kink-switch input:focus-visible + .profile-wizard-kink-switch-track { outline:2px solid var(--primary); outline-offset:3px; }
.profile-wizard-kink-selection-nav { display:flex; justify-content:space-between; gap:14px; align-items:center; margin-top:14px; }
.profile-wizard-kink-flow-status { display:flex; justify-content:space-between; gap:16px; align-items:center; margin:16px 0 10px; padding:10px 12px; border:1px solid var(--line); border-radius:var(--radius-small); background:var(--surface-alt); }
.profile-wizard-kink-flow-status > div { display:grid; gap:2px; }
.profile-wizard-kink-flow-status span { color:var(--muted); font-weight:700; }
.profile-wizard-kink-category-flow { margin-top:10px; }
.profile-wizard-kink-category-step { display:none; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface-alt); overflow:hidden; }
.profile-wizard-kink-category-step.is-active { display:block; }
.profile-wizard-kink-items-panel { display:block; padding:0 18px 12px; }
.profile-wizard-kink-items-heading { display:flex; justify-content:space-between; gap:16px; align-items:baseline; padding:16px 0 8px; }
.profile-wizard-kink-items-heading > strong { color:var(--primary); font-size:1.35rem; line-height:1.15; font-weight:800; letter-spacing:-.01em; }
.profile-wizard-kink-items-heading span { color:var(--muted); font-size:.88rem; }
.profile-wizard-kink-items { padding:0 12px 8px; }
.profile-wizard-kink-category-nav { display:flex; justify-content:space-between; gap:10px; padding:12px 18px 18px; }
.profile-wizard-kink-category-nav .button:last-child { margin-left:auto; }
.profile-wizard-kink-category-complete { display:none; gap:6px; margin-top:10px; padding:16px 18px; border:1px solid var(--line); border-radius:var(--radius-small); background:var(--surface-alt); }
.profile-wizard-kink-category-complete.is-active { display:grid; }
.profile-wizard-kink-category-complete span { color:var(--muted); }
.profile-wizard-kink-complete-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:6px; }
.profile-wizard-kink-row { display:grid; grid-template-columns:minmax(220px,1fr) auto; gap:14px; align-items:center; padding:5px 0 5px 12px; border-top:1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.profile-wizard-kink-options { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:5px 12px; font-size:.86rem; }
.profile-wizard-kink-options label { display:flex; align-items:center; gap:4px; white-space:nowrap; }
.profile-wizard-kink-options input { width:14px; height:14px; margin:0; }
.profile-wizard-date-list { display:grid; gap:7px; margin-top:14px; }
.profile-wizard-date-list label { display:grid; grid-template-columns:minmax(220px,1fr) minmax(170px,240px); align-items:center; gap:18px; padding:4px 0; }
.profile-wizard-sti-table { margin-top:16px; overflow:hidden; border:1px solid var(--line); border-radius:var(--radius-small); background:var(--surface-alt); }
.profile-wizard-sti-header,
.profile-wizard-sti-row { display:grid; grid-template-columns:140px minmax(180px,240px) minmax(220px,1fr); align-items:center; column-gap:20px; }
.profile-wizard-sti-header { min-height:44px; padding:0 16px; border-bottom:1px solid var(--line); background:var(--surface-strong); }
.profile-wizard-sti-heading { font-size:.82rem; font-weight:800; letter-spacing:.015em; color:var(--muted); }
.profile-wizard-sti-heading-show { text-align:center; }
.profile-wizard-sti-row { min-height:58px; padding:8px 16px; border-bottom:1px solid color-mix(in srgb, var(--line) 72%, transparent); }
.profile-wizard-sti-row:last-child { border-bottom:0; }
.profile-wizard-sti-cell { min-width:0; }
.profile-wizard-sti-show { display:flex; justify-content:center; align-items:center; }
.profile-wizard-sti-checkbox { display:inline-grid; place-items:center; width:32px; height:32px; margin:0; cursor:pointer; }
.profile-wizard-sti-checkbox input[type="checkbox"] { width:18px; height:18px; margin:0; cursor:pointer; }
.profile-wizard-sti-date input[type="date"] { width:100%; max-width:240px; margin:0; }
.profile-wizard-sti-name { font-weight:700; line-height:1.25; }
.profile-wizard-set-all { margin:14px 0 4px; }
.profile-wizard-upload-form { max-width:620px; display:grid; gap:10px; margin-top:18px; }
.profile-wizard-upload-form .profile-upload-options.compact { display:flex; gap:22px; }
.profile-wizard-upload-form .profile-upload-options .check { margin:0; }
.profile-wizard-upload-form .profile-upload-options input { width:16px; height:16px; }
.profile-landing-wizard-form { display:contents; }
.profile-landing-card-button { width:100%; text-align:left; color:inherit; font:inherit; cursor:pointer; }
.profile-header-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.inline-form { display:inline; margin:0; }
.registration-wizard-option { margin:16px 0; padding:12px; border:1px solid var(--line); border-radius:var(--radius-small); background:var(--surface-alt); }
.profile-wizard-prompt-backdrop { position:fixed; inset:0; z-index:10000; display:grid; place-items:center; padding:18px; background:rgba(0,0,0,.72); }
.profile-wizard-prompt { width:min(620px,100%); padding:24px; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); box-shadow:0 24px 80px rgba(0,0,0,.45); }
.profile-wizard-prompt h2 { margin:4px 0 10px; }
.profile-wizard-prompt-actions { display:flex; justify-content:flex-end; gap:10px; flex-wrap:wrap; margin-top:20px; }
.profile-wizard-prompt-actions form { margin:0; }

@media (max-width: 760px) {
    .profile-wizard-card { padding:16px; }
    .profile-wizard-progress-copy { align-items:flex-start; flex-direction:column; gap:2px; }
    .profile-wizard-check-grid { grid-template-columns:1fr; }
    .profile-wizard-kink-selection-heading { align-items:flex-start; flex-direction:column; gap:8px; }
    .profile-wizard-kink-category-selector { grid-template-columns:1fr; gap:10px; }
    .profile-wizard-kink-toggle { justify-content:flex-end; }
    .profile-wizard-kink-selection-nav { align-items:stretch; flex-direction:column; }
    .profile-wizard-kink-selection-nav .button { width:100%; }
    .profile-wizard-kink-flow-status { align-items:flex-start; flex-direction:column; gap:8px; }
    .profile-wizard-kink-flow-status .button { width:100%; }
    .profile-wizard-kink-items-heading { align-items:flex-start; flex-direction:column; gap:3px; }
    .profile-wizard-kink-row { grid-template-columns:1fr; gap:5px; }
    .profile-wizard-kink-options { justify-content:flex-start; padding-left:8px; }
    .profile-wizard-kink-category-nav { flex-direction:column-reverse; }
    .profile-wizard-kink-category-nav .button { width:100%; margin-left:0; }
    .profile-wizard-date-list label { grid-template-columns:1fr; gap:4px; }
    .profile-wizard-date-list input { width:100%; }
    .profile-wizard-sti-table { overflow:visible; border:0; background:transparent; }
    .profile-wizard-sti-header { display:none; }
    .profile-wizard-sti-body { display:grid; gap:8px; }
    .profile-wizard-sti-row { grid-template-columns:52px minmax(0,1fr); gap:6px 12px; min-height:0; padding:12px; border:1px solid var(--line); border-radius:var(--radius-small); background:var(--surface-alt); }
    .profile-wizard-sti-row:last-child { border-bottom:1px solid var(--line); }
    .profile-wizard-sti-name { grid-column:1 / -1; grid-row:1; font-size:.95rem; }
    .profile-wizard-sti-show { grid-column:1; grid-row:2; justify-content:flex-start; }
    .profile-wizard-sti-date { grid-column:2; grid-row:2; }
    .profile-wizard-sti-date input[type="date"] { width:100%; max-width:none; }
    .profile-wizard-prompt-actions { flex-direction:column-reverse; }
    .profile-wizard-prompt-actions .button { width:100%; }
}

/* SQL69: per-STI public-profile visibility control */
.profile-sti-visibility { display:flex; align-items:center; gap:.4rem; margin-top:.35rem; font-size:.82rem; line-height:1.15; }
.profile-sti-visibility input[type="checkbox"] { width:15px; height:15px; margin:0; flex:0 0 auto; }
.profile-sti-visibility > span { opacity:.88; }


/* 2026-08-15: GoonTown profile popup from map/list avatars. */
body.goontown-profile-popup-open { overflow: hidden; }
.goontown-profile-popup[hidden] { display: none !important; }
.goontown-profile-popup { position: fixed; inset: 0; z-index: 12000; display: grid; place-items: center; padding: 1.25rem; }
.goontown-profile-popup-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(3px); }
.goontown-profile-popup-window { position: relative; z-index: 1; width: min(1100px, 94vw); height: min(860px, 90vh); display: grid; grid-template-rows: auto 1fr; overflow: hidden; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 24px 70px rgba(0,0,0,.55); }
.goontown-profile-popup-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem .85rem; border-bottom: 1px solid var(--line); background: var(--surface-alt); }
.goontown-profile-popup-header h2 { margin: 0; font-size: 1rem; }
.goontown-profile-popup-close { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 1.45rem; line-height: 1; cursor: pointer; }
.goontown-profile-popup-frame { width: 100%; height: 100%; border: 0; background: var(--background); }
.goontown-profile-marker:not(.is-me), .goontown-nearby-avatar[role="button"] { cursor: pointer; }
@media (max-width: 700px) { .goontown-profile-popup { padding: .5rem; } .goontown-profile-popup-window { width: 100%; height: 94vh; border-radius: 14px; } }

/* GoonTown default-grid view switch */
.goontown-hero-actions,
.goongrid-hero-actions { display: flex; align-items: flex-end; justify-content: flex-end; gap: .65rem; flex-wrap: wrap; }
.goontown-view-switch { display: inline-flex; gap: .4rem; align-items: center; padding: .2rem; border: 1px solid var(--border); border-radius: .8rem; background: rgba(255,255,255,.025); }
.goontown-view-switch .button { min-width: 7.4rem; margin: 0; text-align: center; }
.goontown-view-switch .button.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
@media (max-width: 720px) {
    .goontown-hero-actions, .goongrid-hero-actions { width: 100%; align-items: stretch; }
    .goontown-view-switch { width: 100%; }
    .goontown-view-switch .button { flex: 1 1 0; min-width: 0; }
}

/* GoonGrid presentation cleanup: 2026-08-16 */
.goongrid-hero {
    display: block;
}
.goongrid-hero-actions {
    justify-content: flex-start;
    align-items: center;
    margin-top: .65rem;
}


/* GoonGrid photo cleanup: 2026-08-16 */
.goongrid-list { gap: 5px; }
.goongrid-handle { display: none !important; }


/* GoonTown offline-user filter: 2026-08-16 */
.goontown-filters { display:flex; align-items:center; gap:.65rem; flex-wrap:wrap; margin:.65rem 0 .8rem; }
.goontown-filter-label { font-size:.76rem; font-weight:800; letter-spacing:.08em; text-transform:uppercase; opacity:.72; }
/* Theme-controlled pill buttons. Primary is the normal state; secondary is the selected/active state. */
.pill-button, .button.pill-button, .goontown-filter-pill { display:inline-flex; align-items:center; justify-content:center; min-height:34px; padding:.34rem .82rem; border:1px solid color-mix(in srgb,var(--pill-primary) 72%,var(--line)); border-radius:999px; background:var(--pill-primary); color:var(--pill-primary-text); cursor:pointer; font:inherit; font-size:.84rem; font-weight:800; line-height:1; text-decoration:none; transition:filter .15s ease,border-color .15s ease,color .15s ease,box-shadow .15s ease; }
.pill-button:hover, .button.pill-button:hover, .goontown-filter-pill:hover { text-decoration:none; color:var(--pill-primary-text); filter:brightness(1.08); }
.pill-button.is-active, .button.pill-button.is-active, .goontown-filter-pill.is-active { border-color:var(--pill-secondary); background:var(--pill-secondary); color:var(--pill-secondary-text); box-shadow:0 0 0 1px color-mix(in srgb,var(--pill-secondary) 35%,transparent); }
.pill-button.is-active:hover, .button.pill-button.is-active:hover, .goontown-filter-pill.is-active:hover { background:var(--pill-secondary); color:var(--pill-secondary-text); filter:brightness(1.06); }


/* 2026-08-16: GoonGrid native mobile/profile popup tap support */
button.goongrid-profile {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    margin: 0;
    font: inherit;
    color: inherit;
    text-align: inherit;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
button.goongrid-profile:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}


/* Compact embedded public profile in GoonGrid popups on all browser sizes. */
body.embedded-profile-view .global-topnav,
body.embedded-profile-view .profile-page-heading { display:none !important; }
body.embedded-profile-view .topnav-page-shell { padding-top:10px !important; }

.role-permission-groups{display:grid;gap:.65rem;margin:1rem 0}.role-permission-section{padding:0}.role-permission-section>summary{display:flex;justify-content:space-between;gap:1rem;cursor:pointer;padding:.8rem 1rem}.role-permission-list{border-top:1px solid var(--line)}.role-permission-row{display:grid;grid-template-columns:minmax(0,1fr) 150px;gap:1rem;align-items:center;padding:.55rem 1rem;border-bottom:1px solid color-mix(in srgb,var(--line) 65%,transparent)}.role-permission-row:last-child{border-bottom:0}.role-permission-row select{width:100%}.role-assignment-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:.5rem}.role-assignment-card{display:flex;align-items:center;gap:.55rem;padding:.65rem .8rem;border:1px solid var(--line);border-radius:var(--radius-small);background:var(--surface-alt)}@media(max-width:700px){.role-permission-row{grid-template-columns:1fr}.role-permission-row select{max-width:none}}


/* 2026-08-16: compact public-profile photo viewer and embedded GoonGrid popup layout. */
.profile-public-hero {
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    gap: 1.1rem;
}
.profile-public-photo-viewer {
    min-width: 0;
    display: grid;
    gap: .5rem;
    align-content: start;
}
.profile-public-main-photo {
    width: min(100%, 340px);
    max-width: 340px;
    min-width: 0 !important;
    aspect-ratio: 4 / 5;
}
.profile-public-main-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.profile-public-photo-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    width: min(100%, 340px);
}
.profile-public-photo-thumb {
    position: relative;
    appearance: none;
    -webkit-appearance: none;
    width: 64px;
    height: 64px;
    padding: 0;
    overflow: hidden;
    border: 2px solid var(--line);
    border-radius: 10px;
    background: var(--surface-alt);
    cursor: pointer;
}
.profile-public-photo-thumb.is-selected { border-color: var(--accent); }
.profile-public-photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-public-photo-thumb.is-nsfw img { filter: blur(10px); transform: scale(1.08); }
.profile-public-thumb-nsfw {
    position: absolute;
    left: 3px;
    bottom: 3px;
    padding: 2px 4px;
    border-radius: 5px;
    background: rgba(0,0,0,.72);
    color: #fff;
    font-size: .58rem;
    font-weight: 900;
}
.profile-public-facts { align-self: start; max-width: 680px; }
body.embedded-profile-view .global-topnav,
body.embedded-profile-view .profile-page-heading,
body.embedded-profile-view .topnav-impersonation-banner,
body.embedded-profile-view .emby-availability-page { display: none !important; }
body.embedded-profile-view .topnav-page-shell { padding-top: 10px !important; }
@media (max-width: 760px) {
    .profile-public-hero { grid-template-columns: 1fr; }
    .profile-public-main-photo { width: min(100%, 320px); max-width: 320px; }
    .profile-public-photo-thumbnails { width: min(100%, 320px); }
    .profile-public-photo-thumb { width: 58px; height: 58px; }
}

.goontown-profile-popup-window { position: relative; }
.goontown-profile-popup-close-floating {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
    box-shadow: 0 3px 12px rgba(0,0,0,.22);
}


/* 2026-08-16: embedded public-profile popup sizing, gallery spacing, and edit watermark. */
.goontown-profile-popup-window {
    grid-template-rows: 1fr;
    width: min(1180px, 96vw);
    height: min(920px, 94vh);
}
.goontown-profile-popup-frame {
    width: 100%;
    height: 100%;
}
body.embedded-profile-view .topnav-page-shell {
    padding-top: 0 !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
}
body.embedded-profile-view .profile-public-hero {
    grid-template-columns: clamp(220px, 24vw, 290px) minmax(0, 1fr);
    gap: .9rem;
    align-items: start;
}
body.embedded-profile-view .profile-public-photo-viewer {
    width: 100%;
}
body.embedded-profile-view .profile-public-main-photo {
    width: min(100%, 290px);
    max-width: 290px;
}
body.embedded-profile-view .profile-public-facts {
    max-width: none;
}
.profile-public-hero {
    grid-template-columns: clamp(230px, 25vw, 320px) minmax(0, 1fr);
    gap: .95rem;
    align-items: start;
}
.profile-public-main-photo {
    width: min(100%, 300px);
    max-width: 300px;
}
.profile-public-photo-thumbnails {
    width: min(100%, 300px);
}
.profile-edit-watermark {
    position: relative;
    isolation: isolate;
}
.profile-edit-watermark::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .10;
    background-image: url('/themes/favicon');
    background-repeat: no-repeat;
    background-position: center 260px;
    background-size: min(520px, 62vw);
}
.profile-edit-watermark > * {
    position: relative;
    z-index: 1;
}
@media (max-width: 760px) {
    body.embedded-profile-view .profile-public-hero,
    .profile-public-hero {
        grid-template-columns: 1fr;
    }
    body.embedded-profile-view .profile-public-main-photo,
    .profile-public-main-photo {
        width: min(100%, 320px);
        max-width: 320px;
    }
    body.embedded-profile-view .profile-public-photo-thumbnails,
    .profile-public-photo-thumbnails {
        width: min(100%, 320px);
    }
}


/* 2026-08-16: compact GoonGrid profile popup brand strip. */
.goontown-profile-popup-window {
    grid-template-rows: 72px minmax(0, 1fr);
}
.goongrid-profile-popup-brandbar {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 8px 64px 8px 14px;
    background: var(--primary, #6f2dbd);
    border-bottom: 1px solid color-mix(in srgb, #fff 18%, transparent);
}
.goongrid-profile-popup-brandbar img {
    display: block;
    width: auto;
    height: auto;
    max-width: 236px;
    max-height: 54px;
    object-fit: contain;
    object-position: left center;
}
.goontown-profile-popup-close-floating {
    top: 20px;
    right: 10px;
    width: 32px;
    height: 32px;
}


/* 2026-08-16: public profile review shows self photos without NSFW reveal overlays. */
.profile-public-main-photo.is-nsfw img,
.profile-public-photo-thumb.is-nsfw img {
    filter: none !important;
    transform: none !important;
}
.profile-public-main-photo .profile-nsfw-cover,
.profile-public-photo-thumb .profile-public-thumb-nsfw {
    display: none !important;
}

/* 2026-08-19 cumulative Sexual Health Resources / login privacy UI. */
.login-public-resource-bar{position:relative;display:grid;grid-template-columns:180px 1fr 180px;align-items:center;min-height:64px;margin:0 0 1rem;padding:.45rem .8rem;border-bottom:3px solid var(--primary);background:var(--surface)}
.login-public-resource-logo{display:flex;align-items:center;justify-content:flex-start;min-width:0}.login-public-resource-logo img{display:block;max-width:150px;max-height:48px;object-fit:contain}.login-public-resource-link{grid-column:2;justify-self:center;font-weight:900;text-decoration:none;color:var(--primary)}
.login-cookie-consent{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin:1rem auto 0;max-width:1100px;padding:.8rem 1rem;border:1px solid var(--line);border-radius:14px;background:var(--surface);font-size:.86rem}.login-cookie-consent>div:first-child{display:grid;gap:.2rem}.login-cookie-consent .button-row{flex:0 0 auto}
.sexual-health-filter-panel{display:flex;gap:.65rem;align-items:end;flex-wrap:wrap;margin-bottom:1rem}.sexual-health-filter-panel .field{min-width:180px;flex:1 1 180px}.sexual-health-category-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:.65rem;margin:1rem 0}.sexual-health-category-card{padding:.8rem;border:1px solid var(--line);border-radius:14px;background:var(--surface-alt)}.sexual-health-category-card h3{margin:0 0 .25rem}.sexual-health-resource-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(270px,1fr));gap:.8rem}.sexual-health-resource-card{display:grid;gap:.55rem;padding:1rem;border:1px solid var(--line);border-radius:16px;background:var(--surface)}.sexual-health-resource-card h3{margin:0}.sexual-health-resource-meta{display:flex;gap:.4rem;flex-wrap:wrap}.sexual-health-resource-location{font-size:.86rem;color:var(--muted)}.sexual-health-admin-table{width:100%}
@media(max-width:700px){.login-public-resource-bar{grid-template-columns:110px 1fr;min-height:54px}.login-public-resource-logo img{max-width:100px;max-height:38px}.login-public-resource-link{grid-column:2;justify-self:end;font-size:.85rem}.login-cookie-consent{align-items:stretch;flex-direction:column}.login-cookie-consent .button-row{width:100%}.login-cookie-consent form{flex:1}.login-cookie-consent button{width:100%}}
/* Sexual-health filters intentionally stay compact and left-stacked. */
.sexual-health-filter-panel{display:flex;flex-direction:column;align-items:flex-start;width:min(100%,320px);gap:.45rem}.sexual-health-filter-panel>label{width:100%;display:grid;gap:.2rem}.sexual-health-filter-panel select{width:100%}.sexual-health-filter-panel>.check{display:flex;grid-template-columns:auto 1fr;align-items:center}.sexual-health-filter-panel>.button{align-self:flex-start}


/* Sexual Health Resources: restored SQL71 card hierarchy + compact filter layout. */
.sexual-health-page-heading { margin-bottom: 1rem; }
.sexual-health-category-section,
.sexual-health-resources-section { display: grid; gap: .7rem; }
.sexual-health-section-heading { display: flex; align-items: end; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.sexual-health-section-heading h2,
.sexual-health-filter-heading h2 { margin: .1rem 0 0; }
.sexual-health-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: .8rem;
    margin: 0 0 1rem;
}
.sexual-health-category-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: .8rem;
    min-height: 175px;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    color: inherit;
    text-decoration: none;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.sexual-health-category-card:hover,
.sexual-health-category-card:focus-visible {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--primary) 50%, var(--line));
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
}
.sexual-health-category-card.is-selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 24%, transparent);
}
.sexual-health-category-card h3 { margin: .2rem 0 .35rem; font-size: 1.08rem; }
.sexual-health-category-card p { margin: 0; color: var(--muted); line-height: 1.45; }
.sexual-health-card-link { color: var(--primary); font-weight: 800; font-size: .88rem; }
.sexual-health-filter-panel {
    display: grid;
    width: 100%;
    gap: .75rem;
    padding: 1rem;
    margin: 0 0 1rem;
}
.sexual-health-filter-fields {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .65rem;
    align-items: end;
}
.sexual-health-filter-fields .field { display: grid; gap: .25rem; min-width: 0; }
.sexual-health-filter-fields select { width: 100%; }
.sexual-health-filter-fields small { color: var(--muted); }
.sexual-health-filter-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .38rem;
    padding-top: .65rem;
    border-top: 1px solid var(--line);
}
.sexual-health-filter-check {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    width: auto;
    cursor: pointer;
}
.sexual-health-filter-check input { margin: 0; }
.sexual-health-filter-actions { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: .2rem; }
.sexual-health-resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: .8rem;
}
.sexual-health-resource-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: .85rem;
    min-height: 250px;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
}
.sexual-health-resource-card h3 { margin: .2rem 0 .25rem; font-size: 1.12rem; }
.sexual-health-resource-organization { margin: 0 0 .45rem; color: var(--muted); font-weight: 700; }
.sexual-health-resource-description { margin: 0 0 .7rem; line-height: 1.48; }
.sexual-health-resource-meta { display: flex; gap: .4rem; flex-wrap: wrap; }
.sexual-health-resource-location { margin: .65rem 0 0; font-size: .86rem; color: var(--muted); }
.sexual-health-resource-actions { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }
.sexual-health-empty { grid-column: 1 / -1; }
@media (max-width: 980px) {
    .sexual-health-filter-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
    .sexual-health-category-grid, .sexual-health-resource-grid { grid-template-columns: 1fr; }
    .sexual-health-filter-fields { grid-template-columns: 1fr; }
    .sexual-health-category-card { min-height: 0; }
}


/* Sexual Health Resources: simplified category-card presentation. */
.sexual-health-category-actions { display:flex; justify-content:flex-end; margin:0 0 .65rem; }
.sexual-health-category-card-copy h3 { margin-top:0; }


/* 2026-08-22: left-aligned NSFW Photo Library checkbox settings. */
.profile-checkbox-setting {
    justify-self: start;
    align-self: start;
    width: min(100%, 760px);
    text-align: left;
}
.profile-checkbox-setting > input[type="checkbox"] {
    flex: 0 0 auto;
    margin-left: 0;
}
.profile-checkbox-setting > span {
    text-align: left;
}


/* 2026-08-22: contained, left-aligned checkbox setting cards. */
.profile-checkbox-settings-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    align-items: stretch;
    width: 100%;
}
.profile-setting-card {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: .75rem;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 0;
    padding: .9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-alt);
    text-align: left;
    cursor: pointer;
}
.profile-setting-card > input[type="checkbox"] {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin: .08rem 0 0;
}
.profile-setting-card > span {
    display: grid;
    gap: .2rem;
    min-width: 0;
    text-align: left;
}
.profile-setting-card strong { line-height: 1.25; }
.profile-setting-card small {
    color: var(--muted);
    line-height: 1.4;
    font-weight: 400;
}
.user-settings-section-heading { margin-top: .35rem; }
@media (max-width: 760px) {
    .profile-checkbox-settings-group { grid-template-columns: 1fr; }
}

/* Authenticated post-login launchpad */
.home-launchpad {
    display: grid;
    gap: 1.35rem;
    margin-top: -.7rem;
    padding-bottom: 2rem;
}
.home-welcome-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}
.home-welcome-row h1 {
    margin: .15rem 0 .2rem;
    font-size: clamp(2rem, 4vw, 3.15rem);
    line-height: 1;
}
.home-welcome-row p {
    margin: 0;
    color: var(--muted);
    font-size: 1.05rem;
}
.home-feature-card {
    position: relative;
    overflow: hidden;
    min-height: 260px;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
    align-items: stretch;
    border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
    border-radius: 24px;
    background:
        radial-gradient(circle at 88% 18%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 32%),
        linear-gradient(135deg, color-mix(in srgb, var(--primary) 10%, var(--surface)) 0%, var(--surface) 58%, color-mix(in srgb, var(--accent) 8%, var(--surface)) 100%);
    box-shadow: 0 18px 42px rgba(0,0,0,.08);
}
.home-feature-copy {
    position: relative;
    z-index: 2;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    align-self: center;
}
.home-feature-kicker {
    display: inline-flex;
    padding: .35rem .65rem;
    border-radius: 999px;
    background: var(--primary);
    color: var(--primary-text, #fff);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.home-feature-copy h2 {
    margin: .75rem 0 .55rem;
    font-size: clamp(1.75rem, 3.1vw, 2.7rem);
    line-height: 1.05;
}
.home-feature-copy p {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.6;
}
.home-feature-actions { margin-top: 1.25rem; }
.home-feature-art {
    position: relative;
    min-height: 250px;
    isolation: isolate;
}
.home-feature-avatar {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 122px;
    height: 122px;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 8px solid var(--surface);
    background: color-mix(in srgb, var(--primary) 14%, var(--surface));
    box-shadow: 0 18px 35px rgba(0,0,0,.18);
    z-index: 3;
    overflow: hidden;
}
.home-feature-avatar img { display: block; }
.home-feature-avatar-photo { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.home-feature-avatar-fallback { width: 70%; height: 70%; object-fit: contain; }
.home-feature-orbit {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid color-mix(in srgb, var(--primary) 36%, transparent);
    border-radius: 50%;
}
.home-feature-orbit-one { width: 205px; height: 205px; }
.home-feature-orbit-two { width: 300px; height: 300px; opacity: .7; }
.home-feature-dot {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 14%, transparent);
}
.home-feature-dot.dot-a { left: 18%; top: 28%; }
.home-feature-dot.dot-b { right: 18%; top: 20%; width: 14px; height: 14px; }
.home-feature-dot.dot-c { right: 15%; bottom: 24%; width: 11px; height: 11px; }
.home-feature-art-video { display:grid; place-items:center; font-size:5rem; color:var(--primary); opacity:.65; }
.home-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-top: .2rem;
}
.home-section-heading h2 { margin: .12rem 0 0; font-size: clamp(1.45rem, 2.4vw, 2rem); }
.home-section-heading > p { margin: 0; color: var(--muted); }
.home-section-heading-compact { align-items: center; }
.home-launch-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: .7rem;
}
.home-launch-card {
    position: relative;
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: .7rem;
    padding: .78rem .85rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    box-shadow: 0 7px 20px rgba(0,0,0,.045);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.home-launch-card:hover,
.home-launch-card:focus-visible {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--primary) 48%, var(--line));
    box-shadow: 0 14px 28px rgba(0,0,0,.085);
}
.home-launch-card-admin { background: color-mix(in srgb, var(--primary) 5%, var(--surface)); }
.home-launch-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: color-mix(in srgb, var(--primary) 12%, var(--surface-alt));
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 900;
}
.home-launch-card h3 { margin: .05rem 0 .28rem; font-size: 1.05rem; }
.home-launch-card p { margin: 0; color: var(--muted); line-height: 1.35; font-size: .9rem; }
.home-launch-arrow { align-self: center; color: var(--primary); font-size: 1.35rem; font-weight: 900; }
.home-card-status {
    display: inline-flex;
    margin-top: .7rem;
    padding: .28rem .55rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 14%, var(--surface-alt));
    color: var(--text);
    font-size: .72rem;
    font-weight: 850;
}
.home-for-you {
    display: grid;
    gap: .75rem;
    margin-top: .35rem;
}
.home-suggestion-list {
    display: grid;
    gap: .55rem;
}
.home-suggestion {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .9rem;
    padding: .85rem 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
}
.home-suggestion:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); }
.home-suggestion-marker {
    min-width: 46px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0 .5rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 12%, var(--surface-alt));
    color: var(--primary);
    font-size: .75rem;
    font-weight: 900;
}
.home-suggestion strong,
.home-suggestion small { display:block; }
.home-suggestion small { margin-top:.12rem; color:var(--muted); line-height:1.35; }
@media (max-width: 1050px) {
    .home-launch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .home-feature-card { grid-template-columns: 1fr; min-height: 0; }
    .home-feature-art { display: none; }
    .home-launch-grid { grid-template-columns: 1fr; }
    .home-section-heading { align-items: start; flex-direction: column; gap: .35rem; }
    .home-launch-card { min-height: 0; }
}

/* SQL79 - Goon Chat unavailable-partner conversation archiving */
.goon-chat-list-header { gap: .55rem; align-items: center; }
.chat-archive-toggle { margin-left: auto; padding: .3rem .55rem; font-size: .82rem; }
.chat-thread-unavailable { display: inline-flex; width: fit-content; margin-top: .12rem; padding: .08rem .38rem; border: 1px solid var(--border, #ddd); border-radius: 999px; font-size: .72rem; opacity: .78; }
.goon-chat-unavailable-notice { margin: .75rem 1rem 0; }

/* SQL80: navigation ordering + direct chat request workflow */
.nav-order-panel { padding: 18px; }
.nav-order-table input[type="number"] { width: 90px; }
.chat-request-overlay { position: fixed; inset: 0; z-index: 5000; background: rgba(18, 10, 28, .55); display: grid; place-items: center; padding: 20px; }
.chat-request-overlay[hidden] { display: none !important; }
.chat-request-dialog { width: min(560px, 94vw); background: var(--surface, #fff); color: var(--text, #222); border: 1px solid var(--border, #d9d0e4); border-radius: 18px; box-shadow: 0 24px 70px rgba(0,0,0,.28); padding: 24px; }
.chat-request-dialog h2 { margin: 4px 0 0; }
.chat-request-preview { margin: 18px 0; padding: 16px 18px; border-radius: 14px; background: var(--surface-muted, #f5f2f8); border: 1px solid var(--border, #ded5e8); white-space: pre-wrap; }
.chat-request-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.goon-chat-new-direct { display: flex; flex-direction: column; height: 100%; }
.goon-chat-request-intro { padding: 22px 24px 8px; }
.goon-chat-request-intro h3 { margin: 0 0 6px; }
.goon-chat-request-intro p { margin: 0; color: var(--muted, #666); }
.goon-chat-request-compose { margin-top: auto; }
.goon-chat-profile-picker { display: grid; gap: 6px; max-height: 240px; overflow: auto; padding: 4px; }
.goon-chat-profile-option { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid transparent; border-radius: 12px; text-decoration: none; color: inherit; }
.goon-chat-profile-option:hover, .goon-chat-profile-option.is-selected { background: var(--surface-muted, #f5f2f8); border-color: var(--border, #ded5e8); }
.goon-chat-profile-option span:last-child { min-width: 0; display: grid; }
.goon-chat-profile-option small { color: var(--muted, #666); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* 2026-08-27: comprehensive mobile-device responsive audit and control hardening. */
/* Form controls are full-width by default, but native choice controls must never inherit that width. */
input[type="checkbox"],
input[type="radio"] {
    width: auto;
    min-width: 0;
    min-height: 0;
    flex: 0 0 auto;
}

/* Older Administrator pages use page-header rather than page-heading. Give both the same responsive contract. */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}
.page-header > div,
.page-heading > div,
.panel,
.form-grid > *,
.grid > *,
.role-permission-row > *,
.report-filter-form > *,
.profile-form-grid > * {
    min-width: 0;
}
.page-header p,
.page-heading p,
.panel-title-row p,
.help,
.field-note,
.muted {
    overflow-wrap: anywhere;
}

/* Any table-wrap must be a touch-scroll container. Several admin views used the class without a shared rule. */
.table-wrap,
.nav-order-table-scroll,
.profile-admin-table-wrap,
.profile-kink-table-wrap,
.library-admin-table-scroll,
.automatic-settings-table-wrap,
.clip-grid-table {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.nav-order-table-scroll {
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
}
.nav-order-table { margin: 0; }

/* Choice-card controls: compact native controls + readable text. */
.role-assignment-card input[type="checkbox"],
.checkbox-row input[type="checkbox"],
.profile-reference-card.selectable input[type="checkbox"],
.profile-autoaccept-card input[type="checkbox"],
.sexual-health-filter-check input[type="checkbox"],
.chat-preferences-menu input[type="checkbox"] {
    width: 20px !important;
    height: 20px;
    min-width: 20px !important;
    min-height: 20px;
    margin: 0;
    flex: 0 0 20px;
    accent-color: var(--primary);
}
.role-assignment-card span,
.checkbox-row span,
.profile-reference-card.selectable span,
.profile-autoaccept-card span,
.sexual-health-filter-check span,
.chat-preferences-menu label {
    min-width: 0;
    overflow-wrap: anywhere;
}
.checkbox-row {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: 0;
}
.role-assignment-card {
    min-width: 0;
    margin: 0;
}

/* Prevent long media/admin form content from forcing its grid wider than the viewport. */
.compilation-time-readonly,
.compilation-duration,
.profile-library-row,
.profile-library-upload-form,
.library-invite-form,
.profile-library-invite-form {
    max-width: 100%;
    min-width: 0;
}
.compilation-time-readonly { width: 100%; }
img,
video,
canvas {
    max-width: 100%;
}

@media (max-width: 700px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .page-header > .button,
    .page-header > a.button,
    .page-header > .button-row {
        width: 100%;
    }

    /* Role assignment was unusable on iPhone because the checkbox consumed the card width. */
    .role-assignment-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .role-assignment-card {
        min-height: 52px;
        padding: .7rem .8rem;
        align-items: center;
    }
    .role-assignment-card input[type="checkbox"] {
        width: 22px !important;
        height: 22px;
        min-width: 22px !important;
        min-height: 22px;
        flex-basis: 22px;
    }
    .role-assignment-card span {
        flex: 1 1 auto;
        font-weight: 700;
        line-height: 1.25;
    }
    .role-permission-section > summary {
        flex-wrap: wrap;
        gap: .35rem .75rem;
    }

    /* Mobile-friendly admin/settings controls. Wide data remains scrollable inside its panel, never across the page. */
    .nav-order-panel { padding: 10px; }
    .nav-order-table { min-width: 360px; }
    .nav-order-table input[type="number"] { width: 72px; min-width: 72px; }
    .form-actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .form-actions .button { width: 100%; }

    .profile-reference-grid { grid-template-columns: 1fr; }
    .profile-reference-card.selectable { align-items: flex-start; }
    .profile-section-heading,
    .panel-title-row {
        flex-wrap: wrap;
    }
    .profile-save-bar { padding: .55rem; }
    .profile-save-bar .button { width: 100%; }

    /* Menus that are anchored near the right edge must stay inside the iPhone viewport. */
    .chat-control-menu,
    .chat-preferences-menu {
        left: auto;
        right: 0;
        width: min(320px, calc(100vw - 24px));
        min-width: 0;
        max-width: calc(100vw - 24px);
    }
    .chat-control-menu button,
    .chat-preferences-menu .button { white-space: normal; }

    /* Library invite editors are easier to use inline than as narrow floating popovers on touch screens. */
    .library-invite-form,
    .profile-library-invite-form {
        position: static;
        width: 100%;
        max-width: 100%;
        margin-top: 7px;
        box-shadow: none;
    }

    .report-filter-actions > * {
        flex: 1 1 100%;
    }
    .report-filter-actions .button { width: 100%; }
}

@media (max-width: 430px) {
    .page-shell,
    .app-content .page-shell {
        max-width: 100%;
    }
    .panel { max-width: 100%; }
    .time-fields {
        flex-wrap: wrap;
    }
    .chat-request-dialog {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        padding: 16px;
    }
}

/* 2026-08-27 mobile audit follow-up: narrow account branding and compact section actions. */
.login-brand > div {
    min-width: 0;
}
.login-brand h1,
.login-brand p {
    overflow-wrap: anywhere;
}

@media (max-width: 700px) {
    .section-heading,
    .sexual-health-section-heading {
        flex-wrap: wrap;
    }

    .sexual-health-category-actions {
        max-width: 100%;
    }
    .sexual-health-category-actions .button {
        max-width: 100%;
        white-space: normal;
        text-align: center;
    }
}

@media (max-width: 430px) {
    .login-brand {
        align-items: flex-start;
        gap: 10px;
    }
    .login-logo {
        max-width: min(96px, 32vw);
        max-height: 60px;
    }
    .login-mark {
        width: 46px;
        height: 46px;
        min-width: 46px;
    }
}

@media (max-width: 700px) {
    .role-assignment-grid + .button-row {
        width: 100%;
        margin-top: 10px;
    }
    .role-assignment-grid + .button-row .button {
        width: 100%;
        white-space: normal;
    }
}

/* 2026-08-27: Set Cut Scenes visual timeline / multi-clip batch editor. */
.cut-editor-mode-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}
.cut-editor-mode-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}
.cut-editor-mode-copy strong { font-size: 1rem; }
.cut-editor-mode-buttons {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}
.visual-cut-editor[hidden],
#classic-cut-editor[hidden] { display: none !important; }
.visual-cut-editor {
    padding: 0;
    overflow: hidden;
    margin-bottom: 12px;
}
.visual-cut-editor > .panel-title-row {
    margin: 0;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-alt);
}
.visual-cut-editor-heading { align-items: center; }
.visual-cut-duration-badge {
    min-width: 118px;
    display: grid;
    gap: 1px;
    justify-items: end;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    background: var(--surface);
}
.visual-cut-duration-badge span { color: var(--muted); font-size: 11px; }
.visual-cut-duration-badge strong { font-family: Consolas, monospace; font-size: 14px; }
.visual-cut-video-category-panel {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}
.visual-cut-current-category-panel {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-alt);
}
.visual-cut-category-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.visual-cut-category-heading.compact { align-items: center; }
.visual-cut-category-heading h3 { margin: 0 0 2px; font-size: 1rem; }
.visual-cut-category-actions { flex: 0 0 auto; flex-wrap: wrap; }
.visual-cut-category-chip-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.visual-cut-category-chip-list.clip-scope { max-height: 190px; overflow-y: auto; padding-right: 2px; }
.visual-cut-category-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    max-width: 100%;
    margin: 0;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-alt);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}
.visual-cut-category-chip input[type="checkbox"] {
    width: 17px;
    height: 17px;
    min-width: 17px;
    margin: 0;
    padding: 0;
    accent-color: var(--primary);
}
.visual-cut-category-chip span { min-width: 0; overflow-wrap: anywhere; }
.visual-cut-category-chip.is-associated,
.visual-cut-category-chip.is-selected {
    border-color: color-mix(in srgb, var(--primary) 60%, var(--line));
    background: var(--primary-soft);
    color: var(--primary);
}
.visual-cut-category-chip[hidden] { display: none !important; }
.visual-cut-category-persistence-note { margin-top: 7px; font-size: 11px; }

.visual-cut-category-transfer > div > h4,
.visual-cut-draft-category-transfer > div > h4 {
    margin: 0 0 5px;
    font-size: 13px;
}
.visual-cut-category-transfer .transfer-list,
.visual-cut-draft-category-transfer .transfer-list {
    background: var(--surface);
}
.visual-cut-category-list-item {
    width: 100%;
    min-height: 28px;
    padding-top: 1px;
    padding-bottom: 1px;
    line-height: 1.15;
    text-align: left;
}
.visual-cut-category-list-item:disabled {
    opacity: .58;
    cursor: wait;
}
.visual-cut-category-scope-empty {
    margin-top: 7px;
}
.visual-cut-layout {
    display: grid;
    grid-template-columns: minmax(320px, .9fr) minmax(420px, 1.1fr);
    gap: 14px;
    padding: 14px;
    align-items: start;
}
.visual-cut-player-column,
.visual-cut-selection-column { min-width: 0; }
.visual-cut-video-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: #090b0e;
}
.visual-cut-video-frame video {
    width: 100%;
    height: 100%;
    max-height: 520px;
    object-fit: contain;
    background: #090b0e;
}
.visual-cut-now-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-top: 7px;
}
.visual-cut-now-row strong,
.visual-cut-time-text { font-family: Consolas, monospace; }
.visual-cut-now-row strong { font-size: 16px; }
.visual-cut-scrubber,
.visual-cut-marker-range {
    width: 100%;
    margin: 5px 0 0;
    accent-color: var(--primary);
}
.visual-cut-timeline-shell { margin-bottom: 10px; }
.visual-cut-timeline-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 700;
}
.visual-cut-key {
    width: 10px;
    height: 6px;
    display: inline-block;
    margin: 0 3px 0 7px;
    border-radius: 999px;
    vertical-align: middle;
}
.visual-cut-key.existing { background: #748494; }
.visual-cut-key.draft { background: var(--primary); }
.visual-cut-timeline {
    position: relative;
    height: 48px;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background:
        repeating-linear-gradient(to right, transparent 0, transparent calc(10% - 1px), rgba(100,115,128,.2) calc(10% - 1px), rgba(100,115,128,.2) 10%),
        var(--surface-alt);
    cursor: pointer;
}
.visual-cut-selection-range {
    position: absolute;
    top: 15px;
    height: 17px;
    min-width: 2px;
    z-index: 2;
    border: 2px solid var(--primary);
    border-radius: 5px;
    background: var(--primary-soft);
    pointer-events: none;
}
.visual-cut-selection-range.invalid {
    border-color: var(--danger);
    background: var(--danger-soft);
}
.visual-cut-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    z-index: 5;
    background: var(--text);
    pointer-events: none;
}
.visual-cut-draft-ranges {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
}
.visual-cut-existing-range,
.visual-cut-draft-range {
    position: absolute;
    min-width: 3px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
}
.visual-cut-existing-range {
    top: 4px;
    height: 7px;
    z-index: 3;
    background: #748494;
    opacity: .78;
}
.visual-cut-draft-range {
    bottom: 4px;
    height: 8px;
    z-index: 4;
    background: var(--primary);
    pointer-events: auto;
}
.visual-cut-existing-range:hover,
.visual-cut-draft-range:hover { filter: brightness(.85); }
.visual-cut-marker-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.visual-cut-marker-card {
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-alt);
}
.visual-cut-marker-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
}
.visual-cut-marker-heading label { font-weight: 800; }
.visual-cut-time-text {
    width: 100%;
    text-align: center;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: .02em;
}
.visual-cut-nudge-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    margin-top: 6px;
}
.visual-cut-nudge-row .button { min-width: 0; padding-left: 5px; padding-right: 5px; }
.visual-cut-selection-details {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
    margin-top: 10px;
}
.visual-cut-description-field { display: grid; gap: 4px; min-width: 0; }
.visual-cut-description-field > span { font-weight: 700; }
.visual-cut-exclude-check { min-height: 38px; padding: 0 6px; }
.visual-cut-selection-actions {
    margin-top: 10px;
    flex-wrap: wrap;
}
.visual-cut-status {
    min-height: 20px;
    margin-top: 7px;
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}
.visual-cut-status.error { color: var(--danger); }
.visual-cut-status.success { color: var(--success); }
.visual-cut-batch-panel {
    border-top: 1px solid var(--line);
    background: var(--surface-alt);
}
.visual-cut-batch-heading-row {
    padding: 10px 14px;
    margin: 0;
    border-bottom: 1px solid var(--line);
}
.visual-cut-batch-heading-row h3 { margin: 0; }
.visual-cut-batch-list { display: grid; }
.visual-cut-batch-row {
    display: grid;
    grid-template-columns: 34px minmax(205px, auto) minmax(170px, 1fr) minmax(170px, .9fr) auto auto;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}
.visual-cut-batch-row:nth-child(even) { background: var(--surface-alt); }
.visual-cut-batch-number {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
}
.visual-cut-batch-times { display: grid; gap: 1px; min-width: 0; }
.visual-cut-batch-times strong { font-family: Consolas, monospace; }
.visual-cut-batch-description { min-width: 0; }
.visual-cut-batch-categories { display: grid; gap: 3px; min-width: 0; }
.visual-cut-batch-category-chips { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.visual-cut-batch-category-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 2px 7px;
    border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--line));
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    overflow-wrap: anywhere;
}
.visual-cut-batch-excluded { white-space: nowrap; }
.visual-cut-batch-actions { display: flex; gap: 5px; flex-wrap: wrap; }
.visual-cut-batch-panel .compact-empty { margin: 10px 12px; }
.visual-cut-create-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px 12px;
}
.visual-cut-create-row .visual-cut-status { margin: 0; }
.visual-cut-create-row .button { flex: 0 0 auto; }

@media (max-width: 1050px) {
    .visual-cut-layout { grid-template-columns: 1fr; }
    .visual-cut-video-frame video { max-height: none; }
    .visual-cut-batch-row {
        grid-template-columns: 34px minmax(185px, .7fr) minmax(170px, 1fr) minmax(160px, .9fr) auto;
    }
    .visual-cut-batch-actions { grid-column: 2 / -1; }
}

@media (max-width: 700px) {
    .cut-editor-mode-panel {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }
    .cut-editor-mode-buttons {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }
    .cut-editor-mode-buttons .button { width: 100%; min-height: 44px; }
    .visual-cut-editor > .panel-title-row {
        align-items: flex-start;
        flex-direction: column;
    }
    .visual-cut-duration-badge {
        width: 100%;
        justify-items: start;
    }
    .visual-cut-video-category-panel { padding: 10px; }
    .visual-cut-category-heading,
    .visual-cut-category-heading.compact {
        align-items: stretch;
        flex-direction: column;
    }
    .visual-cut-category-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }
    .visual-cut-category-actions .button,
    .visual-cut-category-heading > .button { width: 100%; min-height: 42px; }
    .visual-cut-category-transfer .transfer-list,
    .visual-cut-draft-category-transfer .transfer-list { min-height: 120px; max-height: 220px; }
    .visual-cut-category-list-item { min-height: 32px; padding-top: 1px; padding-bottom: 1px; font-size: 13px; line-height: 1.15; }
    .visual-cut-category-chip { min-height: 40px; font-size: 13px; }
    .visual-cut-layout { padding: 10px; gap: 10px; }
    .visual-cut-marker-grid { grid-template-columns: 1fr; }
    .visual-cut-marker-card { padding: 9px; }
    .visual-cut-marker-heading .button { min-height: 40px; }
    .visual-cut-nudge-row .button { min-height: 42px; }
    .visual-cut-selection-details { grid-template-columns: 1fr; }
    .visual-cut-exclude-check { min-height: 44px; }
    .visual-cut-selection-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }
    .visual-cut-selection-actions .button { width: 100%; min-height: 44px; }
    .visual-cut-timeline { height: 56px; }
    .visual-cut-selection-range { top: 18px; height: 20px; }
    .visual-cut-existing-range { top: 5px; height: 8px; }
    .visual-cut-draft-range { bottom: 5px; height: 9px; }
    .visual-cut-batch-row {
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 7px 9px;
        padding: 10px;
    }
    .visual-cut-batch-times,
    .visual-cut-batch-description,
    .visual-cut-batch-categories,
    .visual-cut-batch-excluded,
    .visual-cut-batch-actions { grid-column: 2; }
    .visual-cut-batch-description { width: 100%; }
    .visual-cut-batch-actions .button { min-height: 40px; flex: 1 1 auto; }
    .visual-cut-create-row {
        align-items: stretch;
        flex-direction: column;
    }
    .visual-cut-create-row .button { width: 100%; min-height: 46px; }
}

@media (max-width: 430px) {
    .visual-cut-timeline-labels {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }
    .visual-cut-now-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 1px;
    }
    .visual-cut-nudge-row { gap: 4px; }
    .visual-cut-nudge-row .button { font-size: 12px; }
}
.visual-cut-batch-row.is-editing {
    box-shadow: inset 4px 0 0 var(--primary);
    background: var(--primary-soft);
}
.cut-editor-mode-panel { flex-wrap: wrap; }
.cut-editor-mode-copy { flex: 1 1 320px; }
@media (max-width: 700px) {
    .visual-cut-editor input:not([type="range"]):not([type="checkbox"]):not([type="radio"]) {
        font-size: 16px;
    }
}

/* Automatic Processing: File Sync scheduler health diagnostics */
.filesync-health-card {
    margin: .75rem 0 1rem;
    padding: .8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-alt);
}
.filesync-health-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .45rem;
}
.filesync-health-header h3 {
    margin: 0;
    font-size: 1rem;
}
.filesync-health-header .help {
    margin: .18rem 0 0;
}
.filesync-health-status {
    flex: 0 0 auto;
    padding: .26rem .55rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    font-weight: 800;
    white-space: nowrap;
}
.filesync-health-detail {
    margin: 0 0 .65rem;
    line-height: 1.35;
}
.filesync-health-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--line);
}
.filesync-health-grid > div {
    min-width: 0;
    padding: .48rem .55rem;
    background: var(--surface);
}
.filesync-health-grid dt {
    margin: 0 0 .18rem;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 750;
}
.filesync-health-grid dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: .86rem;
    line-height: 1.3;
}
.filesync-health-wide {
    grid-column: 1 / -1;
}

@media (max-width: 900px) {
    .filesync-health-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .filesync-health-header {
        flex-direction: column;
    }
    .filesync-health-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .filesync-health-wide {
        grid-column: auto;
    }
}


/* 2026-08-29: Viewer hero Set Cut Scenes shortcut. */
@media (max-width: 680px) {
    .viewing-hero-cut-scenes {
        top: 11px;
        right: 11px;
        width: 40px;
        height: 40px;
        font-size: 19px;
    }

    .viewing-hero.has-cut-scenes-shortcut .viewing-hero-copy {
        padding-right: 44px;
    }
}


/* 2026-08-29: mobile GoonGrid edge-to-edge photo mosaic.
   Keep desktop card presentation unchanged; on touch-sized screens the grid is image-first. */
@media (max-width: 700px) {
    .goongrid-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0 !important;
        width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        align-items: stretch;
    }

    .goongrid-profile,
    button.goongrid-profile {
        position: relative;
        min-width: 0;
        padding: 0 !important;
        margin: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        overflow: hidden;
    }

    .goongrid-photo-wrap {
        width: 100%;
        aspect-ratio: 1 / 1;
        margin: 0;
        padding: 0;
        overflow: hidden;
    }

    .goongrid-photo,
    .goongrid-photo-fallback {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    /* Distance belongs in the opened profile on mobile, not on the photo grid. */
    .goongrid-distance {
        display: none !important;
    }

    /* Preserve the required offline elapsed-time indicator without creating space between photos. */
    .goongrid-profile-meta {
        position: absolute;
        right: 4px;
        bottom: 4px;
        z-index: 2;
        display: block;
        width: auto;
        margin: 0;
        padding: 0;
        pointer-events: none;
    }

    .goongrid-profile-meta:empty {
        display: none;
    }

    .goongrid-offline-status {
        display: block;
        padding: 2px 5px;
        border: 1px solid rgba(255,255,255,.22);
        border-radius: 7px;
        background: rgba(20,20,24,.82);
        color: #d7d9df;
        font-size: .62rem;
        font-weight: 800;
        line-height: 1.1;
        white-space: nowrap;
        text-shadow: 0 1px 2px rgba(0,0,0,.8);
    }

    .goongrid-live-dot {
        left: 4px;
        bottom: 4px;
        width: 14px;
        height: 14px;
        border-width: 2px;
        border-color: rgba(20,20,24,.72);
    }
}

/* Viewer library cards: shortened-version link occupies its own row,
   then Length/Delete share a consistent bottom row. */
.viewing-library-shortened-row {
    margin: 0;
}

.viewing-library-card-meta-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    column-gap: 8px;
    min-width: 0;
}

.viewing-library-card-meta-actions .viewing-media-length {
    margin-top: 0;
    align-self: end;
}

.viewing-library-delete-form-inline {
    align-self: end;
    display: block;
    margin: 0;
    overflow: visible;
}

.viewing-library-delete-form-inline .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .viewing-library-card-meta-actions {
        column-gap: 6px;
    }
}

/* 2026-08-29: Compact Viewing hero and destination cards.
   Remove the oversized cinematic minimum heights while preserving hierarchy. */
.viewing-hero {
    min-height: 0;
    gap: clamp(14px, 2vw, 28px);
    margin-bottom: 10px;
    padding: clamp(18px, 2.5vw, 30px);
}

.viewing-eyebrow,
.viewing-kicker {
    margin-bottom: 2px;
}

.viewing-hero h1 {
    margin-bottom: 5px;
    font-size: clamp(30px, 3.5vw, 48px);
}

.viewing-hero-stats {
    gap: 7px;
}

.viewing-stat {
    padding: 9px 8px;
}

.viewing-stat span {
    font-size: clamp(20px, 2.1vw, 28px);
    line-height: 1.05;
}

.viewing-destinations {
    gap: 7px;
    margin-bottom: 14px;
}

.viewing-destination {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 58px;
    padding: 7px 10px;
}

.viewing-destination-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 15px;
}

@media (max-width: 680px) {
    .viewing-hero {
        min-height: 0;
        padding: 16px 14px;
        gap: 14px;
    }

    .viewing-hero h1 {
        margin-bottom: 4px;
        font-size: 30px;
    }

    .viewing-stat {
        padding: 8px 5px;
    }

    .viewing-destination {
        min-height: 54px;
        padding: 6px 9px;
    }
}


/* 2026-08-29: Uniform Viewer video-card metadata rows.
   Title and category areas reserve consistent vertical space while the
   shortened-version control lives as an overlay on the artwork. */
.viewing-video-card-body {
    gap: 6px;
}

.viewing-video-card-body > .viewing-media-title {
    height: 32px;
    min-height: 32px;
    max-height: 32px;
}

.viewing-video-card-category-slot {
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    overflow: hidden;
    align-content: flex-start;
}


.viewing-shortened-version-play {
    appearance: none;
    position: relative;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 0 0 0 1px;
    border: 1px solid color-mix(in srgb, var(--primary) 55%, var(--line));
    border-radius: 50%;
    background: color-mix(in srgb, var(--surface) 90%, var(--primary-soft));
    color: var(--primary);
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(10, 8, 20, .10);
    transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.viewing-shortened-version-play::after {
    content: "S";
    position: absolute;
    right: -4px;
    bottom: -3px;
    min-width: 13px;
    height: 13px;
    display: grid;
    place-items: center;
    padding: 0 2px;
    border: 1px solid var(--surface);
    border-radius: 999px;
    background: var(--primary);
    color: var(--primary-text, #fff);
    font-size: 8px;
    font-weight: 850;
    line-height: 1;
}

.viewing-shortened-version-play-glyph {
    display: block;
    font-size: 12px;
    line-height: 1;
}

.viewing-shortened-version-play:hover,
.viewing-shortened-version-play:focus-visible {
    transform: translateY(-1px);
    border-color: var(--primary);
    background: var(--primary-soft);
}

.viewing-video-card-length-slot {
    min-height: 28px;
}

.viewing-video-card-body > .viewing-media-length.viewing-video-card-length-slot {
    display: flex;
    align-items: center;
    margin-top: 0;
}

.viewing-library-card-meta-actions.viewing-video-card-length-slot {
    align-items: center;
}

.viewing-library-card-meta-actions.viewing-video-card-length-slot .viewing-media-length {
    margin-top: 0;
}

@media (max-width: 480px) {
    .viewing-video-card-body {
        gap: 5px;
    }

    .viewing-video-card-category-slot {
        height: 38px;
        min-height: 38px;
        max-height: 38px;
    }
}


/* Processing Center task/status filters */
.processing-center-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    margin: 0 0 14px;
}
.processing-center-filter {
    display: grid;
    gap: 4px;
    min-width: 190px;
}
.processing-center-filter > span {
    font-size: .82rem;
    font-weight: 700;
    color: var(--muted);
}
.processing-center-filter select {
    min-width: 190px;
}
.processing-center-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
@media (max-width: 640px) {
    .processing-center-filter {
        flex: 1 1 100%;
        min-width: 0;
    }
    .processing-center-filter select {
        width: 100%;
        min-width: 0;
    }
    .processing-center-filter-actions {
        width: 100%;
    }
}

/* 2026-09-01 SQL90: Profile Setup Wizard visual refresh.
   Presentation only: preserves all existing wizard fields, binding, navigation, and persistence. */
.profile-wizard {
    --wizard-accent-line: color-mix(in srgb, var(--primary) 34%, var(--line));
    --wizard-soft: color-mix(in srgb, var(--primary-soft) 58%, var(--surface));
    --wizard-glow: color-mix(in srgb, var(--primary) 12%, transparent);
    padding-bottom: 22px;
}
.profile-wizard-heading {
    position: relative;
    padding: 6px 4px 8px 16px;
}
.profile-wizard-heading::before {
    content: "";
    position: absolute;
    inset: 6px auto 8px 0;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    box-shadow: 0 0 18px color-mix(in srgb, var(--primary) 30%, transparent);
}
.profile-wizard-heading h1 {
    margin-bottom: 5px;
    font-size: clamp(2rem, 3vw, 2.55rem);
    font-weight: 800;
    letter-spacing: -.025em;
}
.profile-wizard-heading .eyebrow {
    color: var(--primary);
    font-weight: 800;
    letter-spacing: .03em;
}
.profile-wizard-progress {
    position: relative;
    overflow: hidden;
    margin-bottom: 18px;
    padding: 14px 17px 15px;
    border: 1px solid var(--wizard-accent-line);
    border-radius: 16px;
    background:
        radial-gradient(circle at 100% -30%, var(--wizard-glow), transparent 46%),
        linear-gradient(120deg, var(--wizard-soft), var(--surface) 48%, color-mix(in srgb, var(--primary-soft) 24%, var(--surface)));
    box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 9%, rgba(0,0,0,.08));
}
.profile-wizard-progress-copy strong {
    color: var(--primary);
    font-size: .94rem;
    letter-spacing: .015em;
}
.profile-wizard-progress-copy span { font-weight: 700; }
.profile-wizard-progress-track {
    height: 8px;
    border: 1px solid color-mix(in srgb, var(--primary) 9%, var(--line));
    background: color-mix(in srgb, var(--surface-strong) 80%, var(--primary-soft));
    box-shadow: inset 0 1px 2px rgba(0,0,0,.06);
}
.profile-wizard-progress-track > span {
    background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 74%, var(--accent)));
    box-shadow: 0 0 12px color-mix(in srgb, var(--primary) 30%, transparent);
}
.profile-wizard-card {
    position: relative;
    overflow: hidden;
    padding: 24px 26px 26px;
    border: 1px solid var(--wizard-accent-line);
    border-radius: 18px;
    background:
        radial-gradient(circle at 100% 0%, var(--wizard-glow), transparent 38%),
        linear-gradient(180deg, color-mix(in srgb, var(--primary-soft) 22%, var(--surface)) 0, var(--surface) 145px);
    box-shadow:
        0 14px 34px color-mix(in srgb, var(--primary) 8%, rgba(0,0,0,.10)),
        inset 0 1px 0 color-mix(in srgb, #fff 72%, transparent);
}
.profile-wizard-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 65%, var(--accent)), var(--accent));
}
.profile-wizard-card > .eyebrow,
.profile-wizard-card .profile-section-heading .eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 24px;
    margin: 2px 0 7px;
    padding: 3px 9px;
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--line));
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary-soft) 76%, var(--surface));
    color: var(--primary);
    font-size: .76rem;
    font-weight: 850;
    letter-spacing: .045em;
    text-transform: uppercase;
}
.profile-wizard-card > h2,
.profile-wizard-card .profile-section-heading h2 {
    margin: 0 0 7px;
    color: var(--primary);
    font-size: clamp(1.35rem, 2vw, 1.62rem);
    font-weight: 850;
    letter-spacing: -.015em;
}
.profile-wizard-card > p { color: var(--muted); max-width: 880px; }
.profile-wizard-card input[type="checkbox"],
.profile-wizard-card input[type="radio"] { accent-color: var(--primary); }
.profile-wizard-card input,
.profile-wizard-card select,
.profile-wizard-card textarea {
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.profile-wizard-card input:focus,
.profile-wizard-card select:focus,
.profile-wizard-card textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}

/* Choice cards across Presence / Looking For / Health / Positions. */
.profile-wizard-choice,
.profile-wizard-check-grid .check {
    position: relative;
    border: 1px solid color-mix(in srgb, var(--line) 88%, var(--primary));
    border-radius: 11px;
    background: color-mix(in srgb, var(--surface-alt) 82%, var(--surface));
    transition: transform .14s ease, border-color .14s ease, background .14s ease, box-shadow .14s ease;
}
.profile-wizard-choice {
    min-height: 45px;
    padding: 10px 12px;
}
.profile-wizard-check-grid { gap: 8px 10px; }
.profile-wizard-check-grid .check {
    min-height: 39px;
    padding: 7px 10px;
}
.profile-wizard-choice:hover,
.profile-wizard-check-grid .check:hover {
    border-color: color-mix(in srgb, var(--primary) 48%, var(--line));
    background: color-mix(in srgb, var(--primary-soft) 42%, var(--surface));
    box-shadow: 0 5px 14px color-mix(in srgb, var(--primary) 8%, transparent);
    transform: translateY(-1px);
}
.profile-wizard-choice:has(input:checked),
.profile-wizard-check-grid .check:has(input:checked) {
    border-color: color-mix(in srgb, var(--primary) 66%, var(--line));
    background: color-mix(in srgb, var(--primary-soft) 78%, var(--surface));
    box-shadow: inset 4px 0 0 var(--primary), 0 5px 16px color-mix(in srgb, var(--primary) 9%, transparent);
}
.profile-wizard-choice:has(input:checked) strong,
.profile-wizard-check-grid .check:has(input:checked) span { color: var(--primary-dark); font-weight: 800; }

.profile-wizard-subsection {
    margin-top: 22px;
    padding: 16px;
    border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--line));
    border-radius: 14px;
    background: color-mix(in srgb, var(--primary-soft) 34%, var(--surface));
}
.profile-wizard-subsection h3 {
    margin-bottom: 11px;
    color: var(--primary);
    font-size: 1rem;
    font-weight: 850;
}

/* Make the previously plain multi-column steps feel like selectable content cards. */
.profile-wizard-responsive-option-grid {
    gap: 7px 10px;
    margin-top: 13px;
}
.profile-wizard-responsive-option-grid .check {
    min-height: 40px;
    padding: 7px 10px;
    border-radius: 10px;
    line-height: 1.2;
}
.profile-wizard-responsive-option-grid .check:has(input:checked) {
    background: linear-gradient(110deg, color-mix(in srgb, var(--primary-soft) 90%, var(--surface)), color-mix(in srgb, var(--primary-soft) 48%, var(--surface)));
}

/* Kinks & Interests: richer selection and detail cards without changing flow. */
.profile-wizard-kink-selection-heading,
.profile-wizard-kink-flow-status,
.profile-wizard-kink-category-complete {
    border-color: color-mix(in srgb, var(--primary) 24%, var(--line));
    border-radius: 13px;
    background: linear-gradient(120deg, color-mix(in srgb, var(--primary-soft) 45%, var(--surface)), var(--surface));
}
.profile-wizard-kink-selection-heading strong,
.profile-wizard-kink-flow-status strong,
.profile-wizard-kink-category-complete strong { color: var(--primary); }
.profile-wizard-kink-category-list { gap: 9px; }
.profile-wizard-kink-category-selector {
    border-color: color-mix(in srgb, var(--line) 84%, var(--primary));
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface-alt) 82%, var(--surface));
    box-shadow: 0 2px 8px rgba(0,0,0,.025);
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s ease;
}
.profile-wizard-kink-category-selector:hover {
    border-color: color-mix(in srgb, var(--primary) 44%, var(--line));
    transform: translateY(-1px);
}
.profile-wizard-kink-category-selector.is-yes {
    border-color: color-mix(in srgb, var(--primary) 70%, var(--line));
    background: color-mix(in srgb, var(--primary-soft) 76%, var(--surface));
    box-shadow: inset 4px 0 0 var(--primary), 0 5px 14px color-mix(in srgb, var(--primary) 8%, transparent);
}
.profile-wizard-kink-category-selector-copy > strong { font-size: .98rem; }
.profile-wizard-kink-category-selector.is-yes .profile-wizard-kink-category-selector-copy > strong { color: var(--primary-dark); }
.profile-wizard-kink-category-step {
    border-color: color-mix(in srgb, var(--primary) 28%, var(--line));
    border-radius: 15px;
    background:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--primary) 9%, transparent), transparent 34%),
        var(--surface);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 7%, transparent);
}
.profile-wizard-kink-items-heading {
    margin-bottom: 5px;
    border-bottom: 1px solid color-mix(in srgb, var(--primary) 20%, var(--line));
}
.profile-wizard-kink-items-heading > strong { font-size: 1.5rem; }
.profile-wizard-kink-row {
    margin: 2px 0;
    padding: 7px 8px 7px 10px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: color-mix(in srgb, var(--surface-alt) 68%, transparent);
}
.profile-wizard-kink-row:hover {
    border-color: color-mix(in srgb, var(--primary) 18%, var(--line));
    background: color-mix(in srgb, var(--primary-soft) 30%, var(--surface));
}
.profile-wizard-kink-options label {
    margin: 0;
    padding: 4px 7px;
    border: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
    border-radius: 999px;
    background: var(--surface);
    cursor: pointer;
    transition: border-color .12s ease, background .12s ease, color .12s ease;
}
.profile-wizard-kink-options label:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    font-weight: 750;
}
.profile-wizard-kink-options label:has(input:checked) input { accent-color: #fff; }

/* STI testing: retain the clean columns, add themed hierarchy and row polish. */
.profile-wizard-set-all {
    display: grid;
    grid-template-columns: minmax(150px, .7fr) minmax(170px, 1fr) auto;
    align-items: end;
    gap: 9px 12px;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--primary-soft) 34%, var(--surface));
}
.profile-wizard-set-all label { margin: 0; color: var(--primary); font-weight: 800; }
.profile-wizard-sti-table {
    border-color: color-mix(in srgb, var(--primary) 24%, var(--line));
    border-radius: 13px;
    background: var(--surface);
    box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 6%, transparent);
}
.profile-wizard-sti-header {
    border-bottom-color: color-mix(in srgb, var(--primary) 24%, var(--line));
    background: linear-gradient(110deg, color-mix(in srgb, var(--primary-soft) 80%, var(--surface)), color-mix(in srgb, var(--surface-strong) 82%, var(--primary-soft)));
}
.profile-wizard-sti-heading { color: var(--primary-dark); font-weight: 850; }
.profile-wizard-sti-row { background: var(--surface); transition: background .12s ease; }
.profile-wizard-sti-row:nth-child(even) { background: color-mix(in srgb, var(--surface-alt) 72%, var(--surface)); }
.profile-wizard-sti-row:hover { background: color-mix(in srgb, var(--primary-soft) 34%, var(--surface)); }
.profile-wizard-sti-name { color: var(--text); font-weight: 750; }

/* Wizard navigation gets a little more visual separation from the form surface. */
.profile-wizard-nav {
    align-items: center;
    margin-top: 15px;
    padding-top: 13px;
    border-top: 1px solid color-mix(in srgb, var(--primary) 13%, var(--line));
}
.profile-wizard-form > .profile-wizard-nav { margin-top: 13px; }
.profile-wizard-nav .button.primary {
    min-width: 104px;
    box-shadow: 0 5px 14px color-mix(in srgb, var(--primary) 20%, transparent);
}

@media (max-width: 760px) {
    .profile-wizard-heading { padding-left: 13px; }
    .profile-wizard-heading h1 { font-size: 1.95rem; }
    .profile-wizard-progress { border-radius: 13px; padding: 12px 13px 13px; }
    .profile-wizard-card { padding: 19px 15px 18px; border-radius: 14px; }
    .profile-wizard-card > h2,
    .profile-wizard-card .profile-section-heading h2 { font-size: 1.32rem; }
    .profile-wizard-check-grid .check { min-height: 42px; }
    .profile-wizard-responsive-option-grid { gap: 7px; }
    .profile-wizard-kink-row { padding: 9px; }
    .profile-wizard-kink-options { gap: 6px; padding-left: 0; }
    .profile-wizard-kink-options label { flex: 1 1 calc(50% - 6px); justify-content: flex-start; }
    .profile-wizard-set-all { grid-template-columns: 1fr; align-items: stretch; }
    .profile-wizard-set-all .button { width: 100%; }
    .profile-wizard-sti-row {
        border-color: color-mix(in srgb, var(--primary) 18%, var(--line));
        border-radius: 12px;
        background: var(--surface);
        box-shadow: 0 3px 10px color-mix(in srgb, var(--primary) 5%, transparent);
    }
    .profile-wizard-nav { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    .profile-wizard-choice,
    .profile-wizard-check-grid .check,
    .profile-wizard-kink-category-selector,
    .profile-wizard-card input,
    .profile-wizard-card select,
    .profile-wizard-card textarea { transition: none; }
}

/* Wizard-specific polish for the photo and profile-basics steps. */
.profile-wizard-card .profile-basics-rows {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 15px;
}
.profile-wizard-card .profile-basic-row {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 6px;
    min-width: 0;
    margin: 0;
    padding: 11px 12px 12px;
    border: 1px solid color-mix(in srgb, var(--line) 86%, var(--primary));
    border-radius: 11px;
    background: color-mix(in srgb, var(--surface-alt) 78%, var(--surface));
}
.profile-wizard-card .profile-basic-row > span {
    color: var(--primary-dark);
    font-size: .82rem;
    font-weight: 850;
    letter-spacing: .015em;
}
.profile-wizard-card .profile-basic-row select { min-width: 0; }
.profile-wizard-upload-form {
    padding: 15px;
    border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--line));
    border-radius: 13px;
    background: color-mix(in srgb, var(--primary-soft) 32%, var(--surface));
}
.profile-wizard-card .profile-photo-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 28px;
    padding: 4px 9px;
    border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary-soft) 78%, var(--surface));
    color: var(--primary);
    font-weight: 850;
}

@media (max-width: 760px) {
    .profile-wizard-card .profile-basics-rows { grid-template-columns: 1fr; }
}

/* ============================================================================
   2026-09-01 UNIVERSAL INTERFACE REFRESH
   Control Deck / Profile Wizard visual language applied across the authenticated
   application. Structural rules deliberately preserve dense productivity flows.
   ============================================================================ */

body.topnav-layout {
    --ui-accent-border: color-mix(in srgb, var(--primary) 30%, var(--line));
    --ui-accent-border-strong: color-mix(in srgb, var(--primary) 52%, var(--line));
    --ui-surface: color-mix(in srgb, var(--surface) 95%, var(--primary) 5%);
    --ui-surface-alt: color-mix(in srgb, var(--surface-alt) 91%, var(--primary) 9%);
    --ui-surface-soft: color-mix(in srgb, var(--surface) 97%, var(--primary) 3%);
    --ui-glow: color-mix(in srgb, var(--primary) 12%, transparent);
    --ui-shadow: 0 15px 36px color-mix(in srgb, #000 13%, transparent);
    background:
        radial-gradient(1100px 420px at 52% -170px, color-mix(in srgb, var(--primary) 15%, transparent), transparent 68%),
        linear-gradient(180deg, var(--page-top) 0, var(--page) 320px);
}

/* Global shell and navigation */
body.topnav-layout .global-topnav {
    min-height: 68px;
    border-bottom: 1px solid color-mix(in srgb, var(--primary) 30%, var(--line));
    /* Preserve the original authenticated top-navigation identity.
       The bar is theme-driven from PrimaryColor + SecondaryColor rather than
       the neutral TopbarBackgroundColor surface used by the universal refresh. */
    background:
        linear-gradient(90deg,
            color-mix(in srgb, var(--primary-dark) 82%, #120024) 0%,
            color-mix(in srgb, var(--primary) 72%, #1a0030) 52%,
            color-mix(in srgb, var(--primary-dark) 88%, #0c0018) 100%);
    box-shadow: 0 10px 28px rgba(17, 0, 34, .22);
}
body.topnav-layout .global-topnav-inner {
    min-height: 68px;
    gap: 17px;
}
body.topnav-layout .topnav-logo {
    padding: 6px 8px;
    border-radius: 12px;
}
body.topnav-layout .topnav-item {
    position: relative;
    min-height: 38px;
    padding: 8px 11px;
    border-radius: 10px;
    color: rgba(255,255,255,.92);
    font-weight: 720;
    transition: background .14s ease, border-color .14s ease, transform .14s ease, color .14s ease;
}
body.topnav-layout .topnav-item:hover {
    background: rgba(255,255,255,.09);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}
body.topnav-layout .topnav-item.active {
    background: rgba(255,255,255,.07);
    color: #fff;
    box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--accent) 72%, #fff);
}
body.topnav-layout .topnav-settings-link {
    border: 1px solid rgba(255,255,255,.18);
    background: rgba(255,255,255,.06);
}
body.topnav-layout .topnav-settings-link::before {
    content: "⚙";
    font-size: .86em;
    opacity: .85;
}
body.topnav-layout .topnav-logout {
    color: rgba(255,255,255,.82);
}
body.topnav-layout .topnav-logout:hover,
body.topnav-layout .topnav-logout:focus-visible {
    color: #fff;
}
body.topnav-layout .mobile-native-nav-panel {
    border: 1px solid var(--ui-accent-border);
    border-radius: 15px;
    background: color-mix(in srgb, var(--surface) 96%, var(--primary) 4%);
    box-shadow: 0 18px 45px rgba(0,0,0,.24);
}
body.topnav-layout .mobile-native-nav-links > a,
body.topnav-layout .mobile-native-nav-links > form button {
    border-radius: 9px;
}
body.topnav-layout .mobile-native-nav-links > a.active {
    background: color-mix(in srgb, var(--primary-soft) 82%, var(--surface));
    color: var(--primary);
    box-shadow: inset 3px 0 0 var(--primary);
}

body.topnav-layout .topnav-page-shell {
    width: min(1780px, calc(100% - 30px));
    margin-top: 18px;
}

/* Shared page hierarchy */
body.topnav-layout .page-heading,
body.topnav-layout .page-header {
    position: relative;
    margin-bottom: 17px;
    padding: 5px 4px 7px 16px;
}
body.topnav-layout .page-heading::before,
body.topnav-layout .page-header::before {
    content: "";
    position: absolute;
    inset: 5px auto 7px 0;
    width: 4px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    box-shadow: 0 0 18px var(--ui-glow);
}
body.topnav-layout .page-heading h1,
body.topnav-layout .page-header h1 {
    margin-bottom: 4px;
    font-size: clamp(1.85rem, 2.4vw, 2.35rem);
    font-weight: 820;
    letter-spacing: -.022em;
}
body.topnav-layout .page-heading p,
body.topnav-layout .page-header p { max-width: 860px; }
body.topnav-layout .eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 22px;
    margin-bottom: 5px;
    padding: 3px 8px;
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--line));
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary-soft) 70%, var(--surface));
    color: var(--primary);
    font-size: .72rem;
    font-weight: 850;
    letter-spacing: .065em;
    text-transform: uppercase;
}
body.topnav-layout .breadcrumbs {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-weight: 650;
}

/* Surfaces */
body.topnav-layout .panel,
body.topnav-layout .card {
    border: 1px solid var(--ui-accent-border);
    border-radius: 16px;
    background:
        radial-gradient(circle at 100% -20%, var(--ui-glow), transparent 38%),
        linear-gradient(180deg, var(--ui-surface) 0, var(--surface) 150px);
    box-shadow: var(--ui-shadow);
}
body.topnav-layout .compact-panel { border-radius: 13px; }
body.topnav-layout .panel-title-row,
body.topnav-layout .section-heading {
    padding-bottom: 9px;
    border-bottom: 1px solid color-mix(in srgb, var(--primary) 13%, var(--line));
}
body.topnav-layout .empty-state {
    border-color: color-mix(in srgb, var(--primary) 24%, var(--line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--primary-soft) 26%, var(--surface-alt));
}

/* Buttons and form controls */
body.topnav-layout .button {
    min-height: 36px;
    border-color: color-mix(in srgb, var(--primary) 20%, var(--line-strong));
    border-radius: 9px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, #fff 4%), var(--surface-strong));
    box-shadow: 0 3px 8px rgba(0,0,0,.06);
    transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
body.topnav-layout .button:hover {
    border-color: var(--ui-accent-border-strong);
    box-shadow: 0 6px 15px color-mix(in srgb, var(--primary) 10%, transparent);
    transform: translateY(-1px);
}
body.topnav-layout .button.primary {
    border-color: color-mix(in srgb, var(--primary) 82%, #000 18%);
    background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 76%, var(--accent)));
    box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 24%, transparent);
}
body.topnav-layout .button.secondary {
    border-color: color-mix(in srgb, var(--primary) 28%, var(--line));
    background: color-mix(in srgb, var(--primary-soft) 56%, var(--surface));
    color: var(--text);
}
body.topnav-layout input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
body.topnav-layout select,
body.topnav-layout textarea {
    min-height: 38px;
    border-color: color-mix(in srgb, var(--primary) 15%, var(--line-strong));
    border-radius: 9px;
    background: color-mix(in srgb, var(--input-bg, var(--surface)) 96%, var(--primary) 4%);
    color: var(--input-text, var(--text));
}
body.topnav-layout input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
body.topnav-layout select:focus,
body.topnav-layout textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}
body.topnav-layout input[type="checkbox"],
body.topnav-layout input[type="radio"] { accent-color: var(--primary); }
body.topnav-layout .check,
body.topnav-layout .compact-check { border-radius: 8px; }

/* Tables and dense lists */
body.topnav-layout .table-panel,
body.topnav-layout .table-wrap {
    overflow: auto;
    border-radius: 14px;
    border-color: var(--ui-accent-border);
}
body.topnav-layout th {
    color: color-mix(in srgb, var(--text) 76%, var(--muted));
    background: color-mix(in srgb, var(--surface-strong) 78%, var(--primary-soft));
    border-bottom-color: var(--ui-accent-border);
    font-weight: 820;
}
body.topnav-layout td { border-bottom-color: color-mix(in srgb, var(--line) 86%, var(--primary) 14%); }
body.topnav-layout tbody tr { transition: background .1s ease; }
body.topnav-layout tbody tr:hover { background: color-mix(in srgb, var(--primary-soft) 29%, var(--surface)); }
body.topnav-layout .tabs {
    gap: 6px;
    padding: 6px;
    border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface-alt) 84%, var(--surface));
}
body.topnav-layout .tabs a { border-radius: 8px; }
body.topnav-layout .tabs a.active {
    background: color-mix(in srgb, var(--primary-soft) 86%, var(--surface));
    color: var(--primary);
}

/* Secondary and legacy screens inherit the new hierarchy without requiring a rewrite. */
body.topnav-layout .topnav-page-shell:not(.set-cut-scenes-workspace-page) > .panel.form-panel > h1:first-child,
body.topnav-layout .topnav-page-shell:not(.set-cut-scenes-workspace-page) > .panel.narrow > h1:first-child {
    margin: -2px 0 7px;
    font-size: clamp(1.6rem, 2.1vw, 2rem);
    font-weight: 820;
    letter-spacing: -.02em;
}
body.topnav-layout .topnav-page-shell:not(.set-cut-scenes-workspace-page) > .panel.form-panel > h1:first-child + p,
body.topnav-layout .topnav-page-shell:not(.set-cut-scenes-workspace-page) > .panel.narrow > h1:first-child + p {
    margin-top: 0;
    color: var(--muted);
}
body.topnav-layout .toolbar {
    gap: 8px;
    margin-bottom: 13px;
    padding: 9px;
    border: 1px solid color-mix(in srgb, var(--primary) 17%, var(--line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface-alt) 82%, var(--surface));
    box-shadow: 0 7px 17px rgba(0,0,0,.05);
}
body.topnav-layout details.panel > summary {
    border-radius: 11px;
    transition: background .12s ease, color .12s ease;
}
body.topnav-layout details.panel > summary:hover {
    background: color-mix(in srgb, var(--primary-soft) 40%, transparent);
}
body.topnav-layout .badge,
body.topnav-layout .status-pill {
    border-radius: 999px;
    font-weight: 760;
    letter-spacing: .01em;
}
body.topnav-layout .form-actions,
body.topnav-layout .button-row {
    align-items: center;
}
body.topnav-layout .danger-zone {
    border-color: color-mix(in srgb, var(--danger) 38%, var(--line));
    background:
        radial-gradient(circle at 100% -20%, color-mix(in srgb, var(--danger) 10%, transparent), transparent 38%),
        linear-gradient(180deg, var(--ui-surface) 0, var(--surface) 150px);
}
body.topnav-layout code {
    border-radius: 6px;
    background: color-mix(in srgb, var(--surface-alt) 80%, var(--primary-soft));
}

/* Alerts, status and modal surfaces */
body.topnav-layout .alert { border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.06); }
body.topnav-layout dialog,
body.topnav-layout .processing-log-shell {
    border-color: var(--ui-accent-border);
    border-radius: 17px;
    background: var(--surface);
    box-shadow: 0 26px 80px rgba(0,0,0,.45);
}
body.topnav-layout .dialog-heading {
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ui-accent-border);
}

/* Make existing feature cards speak the same visual language without changing their layouts. */
body.topnav-layout :is(.home-feature-card,.viewing-media-card,.profile-landing-card,.sexual-health-category-card,.sexual-health-resource-card,.goongrid-profile,.profile-album-card,.role-assignment-card,.mfa-method-card) {
    border-color: var(--ui-accent-border);
    box-shadow: 0 10px 26px rgba(0,0,0,.09);
}
body.topnav-layout :is(.home-feature-card,.viewing-media-card,.profile-landing-card,.sexual-health-category-card,.sexual-health-resource-card,.goongrid-profile,.profile-album-card,.role-assignment-card):hover {
    border-color: var(--ui-accent-border-strong);
}

/* --------------------------------------------------------------------------
   CONTROL DECK
   -------------------------------------------------------------------------- */
.settings-control-deck-page {
    width: min(1900px, calc(100% - 18px)) !important;
    margin-top: 12px !important;
}
.settings-deck-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}
.settings-deck-main { min-width: 0; }
.settings-deck-sidebar {
    position: sticky;
    top: calc(78px + var(--impersonation-banner-height, 0px));
    max-height: calc(100vh - 96px - var(--impersonation-banner-height, 0px));
    overflow: auto;
    padding: 12px 10px 16px;
    border: 1px solid var(--ui-accent-border);
    border-radius: 17px;
    background:
        radial-gradient(circle at 15% 0%, color-mix(in srgb, var(--primary) 11%, transparent), transparent 34%),
        color-mix(in srgb, var(--surface) 97%, var(--primary) 3%);
    box-shadow: 0 15px 36px rgba(0,0,0,.11);
    scrollbar-width: thin;
}
.settings-deck-home,
.settings-deck-nav-group > summary,
.settings-deck-nav-child {
    color: var(--text);
    text-decoration: none;
}
.settings-deck-home {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    min-height: 48px;
    padding: 7px 9px;
    border-radius: 11px;
    font-weight: 760;
}
.settings-deck-home:hover,
.settings-deck-home.is-active {
    background: color-mix(in srgb, var(--primary-soft) 68%, var(--surface));
    color: var(--primary);
    text-decoration: none;
}
.settings-deck-nav-label {
    margin: 17px 10px 7px;
    color: var(--muted);
    font-size: .66rem;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.settings-deck-nav-group { margin: 2px 0; }
.settings-deck-nav-group > summary {
    display: grid;
    grid-template-columns: 34px minmax(0,1fr) 18px;
    align-items: center;
    gap: 9px;
    min-height: 45px;
    padding: 6px 9px;
    border-radius: 11px;
    cursor: pointer;
    list-style: none;
    font-weight: 760;
}
.settings-deck-nav-group > summary::-webkit-details-marker { display: none; }
.settings-deck-nav-group > summary:hover,
.settings-deck-nav-group[open] > summary {
    background: color-mix(in srgb, var(--primary-soft) 48%, var(--surface));
}
.settings-deck-nav-icon,
.control-deck-icon {
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
    border-radius: 9px;
    background: color-mix(in srgb, var(--primary-soft) 48%, var(--surface));
    color: var(--primary);
    font-weight: 850;
}
.settings-deck-nav-copy { min-width: 0; }
.settings-deck-nav-copy strong { display: block; }
.settings-deck-nav-copy small { display: block; margin-top: 1px; color: var(--muted); font-size: .68rem; }
.settings-deck-nav-chevron { color: var(--muted); font-size: 1.15rem; transition: transform .12s ease; }
.settings-deck-nav-group[open] .settings-deck-nav-chevron { transform: rotate(90deg); }
.settings-deck-nav-children { display: grid; gap: 2px; padding: 3px 0 7px 42px; }
.settings-deck-nav-child {
    display: grid;
    grid-template-columns: 19px minmax(0,1fr);
    gap: 6px;
    align-items: center;
    padding: 6px 8px;
    border-radius: 8px;
    color: var(--muted);
    font-size: .77rem;
    font-weight: 680;
}
.settings-deck-nav-child:hover,
.settings-deck-nav-child.is-active {
    background: color-mix(in srgb, var(--primary-soft) 58%, var(--surface));
    color: var(--primary);
    text-decoration: none;
}
.settings-deck-nav-child.is-active { box-shadow: inset 3px 0 0 var(--primary); }

.control-deck-heading {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    margin-bottom: 18px;
}
.control-deck-heading > div:first-child { flex: 1; min-width: 0; }
.control-deck-heading h1 {
    margin: 2px 0 5px;
    font-size: clamp(2rem, 3vw, 2.65rem);
    font-weight: 860;
    letter-spacing: -.035em;
}
.control-deck-heading p { margin: 0; color: var(--muted); }
.control-deck-search {
    width: min(430px, 42vw);
    display: grid;
    grid-template-columns: 24px minmax(0,1fr);
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 0 11px;
    border: 1px solid var(--ui-accent-border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface) 96%, var(--primary) 4%);
    box-shadow: 0 8px 22px rgba(0,0,0,.08);
}
.control-deck-search > span { color: var(--primary); font-size: 1.2rem; }
body.topnav-layout .control-deck-search input {
    min-height: 46px;
    padding-left: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
.control-deck-health {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 11px;
    margin-bottom: 16px;
}
.control-deck-health-card {
    display: block;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--ui-accent-border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface) 96%, var(--primary) 4%);
    color: var(--text);
    box-shadow: 0 9px 22px rgba(0,0,0,.07);
}
.control-deck-health-card:hover { border-color: var(--ui-accent-border-strong); text-decoration: none; }
.control-deck-kicker {
    display: block;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 880;
    letter-spacing: .10em;
    text-transform: uppercase;
}
.control-deck-health-status { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-top: 7px; }
.control-deck-health-status strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.control-deck-health-card small { display: block; margin-top: 5px; color: var(--muted); }
.control-deck-status-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: var(--muted); }
.control-deck-status-dot.is-good { background: var(--success); box-shadow: 0 0 12px color-mix(in srgb, var(--success) 58%, transparent); }
.control-deck-status-dot.is-warning { background: var(--warning); box-shadow: 0 0 12px color-mix(in srgb, var(--warning) 45%, transparent); }
.control-deck-status-dot.is-muted { opacity: .55; }
.control-deck-dashboard-grid { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(330px,.85fr); gap: 15px; }
.control-deck-panel { margin: 0; }
.control-deck-panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.control-deck-panel-heading h2 { margin: 2px 0 4px; font-size: 1.14rem; }
.control-deck-panel-heading p { margin: 0; color: var(--muted); font-size: .82rem; }
.control-deck-quick-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.control-deck-quick-card {
    display: grid;
    grid-template-columns: 36px minmax(0,1fr);
    gap: 10px;
    align-items: center;
    min-height: 82px;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface-alt) 80%, var(--surface));
    color: var(--text);
}
.control-deck-quick-card:hover { border-color: var(--ui-accent-border-strong); background: color-mix(in srgb, var(--primary-soft) 34%, var(--surface)); text-decoration: none; }
.control-deck-quick-card strong,
.control-deck-quick-card small { display: block; }
.control-deck-quick-card small { margin-top: 2px; color: var(--muted); font-size: .73rem; }
.control-deck-tip {
    margin-top: 12px;
    padding: 11px 12px;
    border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
    border-radius: 11px;
    background: color-mix(in srgb, var(--primary-soft) 31%, var(--surface));
    color: var(--muted);
    font-size: .78rem;
}
.control-deck-tip strong { color: var(--primary); }
.control-deck-pulse-list { display: grid; }
.control-deck-pulse-row {
    display: grid;
    grid-template-columns: 36px minmax(0,1fr) auto;
    gap: 9px;
    align-items: center;
    padding: 9px 0;
    border-top: 1px solid color-mix(in srgb, var(--line) 85%, var(--primary) 15%);
    color: var(--text);
}
.control-deck-pulse-row:first-child { border-top: 0; }
.control-deck-pulse-row:hover { color: var(--primary); text-decoration: none; }
.control-deck-pulse-row strong,
.control-deck-pulse-row small { display: block; }
.control-deck-pulse-row small { color: var(--muted); font-size: .71rem; }
.control-deck-count,
.control-deck-state {
    min-width: 31px;
    padding: 4px 8px;
    border: 1px solid var(--ui-accent-border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary-soft) 42%, var(--surface));
    color: var(--primary);
    text-align: center;
    font-size: .72rem;
    font-weight: 850;
}
.control-deck-count.is-warning { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 45%, var(--line)); }
.control-deck-impersonate { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--ui-accent-border); }
.control-deck-impersonate > label { font-size: .78rem; }
.control-deck-impersonate-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
.control-deck-impersonate > small { display: block; margin-top: 6px; color: var(--muted); }
.control-deck-directory-panel { grid-column: 1 / -1; }
.control-deck-result-count { color: var(--muted); font-size: .75rem; font-weight: 750; }
.control-deck-category-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.control-deck-category {
    min-width: 0;
    padding: 13px;
    border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--line));
    border-radius: 13px;
    background: color-mix(in srgb, var(--surface-alt) 73%, var(--surface));
}
.control-deck-category-heading { display: grid; grid-template-columns: 36px minmax(0,1fr); gap: 9px; align-items: center; margin-bottom: 9px; }
.control-deck-category-heading h3 { margin: 0; font-size: .9rem; }
.control-deck-category-heading small { color: var(--muted); font-size: .68rem; }
.control-deck-category-links { display: grid; gap: 4px; }
.control-deck-category-links > a {
    display: grid;
    grid-template-columns: minmax(0,1fr) 18px;
    gap: 7px;
    align-items: center;
    padding: 8px;
    border-radius: 9px;
    color: var(--text);
}
.control-deck-category-links > a:hover { background: color-mix(in srgb, var(--primary-soft) 45%, var(--surface)); text-decoration: none; }
.control-deck-category-links strong,
.control-deck-category-links small { display: block; }
.control-deck-category-links strong { font-size: .78rem; }
.control-deck-category-links small { margin-top: 2px; color: var(--muted); font-size: .68rem; line-height: 1.32; }
.control-deck-chevron { color: var(--muted); font-size: 1.15rem; }
.control-deck-search-empty { padding: 22px; border: 1px dashed var(--ui-accent-border); border-radius: 12px; text-align: center; color: var(--muted); }
.control-deck-search-empty strong,
.control-deck-search-empty span { display: block; }
.control-deck-search-empty strong { color: var(--text); margin-bottom: 3px; }

/* Settings section forms live inside the Control Deck without becoming a giant card-in-card. */
.settings-control-deck-page .settings-workspace-panel,
.settings-control-deck-page .responsive-workspace-panel {
    max-width: none;
}
.settings-control-deck-page .settings-workspace-panel {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
.settings-control-deck-page .settings-section {
    position: relative;
    overflow: hidden;
    padding: 20px 21px 22px;
    border: 1px solid var(--ui-accent-border);
    border-radius: 16px;
    background:
        radial-gradient(circle at 100% 0%, var(--ui-glow), transparent 36%),
        var(--surface);
    box-shadow: 0 13px 30px rgba(0,0,0,.09);
}
.settings-control-deck-page .settings-section::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 65%, var(--accent)), var(--accent));
}
.settings-control-deck-page .settings-section > h2 { color: var(--primary); font-size: 1.35rem; }
.settings-control-deck-page .settings-viewer-mode-actions { margin-bottom: 12px; }
.settings-control-deck-page .page-heading { margin-top: 1px; }
.settings-control-deck-page .form-grid { gap: 11px 14px; }
.settings-control-deck-page .settings-feature-card,
.settings-control-deck-page .email-delivery-option-panel {
    border-color: color-mix(in srgb, var(--primary) 22%, var(--line));
    border-radius: 13px;
    background: color-mix(in srgb, var(--surface-alt) 76%, var(--surface));
}

/* --------------------------------------------------------------------------
   GOONGRID PUBLIC PROFILE — companion to Control Deck + refreshed wizard
   -------------------------------------------------------------------------- */
.goon-profile-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 10px;
    color: var(--muted);
    font-size: .78rem;
}
.goon-profile-breadcrumbs a { font-weight: 750; }
.goon-profile-shell {
    --goon-profile-pill-surface: color-mix(in srgb, var(--primary-soft) 55%, var(--surface));
    overflow: hidden;
    border: 1px solid var(--ui-accent-border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 22px 52px rgba(0,0,0,.18);
}
.goon-profile-hero { display: grid; grid-template-columns: minmax(390px,.93fr) minmax(370px,1.07fr); min-height: 520px; }
.goon-profile-photo-stage {
    display: grid;
    grid-template-columns: 74px minmax(0,1fr);
    gap: 10px;
    padding: 16px;
    border-right: 1px solid var(--ui-accent-border);
    background: var(--goon-profile-pill-surface);
}
.goon-profile-thumbs { display: grid; align-content: start; gap: 8px; }
.goon-profile-thumb {
    width: 62px;
    aspect-ratio: 1;
    padding: 2px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--line));
    border-radius: 11px;
    background: var(--surface);
    cursor: pointer;
}
.goon-profile-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.goon-profile-thumb.is-selected { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 26%, transparent); }
.goon-profile-main-photo { position: relative; min-height: 470px; overflow: hidden; border: 1px solid var(--primary); border-radius: 15px; background: var(--surface-strong); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 26%, transparent); }
.goon-profile-main-photo > img { width: 100%; height: 100%; min-height: 470px; display: block; object-fit: cover; }
.goon-profile-photo-badge,
.goon-profile-photo-count {
    position: absolute;
    bottom: 12px;
    padding: 5px 8px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 999px;
    background: rgba(0,0,0,.58);
    color: #fff;
    backdrop-filter: blur(6px);
    font-size: .68rem;
    font-weight: 800;
}
.goon-profile-photo-badge { left: 12px; }
.goon-profile-photo-count { right: 12px; }
.goon-profile-photo-fallback { min-height: 470px; display: grid; place-items: center; border-radius: 15px; background: linear-gradient(145deg, var(--primary-soft), var(--surface-strong)); color: var(--primary); font-size: 6rem; font-weight: 900; }
.goon-profile-identity {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 35px 38px;
    background:
        radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 42%),
        linear-gradient(145deg, color-mix(in srgb, var(--surface) 96%, var(--primary) 4%), var(--surface));
}
.goon-profile-presence-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 23px; }
.goon-profile-presence,
.goon-profile-distance { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .78rem; font-weight: 780; }
.goon-profile-presence-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.goon-profile-presence.is-live { color: var(--success); }
.goon-profile-presence.is-live .goon-profile-presence-dot { background: var(--success); box-shadow: 0 0 12px color-mix(in srgb, var(--success) 62%, transparent); }
.goon-profile-presence.is-offline { color: var(--muted); }
.goon-profile-presence small { font-weight: 650; }
.goon-profile-identity h1 { margin: 2px 0 1px; font-size: clamp(2.7rem, 5vw, 4.6rem); line-height: .98; letter-spacing: -.055em; font-weight: 900; }
.goon-profile-handle { margin: 6px 0 17px; color: var(--muted); font-size: 1rem; font-weight: 680; }
.goon-profile-identity-pills,
.goon-profile-chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.goon-profile-identity-pills > span,
.goon-profile-chip {
    display: inline-flex;
    align-items: center;
    min-height: 29px;
    padding: 5px 9px;
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--line));
    border-radius: 999px;
    background: var(--goon-profile-pill-surface);
    color: var(--text);
    font-size: .75rem;
    font-weight: 760;
}
.goon-profile-chip.is-curious { border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.goon-profile-chip.is-boundary { border-color: color-mix(in srgb, var(--danger) 38%, var(--line)); background: color-mix(in srgb, var(--danger) 9%, var(--surface)); }
.goon-profile-chip.is-muted { color: var(--muted); }
.goon-profile-looking-for { margin-top: 22px; }
.goon-profile-section-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: .66rem; font-weight: 900; letter-spacing: .105em; text-transform: uppercase; }
.goon-profile-hero-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 25px; }
.goon-profile-hero-actions form { margin: 0; }
.goon-profile-quickbar { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border-top: 1px solid var(--ui-accent-border); border-bottom: 1px solid var(--ui-accent-border); background: color-mix(in srgb, var(--surface-alt) 74%, var(--surface)); }
.goon-profile-quickbar > div { padding: 13px 18px; border-right: 1px solid var(--ui-accent-border); }
.goon-profile-quickbar > div:last-child { border-right: 0; }
.goon-profile-quickbar small,
.goon-profile-quickbar strong { display: block; }
.goon-profile-quickbar small { color: var(--muted); font-size: .65rem; font-weight: 850; text-transform: uppercase; letter-spacing: .075em; }
.goon-profile-quickbar strong { margin-top: 2px; font-size: .86rem; }
.goon-profile-section-nav {
    position: sticky;
    top: 68px;
    z-index: 15;
    display: flex;
    gap: 4px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--ui-accent-border);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(15px);
}
.goon-profile-section-nav a { padding: 7px 10px; border-radius: 8px; color: var(--muted); font-size: .76rem; font-weight: 760; }
.goon-profile-section-nav a:hover { background: color-mix(in srgb, var(--primary-soft) 58%, var(--surface)); color: var(--primary); text-decoration: none; }
.goon-profile-content { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(290px,.5fr); gap: 14px; padding: 14px; }
.goon-profile-stack { display: grid; gap: 14px; align-content: start; min-width: 0; }
.goon-profile-panel { padding: 18px; border: 1px solid var(--ui-accent-border); border-radius: 15px; background: color-mix(in srgb, var(--surface) 97%, var(--primary) 3%); box-shadow: 0 10px 25px rgba(0,0,0,.07); }
.goon-profile-panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.goon-profile-panel-heading h2 { margin: 2px 0 0; font-size: 1.18rem; }
.goon-profile-panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: .76rem; }
.goon-profile-count { padding: 4px 8px; border: 1px solid var(--ui-accent-border); border-radius: 999px; color: var(--muted); font-size: .68rem; font-weight: 800; }
.goon-profile-preference-block { padding: 12px 0; border-top: 1px solid color-mix(in srgb, var(--line) 86%, var(--primary) 14%); }
.goon-profile-preference-block:first-of-type { border-top: 0; padding-top: 0; }
.goon-profile-preference-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.goon-profile-preference-heading > span { padding: 3px 7px; border-radius: 999px; background: color-mix(in srgb, var(--primary-soft) 42%, var(--surface)); color: var(--muted); font-size: .65rem; font-weight: 800; }
.goon-profile-preference-heading > span.is-curious { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.goon-profile-preference-heading > span.is-boundary { background: color-mix(in srgb, var(--danger) 9%, var(--surface)); }
.goon-profile-health-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.goon-profile-health-card { min-width: 0; padding: 13px; border: 1px solid color-mix(in srgb, var(--primary) 17%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--surface-alt) 74%, var(--surface)); }
.goon-profile-health-card.is-wide { grid-column: 1 / -1; }
.goon-profile-health-card h3 { margin-bottom: 9px; }
.goon-profile-health-disclosure { overflow: hidden; border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--surface-alt) 58%, var(--surface)); }
.goon-profile-health-disclosure > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 13px; cursor: pointer; list-style: none; user-select: none; }
.goon-profile-health-disclosure > summary::-webkit-details-marker { display: none; }
.goon-profile-health-disclosure > summary:hover { background: color-mix(in srgb, var(--primary-soft) 34%, transparent); }
.goon-profile-health-disclosure-title { display: grid; gap: 2px; min-width: 0; }
.goon-profile-health-disclosure-title strong { font-size: .9rem; }
.goon-profile-health-disclosure-title small { color: var(--muted); font-size: .68rem; font-weight: 650; }
.goon-profile-health-disclosure-chevron { flex: 0 0 auto; color: var(--primary); font-size: 1.15rem; font-weight: 900; line-height: 1; transition: transform .16s ease; }
.goon-profile-health-disclosure[open] .goon-profile-health-disclosure-chevron { transform: rotate(180deg); }
.goon-profile-health-disclosure[open] > summary { border-bottom: 1px solid color-mix(in srgb, var(--primary) 16%, var(--line)); }
.goon-profile-health-disclosure > .goon-profile-health-grid { padding: 9px; }
.goon-profile-health-disclosure.goon-profile-health-panel { padding: 0; border: 1px solid var(--ui-accent-border); border-radius: 15px; background: color-mix(in srgb, var(--surface) 97%, var(--primary) 3%); box-shadow: 0 10px 25px rgba(0,0,0,.07); }
.goon-profile-health-disclosure.goon-profile-health-panel > summary { padding: 18px; }
.goon-profile-health-disclosure.goon-profile-health-panel > .goon-profile-health-grid { padding: 12px 18px 18px; }
.goon-profile-aside .goon-profile-health-grid { grid-template-columns: 1fr; }
.goon-profile-test-list { display: grid; }
.goon-profile-test-list > div { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 7px 0; border-top: 1px solid var(--line); }
.goon-profile-test-list > div:first-child { border-top: 0; }
.goon-profile-test-list span { color: var(--muted); font-size: .72rem; }
.goon-profile-album-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.goon-profile-album { position: relative; min-height: 145px; overflow: hidden; display: flex; flex-direction: column; padding: 14px; border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--line)); border-radius: 13px; background: linear-gradient(145deg, color-mix(in srgb, var(--primary-soft) 35%, var(--surface)), var(--surface)); }
.goon-profile-album::after { content: ""; position: absolute; width: 120px; height: 120px; right: -45px; top: -48px; border-radius: 50%; background: color-mix(in srgb, var(--primary) 9%, transparent); pointer-events: none; }
.goon-profile-album h3 { margin: 0 0 4px; }
.goon-profile-album p { margin: 0; color: var(--muted); font-size: .74rem; }
.goon-profile-album-bottom { display: flex; align-items: end; justify-content: space-between; gap: 9px; margin-top: auto; padding-top: 17px; }
.goon-profile-album-status { color: var(--muted); font-size: .68rem; font-weight: 800; }
.goon-profile-album-bottom form { margin: 0; }
.goon-profile-album-action { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 1px solid var(--ui-accent-border); border-radius: 9px; background: color-mix(in srgb, var(--primary-soft) 44%, var(--surface)); color: var(--primary); font-weight: 900; cursor: pointer; }
.goon-profile-album-action:hover { border-color: var(--primary); text-decoration: none; }
.goon-profile-album-action.is-locked { color: var(--muted); cursor: default; }
.goon-profile-glance-card { position: sticky; top: 118px; }
.goon-profile-facts { margin: 0; }
.goon-profile-facts > div { display: grid; grid-template-columns: 105px minmax(0,1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.goon-profile-facts > div:first-child { border-top: 0; }
.goon-profile-facts dt { color: var(--muted); font-size: .65rem; font-weight: 880; text-transform: uppercase; letter-spacing: .06em; }
.goon-profile-facts dd { margin: 0; text-align: right; font-weight: 730; }
.goon-profile-glance-note { margin-top: 13px; padding: 11px; border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--primary-soft) 30%, var(--surface)); color: var(--muted); font-size: .72rem; }

/* Embedded GoonGrid profile: remove the app shell chrome and prioritize the profile itself. */
body.embedded-profile-view { background: var(--page); }
body.embedded-profile-view .topnav-page-shell { width: 100% !important; margin: 0 !important; padding: 0 !important; }
body.embedded-profile-view .footer { display: none !important; }
body.embedded-profile-view .goon-profile-shell { border: 0; border-radius: 0; box-shadow: none; }
body.embedded-profile-view .goon-profile-section-nav { top: 0; }
body.embedded-profile-view .goon-profile-hero { min-height: 455px; }
body.embedded-profile-view .goon-profile-main-photo,
body.embedded-profile-view .goon-profile-main-photo > img,
body.embedded-profile-view .goon-profile-photo-fallback { min-height: 410px; }
body.embedded-profile-view .goon-profile-identity { padding: 28px 30px; }
body.embedded-profile-view .goon-profile-identity h1 { font-size: clamp(2.35rem, 5vw, 3.8rem); }

/* --------------------------------------------------------------------------
   SET CUT SCENES — productivity workspace exception
   Same visual system; deliberately dense, wide, and low-friction.
   -------------------------------------------------------------------------- */
.set-cut-scenes-workspace-page {
    width: min(1980px, calc(100% - 16px)) !important;
    margin-top: 10px !important;
}
.set-cut-scenes-workspace-page .page-heading {
    align-items: center;
    margin-bottom: 9px;
    padding-top: 2px;
    padding-bottom: 3px;
}
.set-cut-scenes-workspace-page .page-heading::before { top: 2px; }
.set-cut-scenes-workspace-page .page-heading h1 { font-size: 1.75rem; }
.set-cut-scenes-workspace-page .page-heading p { margin: 2px 0 0; font-size: .78rem; }
.set-cut-scenes-workspace-page .page-heading .button-row { gap: 5px; }
.set-cut-scenes-workspace-page .page-heading .button { min-height: 32px; padding: 5px 9px; font-size: .75rem; }
.set-cut-scenes-workspace-page .workbench-toolbar {
    position: sticky;
    top: calc(72px + var(--impersonation-banner-height, 0px));
    z-index: 24;
    margin-bottom: 9px;
    padding: 9px 11px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(14px);
    box-shadow: 0 8px 22px rgba(0,0,0,.12);
}
.set-cut-scenes-workspace-page .workbench-filter { gap: 7px 9px; }
.set-cut-scenes-workspace-page .workbench-toolbar label { margin-bottom: 2px; font-size: .68rem; }
.set-cut-scenes-workspace-page .workbench-toolbar input,
.set-cut-scenes-workspace-page .workbench-toolbar select { min-height: 32px; padding-top: 4px; padding-bottom: 4px; }
.set-cut-scenes-workspace-page .panel { margin-bottom: 9px; box-shadow: 0 7px 18px rgba(0,0,0,.07); }
.set-cut-scenes-workspace-page .compact-panel { padding: 9px 11px; }
.set-cut-scenes-workspace-page .visual-cut-editor { padding: 0; overflow: hidden; }
.set-cut-scenes-workspace-page .visual-cut-editor > .panel-title-row { margin: 0; padding: 9px 11px; }
.set-cut-scenes-workspace-page .visual-cut-video-category-panel,
.set-cut-scenes-workspace-page .visual-cut-current-category-panel { padding: 9px 11px; }
.set-cut-scenes-workspace-page .visual-cut-layout { gap: 9px; padding: 9px 11px; }
.set-cut-scenes-workspace-page .visual-cut-marker-grid { gap: 7px; }
.set-cut-scenes-workspace-page .visual-cut-marker-card { padding: 8px; border-radius: 10px; }
.set-cut-scenes-workspace-page .visual-cut-selection-details { gap: 7px; }
.set-cut-scenes-workspace-page .visual-cut-selection-actions { gap: 5px; }
.set-cut-scenes-workspace-page .visual-cut-batch-panel { border-top-color: var(--ui-accent-border); }
.set-cut-scenes-workspace-page .visual-cut-category-transfer .transfer-list,
.set-cut-scenes-workspace-page .visual-cut-draft-category-transfer .transfer-list { max-height: 210px; }
.set-cut-scenes-workspace-page .clip-editor-panel,
.set-cut-scenes-workspace-page .category-transfer-card { border-radius: 12px; }
.set-cut-scenes-workspace-page .clip-grid-table { border-radius: 10px; }
.set-cut-scenes-workspace-page .visual-cut-video-frame { border-radius: 11px; }

/* Universal responsive pass */
@media (max-width: 1280px) {
    .settings-deck-layout { grid-template-columns: 225px minmax(0,1fr); gap: 14px; }
    .control-deck-category-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .goon-profile-content { grid-template-columns: minmax(0,1.3fr) minmax(265px,.7fr); }
}
@media (max-width: 980px) {
    body.topnav-layout .topnav-page-shell { width: min(100% - 20px, 1780px); }
    .settings-deck-layout { grid-template-columns: 1fr; }
    .settings-deck-sidebar { display: none; }
    .settings-deck-home { flex: 0 0 auto; grid-template-columns: 31px auto; min-height: 42px; }
    .settings-deck-home small,
    .settings-deck-nav-label,
    .settings-deck-nav-children { display: none; }
    .settings-deck-nav-group { flex: 0 0 auto; }
    .settings-deck-nav-group > summary { grid-template-columns: 31px auto; min-height: 42px; }
    .settings-deck-nav-chevron { display: none; }
    .control-deck-health { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .control-deck-dashboard-grid { grid-template-columns: 1fr; }
    .control-deck-directory-panel { grid-column: auto; }
    .goon-profile-hero { grid-template-columns: 1fr; }
    .goon-profile-photo-stage { border-right: 0; border-bottom: 1px solid var(--ui-accent-border); }
    .goon-profile-content { grid-template-columns: 1fr; }
    .goon-profile-glance-card { position: static; }
}
@media (max-width: 760px) {
    body.topnav-layout .topnav-page-shell { width: calc(100% - 14px); margin-top: 9px; }
    body.topnav-layout .page-heading,
    body.topnav-layout .page-header { padding-left: 12px; }
    body.topnav-layout .page-heading h1,
    body.topnav-layout .page-header h1 { font-size: 1.65rem; }
    body.topnav-layout .panel { border-radius: 13px; }
    .settings-deck-sidebar { display: none; }
    .control-deck-heading { display: block; }
    .control-deck-search { width: 100%; margin-top: 12px; }
    .control-deck-health { grid-template-columns: 1fr 1fr; gap: 7px; }
    .control-deck-quick-grid,
    .control-deck-category-grid { grid-template-columns: 1fr; }
    .control-deck-health-card { padding: 11px; }
    .settings-control-deck-page .settings-section { padding: 16px 13px; }
    .goon-profile-breadcrumbs { padding: 0 5px; }
    .goon-profile-shell { border-radius: 16px; }
    .goon-profile-photo-stage { grid-template-columns: 1fr; padding: 10px; }
    .goon-profile-thumbs { order: 2; display: flex; overflow-x: auto; }
    .goon-profile-thumb { flex: 0 0 54px; width: 54px; }
    .goon-profile-main-photo,
    .goon-profile-main-photo > img,
    .goon-profile-photo-fallback { min-height: 365px; }
    .goon-profile-identity { padding: 22px 16px; }
    .goon-profile-identity h1 { font-size: 2.7rem; }
    .goon-profile-presence-row { margin-bottom: 17px; }
    .goon-profile-quickbar { grid-template-columns: 1fr 1fr; }
    .goon-profile-quickbar > div:nth-child(2) { border-right: 0; }
    .goon-profile-quickbar > div:nth-child(-n+2) { border-bottom: 1px solid var(--ui-accent-border); }
    .goon-profile-section-nav { overflow-x: auto; flex-wrap: nowrap; top: 62px; }
    .goon-profile-section-nav a { white-space: nowrap; }
    .goon-profile-content { padding: 9px; gap: 9px; }
    .goon-profile-stack { gap: 9px; }
    .goon-profile-panel { padding: 14px; }
    .goon-profile-health-grid,
    .goon-profile-album-grid { grid-template-columns: 1fr; }
    .goon-profile-health-card.is-wide { grid-column: auto; }
    .set-cut-scenes-workspace-page { width: calc(100% - 8px) !important; }
    .set-cut-scenes-workspace-page .workbench-toolbar { position: static; backdrop-filter: none; }
    .set-cut-scenes-workspace-page .page-heading { align-items: flex-start; }
    .set-cut-scenes-workspace-page .page-heading .button-row { width: 100%; }
    .set-cut-scenes-workspace-page .page-heading .button,
    .set-cut-scenes-workspace-page .page-heading .button-row form { flex: 1 1 auto; }
}
@media (max-width: 520px) {
    .control-deck-health { grid-template-columns: 1fr; }
    .goon-profile-presence-row { align-items: flex-start; flex-direction: column; gap: 5px; }
    .goon-profile-quickbar { grid-template-columns: 1fr 1fr; }
    .goon-profile-facts > div { grid-template-columns: 95px minmax(0,1fr); }
    .goon-profile-hero-actions .button,
    .goon-profile-hero-actions form { flex: 1 1 130px; }
    .goon-profile-hero-actions form .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    body.topnav-layout .topnav-item,
    body.topnav-layout .button { transition: none; }
}

/* 2026-11-24: bulk recommended rename for Library video cards */
.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;
}

/* Library settings: only filenames with a proposed change appear here. */
.library-bulk-rename-panel {
    min-width: 0;
    padding: 0;
    overflow: hidden;
}

.library-bulk-rename-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.library-bulk-rename-select-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    cursor: pointer;
    font-weight: 700;
}

.library-bulk-rename-toolbar .button {
    margin-left: auto;
}

.library-bulk-rename-select-all input,
.library-bulk-rename-checkbox {
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.library-bulk-rename-checkbox:disabled {
    cursor: not-allowed;
}

.library-bulk-rename-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    margin: 0;
}

.library-bulk-rename-select-column {
    width: 44px;
}

.library-bulk-rename-arrow-column {
    width: 40px;
}

.library-bulk-rename-table th,
.library-bulk-rename-table td {
    padding: 12px 10px;
    vertical-align: middle;
    white-space: normal;
    overflow-wrap: anywhere;
}

.library-bulk-rename-table .library-bulk-rename-select-cell,
.library-bulk-rename-table .library-bulk-rename-arrow {
    text-align: center;
}

.library-bulk-rename-filename {
    display: block;
    margin: 0;
    cursor: pointer;
    font-weight: 400;
}

.library-bulk-rename-proposed {
    font-weight: 600;
}

.library-bulk-rename-arrow {
    color: var(--muted);
    font-size: 20px;
}

.library-bulk-rename-validation {
    display: block;
    margin-top: 4px;
    color: var(--danger);
}

@media (max-width: 560px) {
    .library-bulk-rename-toolbar {
        padding: 12px;
        gap: 10px;
    }

    .library-bulk-rename-toolbar .button {
        width: 100%;
        margin-left: 0;
    }

    .library-bulk-rename-select-column,
    .library-bulk-rename-arrow-column {
        width: 32px;
    }

    .library-bulk-rename-table th,
    .library-bulk-rename-table td {
        padding: 10px 5px;
        font-size: 13px;
    }
}
