/* Sierra/Jones in the Fast Lane inspired design tokens */
:root {
    --beige-plastic: #d6cebf;
    --beige-light: #eae5db;
    --beige-dark: #a89e8c;
    --beige-shadow: #5c5548;
    --lcd-green-bg: #141b15;
    --lcd-green-text: #39ff14;
    --lcd-amber-bg: #1a1510;
    --lcd-amber-text: #ffb000;
    --paper-color: #faf8f0;
    --folder-card: #ece5d3;
}

html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    -webkit-text-size-adjust: 100%;
}

body,
.mobile-body {
    background-color: #2b3a4a;
    background-image: radial-gradient(#394c61 20%, transparent 20%),
                      radial-gradient(#394c61 20%, transparent 20%);
    background-size: 16px 16px;
    background-position: 0 0, 8px 8px;
    font-family: 'Courier Prime', monospace;
    image-rendering: pixelated;
}

/* Mobil: fyll hele skjermen (inkl. safe area / notch) */
.mobile-body {
    position: fixed;
    inset: 0;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100vw;
    height: 100%;
    height: 100dvh;
    height: 100svh;
    min-height: -webkit-fill-available;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: manipulation;
}

.login-screen {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    height: 100svh;
    min-height: -webkit-fill-available;
    padding: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: #1e2530;
    font-family: 'Share Tech Mono', monospace;
    color: #111;
    -webkit-tap-highlight-color: transparent;
}

.login-screen ::selection {
    background: #ad2323;
    color: #fff;
}

.auth-chassis {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 100%;
    height: 100dvh;
    height: 100svh;
    min-height: -webkit-fill-available;
    max-height: 100dvh;
    max-height: 100svh;
    margin: 0 auto;
    background: #d2cab8;
    border-left: 4px solid #4e4537;
    border-right: 4px solid #4e4537;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55);
    overflow: hidden;
    box-sizing: border-box;
}

@media (min-width: 640px) {
    .login-screen {
        align-items: center;
        padding: 16px;
        overflow-y: auto;
    }

    .auth-chassis {
        height: auto;
        min-height: 820px;
        max-height: none;
        border: 8px solid #4e4537;
        border-radius: 36px;
    }

    .auth-panel-lower {
        flex: 1 1 auto;
        justify-content: space-between;
        padding: 24px;
    }
}

.auth-chassis-notch {
    display: none;
    position: absolute;
    top: 10px;
    left: 0;
    right: 0;
    justify-content: center;
    align-items: center;
    gap: 6px;
    z-index: 40;
}

@media (min-width: 640px) {
    .auth-chassis-notch {
        display: flex;
    }
}

.auth-notch-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #1c1813;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

.auth-notch-slot {
    width: 56px;
    height: 6px;
    border-radius: 999px;
    background: #2d2820;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

.auth-screen {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin: 12px;
    border: 4px solid #3e362a;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35);
    background: #3a4856;
    position: relative;
}

@media (min-width: 640px) {
    .auth-screen {
        margin: 16px;
    }
}

.auth-panel-upper {
    background: #f0ebd3;
    padding: 32px 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 4px solid #3e362a;
    position: relative;
}

.auth-back-link {
    align-self: flex-start;
    position: sticky;
    top: 0;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    margin: 0 0 10px;
    padding: 8px 12px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    color: #1a1713;
    background: #c0b7a6;
    border: 3px solid #221d15;
    border-color: #eee5d5 #7a7162 #7a7162 #eee5d5;
    box-shadow: 1px 1px 0 #000;
    cursor: pointer;
    transition: transform 0.05s ease;
}

.auth-back-link:active {
    border-color: #7a7162 #eee5d5 #eee5d5 #7a7162;
    transform: translate(1px, 1px);
    box-shadow: none;
}

.auth-back-link--lower {
    position: static;
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
    margin: 12px 0 0;
    padding: 10px 12px;
    font-size: 11px;
    color: #f0ebd3;
    background: #2e3a47;
    border-color: #1a2229 #4a5c6e #4a5c6e #1a2229;
}

.auth-lens {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #111;
    border: 2px solid #555;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.auth-fax-art-wrap {
    display: flex;
    justify-content: center;
    margin: 8px 0 4px;
}

.auth-fax-art {
    width: 125px;
    height: auto;
}

.auth-title {
    margin: 0 0 16px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 2.925rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #1a1713;
    line-height: 1;
    user-select: none;
}

.auth-form-view {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form-view.hidden {
    display: none;
}

.auth-form-hint {
    margin: 0 0 4px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    line-height: 1.4;
    color: #4e4537;
    text-align: center;
    text-transform: uppercase;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.auth-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.15em;
    color: #2e261a;
    text-transform: uppercase;
}

.bevel-input-custom,
.auth-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px;
    background: #fbf9eb;
    border: 3px solid #221d15;
    box-shadow: inset 3px 3px 0 #5e574c, inset -1px -1px 0 #fff;
    color: #111;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.05em;
    outline: none;
    transition: background-color 0.15s ease;
}

.auth-input::placeholder {
    color: rgba(78, 69, 55, 0.5);
    text-transform: uppercase;
}

.auth-input:focus {
    background: #fffae0;
}

.auth-msg {
    margin: 0;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    line-height: 1.35;
    text-transform: uppercase;
}

.auth-msg--error {
    color: #ad2323;
}

.auth-msg--ok {
    color: #2d6a4f;
}

.auth-register-actions {
    flex-shrink: 0;
    width: 100%;
    margin: 0;
    padding: 10px 12px 12px;
    box-sizing: border-box;
    background: #3a4856;
    border-top: 4px solid #3e362a;
    position: relative;
    z-index: 3;
}

.auth-register-actions.hidden {
    display: none;
}

.auth-screen--register {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 0;
    overflow: hidden;
}

.auth-screen--register .auth-panel-upper {
    grid-row: 1;
    flex: none;
    min-height: 0;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-bottom: 0;
    padding: 12px 14px 10px;
    align-items: stretch;
}

.auth-screen--register .auth-back-link {
    position: static;
    margin-bottom: 8px;
    padding: 6px 10px;
    font-size: 9px;
}

.auth-form-view--register {
    gap: 14px;
}

.auth-form-view--register .auth-field {
    gap: 5px;
}

.auth-form-view--register .auth-label {
    font-size: 10px;
    letter-spacing: 0.1em;
}

.auth-form-view--register .auth-input {
    padding: 14px 17px;
    font-size: 0.875rem;
    line-height: 1.2;
    min-height: 67px;
    box-sizing: border-box;
}

.auth-chassis--register .auth-televerket-stamp {
    margin-bottom: max(8px, env(safe-area-inset-bottom));
}

.auth-panel-lower {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 8px;
    padding: 16px;
    background: #3a4856;
    position: relative;
}

.auth-action-zone {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
}

.auth-action-set {
    width: 100%;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
}

.auth-action-set.hidden {
    display: none;
}

.auth-back-link.hidden {
    display: none;
}

.auth-bolt {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.25rem;
    color: #ffd33d;
    font-weight: 700;
    filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.5));
    animation: auth-bolt-pulse 1.5s ease-in-out infinite;
    user-select: none;
    pointer-events: none;
}

.auth-bolt--left {
    left: 4px;
}

.auth-bolt--right {
    right: 4px;
    animation-delay: 0.2s;
}

@keyframes auth-bolt-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

.bevel-btn-red-custom,
.auth-btn-login {
    width: 100%;
    padding: 14px 16px;
    font-family: 'VT323', monospace;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #fff;
    background: #cb2020;
    border: 3px solid #221d15;
    border-radius: 12px;
    box-shadow: inset 0 3px 0 #ff7676, inset 0 -4px 0 #4d0909;
    text-shadow: 1px 2px 0 #3c0606;
    filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.4));
    cursor: pointer;
    transition: transform 0.05s ease;
}

.bevel-btn-red-custom:active,
.auth-btn-login:active {
    box-shadow: inset 0 2px 0 #4d0909, inset 0 -2px 0 #ff7676;
    transform: translateY(2px);
}

.auth-btn-login:disabled {
    opacity: 0.75;
    cursor: wait;
}

.auth-btn-forgot-submit {
    width: 100%;
    padding: 12px 16px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.875rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #111;
    background: #e5b83b;
    border: 3px solid #221d15;
    border-top-color: #f7e1a0;
    border-left-color: #f7e1a0;
    border-bottom-color: #8c6d1d;
    border-right-color: #8c6d1d;
    border-radius: 12px;
    filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.4));
    cursor: pointer;
    transition: transform 0.05s ease;
}

.auth-btn-forgot-submit:active {
    transform: translateY(2px);
}

.auth-btn-forgot-submit:disabled {
    opacity: 0.75;
    cursor: wait;
}

.auth-nav-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 16px 0;
    text-align: center;
}

.auth-link-row {
    margin: 0;
}

.auth-link-row.hidden {
    display: none;
}

.auth-link {
    display: inline;
    padding: 0;
    border: 0;
    background: none;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #ebcb5b;
    text-decoration: none;
    cursor: pointer;
    filter: drop-shadow(0 1.5px 1px rgba(0, 0, 0, 0.7));
}

.auth-link:hover {
    color: #fff;
    text-decoration: underline;
}

.auth-link--back {
    color: #fff;
}

.auth-link--back:hover {
    color: #ebcb5b;
}

.auth-link--register {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 15px;
    letter-spacing: 0.1em;
    line-height: 1.3;
    text-decoration: none;
    animation: auth-register-text-blink 1.1s ease-in-out infinite;
}

.auth-link--register:hover {
    text-decoration: none;
}

.auth-link--register-text {
    text-transform: uppercase;
}

.auth-register-led {
    flex-shrink: 0;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #39ff14;
    border: 1.5px solid #1a3d12;
    box-shadow: 0 0 6px #39ff14, 0 0 12px rgba(57, 255, 20, 0.55);
    animation: auth-register-led-blink 1.1s ease-in-out infinite;
}

.auth-register-led:last-child {
    animation-delay: 0.55s;
}

@keyframes auth-register-text-blink {
    0%, 100% {
        opacity: 1;
        color: #ebcb5b;
    }
    50% {
        opacity: 0.5;
        color: #fff89a;
    }
}

@keyframes auth-register-led-blink {
    0%, 100% {
        opacity: 1;
        background: #39ff14;
        box-shadow: 0 0 8px #39ff14, 0 0 14px rgba(57, 255, 20, 0.75);
    }
    50% {
        opacity: 0.2;
        background: #1a5c12;
        box-shadow: 0 0 2px rgba(57, 255, 20, 0.3);
    }
}

@keyframes auth-register-blink {
    0%, 100% {
        background-color: #facc15;
    }
    50% {
        background-color: #fde047;
    }
}

.auth-paper-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 8px;
}

