/* PaperOffice Mobil — Lesemodus Stufe A (d5, 21.10.2026). Farben nur über die --pm-… Variablen aus mobile.css (hell; die
   Dunkel-Selektoren dort bilden auf dieselben Werte ab). Schrift nie fetter als 500, Zeilenhöhe 1.6, Textbreite max. 42em. */

html.po-rm-open,
html.po-rm-open body {
    overflow: hidden;
}

.po-rm {
    position: fixed;
    inset: 0;
    z-index: 1000190; /* über Vorschau/Blättern (1000000–1000180), unter den Meldungen (1000200) */
    display: flex;
    flex-direction: column;
    background: var(--pm-bg-secondary, #ffffff);
    color: var(--pm-text-primary, #1f2937);
    font-family: inherit;
    font-weight: 400;
    --po-rm-font: 18px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.po-rm__bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 56px;
    padding: calc(env(safe-area-inset-top, 0px) + 6px) calc(env(safe-area-inset-right, 0px) + 8px) 6px calc(env(safe-area-inset-left, 0px) + 8px);
    background: var(--pm-bg-secondary, #ffffff);
    border-bottom: 1px solid var(--pm-border, #e5e7eb);
    box-sizing: border-box;
}

.po-rm__head {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 4px;
}

.po-rm__eyebrow {
    font-size: 12px;
    line-height: 1.3;
    font-weight: 500;
    color: var(--pm-text-muted, #6b7280);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.po-rm__title {
    margin: 0;
    font-size: 16px;
    line-height: 1.3;
    font-weight: 500;
    color: var(--pm-text-primary, #1f2937);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.po-rm__btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--pm-text-primary, #1f2937);
    font: inherit;
    font-weight: 400;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.po-rm__btn:active {
    background: var(--pm-bg-active, #E6F2FA);
}

.po-rm__btn:focus-visible {
    outline: 2px solid var(--pm-border-focus, #587899);
    outline-offset: 1px;
}

.po-rm__btn[aria-disabled="true"] {
    color: var(--pm-text-light, #9ca3af);
    cursor: default;
}

[dir="rtl"] .po-rm__close svg {
    transform: scaleX(-1);
}

.po-rm__scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: var(--pm-bg-secondary, #ffffff);
}

.po-rm__scroll:focus {
    outline: none;
}

.po-rm__scroll:focus-visible {
    outline: 2px solid var(--pm-border-focus, #587899);
    outline-offset: -2px;
}

.po-rm__content {
    box-sizing: border-box;
    max-width: 42em;
    margin: 0 auto;
    padding: 16px calc(env(safe-area-inset-right, 0px) + 20px) calc(env(safe-area-inset-bottom, 0px) + 32px) calc(env(safe-area-inset-left, 0px) + 20px);
    font-size: var(--po-rm-font);
    line-height: 1.6;
    font-weight: 400;
    color: var(--pm-text-primary, #1f2937);
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
    -webkit-hyphens: auto;
}

.po-rm__hint {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 400;
    color: var(--pm-text-muted, #6b7280);
}

.po-rm__hint[hidden] {
    display: none;
}

.po-rm__status:empty {
    display: none;
}

.po-rm__status.is-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--pm-text-secondary, #495057);
}

.po-rm__spinner {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--pm-border, #e5e7eb);
    border-top-color: var(--pm-accent, #587899);
    animation: po-rm-spin 0.9s linear infinite;
}

@keyframes po-rm-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .po-rm__spinner { animation-duration: 2.4s; }
}

.po-rm__message {
    margin: 24px 0;
    font-size: 16px;
    line-height: 1.6;
    color: var(--pm-text-primary, #1f2937);
}

.po-rm__empty {
    margin: 32px 0;
    text-align: center;
    font-size: 16px;
    color: var(--pm-text-muted, #6b7280);
}

.po-rm__page {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 24px 0 12px;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--pm-text-muted, #6b7280);
}

.po-rm__page::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: var(--pm-border, #e5e7eb);
}

.po-rm__body > .po-rm__page:first-child {
    margin-top: 4px;
}

.po-rm__h {
    margin: 1.2em 0 0.4em;
    font-size: 1.2em;
    line-height: 1.35;
    font-weight: 500;
    color: var(--pm-ink, #0f172a);
}

.po-rm__p {
    margin: 0 0 0.9em;
    white-space: pre-line;
}

.po-rm__list {
    margin: 0 0 0.9em;
    padding: 0;
    list-style: none;
}

.po-rm__list li {
    position: relative;
    margin: 0 0 0.35em;
    padding-inline-start: 1.2em;
}

.po-rm__list li::before {
    content: "";
    position: absolute;
    inset-inline-start: 0.3em;
    top: 0.72em;
    width: 0.32em;
    height: 0.32em;
    border-radius: 50%;
    background: var(--pm-text-secondary, #495057);
}

.po-rm__list.is-ordered li {
    padding-inline-start: 0;
}

.po-rm__list.is-ordered li::before {
    display: none;
}

.po-rm__table-wrap {
    margin: 0 0 0.9em;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.po-rm__table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.88em;
    line-height: 1.5;
}

.po-rm__table td {
    padding: 0.35em 0.5em;
    border-bottom: 1px solid var(--pm-border, #e5e7eb);
    vertical-align: top;
    text-align: start;
    overflow-wrap: anywhere;
}

.po-rm__table tr:first-child td {
    border-top: 1px solid var(--pm-border, #e5e7eb);
}

/* sehr schmal (320 px): etwas weniger Rand */
@media (max-width: 359px) {
    .po-rm__content {
        padding-left: calc(env(safe-area-inset-left, 0px) + 14px);
        padding-right: calc(env(safe-area-inset-right, 0px) + 14px);
    }
    .po-rm__btn {
        width: 40px;
        height: 44px;
    }
}

/* Querformat mit wenig Höhe: flachere Kopfzeile */
@media (orientation: landscape) and (max-height: 500px) {
    .po-rm__bar {
        min-height: 48px;
        padding-top: calc(env(safe-area-inset-top, 0px) + 2px);
        padding-bottom: 2px;
    }
    .po-rm__eyebrow {
        display: none;
    }
}
