:root {
    --bg: #f4efe4;
    --panel: rgba(255, 252, 247, 0.88);
    --panel-strong: #fffaf0;
    --line: rgba(59, 41, 26, 0.12);
    --ink: #1f1a17;
    --muted: #65594d;
    --accent: #0d6b4d;
    --accent-strong: #0a563d;
    --warn: #a33c29;
    --shadow: 0 20px 50px rgba(50, 36, 24, 0.12);
    --radius: 20px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Aptos", "Segoe UI", "Malgun Gothic", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(13, 107, 77, 0.14), transparent 34%),
        radial-gradient(circle at top right, rgba(185, 115, 38, 0.18), transparent 28%),
        linear-gradient(180deg, #f7f0e3 0%, #f2ede4 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

code {
    display: inline-block;
    margin-right: 0.4rem;
    padding: 0.3rem 0.5rem;
    border-radius: 10px;
    background: rgba(13, 107, 77, 0.08);
    color: var(--accent-strong);
}

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 40px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 18px 22px;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 249, 240, 0.8);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.brand {
    display: inline-block;
    margin-bottom: 4px;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    word-break: keep-all;
}

.brand-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.topbar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.user-pill {
    display: grid;
    gap: 2px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(13, 107, 77, 0.07);
}

.user-pill span {
    color: var(--muted);
    font-size: 0.88rem;
}

.flash {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
}

.flash-notice {
    background: rgba(13, 107, 77, 0.09);
    color: var(--accent-strong);
}

.flash-error {
    background: rgba(163, 60, 41, 0.09);
    color: var(--warn);
}

.hero-row {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin: 28px 0 18px;
}

.hero-row-tight {
    margin-bottom: 14px;
}

.hero-row h1,
.panel-head h1,
.panel-head h2 {
    margin: 0;
    letter-spacing: -0.03em;
}

.hero-row p,
.panel-head p,
.auth-panel p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.center-panel {
    display: grid;
    place-items: center;
    min-height: calc(100vh - 180px);
}

.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

.auth-panel {
    width: min(520px, 100%);
    padding: 28px;
}

.panel-head {
    margin-bottom: 20px;
}

.panel-head.compact {
    padding: 24px 24px 0;
}

.padded-form {
    padding: 0 24px 24px;
}

.stack-form {
    display: grid;
    gap: 14px;
}

.stack-form label,
.check-card {
    display: grid;
    gap: 8px;
}

.stack-form > label span {
    font-size: 0.92rem;
    font-weight: 700;
}

input,
select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(59, 41, 26, 0.14);
    border-radius: 14px;
    font: inherit;
    background: rgba(255, 255, 255, 0.88);
}

input:focus,
select:focus {
    outline: 2px solid rgba(13, 107, 77, 0.16);
    border-color: rgba(13, 107, 77, 0.35);
}

.primary-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    border-radius: 14px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.primary-button {
    background: var(--accent);
    color: white;
}

.primary-button:hover {
    background: var(--accent-strong);
}

.ghost-button {
    border-color: rgba(59, 41, 26, 0.14);
    background: rgba(255, 255, 255, 0.72);
}

.ghost-button-small {
    padding: 8px 12px;
    font-size: 0.92rem;
}

.strong-ghost {
    border-color: rgba(13, 107, 77, 0.24);
}

.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 16px;
    border: 0;
    border-radius: 14px;
    background: #a33c29;
    color: white;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.danger-button:hover {
    background: #8a2f1f;
}

.danger-button-small {
    padding: 8px 12px;
    font-size: 0.92rem;
}

.primary-button:disabled,
.ghost-button:disabled,
.danger-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.info-box {
    margin-top: 18px;
    padding: 16px;
    border-radius: 16px;
    background: rgba(13, 107, 77, 0.06);
}

.compact-info {
    margin-top: 0;
}

.split-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.info-box p,
.muted {
    color: var(--muted);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.admin-grid .panel {
    padding: 0 24px 24px;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 24px 24px;
}

.table-tip {
    margin-top: 10px;
    font-size: 0.9rem;
}

.filter-bar,
.bulk-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 0 24px 20px;
}

.filter-bar input,
.filter-bar select,
.bulk-toolbar select {
    flex: 1 1 180px;
}