.auth-paper-slot-rim {
    width: 84%;
    height: 20px;
    background: #251f18;
    border: 2.5px solid #3e362a;
    border-bottom: 3px solid #111;
    border-radius: 8px 8px 0 0;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-paper-slot-rim::after {
    content: '';
    width: 94%;
    height: 3px;
    background: #111;
    border-radius: 999px;
}

.auth-paper-strip {
    width: 78%;
    min-height: 50px;
    background: #faf8ee;
    border: 3px solid #3e362a;
    border-top: 0;
    padding: 8px;
    text-align: center;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.auth-paper-strip::before,
.auth-paper-strip::after {
    content: '';
    position: absolute;
    top: 4px;
    bottom: 4px;
    width: 1px;
    background: rgba(168, 162, 158, 0.25);
}

.auth-paper-strip::before {
    left: 8px;
}

.auth-paper-strip::after {
    right: 8px;
}

.auth-paper-strip-title {
    margin: 0;
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: none;
    color: #221c15;
}

.auth-notification {
    position: absolute;
    top: 50%;
    left: 24px;
    right: 24px;
    transform: translateY(-50%);
    z-index: 50;
    background: #faf9e5;
    border: 4px double #ad2323;
    padding: 16px;
    border-radius: 4px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.55);
    text-align: center;
    animation: auth-notification-bounce 0.8s ease infinite;
}

.auth-notification.hidden {
    display: none;
}

@keyframes auth-notification-bounce {
    0%, 100% { transform: translateY(-50%); }
    50% { transform: translateY(calc(-50% - 4px)); }
}

.auth-notification-title {
    margin: 0 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(173, 35, 35, 0.25);
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #ad2323;
}

.auth-notification-msg {
    margin: 0;
    font-family: 'Share Tech Mono', monospace;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1.5;
    color: #111;
}

.auth-televerket-stamp {
    flex-shrink: 0;
    text-align: center;
    font-family: 'Share Tech Mono', monospace;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: none;
    color: #4e4537;
    border: 1px solid rgba(78, 69, 55, 0.35);
    border-radius: 4px;
    background: rgba(210, 202, 184, 0.5);
    margin: 0 16px max(12px, env(safe-area-inset-bottom));
    padding: 4px 12px;
    width: fit-content;
    align-self: center;
}

/* Mobil: øvre panel ruller, rød knapp + bunntekst alltid synlig */
@media (max-width: 639px) {
    .login-screen {
        overflow: hidden;
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        box-sizing: border-box;
    }

    .auth-chassis {
        height: 100%;
        max-height: 100%;
    }

    .auth-screen {
        margin: 8px;
    }

    .auth-panel-upper {
        flex: 1 1 0;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 20px 16px 12px;
    }

    .auth-panel-lower {
        padding: 10px 12px 12px;
    }

    .auth-fax-art {
        width: 96px;
    }

    .auth-fax-art-wrap {
        margin: 4px 0 2px;
    }

    .auth-title {
        font-size: 2.1rem;
        margin-bottom: 10px;
    }

    .auth-form-view {
        gap: 10px;
    }

    .auth-form-hint {
        font-size: 9px;
        margin-bottom: 2px;
    }

    .bevel-input-custom,
    .auth-input {
        padding: 10px;
        font-size: 0.9375rem;
    }

    .auth-nav-links {
        margin: 6px 0;
        gap: 6px;
    }

    .auth-paper-slot {
        margin-top: 2px;
    }

    .auth-paper-strip {
        min-height: 36px;
        padding: 6px;
    }

    .auth-paper-strip-title {
        font-size: 11px;
    }

    .auth-btn-login {
        padding: 12px 14px;
        font-size: 1.125rem;
    }

    .auth-screen--register {
        margin: 6px;
    }

    .auth-chassis--register .auth-televerket-stamp {
        display: none;
    }

    .auth-screen--register .auth-panel-upper {
        padding: 10px 12px 8px;
    }

    .auth-form-view--register {
        gap: 12px;
    }

    .auth-form-view--register .auth-input {
        padding: 13px 14px;
        font-size: 0.8125rem;
        min-height: 67px;
    }

    .auth-screen--register .auth-register-actions {
        padding: 8px 10px 10px;
    }

    .auth-screen--register .auth-btn-login {
        padding: 10px 12px;
        font-size: 1rem;
    }
}

/* Legacy aliases for register page */
.auth-register-link {
    display: inline-block;
    color: #3f3a33;
    text-decoration: none;
    padding: 10px 12px;
    background-color: #c0b7a6;
    border: 3px solid;
    border-color: #eee5d5 #7a7162 #7a7162 #eee5d5;
    box-shadow: 1px 1px 0 #000;
    transition: all 0.05s ease;
    line-height: 1.4;
}

.auth-register-link:hover {
    color: #1c1917;
    background-color: #d4cbb8;
}

.auth-register-link:active {
    border-color: #7a7162 #eee5d5 #eee5d5 #7a7162;
    transform: translate(1px, 1px);
    box-shadow: none;
}

.auth-register-link--create {
    display: block;
    width: 100%;
    color: #1c1917;
    background-color: #facc15;
    border-color: #fef08a #ca8a04 #ca8a04 #fef08a;
    animation: auth-register-blink 1.1s ease-in-out infinite;
}

.auth-register-link--create:hover {
    color: #0c0a09;
    background-color: #fde047;
}

.register-success-panel {
    width: 100%;
}

.register-success-fax-block {
    margin: 8px 0 16px;
    padding: 16px 12px;
    text-align: center;
    background: #fbf9eb;
    border: 3px solid #221d15;
    box-shadow: inset 3px 3px 0 #5e574c, inset -1px -1px 0 #fff;
}

.register-success-fax-label {
    display: block;
    margin-bottom: 8px;
}

.register-success-fax-number {
    display: block;
    font-family: 'Share Tech Mono', monospace;
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.08em;
    color: #ad2323;
    text-shadow: 1px 2px 0 rgba(60, 6, 6, 0.15);
}

.register-success-checklist {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    text-align: left;
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    line-height: 1.45;
    color: #4e4537;
    text-transform: uppercase;
}

.register-success-checklist li {
    padding-left: 1.1rem;
    position: relative;
    margin-bottom: 10px;
}

.register-success-checklist li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #ad2323;
}

.register-success-checklist strong {
    color: #2e261a;
}

.register-success-login-btn {
    display: block;
    text-align: center;
    text-decoration: none;
}

.inbox-pending-notice {
    border: 2px solid #5a5142;
    background: #1a1510;
}

.inbox-pending-notice-title {
    text-shadow: 0 0 8px rgba(251, 191, 36, 0.35);
}

.start-station-settings-btn {
    flex-shrink: 0;
}

.mobile-app {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
    height: 100%;
    height: 100dvh;
    height: 100svh;
    min-height: -webkit-fill-available;
    max-height: none;
    margin: 0;
    overflow: hidden;
    box-sizing: border-box;
    padding-bottom: env(safe-area-inset-bottom);
    isolation: isolate;
}

.app-session-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left));
    padding-top: max(8px, env(safe-area-inset-top));
    background: #27272a;
    border-bottom: 2px solid #3f3f46;
    color: #d4d4d8;
    font-size: 11px;
}

.app-session-user {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.app-home-btn {
    flex-shrink: 0;
    background: #c0b7a6;
    border: 2px solid #7a7162;
    color: #1c1917;
    width: 32px;
    height: 32px;
    padding: 0;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-home-btn:active {
    transform: translate(1px, 1px);
}

.app-session-user strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
}

.app-session-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 6px #22c55e;
    flex-shrink: 0;
}

.app-session-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.app-inbox-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-width: 6.75rem;
    background: #c0b7a6;
    border: 3px solid #7a7162;
    padding: 9px 18px;
    color: #1c1917;
    cursor: pointer;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.03em;
}

.app-inbox-btn i {
    font-size: 16px;
}

.app-inbox-label {
    white-space: nowrap;
}

.app-logout-btn {
    padding: 9px 14px;
    min-height: 36px;
    font-size: 12px;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.app-inbox-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 12px;
    background: #dc2626;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    line-height: 24px;
    text-align: center;
}

.app-inbox-badge.hidden {
    display: none;
}

.app-inbox-btn--alert,
.app-session-actions button.app-inbox-btn.app-inbox-btn--alert {
    background-color: #dc2626 !important;
    animation: inbox-alert-blink 0.45s ease-in-out infinite alternate !important;
    border-color: #7f1d1d !important;
    color: #fff !important;
    position: relative;
    z-index: 1;
}

.app-inbox-btn--alert::before,
.app-session-actions button.app-inbox-btn.app-inbox-btn--alert::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 2px;
    border: 2px solid #fca5a5;
    animation: inbox-alert-ring 0.9s ease-in-out infinite;
    pointer-events: none;
}

.app-inbox-btn--alert i,
.app-inbox-btn--alert .app-inbox-label,
.app-session-actions button.app-inbox-btn.app-inbox-btn--alert i,
.app-session-actions button.app-inbox-btn.app-inbox-btn--alert .app-inbox-label {
    color: #fff !important;
    position: relative;
    z-index: 1;
}

.app-inbox-btn--alert .app-inbox-badge,
.app-session-actions button.app-inbox-btn.app-inbox-btn--alert .app-inbox-badge {
    animation: inbox-badge-pulse 0.45s ease-in-out infinite alternate;
    background: #fff !important;
    color: #dc2626 !important;
    border: 2px solid #7f1d1d;
    display: block !important;
    z-index: 2;
}

.app-session-bar--fax-alert {
    box-shadow: inset 0 -4px 0 #ef4444;
    animation: session-fax-alert-bar 1.2s ease-in-out infinite alternate;
}

@keyframes inbox-alert-ring {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(1.06); }
}

@keyframes session-fax-alert-bar {
    from { box-shadow: inset 0 -4px 0 #b91c1c; }
    to { box-shadow: inset 0 -4px 0 #f87171; }
}

@keyframes inbox-alert-blink {
    from {
        background-color: #991b1b !important;
        box-shadow: 0 0 0 2px #fca5a5, 0 0 14px rgba(239, 68, 68, 0.9);
    }
    to {
        background-color: #ef4444 !important;
        box-shadow: 0 0 0 3px #fecaca, 0 0 24px rgba(239, 68, 68, 1);
    }
}

@keyframes inbox-badge-pulse {
    from { transform: scale(1); }
    to { transform: scale(1.12); }
}

.app-main-nav {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
    padding: 6px 8px;
    background: #3d3830;
    border-bottom: 3px solid #1a1814;
}

.app-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px;
    min-height: 52px;
    background: #c0b7a6;
    border: 2px solid;
    border-color: #eee5d5 #7a7162 #7a7162 #eee5d5;
    color: #292524;
    font-family: 'Courier Prime', monospace;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.1s, transform 0.05s;
}

.app-nav-btn i {
    font-size: 16px;
}

.app-nav-btn.active {
    background: #a49a88;
    border-color: #554e43 #dfd7c9 #dfd7c9 #554e43;
    box-shadow: inset 1px 1px 4px rgba(0, 0, 0, 0.35);
    color: #1a1510;
}

.app-nav-btn:active {
    transform: translate(1px, 1px);
}

.app-screen-viewport {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin: 0;
    overflow: hidden;
}

.app-screen {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.app-screen.is-active {
    display: flex;
}

.app-screen-header {
    flex-shrink: 0;
    padding: 10px 12px 8px;
    border-bottom: 2px solid #9e9584;
    background: #b5ad9e;
}

.app-screen-header--compact {
    padding: 8px 10px 6px;
}

.app-screen-title {
    font-size: 13px;
    font-weight: 800;
    color: #292524;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.app-screen-desc {
    font-size: 10px;
    color: #57534e;
    font-family: 'Courier Prime', monospace;
}

#screenKartotek .app-screen-title {
    text-transform: none;
}

#screenDialer .app-screen-desc {
    font-size: calc(10px * 1.3);
}

