:root {
    --bg: #f3f4f6;
    --panel: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #d1d5db;
    --border-soft: #e5e7eb;
    --primary: #1f2937;
    --primary-hover: #111827;
    --button-bg: #ffffff;
    --button-hover: #f9fafb;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

html {
    width: 100%;
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

button,
select {
    font: inherit;
}

button {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    min-height: 42px;
    cursor: pointer;
    background: var(--button-bg);
    color: var(--text);
    transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}

button:hover:not(:disabled) {
    background: var(--button-hover);
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 12px;
    background: #fff;
    color: var(--text);
}

label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    background: var(--primary);
    color: #fff;
    padding: 18px 24px;
}

.header-content {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.app-header h1 {
    margin: 0;
    font-size: 26px;
    line-height: 1.2;
}

.app-header p {
    margin: 4px 0 0 0;
    color: #d1d5db;
    font-size: 15px;
}

.app-main {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

/*
 * Panel sterowania jako fixed overlay.
 * Dzięki temu po kliknięciu strzałki panel otwiera się zawsze
 * na aktualnym ekranie, nawet po przewinięciu daleko w dół.
 */
.toolbar {
    position: fixed;
    top: 12px;
    left: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 1360px;
    margin-left: auto;
    margin-right: auto;
    background: var(--panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px;
}

.toolbar.is-closed {
    display: none;
}

.toolbar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.toolbar-title {
    font-weight: 700;
    color: var(--text);
}

.toolbar-collapse-btn {
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toolbar-floating-btn {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1100;
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: var(--shadow);
    font-size: 18px;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
}

.toolbar-floating-btn:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.toolbar-floating-btn.is-visible {
    display: flex;
}

.toolbar-content {
    overflow: visible;
}

.field-group {
    margin-bottom: 14px;
}

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

.navigation-row,
.view-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.primary-btn {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 700;
    white-space: nowrap;
}

.primary-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.secondary-btn {
    white-space: nowrap;
}

.page-info,
.zoom-info {
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: #f9fafb;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.page-info {
    min-width: 130px;
}

.zoom-info {
    min-width: 76px;
}

.status {
    margin-top: 12px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}

.score-wrapper {
    width: 100%;
}

.notation {
    background: var(--panel);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    overflow: auto;
    min-height: 50vh;
    -webkit-overflow-scrolling: touch;
}

.notation svg {
    display: block;
    width: auto;
    height: auto;
    max-width: none;
    transform-origin: top left;
}

.notation.fit-width svg {
    width: 100%;
    height: auto;
    max-width: 100%;
}

.empty-state {
    min-height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    text-align: center;
    padding: 30px;
}

@media (max-width: 900px) {
    .app-header {
        padding: 16px 18px;
    }

    .app-header h1 {
        font-size: 23px;
    }

    .app-main {
        padding: 14px;
    }

    .toolbar {
        top: 10px;
        left: 14px;
        right: 14px;
        padding: 10px;
        border-radius: 10px;
    }

    .notation {
        padding: 14px;
        border-radius: 10px;
    }
}

@media (max-width: 640px) {
    body {
        background: #fff;
    }

    .app-header {
        padding: 14px 14px;
    }

    .app-header h1 {
        font-size: 21px;
    }

    .app-header p {
        font-size: 13px;
    }

    .app-main {
        padding: 10px;
    }

    .toolbar {
        top: 8px;
        left: 8px;
        right: 8px;
        max-height: calc(100vh - 16px);
        overflow-y: auto;
        padding: 10px;
        border-radius: 12px;
    }

    .toolbar-floating-btn {
        top: 8px;
        right: 8px;
        width: 38px;
        min-width: 38px;
        height: 38px;
        font-size: 16px;
        opacity: 0.92;
    }

    .toolbar-title {
        font-size: 14px;
    }

    .toolbar-collapse-btn {
        width: 38px;
        min-width: 38px;
        height: 38px;
        font-size: 16px;
    }

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

    .primary-btn,
    .secondary-btn {
        width: 100%;
    }

    .navigation-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .view-row {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
    }

    .view-row #fitBtn {
        grid-column: 1 / -1;
    }

    .page-info,
    .zoom-info {
        width: 100%;
        min-width: 0;
    }

    .notation {
        border-radius: 0;
        margin-left: -10px;
        margin-right: -10px;
        border-left: 0;
        border-right: 0;
        padding: 8px;
        min-height: 55vh;
    }

    .notation svg {
        min-width: 720px;
    }

    .notation.fit-width svg {
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }

    .empty-state {
        min-height: 45vh;
        padding: 20px;
        font-size: 14px;
    }
}

@media (max-width: 380px) {
    .app-header h1 {
        font-size: 19px;
    }

    button,
    select,
    .page-info,
    .zoom-info {
        min-height: 40px;
        padding: 9px 10px;
        font-size: 14px;
    }

    .status {
        font-size: 13px;
    }
}

@media print {
    body {
        background: #fff;
    }

    .app-header,
    .toolbar,
    .toolbar-floating-btn {
        display: none;
    }

    .app-main {
        padding: 0;
        max-width: none;
    }

    .notation {
        border: 0;
        box-shadow: none;
        padding: 0;
        overflow: visible;
    }

    .notation svg {
        width: 100%;
        max-width: 100%;
    }
}

/* ==========================================================
   Korekta renderowania nut dla trybu auto / mobile / landscape
   ========================================================== */

.notation {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    touch-action: pan-x pan-y;
}

.notation svg {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.notation.fit-width {
    overflow-x: hidden;
}

.notation.fit-width svg {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
}

.notation.manual-zoom {
    overflow-x: auto;
}

.notation.manual-zoom svg {
    max-width: none !important;
}

@media (orientation: landscape) and (max-width: 900px) {
    .app-header {
        display: none;
    }

    .app-main {
        padding-top: 6px;
    }

    .notation {
        min-height: calc(100dvh - 12px);
        padding: 6px;
    }

    .notation.fit-width svg {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (orientation: portrait) and (max-width: 700px) {
    .notation {
        min-height: calc(100dvh - 20px);
    }

    .notation.fit-width svg {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ==========================================================
   Fullscreen
   ========================================================== */

.fullscreen-btn {
    font-weight: 700;
}

.app-shell:fullscreen {
    background: #fff;
    width: 100vw;
    height: 100vh;
    overflow: auto;
}

.app-shell:fullscreen .app-header {
    display: none;
}

.app-shell:fullscreen .app-main {
    max-width: none;
    width: 100%;
    min-height: 100vh;
    padding: 6px;
}

.app-shell:fullscreen .notation {
    min-height: calc(100vh - 12px);
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding: 6px;
    box-shadow: none;
}

.app-shell:fullscreen .toolbar {
    top: 8px;
    left: 8px;
    right: 8px;
    max-width: none;
}

.app-shell:fullscreen .toolbar-floating-btn {
    top: 8px;
    right: 8px;
}

/* Safari / iOS częściowo używa prefiksów */
.app-shell:-webkit-full-screen {
    background: #fff;
    width: 100vw;
    height: 100vh;
    overflow: auto;
}

.app-shell:-webkit-full-screen .app-header {
    display: none;
}

.app-shell:-webkit-full-screen .app-main {
    max-width: none;
    width: 100%;
    min-height: 100vh;
    padding: 6px;
}

.app-shell:-webkit-full-screen .notation {
    min-height: calc(100vh - 12px);
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding: 6px;
    box-shadow: none;
}

@media (max-width: 640px) {
    .view-row {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .view-row #fitBtn,
    .view-row #fullscreenBtn {
        grid-column: 1 / -1;
    }

    .app-shell:fullscreen .notation {
        min-height: calc(100dvh - 12px);
    }

    .app-shell:-webkit-full-screen .notation {
        min-height: calc(100dvh - 12px);
    }
}

/* ==========================================================
   Fullscreen / mobile fullscreen fallback
   ========================================================== */

.fullscreen-floating-btn {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1200;
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: var(--shadow);
    font-size: 20px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-floating-btn:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/*
 * Strzałka menu jest pod przyciskiem fullscreen.
 */
.toolbar-floating-btn {
    top: 62px !important;
}

/*
 * Gdy panel jest otwarty, strzałka menu i tak jest schowana,
 * ale przycisk fullscreen pozostaje dostępny.
 */
body.pseudo-fullscreen {
    overflow: hidden;
    background: #fff;
}

body.pseudo-fullscreen .app-header {
    display: none;
}

body.pseudo-fullscreen .toolbar {
    display: none !important;
}

body.pseudo-fullscreen .toolbar-floating-btn {
    display: none !important;
}

body.pseudo-fullscreen .app-shell {
    min-height: 100dvh;
}

body.pseudo-fullscreen .app-main {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100dvh;
    padding: 0;
    margin: 0;
    background: #fff;
    overflow: hidden;
}

body.pseudo-fullscreen .score-wrapper {
    width: 100vw;
    height: 100dvh;
}

body.pseudo-fullscreen .notation {
    width: 100vw;
    height: 100dvh;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    padding: 6px;
    overflow: auto;
}

body.pseudo-fullscreen .fullscreen-floating-btn {
    top: 8px;
    right: 8px;
    z-index: 1300;
    opacity: 0.88;
}

body.pseudo-fullscreen .fullscreen-floating-btn::after {
    content: "";
}

/*
 * Gdy przeglądarka ma natywny fullscreen, też ukrywamy nadmiar UI.
 */
:fullscreen .app-header {
    display: none;
}

:fullscreen .toolbar {
    display: none !important;
}

:fullscreen .toolbar-floating-btn {
    display: none !important;
}

:fullscreen .app-main {
    max-width: none;
    width: 100vw;
    height: 100vh;
    padding: 0;
    background: #fff;
}

:fullscreen .notation {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    padding: 6px;
    overflow: auto;
}

:-webkit-full-screen .app-header {
    display: none;
}

:-webkit-full-screen .toolbar {
    display: none !important;
}

:-webkit-full-screen .toolbar-floating-btn {
    display: none !important;
}

:-webkit-full-screen .app-main {
    max-width: none;
    width: 100vw;
    height: 100vh;
    padding: 0;
    background: #fff;
}

:-webkit-full-screen .notation {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    padding: 6px;
    overflow: auto;
}

@media (max-width: 640px) {
    .fullscreen-floating-btn {
        top: 8px;
        right: 8px;
        width: 38px;
        min-width: 38px;
        height: 38px;
        font-size: 18px;
        opacity: 0.92;
    }

    .toolbar-floating-btn {
        top: 54px !important;
    }

    body.pseudo-fullscreen .notation {
        padding: 4px;
    }
}

@media print {
    .fullscreen-floating-btn {
        display: none !important;
    }
}

/* ==========================================================
   FIX: widoczne ikony menu i fullscreen w trybie fullscreen
   ========================================================== */

.toolbar-floating-btn,
.fullscreen-floating-btn {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
}

.toolbar-floating-btn svg,
.fullscreen-floating-btn svg {
    width: 21px;
    height: 21px;
    display: block;
    stroke: #ffffff;
    fill: none;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.fullscreen-floating-btn .icon-close {
    width: 22px;
    height: 22px;
}

/*
 * W trybie pseudo-fullscreen menu ma być widoczne.
 * Poprzednio było ukrywane.
 */
body.pseudo-fullscreen .toolbar-floating-btn {
    display: flex !important;
    top: 54px !important;
    right: 8px !important;
    z-index: 1300 !important;
    opacity: 0.92;
}

body.pseudo-fullscreen .fullscreen-floating-btn {
    display: flex !important;
    top: 8px !important;
    right: 8px !important;
    z-index: 1301 !important;
    opacity: 0.92;
}

/*
 * W natywnym fullscreen też zostawiamy menu i fullscreen.
 */
:fullscreen .toolbar-floating-btn {
    display: flex !important;
    top: 62px !important;
    right: 12px !important;
    z-index: 1300 !important;
    opacity: 0.92;
}

:fullscreen .fullscreen-floating-btn {
    display: flex !important;
    top: 12px !important;
    right: 12px !important;
    z-index: 1301 !important;
    opacity: 0.92;
}

:-webkit-full-screen .toolbar-floating-btn {
    display: flex !important;
    top: 62px !important;
    right: 12px !important;
    z-index: 1300 !important;
    opacity: 0.92;
}

:-webkit-full-screen .fullscreen-floating-btn {
    display: flex !important;
    top: 12px !important;
    right: 12px !important;
    z-index: 1301 !important;
    opacity: 0.92;
}

@media (max-width: 640px) {
    :fullscreen .toolbar-floating-btn,
    :-webkit-full-screen .toolbar-floating-btn {
        top: 54px !important;
        right: 8px !important;
    }

    :fullscreen .fullscreen-floating-btn,
    :-webkit-full-screen .fullscreen-floating-btn {
        top: 8px !important;
        right: 8px !important;
    }

    body.pseudo-fullscreen .toolbar-floating-btn {
        top: 54px !important;
        right: 8px !important;
    }

    body.pseudo-fullscreen .fullscreen-floating-btn {
        top: 8px !important;
        right: 8px !important;
    }
}

/* ==========================================================
   FIX: panel menu ma się otwierać również w fullscreen
   ========================================================== */

body.pseudo-fullscreen .toolbar.is-open {
    display: block !important;
    position: fixed !important;
    top: 8px !important;
    left: 8px !important;
    right: 58px !important;
    z-index: 1400 !important;
    max-height: calc(100dvh - 16px);
    overflow-y: auto;
}

body.pseudo-fullscreen .toolbar.is-closed {
    display: none !important;
}

:fullscreen .toolbar.is-open {
    display: block !important;
    position: fixed !important;
    top: 12px !important;
    left: 12px !important;
    right: 62px !important;
    z-index: 1400 !important;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
}

:fullscreen .toolbar.is-closed {
    display: none !important;
}

:-webkit-full-screen .toolbar.is-open {
    display: block !important;
    position: fixed !important;
    top: 12px !important;
    left: 12px !important;
    right: 62px !important;
    z-index: 1400 !important;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
}

:-webkit-full-screen .toolbar.is-closed {
    display: none !important;
}

@media (max-width: 640px) {
    :fullscreen .toolbar.is-open,
    :-webkit-full-screen .toolbar.is-open,
    body.pseudo-fullscreen .toolbar.is-open {
        top: 8px !important;
        left: 8px !important;
        right: 54px !important;
        max-height: calc(100dvh - 16px);
    }
}

/* ==========================================================
   FIX: prawy margines dla pływających przycisków
   ========================================================== */

.notation {
    padding-right: 72px !important;
}

body.pseudo-fullscreen .notation {
    padding-right: 72px !important;
}

:fullscreen .notation {
    padding-right: 76px !important;
}

:-webkit-full-screen .notation {
    padding-right: 76px !important;
}

@media (max-width: 640px) {
    .notation {
        padding-right: 56px !important;
    }

    body.pseudo-fullscreen .notation,
    :fullscreen .notation,
    :-webkit-full-screen .notation {
        padding-right: 56px !important;
    }
}

@media (orientation: landscape) and (max-width: 900px) {
    .notation {
        padding-right: 62px !important;
    }

    body.pseudo-fullscreen .notation,
    :fullscreen .notation,
    :-webkit-full-screen .notation {
        padding-right: 62px !important;
    }
}

/* ==========================================================
   Korekta: lepsze wykorzystanie ekranu w fullscreen
   ========================================================== */

body.pseudo-fullscreen .notation.fit-width svg,
:fullscreen .notation.fit-width svg,
:-webkit-full-screen .notation.fit-width svg {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

body.pseudo-fullscreen .notation,
:fullscreen .notation,
:-webkit-full-screen .notation {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
}

/* ==========================================================
   Pływające przyciski zoom + / -
   ========================================================== */

.floating-zoom-btn {
    position: fixed;
    right: 12px;
    z-index: 1200;
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 999px;
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: var(--shadow);
    font-size: 24px;
    line-height: 1;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.92;
}

.floating-zoom-in {
    top: 112px;
}

.floating-zoom-out {
    top: 162px;
}

.floating-zoom-btn:hover {
    background: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

.floating-zoom-btn:disabled {
    opacity: 0.35;
}

body.pseudo-fullscreen .floating-zoom-btn {
    z-index: 1300 !important;
}

body.pseudo-fullscreen .floating-zoom-in {
    top: 100px !important;
    right: 8px !important;
}

body.pseudo-fullscreen .floating-zoom-out {
    top: 146px !important;
    right: 8px !important;
}

:fullscreen .floating-zoom-btn,
:-webkit-full-screen .floating-zoom-btn {
    z-index: 1300 !important;
}

:fullscreen .floating-zoom-in,
:-webkit-full-screen .floating-zoom-in {
    top: 112px !important;
    right: 12px !important;
}

:fullscreen .floating-zoom-out,
:-webkit-full-screen .floating-zoom-out {
    top: 162px !important;
    right: 12px !important;
}

@media (max-width: 640px) {
    .floating-zoom-btn {
        right: 8px;
        width: 38px;
        min-width: 38px;
        height: 38px;
        font-size: 22px;
    }

    .floating-zoom-in {
        top: 100px;
    }

    .floating-zoom-out {
        top: 146px;
    }

    body.pseudo-fullscreen .floating-zoom-in,
    :fullscreen .floating-zoom-in,
    :-webkit-full-screen .floating-zoom-in {
        top: 100px !important;
        right: 8px !important;
    }

    body.pseudo-fullscreen .floating-zoom-out,
    :fullscreen .floating-zoom-out,
    :-webkit-full-screen .floating-zoom-out {
        top: 146px !important;
        right: 8px !important;
    }
}

@media print {
    .floating-zoom-btn {
        display: none !important;
    }
}

/* ==========================================================
   Ekran autoryzacji
   ========================================================== */

.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #111827;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-overlay.is-hidden {
    display: none;
}

.auth-box {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    color: #111827;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.auth-box h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
}

.auth-box p {
    margin: 0 0 18px 0;
    color: #6b7280;
}

.auth-box input {
    width: 100%;
    min-height: 46px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 18px;
    margin-bottom: 12px;
}

.auth-box button {
    width: 100%;
    background: #1f2937;
    color: #ffffff;
    border-color: #1f2937;
    font-weight: 700;
}

.auth-error {
    min-height: 22px;
    margin-top: 12px;
    color: #b91c1c;
    font-weight: 700;
}

/* FIX: przycisk logowania ma pozostać czytelny podczas hover/focus/active */
.auth-box button,
.auth-box button:hover,
.auth-box button:focus,
.auth-box button:active {
    background: #1f2937 !important;
    color: #ffffff !important;
    border-color: #1f2937 !important;
    outline: none;
}

.auth-box button:focus-visible {
    box-shadow: 0 0 0 3px rgba(31, 41, 55, 0.35);
}

/* ==========================================================
   Pływające przyciski poprzednia / następna strona
   ========================================================== */

.floating-page-btn {
    position: fixed;
    right: 12px;
    z-index: 1200;
    width: 42px;
    min-width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 999px;
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: var(--shadow);
    font-size: 30px;
    line-height: 1;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.92;
}

.floating-next-page {
    top: 212px;
}

.floating-prev-page {
    top: 262px;
}

.floating-page-btn:hover {
    background: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

.floating-page-btn:disabled {
    opacity: 0.35;
}

body.pseudo-fullscreen .floating-page-btn {
    z-index: 1300 !important;
}

body.pseudo-fullscreen .floating-next-page {
    top: 192px !important;
    right: 8px !important;
}

body.pseudo-fullscreen .floating-prev-page {
    top: 238px !important;
    right: 8px !important;
}

:fullscreen .floating-page-btn,
:-webkit-full-screen .floating-page-btn {
    z-index: 1300 !important;
}

:fullscreen .floating-next-page,
:-webkit-full-screen .floating-next-page {
    top: 212px !important;
    right: 12px !important;
}

:fullscreen .floating-prev-page,
:-webkit-full-screen .floating-prev-page {
    top: 262px !important;
    right: 12px !important;
}

@media (max-width: 640px) {
    .floating-page-btn {
        right: 8px;
        width: 38px;
        min-width: 38px;
        height: 38px;
        font-size: 28px;
    }

    .floating-next-page {
        top: 192px;
    }

    .floating-prev-page {
        top: 238px;
    }

    body.pseudo-fullscreen .floating-next-page,
    :fullscreen .floating-next-page,
    :-webkit-full-screen .floating-next-page {
        top: 192px !important;
        right: 8px !important;
    }

    body.pseudo-fullscreen .floating-prev-page,
    :fullscreen .floating-prev-page,
    :-webkit-full-screen .floating-prev-page {
        top: 238px !important;
        right: 8px !important;
    }
}

@media print {
    .floating-page-btn {
        display: none !important;
    }
}