.bulk-toolbar {
    align-items: center;
    padding-top: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

.resizable-table {
    width: 1160px;
    min-width: 1160px;
    table-layout: fixed;
}

.audit-table .audit-col-time {
    width: 180px;
}

.audit-table .audit-col-event {
    width: 160px;
}

.audit-table .audit-col-user {
    width: 220px;
}

.audit-table .audit-col-doc {
    width: 120px;
}

.audit-table .audit-col-ip {
    width: 150px;
}

.audit-table .audit-col-details {
    width: 360px;
}

.user-table {
    width: 1212px;
    min-width: 1212px;
}

.user-table .user-col-select {
    width: 56px;
}

.user-table .user-col-email {
    width: 200px;
}

.user-table .user-col-telegram {
    width: 230px;
}

.user-table .user-col-role {
    width: 110px;
}

.user-table .user-col-status {
    width: 90px;
}

.user-table .user-col-sessions,
.user-table .user-col-docs {
    width: 80px;
}

.user-table .user-col-last-seen {
    width: 180px;
}

.user-table .user-col-actions {
    width: 186px;
}

.device-table {
    width: 840px;
    min-width: 840px;
}

.device-table .device-col-slot {
    width: 90px;
}

.device-table .device-col-name {
    width: 240px;
}

.device-table .device-col-approved,
.device-table .device-col-last-seen {
    width: 180px;
}

.device-table .device-col-ip {
    width: 150px;
}

.resizable-table th {
    position: relative;
    padding-right: 18px;
}

.audit-table .audit-time,
.audit-table .audit-ip {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.audit-table .audit-event,
.audit-table .audit-user,
.audit-table .audit-doc {
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.audit-table .audit-details {
    white-space: normal;
    vertical-align: top;
}

.audit-table .audit-details-text {
    display: block;
    white-space: pre-line;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.audit-col-resizer {
    position: absolute;
    top: 0;
    right: -7px;
    width: 14px;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: col-resize;
    touch-action: none;
}

.audit-col-resizer::after {
    content: "";
    position: absolute;
    top: 18%;
    bottom: 18%;
    left: 6px;
    width: 2px;
    border-radius: 999px;
    background: transparent;
    transition: background 0.15s ease;
}

.resizable-table th:hover .audit-col-resizer::after,
.audit-col-resizer:focus-visible::after {
    background: rgba(13, 107, 77, 0.28);
}

.user-table td,
.device-table td {
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.user-table td:nth-child(1),
.user-table td:nth-child(6),
.user-table td:nth-child(7),
.device-table td:nth-child(1),
.device-table td:nth-child(4),
.device-table td:nth-child(3),
.device-table td:nth-child(5) {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

body.audit-resizing,
body.audit-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
    padding: 0 24px 24px;
}

.doc-card {
    display: grid;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 252, 247, 0.95);
}

.table-checkbox {
    width: 18px;
    height: 18px;
}

.mini-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(59, 41, 26, 0.08);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.mini-badge-ok {
    background: rgba(13, 107, 77, 0.1);
    color: var(--accent-strong);
}

.mini-badge-muted {
    background: rgba(59, 41, 26, 0.08);
    color: var(--muted);
}

.doc-label {
    display: inline-flex;
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(13, 107, 77, 0.1);
    color: var(--accent-strong);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.doc-label-secondary {
    margin-left: 6px;
    background: rgba(185, 115, 38, 0.12);
    color: #9a5d16;
}

.doc-meta h3 {
    margin: 12px 0 6px;
}

.doc-meta p,
.doc-stats dt {
    color: var(--muted);
}

.doc-stats {
    display: grid;
    gap: 10px;
    margin: 0;
}

.doc-stats div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.doc-stats dt,
.doc-stats dd {
    margin: 0;
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.inline-form {
    margin: 0;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.empty-state {
    margin: 0 24px 24px;
    padding: 28px;
    border: 1px dashed rgba(59, 41, 26, 0.2);
    border-radius: 18px;
    text-align: center;
}

.empty-state.compact {
    margin: 0;
}

.checkbox-row {
    grid-template-columns: auto 1fr;
    align-items: center;
}

.checkbox-row input {
    width: 18px;
    height: 18px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.check-card {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
}

.check-card input {
    width: 18px;
    height: 18px;
}

.viewer-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.viewer-meta {
    min-width: 0;
}

.presentation-controls {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.presentation-page-indicator {
    min-width: 72px;
    text-align: center;
    font-weight: 700;
    color: var(--muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.stat-card {
    padding: 22px;
}

.stat-label {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

.stat-card strong {
    font-size: 1.5rem;
    letter-spacing: -0.03em;
}

.single-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.single-columns .panel {
    padding-bottom: 0;
}

.inline-note {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(13, 107, 77, 0.12);
    color: var(--accent-strong);
    font-weight: 700;
}

.status-pill-error {
    background: rgba(163, 60, 41, 0.12);
    color: var(--warn);
}

.viewer-shell {
    position: relative;
    overflow: hidden;
    min-height: calc(100vh - 220px);
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow);
}

.viewer-stage:fullscreen {
    width: 100%;
    height: 100%;
    padding: 0;
    overflow: hidden;
    background: #111;
}

.viewer-stage.presentation-active:not(:fullscreen) {
    min-height: 100dvh;
    padding: 0;
    background: #111;
    overflow: hidden;
}

.viewer-stage.presentation-active,
.viewer-stage:fullscreen {
    --presentation-top-offset: 84px;
    --presentation-side-gap: 16px;
}

.viewer-stage.presentation-active .hero-row,
.viewer-stage:fullscreen .hero-row {
    position: sticky;
    top: 0;
    z-index: 4;
    margin-top: 0;
    align-items: center;
    justify-content: flex-end;
    min-height: 72px;
    margin-bottom: 0;
    padding: 12px 16px 0;
    background: linear-gradient(180deg, rgba(17, 17, 17, 0.96) 0%, rgba(17, 17, 17, 0.82) 82%, rgba(17, 17, 17, 0) 100%);
    backdrop-filter: blur(12px);
}

.viewer-stage.presentation-active .viewer-meta,
.viewer-stage:fullscreen .viewer-meta {
    display: none;
}

.viewer-stage.presentation-active .hero-row h1,
.viewer-stage.presentation-active .hero-row p,
.viewer-stage:fullscreen .hero-row h1,
.viewer-stage:fullscreen .hero-row p {
    color: #f7f3eb;
}

.viewer-stage.presentation-active .eyebrow,
.viewer-stage:fullscreen .eyebrow {
    color: rgba(255, 255, 255, 0.72);
}

.viewer-stage.presentation-active .viewer-toolbar,
.viewer-stage:fullscreen .viewer-toolbar {
    justify-content: flex-end;
    width: 100%;
}

.viewer-stage.presentation-active .status-pill,
.viewer-stage:fullscreen .status-pill {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 0.92rem;
}

.viewer-stage.presentation-active .status-pill.status-pill-error,
.viewer-stage:fullscreen .status-pill.status-pill-error {
    background: rgba(211, 104, 82, 0.22);
    color: #ffd7cf;
}

.viewer-stage.presentation-active .presentation-page-indicator,
.viewer-stage.presentation-active .ghost-button,
.viewer-stage.presentation-active .primary-button,
.viewer-stage:fullscreen .presentation-page-indicator,
.viewer-stage:fullscreen .primary-button,
.viewer-stage:fullscreen .ghost-button {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: none;
}

.viewer-stage.presentation-active .ghost-button,
.viewer-stage:fullscreen .ghost-button {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.viewer-stage.presentation-active .viewer-shell,
.viewer-stage:fullscreen .viewer-shell {
    min-height: calc(100dvh - var(--presentation-top-offset));
    border: 0;
    background: transparent;
    box-shadow: none;
}

.viewer-stage.presentation-active .viewer-shell-plain,
.viewer-stage:fullscreen .viewer-shell-plain {
    padding: 0;
}

.viewer-stage.presentation-active .viewer-banner,
.viewer-stage:fullscreen .viewer-banner {
    display: none;
}

.viewer-stage.presentation-active .viewer-pages,
.viewer-stage:fullscreen .viewer-pages {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100dvh - var(--presentation-top-offset));
    height: calc(100dvh - var(--presentation-top-offset));
    padding: 8px var(--presentation-side-gap) 16px;
    gap: 0;
    overflow: hidden;
}

.viewer-stage.presentation-active .page-card,
.viewer-stage:fullscreen .page-card {
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    place-items: center;
}

.viewer-stage.presentation-active .page-card-header,
.viewer-stage:fullscreen .page-card-header {
    display: none;
}

.viewer-stage.presentation-active .page-canvas,
.viewer-stage:fullscreen .page-canvas {
    display: block;
    width: auto;
    height: auto;
    max-width: min(100%, calc(100vw - (var(--presentation-side-gap) * 2)));
    max-height: calc(100dvh - var(--presentation-top-offset) - 24px);
    margin: 0 auto;
    border-radius: 0;
    background: white;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
}

.viewer-stage.presentation-active .page-card-presentation-hidden,
.viewer-stage:fullscreen .page-card-presentation-hidden {
    display: none;
}

.viewer-stage.presentation-active .page-card-presentation-active,
.viewer-stage:fullscreen .page-card-presentation-active {
    display: grid;
}

.viewer-stage.presentation-active .page-error,
.viewer-stage:fullscreen .page-error {
    border-color: rgba(211, 104, 82, 0.32);
    background: rgba(255, 255, 255, 0.06);
    color: #ffd7cf;
}

.viewer-shell-plain {
    padding: 20px;
    overflow: visible;
}

.viewer-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(13, 107, 77, 0.12);
    border-radius: 16px;
    background: rgba(13, 107, 77, 0.08);
    color: var(--accent-strong);
}

.viewer-pages {
    display: grid;
    gap: 18px;
}

.page-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 12px 30px rgba(50, 36, 24, 0.08);
}

.page-card.loading {
    opacity: 0.92;
}

.page-card.loaded {
    opacity: 1;
}

.page-card.failed {
    min-height: 220px;
    place-items: center;
}

.page-card-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.page-card-state {
    color: var(--accent-strong);
}

.page-canvas {
    width: 100%;
    height: auto;
    border-radius: 14px;
    background: #f8f5ee;
    box-shadow: inset 0 0 0 1px rgba(59, 41, 26, 0.08);
}

.page-error {
    display: grid;
    place-items: center;
    min-height: 180px;
    padding: 20px;
    border: 1px dashed rgba(163, 60, 41, 0.24);
    border-radius: 16px;
    color: var(--warn);
    text-align: center;
}

.viewer-frame {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: calc(100vh - 220px);
    border: 0;
    background: #d7d2c6;
}

.watermark-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    padding: 24px;
    pointer-events: none;
}

.watermark-layer span {
    align-self: center;
    justify-self: center;
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 800;
    color: rgba(70, 54, 40, 0.12);
    transform: rotate(-18deg);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.session-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    background: rgba(21, 16, 11, 0.62);
}

.session-overlay.hidden {
    display: none;
}

.session-card {
    width: min(420px, calc(100% - 32px));
    padding: 26px;
    border-radius: 22px;
    background: rgba(255, 249, 240, 0.96);
    text-align: center;
    box-shadow: var(--shadow);
}

@media print {
    body {
        background: white;
    }

    .topbar,
    .hero-row,
    .viewer-banner,
    .session-overlay,
    .flash {
        display: none !important;
    }

    .page-shell,
    .viewer-shell,
    .viewer-shell-plain {
        width: 100%;
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
        background: white;
    }

    .viewer-pages {
        gap: 0;
    }

    .page-card {
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        break-inside: avoid;
        page-break-inside: avoid;
        background: white;
    }

    .page-card-header {
        display: none;
    }

    .page-canvas {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

@media (max-width: 900px) {
    .topbar,
    .hero-row,
    .viewer-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid,
    .single-columns {
        grid-template-columns: 1fr;
    }

    .viewer-frame,
    .viewer-shell {
        min-height: 70vh;
    }

    .viewer-shell-plain {
        padding: 14px;
    }

    .watermark-layer {
        grid-template-columns: 1fr;
    }

    .page-card {
        padding: 12px;
    }

    .page-card-header {
        font-size: 0.86rem;
    }

    .presentation-controls {
        width: 100%;
        justify-content: space-between;
    }

    .viewer-stage.presentation-active,
    .viewer-stage:fullscreen {
        --presentation-top-offset: 64px;
        --presentation-side-gap: 10px;
    }

    .viewer-stage.presentation-active .hero-row,
    .viewer-stage:fullscreen .hero-row {
        min-height: 56px;
        padding: 8px 10px 0;
        align-items: center;
        justify-content: center;
    }

    .viewer-stage.presentation-active .viewer-toolbar,
    .viewer-stage:fullscreen .viewer-toolbar {
        width: 100%;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .viewer-stage.presentation-active .status-pill,
    .viewer-stage:fullscreen .status-pill,
    .viewer-stage.presentation-active #printButton,
    .viewer-stage:fullscreen #printButton,
    .viewer-stage.presentation-active .viewer-back-link,
    .viewer-stage:fullscreen .viewer-back-link {
        display: none;
    }

    .viewer-stage.presentation-active #presentationButton,
    .viewer-stage:fullscreen #presentationButton {
        flex: 0 0 auto;
        min-width: 64px;
        padding: 10px 12px;
        font-size: 0.92rem;
    }

    .viewer-stage.presentation-active .presentation-controls,
    .viewer-stage:fullscreen .presentation-controls {
        width: auto;
        flex: 1 1 auto;
        justify-content: flex-end;
        gap: 6px;
    }

    .viewer-stage.presentation-active .presentation-controls .ghost-button,
    .viewer-stage:fullscreen .presentation-controls .ghost-button {
        min-width: 56px;
        padding: 10px 10px;
        font-size: 0.92rem;
    }

    .viewer-stage.presentation-active .presentation-page-indicator,
    .viewer-stage:fullscreen .presentation-page-indicator {
        min-width: 52px;
        font-size: 1rem;
    }

    .viewer-stage.presentation-active .viewer-pages,
    .viewer-stage:fullscreen .viewer-pages {
        align-items: flex-start;
        padding: 4px var(--presentation-side-gap) 10px;
    }
}