#screenSend .app-screen-header--compact .app-screen-title {
    font-size: calc(13px * 1.3);
}

#screenSend .app-screen-header--compact .send-header-paper-meta {
    font-size: calc(10px * 1.3);
}

#screenSend .app-screen-header--compact .btn-reload-paper {
    font-size: calc(11px * 1.3);
}

#screenSend .app-screen-header--compact .btn-reload-paper i {
    font-size: calc(14px * 1.3);
}

#telefaxDestIdSend {
    font-size: calc(10px * 1.5);
}

/* SKRIV-fanen: 125 % av standard (50 % + 50 % til) */
.app-screen--compose .app-screen-title {
    font-size: 29.25px;
}

.app-screen--compose .compose-meta-text {
    font-size: 22.5px;
}

.app-screen--compose .compose-textarea {
    font-size: 43.2px;
    line-height: 1.5;
}

.app-screen--compose .compose-goto-send-btn {
    font-size: 18px;
    padding: 12px 16px;
    min-height: 54px;
    letter-spacing: 0.04em;
}

.compose-attach-row {
    border-top: 1px dotted #d4cca9;
    padding-top: 0.5rem;
}

.compose-attach-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0;
    border: 0;
    background: none;
    color: #44403c;
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.compose-attach-link:hover {
    color: #1c1917;
}

.compose-attach-link:active {
    opacity: 0.75;
}

.compose-attach-icon {
    font-size: 1.1rem;
    color: #1c1917;
    text-decoration: none;
}

.compose-floppy-icon {
    width: 1.35rem;
    height: 1.35rem;
    flex-shrink: 0;
    display: block;
}

.compose-attach-label {
    text-transform: none;
}

.compose-image-preview {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.compose-image-preview-img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border: 2px solid #1c1917;
    image-rendering: pixelated;
    filter: contrast(1.15);
    background: #fff;
}

.compose-image-remove {
    width: 22px;
    height: 22px;
    border: 1px solid #a8a29e;
    background: #f5f0e6;
    color: #7f1d1d;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
}

.compose-image-status {
    flex: 1;
    min-width: 0;
    text-transform: uppercase;
}

.dialer-recipients {
    background: #c6beaf;
    border: 2px solid #a49a88;
    border-radius: 2px;
    padding: 0.5rem 0.6rem;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.15);
}

.dialer-keypad {
    flex: 1 1 0;
    min-height: 0;
    grid-template-rows: repeat(4, minmax(0, 1fr));
    gap: calc(0.5rem * 0.65);
    padding: calc(0.5rem * 0.65);
    align-content: stretch;
    overflow: hidden;
}

.dialer-keypad .btn-retro {
    min-height: 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.35rem;
}

.dialer-keypad .btn-retro.text-xl {
    font-size: clamp(0.95rem, 4.2vw, 1.1rem);
}

.dialer-keypad .btn-retro.text-sm {
    font-size: clamp(0.65rem, 2.8vw, 0.75rem);
}

#screenDialer .app-screen-body {
    overflow: hidden;
    gap: 8px;
    padding: 8px 12px;
}

#screenDialer .lcd-display {
    padding: 10px 12px;
    flex-shrink: 0;
}

#screenDialer #dialNumberDisplay {
    font-size: clamp(1.35rem, 6.5vw, 1.75rem);
}

#screenDialer .dialer-recipients {
    flex-shrink: 0;
    max-height: min(18svh, 88px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.recipient-add-btn {
    display: inline-flex;
    align-items: center;
    gap: calc(0.35rem * 1.4);
    padding: calc(0.3rem * 1.4) calc(0.55rem * 1.4);
    border: 2px solid #92400e;
    background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%);
    color: #1c1917;
    font-family: 'Share Tech Mono', monospace;
    font-size: calc(10px * 1.4);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: none;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 0 #78350f;
}

.recipient-add-btn:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.recipient-chip-list {
    min-height: 1.5rem;
}

.recipient-empty-hint {
    font-family: 'Share Tech Mono', monospace;
    font-size: calc(9px * 1.3);
    color: #6b6457;
    font-style: italic;
}

.recipient-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.2rem 0.2rem 0.45rem;
    background: #1c1917;
    color: #f5f0e6;
    border: 1px solid #44403c;
    border-radius: 2px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    font-weight: 700;
}

.recipient-chip-text {
    white-space: nowrap;
}

.recipient-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: none;
    background: #7f1d1d;
    color: #fef2f2;
    font-size: 9px;
    line-height: 1;
    cursor: pointer;
    border-radius: 1px;
}

.recipient-chip-remove:active {
    transform: translateY(1px);
}

.fax-image-frame {
    margin: 0 0 0.75rem;
    padding: 4px;
    border: 3px double #1c1917;
    background:
        linear-gradient(90deg, #d6d3d1 1px, transparent 1px) 0 0 / 8px 8px,
        linear-gradient(#d6d3d1 1px, transparent 1px) 0 0 / 8px 8px,
        #fafaf9;
    box-shadow: inset 0 0 0 1px #78716c, 2px 2px 0 rgba(0, 0, 0, 0.12);
}

.fax-image-pixel {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    filter: contrast(1.2);
    background: #fff;
}

.fax-sheet-text + .fax-image-frame,
.fax-image-frame + .fax-sheet-text {
    margin-top: 0.5rem;
}

.app-screen--compose .compose-goto-send-btn i {
    font-size: 18px;
}

/* Innboks: handlingsknapper 50 % større */
.inbox-action-btn,
.inbox-toolbar-chip {
    font-size: 15px;
    padding: 6px 12px;
    min-height: 39px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    border-radius: 0.125rem;
    background-color: rgba(68, 64, 60, 0.9);
    color: rgb(231, 229, 228);
    border: none;
    box-sizing: border-box;
    white-space: nowrap;
}

.inbox-action-btn {
    cursor: pointer;
}

.inbox-action-btn i {
    font-size: 18px;
}

.inbox-toolbar {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.inbox-toolbar-chip {
    margin-left: auto;
}

.app-screen-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#screenStart .app-screen-body {
    overflow: hidden;
}

.app-screen-body--center {
    display: flex;
    flex-direction: column;
}

.start-screen-body {
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    overflow: hidden;
}

#screenStart .start-screen-body {
    --start-chrome: 230px;
    --start-content-height: 680px;
    --start-fit-scale: min(1, calc((100svh - var(--start-chrome)) / var(--start-content-height)));
    padding: 10px 12px max(10px, env(safe-area-inset-bottom));
}

@media (max-height: 780px) {
    #screenStart .start-screen-body {
        --start-chrome: 210px;
        --start-content-height: 620px;
    }
}

.start-jitfl-scene {
    position: relative;
    width: 100%;
    max-width: 571px;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    border: 5px solid #1a1814;
    box-shadow: 5px 12px 0 rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.start-jitfl-scene .jitfl-room-bg {
    position: absolute;
    inset: 0;
}

.start-jitfl-machine-wrap {
    position: relative;
    z-index: 2;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 12px 14px;
    zoom: var(--start-fit-scale, 1);
}

.start-jitfl-machine-wrap .start-jitfl-machine {
    width: 100%;
    max-width: 100%;
}

@supports not (zoom: 1) {
    .start-jitfl-machine-wrap {
        zoom: unset;
        transform: scale(var(--start-fit-scale, 1));
        transform-origin: center center;
    }
}

.start-incoming-idle,
.start-incoming-link,
#screenStart .pwa-setup-banner {
    flex-shrink: 0;
    width: 100%;
    max-width: 571px;
}

.start-jitfl-scene .jitfl-lcd {
    min-width: 168px;
    min-height: calc(43px * 1.69);
    padding: calc(7px * 1.69) 12px;
    justify-content: center;
}

.start-jitfl-scene .jitfl-lcd-text {
    font-size: clamp(1.89rem, 7.56vw, 2.65rem);
    white-space: pre-line;
    line-height: 1.05;
    text-align: center;
    width: 100%;
    animation: start-jitfl-lcd-blink 1s ease-in-out infinite alternate;
}

@keyframes start-jitfl-lcd-blink {
    from { opacity: 1; }
    to { opacity: 0.3; }
}

.start-jitfl-scene .jitfl-brand,
.start-jitfl-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 12px;
    text-align: center;
}

.start-jitfl-televerket-logo {
    width: clamp(180px, 58vw, 404px);
    height: auto;
    margin-bottom: 8px;
}

.start-jitfl-televerket-caption {
    font-family: 'VT323', monospace;
    font-size: clamp(0.95rem, 3.8vw, 1.15rem);
    color: #44403c;
    letter-spacing: 0.04em;
    line-height: 1.15;
    margin: 0;
    text-align: center;
}

.start-jitfl-scene .jitfl-led {
    width: 48px;
    height: 48px;
    border-width: 3px;
}

.start-jitfl-scene .jitfl-leds {
    gap: 14px;
}

.start-jitfl-scene .jitfl-led--green.lit {
    box-shadow: 0 0 20px #00ff00, 0 0 34px rgba(0, 255, 0, 0.45), inset 0 0 6px #fff;
    animation: jitfl-led-blink 1s ease-in-out infinite alternate;
}

.start-jitfl-scene .jitfl-machine-bezel {
    padding: 17px 20px;
    gap: 17px;
}

.start-jitfl-scene .jitfl-chassis-body {
    padding: 20px 24px 26px;
}

.start-jitfl-machine {
    animation: start-jitfl-idle-hum 2.8s ease-in-out infinite;
}

.start-jitfl-scene.start-fax--incoming {
    animation: start-jitfl-incoming-blink 1.1s ease-in-out infinite alternate;
}

.start-jitfl-scene.start-fax--incoming .start-jitfl-machine {
    animation:
        start-jitfl-idle-hum 2.8s ease-in-out infinite,
        jitfl-machine-rumble 0.18s steps(2) infinite;
}

@keyframes start-jitfl-idle-hum {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

@keyframes start-jitfl-incoming-blink {
    from {
        box-shadow: 5px 12px 0 rgba(0, 0, 0, 0.35), 0 0 0 rgba(245, 158, 11, 0);
    }
    to {
        box-shadow:
            5px 12px 0 rgba(0, 0, 0, 0.35),
            0 0 34px rgba(245, 158, 11, 0.55),
            inset 0 0 24px rgba(251, 191, 36, 0.12);
    }
}

.start-jitfl-output-slot {
    position: relative;
    height: 41px;
    margin-top: 7px;
    background: linear-gradient(180deg, #0d0c0a 0%, #2a2620 45%, #0d0c0a 100%);
    border: 5px inset #0d0c0a;
    overflow: hidden;
}

.start-jitfl-slot-glow {
    position: absolute;
    inset: 4px;
    z-index: 1;
    border-radius: 1px;
    pointer-events: none;
    animation: start-fax-slot-blink 1.15s ease-in-out infinite alternate;
}

@keyframes start-fax-slot-blink {
    from {
        background: rgba(34, 197, 94, 0.28);
        box-shadow: inset 0 0 16px rgba(34, 197, 94, 0.55), 0 0 8px rgba(34, 197, 94, 0.35);
    }
    to {
        background: rgba(250, 204, 21, 0.28);
        box-shadow: inset 0 0 16px rgba(250, 204, 21, 0.55), 0 0 8px rgba(234, 179, 8, 0.35);
    }
}

.start-jitfl-status-strip {
    display: flex;
    gap: 2px;
    margin-top: 12px;
    padding: 4px 6px;
    background: linear-gradient(180deg, #0d0c0a 0%, #2a2620 100%);
    border: 2px inset #5c5548;
}

.start-jitfl-status-strip span {
    flex: 1;
    height: 14px;
    min-width: 0;
    border: 1px solid #1a1814;
    background: #57534e;
    animation: start-fax-status-blink 1.1s ease-in-out infinite alternate;
}

.start-jitfl-status-strip span:nth-child(1) { animation-delay: 0s; }
.start-jitfl-status-strip span:nth-child(2) { animation-delay: 0.08s; }
.start-jitfl-status-strip span:nth-child(3) { animation-delay: 0.16s; }
.start-jitfl-status-strip span:nth-child(4) { animation-delay: 0.24s; }
.start-jitfl-status-strip span:nth-child(5) { animation-delay: 0.32s; }
.start-jitfl-status-strip span:nth-child(6) { animation-delay: 0.4s; }
.start-jitfl-status-strip span:nth-child(7) { animation-delay: 0.48s; }
.start-jitfl-status-strip span:nth-child(8) { animation-delay: 0.56s; }
.start-jitfl-status-strip span:nth-child(9) { animation-delay: 0.64s; }
.start-jitfl-status-strip span:nth-child(10) { animation-delay: 0.72s; }
.start-jitfl-status-strip span:nth-child(11) { animation-delay: 0.8s; }
.start-jitfl-status-strip span:nth-child(12) { animation-delay: 0.88s; }
.start-jitfl-status-strip span:nth-child(13) { animation-delay: 0.96s; }
.start-jitfl-status-strip span:nth-child(14) { animation-delay: 1.04s; }

@keyframes start-fax-status-blink {
    from {
        background: #22c55e;
        box-shadow: 0 0 5px #22c55e, inset 0 0 3px rgba(255, 255, 255, 0.35);
    }
    to {
        background: #eab308;
        box-shadow: 0 0 5px #facc15, inset 0 0 2px rgba(0, 0, 0, 0.25);
    }
}

.start-jitfl-output-rim {
    position: absolute;
    inset: 0;
    z-index: 3;
    border-top: 2px solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.start-jitfl-output-ticker {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.start-jitfl-ticker-track {
    display: flex;
    flex-shrink: 0;
    animation: start-jitfl-ticker-scroll 8s linear infinite;
}

.start-jitfl-ticker-text {
    flex-shrink: 0;
    padding: 0 1.5rem;
    font-family: 'VT323', monospace;
    font-size: clamp(1.1rem, 4.5vw, 1.35rem);
    color: #e7e5e4;
    letter-spacing: 0.08em;
    white-space: nowrap;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.35);
    animation: start-jitfl-ticker-blink 0.9s ease-in-out infinite alternate;
}

@keyframes start-jitfl-ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes start-jitfl-ticker-blink {
    from { opacity: 1; }
    to { opacity: 0.25; }
}

#startJitflLedRx.lit {
    background: #ff3333;
    box-shadow: 0 0 24px #ff0000, 0 0 40px rgba(255, 0, 0, 0.45);
    animation: jitfl-led-blink 0.32s ease-in-out infinite alternate;
}

.start-incoming-idle {
    font-family: 'Courier Prime', monospace;
    font-size: clamp(0.8rem, 3.2vw, 0.95rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #78716c;
    text-align: center;
    max-width: 320px;
    margin: 0;
    padding: 8px 12px;
}

.start-incoming-link {
    font-family: 'Courier Prime', monospace;
    font-size: clamp(0.85rem, 3.5vw, 1rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #44403c;
    background: #c0b7a6;
    border: 3px solid #7a7162;
    padding: 14px 18px;
    cursor: pointer;
    text-align: center;
    max-width: 320px;
    width: 100%;
    box-shadow: 2px 2px 0 #000;
}

.start-incoming-link:active {
    transform: translate(1px, 1px);
    box-shadow: none;
}

.start-incoming-link.hidden {
    display: none;
}

.start-incoming-idle.hidden {
    display: none;
}

.start-incoming-link--active {
    color: #92400e;
    border-color: #d97706;
    animation: start-link-gentle-pulse 2.6s ease-in-out infinite alternate;
}

.pwa-setup-banner {
    width: 100%;
    max-width: 320px;
    margin-top: 10px;
    padding: 12px 14px;
    background: #1a1510;
    border: 2px solid #5a5142;
    box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.15), 2px 2px 0 #000;
    text-align: left;
}

.pwa-setup-banner--warn {
    border-color: #92400e;
}

.pwa-setup-banner.hidden {
    display: none;
}

.pwa-setup-banner-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #fbbf24;
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pwa-setup-banner-text {
    font-family: 'Courier Prime', monospace;
    font-size: 11px;
    line-height: 1.45;
    color: #d6d3d1;
    margin: 0 0 10px;
}

.pwa-setup-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pwa-setup-btn {
    flex: 1;
    min-width: 120px;
    padding: 8px 10px;
    border: 2px solid #78716c;
    background: #44403c;
    color: #f5f5f4;
    font-family: 'Share Tech Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    cursor: pointer;
}

.pwa-setup-btn--primary {
    border-color: #b45309;
    background: linear-gradient(180deg, #f59e0b 0%, #b45309 100%);
    color: #1c1917;
}

.pwa-setup-btn:active {
    transform: translateY(1px);
}

.pwa-setup-btn:disabled {
    cursor: not-allowed;
}

@keyframes start-link-gentle-pulse {
    from {
        background: #fde68a;
        box-shadow: 2px 2px 0 #000, 0 0 0 rgba(245, 158, 11, 0);
    }
    to {
        background: #fcd34d;
        box-shadow: 2px 2px 0 #000, 0 0 14px rgba(245, 158, 11, 0.35);
    }
}

.app-screen-body--send {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.app-kartotek-full {
    min-height: 0;
    flex: 1;
}

/* Katalog: kort fyller halve skjermen */
.kartotek-card-container {
    height: 50dvh;
    height: 50vh;
    min-height: 50dvh;
    max-height: 50dvh;
}

.kartotek-card--catalog {
    width: 92%;
    max-width: 100%;
    min-height: 48dvh;
    min-height: 48vh;
    height: 48dvh;
    height: 48vh;
    padding: 12px 16px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
}

.kartotek-card--catalog .kartotek-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-shrink: 0;
    gap: 8px;
}

.kartotek-card--catalog .kartotek-card-label {
    background: #9e937d;
    color: #f5f5f4;
    padding: 4px 8px;
    font-size: clamp(10px, 2.5vw, 12px);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.kartotek-card--catalog .kartotek-card-own {
    font-size: clamp(9px, 2.2vw, 11px);
    font-weight: 700;
    color: #2b251f;
}

.kartotek-card-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 8px 4px;
    text-align: center;
}

.kartotek-card-name {
    font-size: clamp(2rem, 12vw, 3.75rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #1c1917;
    word-break: break-word;
    hyphens: auto;
}

.kartotek-card-desc {
    margin-top: 10px;
    font-size: clamp(11px, 3.2vw, 14px);
    color: #57534e;
    text-transform: uppercase;
    line-height: 1.35;
    max-width: 95%;
}

.kartotek-card-station {
    flex-shrink: 0;
    align-self: center;
    background: #1c1917;
    color: #facc15;
    font-size: clamp(1.25rem, 6vw, 2rem);
    font-weight: 800;
    padding: 8px 20px;
    letter-spacing: 0.12em;
}

.app-screen-footer {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    border-top: 2px solid #9e9584;
    background: #b8b0a1;
    align-items: center;
}

/* Faxmaskin: 50 % av skjermhøyde, samme bredde ved send */
.fax-machine-slot {
    width: 100%;
    max-width: 100%;
    height: 50dvh;
    height: 50vh;
    max-height: 50dvh;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 0 auto;
}

.fax-machine-slot--overlay {
    flex-shrink: 0;
}

.fax-machine-animated {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 100%;
    line-height: 0;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45));
    animation: fax-machine-idle-hum 2.8s ease-in-out infinite;
}

.fax-machine-animated--tx,
.fax-machine-animated.fax-machine-animated--tx {
    animation: fax-machine-tx-vibrate 0.12s steps(2) infinite;
}

@keyframes fax-machine-idle-hum {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-1px); }
}

@keyframes fax-machine-tx-vibrate {
    0% { transform: translate(0, 0); }
    50% { transform: translate(-1px, 1px); }
    100% { transform: translate(1px, 0); }
}

.fax-machine-animated .fax-machine-photo {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    object-position: center center;
}

.fax-anim-lcd-flicker {
    position: absolute;
    top: 11%;
    left: 52%;
    width: 22%;
    height: 7%;
    background: rgba(20, 30, 20, 0.85);
    box-shadow: inset 0 0 8px rgba(57, 255, 20, 0.15);
    animation: fax-lcd-flicker 3s steps(4) infinite;
    pointer-events: none;
    z-index: 2;
}

@keyframes fax-lcd-flicker {
    0%, 88%, 100% { opacity: 0.92; }
    90% { opacity: 0.65; }
    94% { opacity: 1; }
}

.fax-anim-status-bar {
    position: absolute;
    top: 11.5%;
    left: 53%;
    width: 18%;
    height: 2px;
    background: #39ff14;
    box-shadow: 0 0 6px #39ff14;
    animation: fax-status-scan 2s linear infinite;
    z-index: 3;
    pointer-events: none;
}

@keyframes fax-status-scan {
    0% { transform: scaleX(0.2); opacity: 0.5; }
    50% { transform: scaleX(1); opacity: 1; }
    100% { transform: scaleX(0.2); opacity: 0.5; }
}

.fax-anim-motor-glow {
    position: absolute;
    left: 35%;
    right: 5%;
    top: 44%;
    height: 20%;
    background: radial-gradient(ellipse at center, rgba(255, 120, 0, 0.06) 0%, transparent 70%);
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

.fax-machine-animated--tx .fax-anim-motor-glow,
.fax-machine-animated.fax-machine-animated--tx .fax-anim-motor-glow {
    opacity: 1;
    animation: fax-motor-glow-pulse 0.5s ease-in-out infinite alternate;
}

@keyframes fax-motor-glow-pulse {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

.fax-anim-green-pulse.lit,
.fax-send-green-btn.lit {
    animation: fax-green-pulse 0.45s ease-in-out infinite alternate;
}

.fax-machine-animated--idle .fax-send-green-btn {
    animation: fax-green-standby 2.5s ease-in-out infinite;
}

@keyframes fax-green-standby {
    0%, 70%, 100% {
        background: rgba(40, 160, 60, 0.25);
        box-shadow: none;
    }
    85% {
        background: rgba(60, 200, 80, 0.45);
        box-shadow: 0 0 8px #33ff55;
    }
}

#screenInbox .app-screen-body {
    min-height: 0;
}

#screenInbox #paperStackContainer {
    flex: 1 1 auto;
    min-height: 58svh;
    height: 58svh;
    max-height: 58svh;
    position: relative;
    z-index: 1;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

#screenInbox #stackNavBar {
    position: relative;
    z-index: 20;
    margin-top: 0.75rem;
    padding: 0.625rem 12px 0.5rem;
    flex-shrink: 0;
    background: var(--beige-plastic);
    border-top: 2px solid #9e9584;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
}

#screenInbox .fax-paper-sheet {
    left: 1%;
    right: 1%;
    top: 0;
    height: calc(100% - 8px);
    min-height: 0;
    max-height: calc(100% - 8px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.pt-safe {
    padding-top: max(8px, env(safe-area-inset-top));
}

.pb-safe {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
}

/* Kun på stor skjerm: smal «telefonramme» — på mobil er det 100 % bredde */
@media (min-width: 768px) {
    .mobile-body {
        position: static;
        display: flex;
        flex-direction: column;
        align-items: center;
        min-height: 100dvh;
    }

    .login-screen,
    .mobile-app {
        position: relative;
        inset: auto;
        max-width: 480px;
        width: 100%;
        height: 100dvh;
        border-left: 4px solid #1e293b;
        border-right: 4px solid #1e293b;
    }

    .login-screen .auth-chassis {
        max-width: 400px;
    }
}

.bevel-out {
    border: 4px solid;
    border-color: var(--beige-light) var(--beige-dark) var(--beige-dark) var(--beige-light);
    background-color: var(--beige-plastic);
}

.bevel-in {
    border: 4px solid;
    border-color: var(--beige-dark) var(--beige-light) var(--beige-light) var(--beige-dark);
    background-color: #24201a;
}

.btn-retro {
    background-color: #c0b7a6;
    border: 3px solid;
    border-color: #eee5d5 #7a7162 #7a7162 #eee5d5;
    box-shadow: 1px 1px 0px #000;
    transition: all 0.05s ease;
    image-rendering: pixelated;
    cursor: pointer;
    pointer-events: auto;
}

.btn-retro:active {
    border-color: #7a7162 #eee5d5 #eee5d5 #7a7162;
    transform: translate(1px, 1px);
    box-shadow: none;
}

.btn-retro.active {
    background-color: #a49a88;
    border-color: #554e43 #dfd7c9 #dfd7c9 #554e43;
    box-shadow: inset 1px 1px 3px rgba(0,0,0,0.5);
}

.btn-hardware-red {
    background-color: #a11d1d;
    border: 3px solid;
    border-color: #d64747 #4f0a0a #4f0a0a #d64747;
    box-shadow: 2px 2px 0px #000;
    color: #fff;
    text-shadow: 1px 1px 2px #000;
    cursor: pointer;
    pointer-events: auto;
}

.btn-hardware-red:active {
    border-color: #4f0a0a #d64747 #d64747 #4f0a0a;
    transform: translate(1px, 1px);
    box-shadow: none;
}

.btn-reload-paper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    min-height: 40px;
    font-size: 11px;
    font-weight: bold;
    font-family: 'Courier Prime', monospace;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-reload-paper i {
    font-size: 14px;
}

.paper-indicators {
    display: flex;
    gap: 2px;
    width: 54px;
    flex-shrink: 0;
}

.paper-indicators .paper-led {
    flex: 1;
    height: 8px;
    border: 1px solid #1c1917;
}

.lcd-display {
    background-color: var(--lcd-amber-bg);
    color: var(--lcd-amber-text);
    font-family: 'VT323', monospace;
    text-shadow: 0 0 6px rgba(255, 176, 0, 0.7);
    letter-spacing: 1px;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.9);
    border: 4px solid #5a5142;
}

/* Kvitterings-/alert-boks (+40 %) */
.custom-alert-panel {
    width: 100%;
    max-width: 33.6rem;
    padding: 1.75rem;
    gap: 1.4rem;
    border: 6px solid #9e9584;
    box-sizing: border-box;
}

.custom-alert-title {
    font-size: 1.75rem;
}

.custom-alert-msg {
    font-size: 1.05rem;
}

.custom-alert-btn {
    font-size: 1.05rem;
    padding: 0.7rem 1.75rem;
}

#alertActionsConfirm {
    gap: 1.05rem;
}

.fax-paper-sheet {
    background-color: var(--paper-color);
    background-image: radial-gradient(#e4dfd0 8%, transparent 8%);
    background-size: 12px 12px;
    border: 1px solid #d4cca9;
    box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.45s cubic-bezier(0.25, 0.8, 0.25, 1),
                opacity 0.35s ease,
                box-shadow 0.35s ease;
    position: absolute;
    left: 5%;
    right: 5%;
    top: 20px;
    min-height: 380px;
    pointer-events: none;
}

.fax-compose-sheet {
    background-color: var(--paper-color);
    background-image: radial-gradient(#e4dfd0 8%, transparent 8%);
    background-size: 12px 12px;
    border: 1px solid #d4cca9;
    box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.15);
    position: relative;
    pointer-events: auto;
}

.fax-paper-sheet.stack-front {
    pointer-events: auto;
    box-shadow: 4px 8px 18px rgba(0, 0, 0, 0.22);
}

.fax-paper-sheet.stack-peeled {
    opacity: 0;
    transform: translate(-140px, -30px) rotate(-12deg) scale(0.92) !important;
    pointer-events: none;
}

.paper-perforation {
    background-image: linear-gradient(90deg, transparent 50%, #d4cca9 50%);
    background-size: 8px 3px;
    height: 3px;
    width: 100%;
}

.scanlines {
    position: relative;
    overflow: hidden;
}

.scanlines::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.22) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.04), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.04));
    z-index: 10;
    background-size: 100% 4px, 6px 100%;
    pointer-events: none;
}

.kartotek-drawer {
    background-color: #55483b;
    border: 4px solid #332a22;
    box-shadow: inset 0 10px 20px rgba(0,0,0,0.5), 0 4px 6px rgba(0,0,0,0.3);
    border-radius: 4px;
}

.kartotek-card {
    background-color: var(--folder-card);
    border: 1px solid #9e937d;
    border-top: 15px solid #bdab8c;
    box-shadow: 1px 3px 5px rgba(0,0,0,0.25);
    transition: transform 0.4s ease;
    cursor: pointer;
    pointer-events: auto;
}

button {
    pointer-events: auto;
}

textarea,
input {
    pointer-events: auto;
    cursor: text;
}

.led-green {
    width: 10px;
    height: 10px;
    background-color: #33ff33;
    border-radius: 50%;
    box-shadow: 0 0 8px #00ff00;
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--beige-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--beige-light);
    border: 1px solid var(--beige-shadow);
}

/* Gammel faxmaskin — mottak/sending */
.fax-machine-overlay {
    position: absolute;
    inset: 0;
    justify-content: flex-end;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
    overflow: hidden;
}

.fax-machine-overlay.mode-receive {
    justify-content: flex-start;
    align-items: stretch;
    background: #2b3a4a;
    padding-top: max(8px, env(safe-area-inset-top));
}

.fax-machine-overlay.mode-receive .fax-overlay-status,
.fax-machine-overlay.mode-receive #faxMachineHint {
    display: none;
}

.fax-receive-scene {
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding: 0 10px;
    box-sizing: border-box;
}

.fax-machine-overlay.mode-receive .fax-receive-scene,
.fax-machine-overlay.mode-receive #faxMachineReceiveLayout {
    flex: 0 0 80vh;
    height: 80vh;
    max-height: 80vh;
    justify-content: flex-start;
    align-items: center;
}

.fax-machine-overlay.mode-receive .fax-machine-chassis {
    width: 100%;
    flex-shrink: 0;
}

.fax-machine-overlay.mode-receive .fax-machine-face {
    padding: 14px 14px 16px;
}

.fax-machine-overlay.mode-receive .fax-machine-face .fa-fax {
    font-size: 1.5rem;
}

.fax-machine-overlay.mode-receive .fax-machine-face span,
.fax-receive-machine-label {
    font-size: 12px;
}

.fax-receive-machine-label {
    text-align: center;
    line-height: 1.2;
    letter-spacing: 0.02em;
    text-transform: none;
    max-width: 100%;
}

.fax-machine-overlay.mode-receive .fax-output-slot {
    height: 14px;
}

.fax-machine-overlay.mode-receive .fax-emerging-tray {
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    margin-top: -2px;
    display: flex;
    align-items: stretch;
    justify-content: center;
    perspective: none;
    overflow: hidden;
    position: relative;
}

.fax-machine-overlay.mode-receive .fax-emerging-paper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    padding: 0;
    background-color: var(--paper-color);
    background-image: radial-gradient(#e4dfd0 8%, transparent 8%);
    background-size: 12px 12px;
    border: 1px solid #d4cca9;
    box-shadow: 3px 6px 16px rgba(0, 0, 0, 0.28);
    transform: translateY(-100%);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    will-change: transform;
    box-sizing: border-box;
}

.fax-machine-overlay.mode-receive .fax-emerging-paper.printing {
    animation: fax-receive-paper-emerge 10s cubic-bezier(0.22, 0.05, 0.15, 1) forwards;
}

@keyframes fax-receive-paper-emerge {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(0); }
}

.fax-machine-overlay.mode-receive .fax-cover-sheet--receive {
    width: 100%;
    height: auto;
    min-height: 0;
    flex-shrink: 0;
    margin: 0;
    padding: clamp(18px, 3.5vh, 32px) clamp(16px, 4vw, 28px);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    border-left: none;
    border-right: none;
    border-top: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

.fax-machine-overlay.mode-receive .fax-emerging-body--receive {
    flex: 1 1 auto;
    min-height: 80px;
    max-height: none;
    margin: 0;
    padding: clamp(8px, 1.5vh, 14px) clamp(16px, 4vw, 28px) clamp(18px, 3.5vh, 32px);
    font-size: clamp(1.1rem, 2.8vh, 1.5rem);
    line-height: 1.45;
    word-break: break-word;
    box-sizing: border-box;
}

.fax-machine-overlay.mode-receive .fax-emerging-body--receive.thermal-print {
    clip-path: inset(0 0 calc(100% - var(--fax-reveal, 0%)) 0);
    filter: contrast(1.05);
}

.fax-machine-overlay.mode-receive .fax-emerging-footer {
    display: none !important;
}

.fax-machine-overlay.mode-receive .fax-cover-kicker {
    font-size: clamp(10px, 1.6vh, 14px);
    margin-bottom: clamp(4px, 0.8vh, 8px);
}

.fax-machine-overlay.mode-receive .fax-cover-heading {
    font-size: clamp(1.25rem, 3.2vh, 1.75rem);
    padding-bottom: clamp(10px, 1.8vh, 16px);
    margin-bottom: clamp(10px, 1.8vh, 16px);
}

.fax-machine-overlay.mode-receive .fax-cover-grid {
    gap: clamp(8px, 1.4vh, 14px);
}

.fax-machine-overlay.mode-receive .fax-cover-label {
    font-size: clamp(9px, 1.4vh, 12px);
}

.fax-machine-overlay.mode-receive .fax-cover-value {
    font-size: clamp(12px, 2vh, 16px);
}

.fax-machine-overlay.mode-receive .fax-cover-value--name {
    font-size: clamp(14px, 2.4vh, 20px);
}

.fax-machine-overlay.mode-receive .fax-cover-value--time {
    font-size: clamp(13px, 2.1vh, 18px);
}

.fax-machine-overlay.mode-receive .fax-cover-paper {
    margin-top: clamp(10px, 1.8vh, 16px);
    padding-top: clamp(10px, 1.8vh, 16px);
}

.fax-machine-overlay.mode-receive .fax-cover-paper-led {
    height: clamp(9px, 1.4vh, 13px);
}

.fax-machine-overlay.mode-receive .fax-cover-paper-count {
    font-size: clamp(11px, 1.8vh, 15px);
}

.fax-machine-overlay.mode-receive .fax-cover-sheet--receive.thermal-print {
    clip-path: inset(0 0 calc(100% - var(--fax-reveal, 0%)) 0);
}

.fax-machine-overlay.mode-send {
    justify-content: stretch;
    align-items: stretch;
    padding: 0;
    background: #3d4f5c;
}

.fax-machine-overlay.mode-send .fax-overlay-status {
    width: 100%;
    max-width: 100%;
    padding: 8px 12px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
    z-index: 2;
}

.fax-machine-overlay.mode-send #faxMachineHint {
    flex-shrink: 0;
    z-index: 2;
    background: rgba(0, 0, 0, 0.25);
    width: 100%;
    padding-left: 12px;
    padding-right: 12px;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .fax-machine-overlay.mode-send .fax-overlay-status,
    .fax-machine-overlay.mode-send #faxMachineHint,
    .fax-machine-overlay.mode-send .jitfl-send-fullscreen {
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}

/* Jones-in-the-Fast-Lane-inspirert fax (CSS, fullskjerm ved send) */
.jitfl-send-fullscreen {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.jitfl-scene {
    position: relative;
    flex: 1;
    width: 100%;
    max-width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 8px 10px 16px;
    box-sizing: border-box;
    overflow: hidden;
}

.jitfl-room-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, #6b8494 0%, #4a6272 35%, #354956 100%);
    pointer-events: none;
}

.jitfl-room-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(#ffffff18 1px, transparent 1px);
    background-size: 8px 8px;
    opacity: 0.4;
}

.jitfl-paper-sheet {
    position: relative;
    z-index: 3;
    width: 94%;
    max-width: 100%;
    min-height: 48vh;
    max-height: 56vh;
    margin-bottom: 8px;
    padding: 16px 18px 20px;
    background-color: var(--paper-color);
    background-image: radial-gradient(#e4dfd0 8%, transparent 8%);
    background-size: 14px 14px;
    border: 3px solid #c8c0a8;
    box-shadow: 4px 8px 0 rgba(0, 0, 0, 0.35), 0 12px 24px rgba(0, 0, 0, 0.25);
    font-family: 'Courier Prime', monospace;
    display: flex;
    flex-direction: column;
    transform: translateY(0);
    will-change: transform, opacity;
}

.jitfl-paper-header {
    flex-shrink: 0;
    border-bottom: 2px dashed #c8c0a8;
    padding-bottom: 10px;
    margin-bottom: 12px;
}

.jitfl-paper-title {
    display: block;
    font-size: clamp(11px, 3vw, 13px);
    color: #78716c;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
}

.jitfl-paper-dest {
    display: block;
    font-size: clamp(14px, 4vw, 18px);
    font-weight: 800;
    color: #92400e;
    text-transform: uppercase;
}

.jitfl-paper-message {
    flex: 1;
    overflow-y: auto;
    font-size: clamp(1.15rem, 5.2vw, 1.65rem);
    line-height: 1.45;
    font-weight: 700;
    text-transform: uppercase;
    color: #1c1917;
    letter-spacing: 0.03em;
    word-break: break-word;
    -webkit-overflow-scrolling: touch;
}

.jitfl-paper-footer {
    flex-shrink: 0;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px dotted #a8a29e;
    font-size: clamp(9px, 2.5vw, 11px);
    color: #78716c;
}

.jitfl-paper-sheet.phase-feed {
    animation: jitfl-paper-feed 5.4s steps(28) forwards;
}

@keyframes jitfl-paper-feed {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    35% {
        transform: translateY(-18vh) scale(0.96);
    }
    70% {
        transform: translateY(-42vh) scale(0.88);
        opacity: 0.9;
    }
    100% {
        transform: translateY(-58vh) scale(0.72);
        opacity: 0;
    }
}

.jitfl-machine-wrap {
    position: relative;
    z-index: 4;
    width: 100%;
    max-width: 100%;
    flex-shrink: 0;
}

.jitfl-machine {
    width: 100%;
    image-rendering: pixelated;
}

.jitfl-machine-bezel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--beige-plastic);
}

.jitfl-lcd {
    flex: 1;
    min-width: 140px;
    min-height: 36px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
}

.jitfl-lcd-text {
    font-family: 'VT323', monospace;
    font-size: clamp(1.25rem, 5vw, 1.75rem);
    letter-spacing: 0.08em;
}

.jitfl-leds {
    display: flex;
    gap: 8px;
    align-items: center;
}

.jitfl-led {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #3d3830;
    background: #444;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.jitfl-led--green.lit {
    background: #33ff33;
    box-shadow: 0 0 10px #00ff00, inset 0 0 4px #fff;
    animation: jitfl-led-blink 1s ease-in-out infinite alternate;
}

.jitfl-led--red.lit {
    background: #ff3333;
    box-shadow: 0 0 12px #ff0000;
    animation: jitfl-led-blink 0.35s ease-in-out infinite alternate;
}

@keyframes jitfl-led-blink {
    from { opacity: 1; }
    to { opacity: 0.5; }
}

.jitfl-btn-deco {
    font-family: 'VT323', monospace;
    font-size: 1rem;
    padding: 4px 10px;
    border: 3px solid;
    pointer-events: none;
    user-select: none;
}

.jitfl-btn-deco--red {
    background: #a11d1d;
    border-color: #ff6666 #4f0a0a #4f0a0a #ff6666;
    color: #fff;
    text-shadow: 1px 1px #000;
}

.jitfl-chassis-body {
    padding: 12px 14px 16px;
    background: var(--beige-plastic);
}

.jitfl-brand {
    font-family: 'VT323', monospace;
    font-size: clamp(0.85rem, 3.5vw, 1.1rem);
    color: #44403c;
    letter-spacing: 0.12em;
    margin-bottom: 10px;
    text-align: center;
}

.send-jitfl-brand {
    font-size: clamp(0.72rem, 2.8vw, 0.95rem);
    letter-spacing: 0.04em;
    line-height: 1.15;
    max-width: 100%;
}

.jitfl-intake-slot {
    position: relative;
    height: 28px;
    background: linear-gradient(180deg, #1a1814 0%, #2a2620 50%, #1a1814 100%);
    border: 4px inset #0d0c0a;
    overflow: hidden;
}

.jitfl-intake-glow {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(90deg, transparent, rgba(255, 150, 0, 0.25), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.jitfl-intake-glow.active {
    opacity: 1;
    animation: jitfl-intake-sweep 0.4s linear infinite;
}

@keyframes jitfl-intake-sweep {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.jitfl-rollers {
    position: absolute;
    inset: 4px 8px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-around;
    opacity: 0;
}

.jitfl-rollers.active {
    opacity: 1;
}

.jitfl-rollers.active span {
    display: block;
    width: 22%;
    height: 4px;
    background: #6b6356;
    animation: jitfl-roller-spin 0.2s steps(2) infinite;
}

.jitfl-rollers.active span:nth-child(2) { animation-delay: 0.05s; }
.jitfl-rollers.active span:nth-child(3) { animation-delay: 0.1s; }

@keyframes jitfl-roller-spin {
    50% { transform: translateY(2px); background: #9e9584; }
}

.jitfl-speaker-grille {
    margin-top: 10px;
    height: 12px;
    background: repeating-linear-gradient(
        90deg,
        #7a7162 0,
        #7a7162 4px,
        #a89e8c 4px,
        #a89e8c 8px
    );
    border: 2px inset #5c5548;
}

.jitfl-scene--transmitting .jitfl-machine {
    animation: jitfl-machine-rumble 0.12s steps(2) infinite;
}

@keyframes jitfl-machine-rumble {
    0% { transform: translate(0, 0); }
    50% { transform: translate(-2px, 1px); }
    100% { transform: translate(1px, -1px); }
}

.jitfl-scene--transmitting .jitfl-btn-deco--red {
    animation: jitfl-btn-press 0.5s ease-in-out infinite alternate;
}

/* Send-fane: grønn/gul statuslys under sending (som forsiden) */
.send-jitfl-slot-glow {
    position: absolute;
    inset: 3px;
    z-index: 0;
    border-radius: 1px;
    opacity: 0;
    pointer-events: none;
}

.jitfl-scene--transmitting .send-jitfl-slot-glow {
    opacity: 1;
    animation: start-fax-slot-blink 1.15s ease-in-out infinite alternate;
}

.send-jitfl-status-strip {
    display: flex;
    gap: 3px;
    margin-top: 10px;
    padding: 4px 6px;
    background: linear-gradient(180deg, #0d0c0a 0%, #2a2620 100%);
    border: 2px inset #5c5548;
}

.send-jitfl-status-strip span {
    flex: 1;
    height: 12px;
    min-width: 0;
    border: 1px solid #1a1814;
    background: #57534e;
}

.jitfl-scene--transmitting .send-jitfl-status-strip span {
    animation: start-fax-status-blink 1.1s ease-in-out infinite alternate;
}

.jitfl-scene--transmitting .send-jitfl-status-strip span:nth-child(1) { animation-delay: 0s; }
.jitfl-scene--transmitting .send-jitfl-status-strip span:nth-child(2) { animation-delay: 0.08s; }
.jitfl-scene--transmitting .send-jitfl-status-strip span:nth-child(3) { animation-delay: 0.16s; }
.jitfl-scene--transmitting .send-jitfl-status-strip span:nth-child(4) { animation-delay: 0.24s; }
.jitfl-scene--transmitting .send-jitfl-status-strip span:nth-child(5) { animation-delay: 0.32s; }
.jitfl-scene--transmitting .send-jitfl-status-strip span:nth-child(6) { animation-delay: 0.4s; }
.jitfl-scene--transmitting .send-jitfl-status-strip span:nth-child(7) { animation-delay: 0.48s; }
.jitfl-scene--transmitting .send-jitfl-status-strip span:nth-child(8) { animation-delay: 0.56s; }
.jitfl-scene--transmitting .send-jitfl-status-strip span:nth-child(9) { animation-delay: 0.64s; }
.jitfl-scene--transmitting .send-jitfl-status-strip span:nth-child(10) { animation-delay: 0.72s; }
.jitfl-scene--transmitting .send-jitfl-status-strip span:nth-child(11) { animation-delay: 0.8s; }
.jitfl-scene--transmitting .send-jitfl-status-strip span:nth-child(12) { animation-delay: 0.88s; }
.jitfl-scene--transmitting .send-jitfl-status-strip span:nth-child(13) { animation-delay: 0.96s; }
.jitfl-scene--transmitting .send-jitfl-status-strip span:nth-child(14) { animation-delay: 1.04s; }

@keyframes jitfl-btn-press {
    from { transform: scale(1); }
    to { transform: scale(0.94) translate(1px, 1px); }
}

/* Forhåndsvisning på SEND-fanen */
.jitfl-idle-preview {
    width: 100%;
    height: auto;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    flex-shrink: 1;
    min-height: 0;
}

.jitfl-idle-preview .jitfl-idle-hint {
    font-size: 1.46rem;
    margin-top: 1.46rem;
}

.jitfl-idle-preview .jitfl-status-panel {
    width: 100%;
    max-width: calc(624px * 1.4);
    padding: calc(31px * 1.4) calc(27px * 1.4);
    display: flex;
    flex-direction: column;
    gap: calc(23px * 1.4);
    border: calc(4px * 1.4) solid #5a5142;
    box-shadow: inset 0 0 calc(23px * 1.4) rgba(0, 0, 0, 0.85);
}

.jitfl-idle-preview .jitfl-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: calc(20px * 1.4);
}

.jitfl-idle-preview .jitfl-status-row--hero {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.jitfl-idle-preview .jitfl-status-row--hero .jitfl-status-leds {
    display: flex;
    gap: calc(13px * 1.4);
    align-items: center;
    flex-shrink: 0;
}

.jitfl-idle-preview .jitfl-status-text {
    font-family: 'VT323', monospace;
    font-size: clamp(calc(1.95rem * 1.4), calc(8.2vw * 1.4), calc(2.63rem * 1.4));
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-align: left;
    flex: 1;
}

.jitfl-idle-preview .jitfl-status-row--hero .jitfl-status-text {
    font-size: clamp(calc(2.05rem * 1.4), calc(8.8vw * 1.4), calc(2.83rem * 1.4));
}

.jitfl-idle-preview .jitfl-status-led {
    flex-shrink: 0;
    width: calc(27px * 1.4);
    height: calc(27px * 1.4);
    border-radius: 50%;
    border: calc(3px * 1.4) solid #3d3830;
    background: #444;
    box-shadow: inset 0 calc(1px * 1.4) calc(4px * 1.4) rgba(0, 0, 0, 0.5);
}

.jitfl-idle-preview .jitfl-status-led.lit {
    background: #33ff33;
    animation: jitfl-status-blink 0.85s ease-in-out infinite alternate;
}

.jitfl-idle-preview .jitfl-status-led--hero.lit {
    width: calc(39px * 1.4);
    height: calc(39px * 1.4);
    border-width: calc(4px * 1.4);
    animation: jitfl-status-blink-hero 0.45s ease-in-out infinite alternate;
}

@keyframes jitfl-status-blink {
    from {
        opacity: 1;
        background: #44ff44;
        box-shadow: 0 0 8px #00ff00, 0 0 14px rgba(51, 255, 51, 0.6), inset 0 0 4px #fff;
    }
    to {
        opacity: 0.35;
        background: #118811;
        box-shadow: 0 0 2px #006600, inset 0 0 2px rgba(0, 0, 0, 0.4);
    }
}

@keyframes jitfl-status-blink-hero {
    from {
        opacity: 1;
        transform: scale(1);
        background: #66ff66;
        box-shadow:
            0 0 12px #00ff00,
            0 0 24px #33ff33,
            0 0 36px rgba(0, 255, 0, 0.45),
            inset 0 0 6px #fff;
    }
    to {
        opacity: 0.25;
        transform: scale(0.88);
        background: #0a660a;
        box-shadow: 0 0 3px #004400, inset 0 0 2px rgba(0, 0, 0, 0.5);
    }
}

.jitfl-machine--compact {
    width: 100%;
    max-width: 280px;
}

.jitfl-machine--compact .jitfl-lcd {
    min-height: 28px;
}

.jitfl-machine--compact .jitfl-intake-slot {
    height: 16px;
}

.fax-machine-chassis {
    border: 4px solid;
    border-color: #6b6356 #2a2620 #2a2620 #6b6356;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.fax-send-scene {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 100%;
}

/* Inntaksspalte + matingsbrett (høyre side på bildet) */
.fax-intake-tunnel {
    position: absolute;
    left: 36.5%;
    right: 4.5%;
    top: 46.5%;
    bottom: 7%;
    overflow: hidden;
    z-index: 4;
    pointer-events: none;
}

.fax-send-slot-rim {
    position: absolute;
    left: 35%;
    right: 4%;
    top: 45.8%;
    height: 2.2%;
    z-index: 5;
    pointer-events: none;
    border-top: 3px solid rgba(20, 18, 14, 0.55);
    border-bottom: 2px solid rgba(0, 0, 0, 0.35);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.45);
}

.fax-send-intake-glow {
    position: absolute;
    left: 35%;
    right: 4%;
    top: 45.5%;
    height: 4.5%;
    border-radius: 1px;
    background: linear-gradient(180deg, rgba(255, 150, 0, 0.12), transparent);
    opacity: 0;
    z-index: 6;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.fax-send-intake-glow.pulling {
    opacity: 1;
    animation: fax-intake-pulse 0.45s ease-in-out infinite alternate;
}

@keyframes fax-intake-pulse {
    from { box-shadow: inset 0 0 12px rgba(255, 140, 0, 0.15); }
    to { box-shadow: inset 0 0 22px rgba(255, 100, 0, 0.35); }
}

.fax-send-green-btn {
    position: absolute;
    top: 19%;
    right: 11.5%;
    width: 7.5%;
    aspect-ratio: 1.35;
    border-radius: 6px;
    background: rgba(40, 160, 60, 0.35);
    box-shadow: none;
    pointer-events: none;
    transition: box-shadow 0.2s, background 0.2s;
}

.fax-send-green-btn.lit {
    background: rgba(60, 220, 80, 0.55);
    box-shadow: 0 0 14px #33ff55, 0 0 4px #00aa22;
    animation: fax-green-pulse 0.5s ease-in-out infinite alternate;
}

@keyframes fax-green-pulse {
    from { transform: scale(1); }
    to { transform: scale(0.96); }
}

.fax-send-track {
    position: absolute;
    left: 2%;
    right: 4%;
    bottom: 0;
    height: 118%;
    will-change: transform;
    transform: translateY(32%);
}

.fax-send-track.feeding {
    animation: fax-send-track-pull-in var(--fax-feed-duration, 5.4s) steps(32) var(--fax-feed-delay, 0s) forwards;
}

@keyframes fax-send-track-pull-in {
    0% {
        transform: translateY(32%);
    }
    15% {
        transform: translateY(28%);
    }
    40% {
        transform: translateY(8%);
    }
    65% {
        transform: translateY(-22%);
    }
    85% {
        transform: translateY(-48%);
    }
    100% {
        transform: translateY(-82%);
    }
}

.fax-send-sheet {
    width: 100%;
    min-height: 100%;
    padding: 12px 14px 16px;
    background-color: var(--paper-color);
    background-image: radial-gradient(#e4dfd0 8%, transparent 8%);
    background-size: 12px 12px;
    border: 1px solid #c8c0a8;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    font-family: 'Courier Prime', monospace;
    font-size: clamp(9px, 1.6vw, 12px);
    line-height: 1.4;
    text-transform: uppercase;
    color: #3d3830;
    transform-origin: center bottom;
}

.fax-send-track.feeding .fax-send-sheet {
    animation: fax-send-sheet-shrink var(--fax-feed-duration, 5.4s) steps(32) var(--fax-feed-delay, 0s) forwards;
}

@keyframes fax-send-sheet-shrink {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(0.97);
        opacity: 1;
    }
    100% {
        transform: scale(0.88);
        opacity: 0.15;
    }
}

.fax-send-roller-hint {
    position: absolute;
    left: 36%;
    right: 5%;
    top: 44.5%;
    height: 5%;
    display: flex;
    gap: 6%;
    align-items: center;
    justify-content: center;
    z-index: 3;
    pointer-events: none;
}

.fax-send-roller-hint.active .fax-roller-bar {
    animation: fax-roller-tick 0.22s steps(2) infinite;
}

.fax-roller-bar {
    flex: 1;
    height: 3px;
    background: rgba(80, 70, 60, 0.5);
    border-radius: 1px;
}

@keyframes fax-roller-tick {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(2px); opacity: 1; }
}

.fax-machine-led {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #444;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
    transition: background 0.2s, box-shadow 0.2s;
}

.fax-machine-led.active {
    background: #ff3333;
    box-shadow: 0 0 10px #ff0000, 0 0 4px #ff6600;
    animation: fax-led-blink 0.35s ease-in-out infinite alternate;
}

@keyframes fax-led-blink {
    from { opacity: 1; }
    to { opacity: 0.45; }
}

.fax-output-slot {
    z-index: 5;
}

.fax-scan-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ffb000 20%, #ff6600 50%, #ffb000 80%, transparent);
    box-shadow: 0 0 8px #ff9900;
    top: 0;
    z-index: 10;
    pointer-events: none;
}

.fax-scan-line.scanning {
    animation: fax-scan-sweep 6s linear forwards;
}

@keyframes fax-scan-sweep {
    0% { top: -4px; opacity: 0.9; }
    100% { top: 100%; opacity: 0.4; }
}

.fax-emerging-tray {
    perspective: 400px;
    position: relative;
    overflow: hidden;
    max-height: min(59.3vh, 374px);
}

.fax-emerging-paper {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    width: 100%;
    max-height: 100%;
    min-height: 0;
    padding: 10px 12px;
    box-sizing: border-box;
    background-color: var(--paper-color);
    background-image: radial-gradient(#e4dfd0 8%, transparent 8%);
    background-size: 12px 12px;
    border: 1px solid #d4cca9;
    box-shadow: 3px 6px 16px rgba(0, 0, 0, 0.28);
    transform: translateY(-92%);
    will-change: transform;
    overflow: hidden;
}

.fax-emerging-paper.printing {
    animation: fax-paper-emerge 6s cubic-bezier(0.22, 0.05, 0.15, 1) forwards;
}

@keyframes fax-paper-emerge {
    0% { transform: translateY(-92%); }
    100% { transform: translateY(0); }
}

.fax-emerging-body {
    --fax-reveal: 0%;
    clip-path: inset(0 0 calc(100% - var(--fax-reveal)) 0);
    min-height: 74px;
    max-height: min(43.7vh, 250px);
    overflow: hidden;
    word-break: break-word;
    font-size: 1.25rem;
    line-height: 1.45;
}

.fax-emerging-body.thermal-print {
    filter: contrast(1.05);
}

.fax-cover-sheet {
    flex-shrink: 0;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 2px solid #1c1917;
    background: linear-gradient(180deg, #f5f0e4 0%, #ebe4d4 100%);
    box-shadow: inset 0 0 0 1px #c8c0a8;
    font-family: 'Courier Prime', monospace;
    color: #1c1917;
}

.fax-cover-sheet--compact {
    margin-bottom: 8px;
    padding: 8px 10px;
}

.fax-cover-kicker {
    font-size: 8px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #78716c;
    text-align: center;
    margin-bottom: 2px;
}

.fax-cover-kicker--gruppefax {
    color: #b91c1c;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.2em;
}

.fax-cover-sheet--gruppefax {
    border-color: #b91c1c;
    box-shadow: inset 0 0 0 2px rgba(185, 28, 28, 0.22);
    background: linear-gradient(180deg, #fff5f5 0%, #f5ebe4 100%);
}

.fax-cover-value--gruppe {
    font-size: 14px;
    color: #991b1b;
    letter-spacing: 0.08em;
}

.fax-cover-row--gruppe .fax-cover-label {
    color: #991b1b;
}

.fax-paper-sheet--gruppefax {
    position: relative;
    box-shadow:
        0 0 0 2px rgba(185, 28, 28, 0.35),
        0 12px 24px rgba(0, 0, 0, 0.35);
}

.fax-paper-sheet--gruppefax::before {
    content: 'GRUPPEFAX';
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 2;
    padding: 3px 8px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #fff;
    background: #b91c1c;
    border: 2px solid #7f1d1d;
    box-shadow: 1px 1px 0 #000;
    pointer-events: none;
}

.fax-paper-sheet--unread {
    box-shadow:
        0 0 0 2px rgba(234, 179, 8, 0.55),
        0 12px 24px rgba(0, 0, 0, 0.35);
}

.fax-paper-sheet--unread.stack-front::after {
    content: 'ULEST';
    position: absolute;
    top: 10px;
    left: 12px;
    z-index: 2;
    padding: 3px 8px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: #1c1917;
    background: #fbbf24;
    border: 2px solid #b45309;
    box-shadow: 1px 1px 0 #000;
    pointer-events: none;
}

.fax-cover-heading {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-align: center;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 2px solid #1c1917;
}

.fax-cover-sheet--compact .fax-cover-heading {
    font-size: 11px;
    padding-bottom: 6px;
    margin-bottom: 6px;
}

.fax-cover-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fax-cover-sheet--compact .fax-cover-grid {
    gap: 4px;
}

.fax-cover-row {
    display: grid;
    grid-template-columns: minmax(72px, 38%) 1fr;
    gap: 8px;
    align-items: baseline;
}

.fax-cover-sheet--compact .fax-cover-row {
    grid-template-columns: minmax(64px, 42%) 1fr;
    gap: 6px;
}

.fax-cover-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #57534e;
}

.fax-cover-sheet--compact .fax-cover-label {
    font-size: 8px;
}

.fax-cover-value {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    word-break: break-word;
}

.fax-cover-value--name {
    font-size: 13px;
    letter-spacing: 0.04em;
}

.fax-cover-value--time {
    font-size: 12px;
    letter-spacing: 0.12em;
}

.fax-cover-sheet--compact .fax-cover-value {
    font-size: 10px;
}

.fax-cover-sheet--compact .fax-cover-value--name {
    font-size: 11px;
}

.fax-cover-sheet--compact .fax-cover-value--time {
    font-size: 11px;
}

#screenInbox .fax-sheet-body {
    margin-top: 2px;
    font-size: 1.5rem;
    line-height: 1.45;
}

.fax-cover-paper {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #78716c;
}

.fax-cover-sheet--compact .fax-cover-paper {
    margin-top: 6px;
    padding-top: 6px;
}

.fax-cover-paper-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
}

.fax-cover-paper-leds {
    display: flex;
    gap: 3px;
    flex: 1;
    max-width: 120px;
}

.fax-cover-paper-led {
    flex: 1;
    height: 9px;
    border: 1px solid #1c1917;
    background: #57534e;
}

.fax-cover-paper-led.is-lit {
    background: #22c55e;
    box-shadow: 0 0 4px #22c55e;
}

.fax-cover-sheet--compact .fax-cover-paper-led {
    height: 7px;
}

.fax-cover-paper-count {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.fax-cover-sheet--compact .fax-cover-paper-count {
    font-size: 10px;
}

/* Makuleringsmaskin — JITFL-stil, 6 sek */
.shredder-overlay {
    position: absolute;
    inset: 0;
    justify-content: flex-start;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    overflow: hidden;
    overflow-x: clip;
}

.shredder-overlay,
.shredder-overlay * {
    box-sizing: border-box;
}

.shredder-overlay-status {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
}

.jitfl-shred-scene {
    position: relative;
    flex: 0 0 70%;
    width: 100%;
    max-width: 100%;
    height: 70%;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 8px 6px 10px;
    overflow: hidden;
    overflow-x: clip;
}

.jitfl-shred-scene .jitfl-room-bg {
    position: absolute;
    inset: 0;
}

.jitfl-shred-scene .jitfl-lcd-text {
    font-size: clamp(1.1rem, 4.8vw, 1.75rem);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jitfl-shred-scene .jitfl-brand {
    font-size: clamp(0.62rem, 2.6vw, 0.95rem);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.06em;
}

.jitfl-shred-scene .jitfl-led {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.jitfl-shred-scene .jitfl-machine-bezel {
    padding: 10px 10px;
    gap: 8px;
    min-width: 0;
}

.jitfl-shred-scene .jitfl-lcd {
    min-width: 0;
    flex: 1 1 0;
}

.jitfl-shred-scene .jitfl-chassis-body {
    padding: 12px 10px 14px;
    min-width: 0;
}

.jitfl-shred-paper {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 72px;
    max-height: 22%;
    margin-bottom: 8px;
    padding: 10px;
    background-color: var(--paper-color);
    background-image: radial-gradient(#e4dfd0 8%, transparent 8%);
    background-size: 12px 12px;
    border: 2px solid #c8c0a8;
    box-shadow: 2px 4px 0 rgba(0, 0, 0, 0.3);
    font-family: 'Courier Prime', monospace;
    overflow: hidden;
    transform: translateY(0);
    will-change: transform, opacity;
    flex-shrink: 0;
}

.jitfl-shred-paper .fax-cover-sheet {
    max-width: 100%;
    overflow: hidden;
}

.jitfl-shred-paper .fax-cover-row {
    grid-template-columns: minmax(0, 38%) minmax(0, 1fr);
}

.jitfl-shred-paper-body {
    font-size: 0.7rem;
    text-transform: uppercase;
    line-height: 1.35;
    margin-top: 6px;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-height: 5.5svh;
    overflow: hidden;
}

.jitfl-shred-paper.phase-feed {
    animation: jitfl-shred-paper-feed 6s cubic-bezier(0.35, 0.05, 0.2, 1) forwards;
}

@keyframes jitfl-shred-paper-feed {
    0% {
        transform: translateY(0) rotate(-1deg);
        opacity: 1;
    }
    35% {
        transform: translateY(72px) rotate(0deg);
        opacity: 1;
    }
    55% {
        transform: translateY(96px) scaleY(0.55);
        opacity: 0.85;
    }
    75% {
        transform: translateY(108px) scaleY(0.2);
        opacity: 0.4;
    }
    100% {
        transform: translateY(116px) scaleY(0);
        opacity: 0;
    }
}

.jitfl-shredder-wrap {
    position: relative;
    z-index: 4;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
}

.jitfl-shredder {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.jitfl-shredder .jitfl-chassis-body {
    flex: 1;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.jitfl-shredder-wrap:has(.jitfl-shred-blades.active) .jitfl-shredder {
    animation: jitfl-machine-rumble 0.14s steps(2) infinite;
}

.jitfl-shred-slot {
    position: relative;
    height: clamp(36px, 6svh, 52px);
    background: linear-gradient(180deg, #1a1814 0%, #2a2620 50%, #1a1814 100%);
    border: 4px inset #0d0c0a;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.jitfl-shred-blades {
    display: flex;
    gap: 6px;
    align-items: center;
    opacity: 0.35;
    transition: opacity 0.2s;
}

.jitfl-shred-blades.active {
    opacity: 1;
}

.jitfl-shred-blades span {
    display: block;
    width: 10px;
    height: 14px;
    background: linear-gradient(180deg, #8a8275 0%, #3d3830 100%);
    border: 1px solid #1a1814;
    border-radius: 1px;
}

.jitfl-shred-blades.active span {
    animation: jitfl-shred-blade-chop 0.12s steps(2) infinite;
}

.jitfl-shred-blades.active span:nth-child(2) { animation-delay: 0.03s; }
.jitfl-shred-blades.active span:nth-child(3) { animation-delay: 0.06s; }
.jitfl-shred-blades.active span:nth-child(4) { animation-delay: 0.02s; }
.jitfl-shred-blades.active span:nth-child(5) { animation-delay: 0.05s; }

@keyframes jitfl-shred-blade-chop {
    0% { transform: translateY(0); background: #9e9584; }
    50% { transform: translateY(3px); background: #c8c0a8; }
    100% { transform: translateY(0); background: #8a8275; }
}

.jitfl-shred-bin {
    position: relative;
    flex: 1;
    min-height: clamp(88px, 14svh, 130px);
    margin-top: 6px;
    background: linear-gradient(180deg, #3d3830 0%, #2a2620 100%);
    border: 3px inset #1a1814;
    overflow: hidden;
}

.jitfl-shred-strips {
    position: absolute;
    inset: 4px 6px 0;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: flex-start;
    gap: 3px;
    pointer-events: none;
    overflow: hidden;
}

.jitfl-shred-strip {
    width: 5px;
    height: 0;
    background: linear-gradient(180deg, var(--paper-color) 0%, #d8d0bc 100%);
    border-radius: 1px;
    opacity: 0;
    animation: jitfl-shred-strip-fall 2.8s ease-out forwards;
}

@keyframes jitfl-shred-strip-fall {
    0% {
        height: 0;
        opacity: 0;
        transform: translateY(0);
    }
    15% {
        height: 72px;
        opacity: 1;
    }
    100% {
        height: 48px;
        opacity: 0.45;
        transform: translateY(52px) rotate(8deg);
    }
}

.shredder-overlay #shredderHint {
    width: 100%;
    max-width: 100%;
    flex-shrink: 0;
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: border-box;
}

#shredLedActive.lit,
#shredLedTx.lit {
    background: #ff3333;
    box-shadow: 0 0 12px #ff0000;
    animation: jitfl-led-blink 0.35s ease-in-out infinite alternate;
}
