/*
 * Download-server speed test: card, status bar, extension promo, modals, link-card badges, player pills.
 * Spec: docs/superpowers/specs/2026-10-12-link-speed-test-design.md §3, §4 (+ phase 2 extension spec)
 * Markup: resources/views/filmazon_new_web/partials/speed_test.blade.php; badges/pills come from speed-test.js.
 * Site look: white rounded cards, orange (#ff9800) actions, IranYekan; dark mode through body.dark.
 */

.fz-st,
.fz-pl {
    --fz-accent: #ff9800;
    --fz-accent-dark: #f57c00;
    --fz-accent-soft: #fff3e0;
    --fz-blue: #0288d1;
    --fz-text: #37474f;
    --fz-muted: #78909c;
    --fz-card: #ffffff;
    --fz-soft: #f6f9fb;
    --fz-line: #e3edf2;
    --fz-shadow: 0 6px 24px rgba(16, 42, 67, .08);
    --fz-t1: var(--fz-c1, #2e7d32);
    --fz-t2: var(--fz-c2, #00897b);
    --fz-t3: var(--fz-c3, #ef6c00);
    --fz-t4: var(--fz-c4, #c62828);
    --fz-ext: #78909c;
    --fz-down: #455a64;
}

body.dark .fz-st,
body.dark .fz-pl {
    --fz-accent: #ff9800;
    --fz-accent-dark: #ffa726;
    --fz-accent-soft: #3a2a12;
    --fz-blue: #4fc3f7;
    --fz-text: #e0e6ea;
    --fz-muted: #9fb3bd;
    --fz-card: #0f1d27;
    --fz-soft: #142633;
    --fz-line: #1f3a4b;
    --fz-shadow: 0 6px 24px rgba(0, 0, 0, .45);
    --fz-t1: var(--fz-c1, #43a047);
    --fz-t2: var(--fz-c2, #26a69a);
    --fz-t3: var(--fz-c3, #fb8c00);
    --fz-t4: var(--fz-c4, #e53935);
    --fz-ext: #607d8b;
    --fz-down: #546e7a;
}

.fz-st {
    float: right;
    width: 100%;
    margin: 8px 0 4px;
    direction: rtl;
    text-align: right;
    font-family: IranYekan, Tahoma, sans-serif;
    font-size: 14px;
    line-height: 1.8;
    color: var(--fz-text);
    box-sizing: border-box;
}

.fz-st *,
.fz-st *::before,
.fz-st *::after {
    box-sizing: border-box;
}

.fz-st[hidden],
.fz-st [hidden],
.fz-pl [hidden] {
    display: none !important;
}

/* ------------------------------------------------------------ card */

.fz-st-box {
    padding: 14px 16px;
    border: 1px solid var(--fz-line);
    border-radius: 16px;
    background: var(--fz-card);
    box-shadow: var(--fz-shadow);
}

.fz-st-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.fz-st-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ffb74d, var(--fz-accent));
    color: #fff;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(255, 152, 0, .35);
}

.fz-st-titles {
    flex: 1 1 220px;
    min-width: 0;
}

.fz-st-title {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.6;
}

.fz-st-sub {
    color: var(--fz-muted);
    font-size: 12.5px;
    line-height: 1.7;
}

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

/* ------------------------------------------------------------ buttons */

.fz-st-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 6px 16px;
    border: 1px solid var(--fz-line);
    border-radius: 10px;
    background: var(--fz-soft);
    color: var(--fz-text);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s, transform .1s;
}

.fz-st-btn:hover,
.fz-st-btn:focus {
    border-color: var(--fz-accent);
    color: var(--fz-accent-dark);
    text-decoration: none;
    outline: none;
}

.fz-st-btn:active {
    transform: translateY(1px);
}

.fz-st-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(255, 152, 0, .35);
}

.fz-st-btn-main,
.fz-st-btn-primary {
    border-color: var(--fz-accent);
    background: var(--fz-accent);
    color: #fff;
}

.fz-st-btn-main:hover,
.fz-st-btn-main:focus,
.fz-st-btn-primary:hover,
.fz-st-btn-primary:focus {
    border-color: var(--fz-accent-dark);
    background: var(--fz-accent-dark);
    color: #fff;
}

.fz-st-count {
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .25);
    font-size: 12px;
    font-weight: 700;
}

.fz-st-btn-fresh .fz-st-count {
    background: var(--fz-accent-soft);
    color: var(--fz-accent-dark);
}

.fz-st-btn-stop {
    min-height: 32px;
    padding: 2px 14px;
    border-color: var(--fz-t4);
    background: transparent;
    color: var(--fz-t4);
}

.fz-st-btn-stop:hover,
.fz-st-btn-stop:focus {
    border-color: var(--fz-t4);
    background: var(--fz-t4);
    color: #fff;
}

/* ------------------------------------------------------------ progress */

.fz-st-progress {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--fz-accent-soft);
    color: var(--fz-text);
    font-weight: 700;
}

.fz-st-progress-text {
    flex: 1 1 auto;
}

.fz-st-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 152, 0, .3);
    border-top-color: var(--fz-accent);
    border-radius: 50%;
    animation: fz-st-spin .8s linear infinite;
}

@keyframes fz-st-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ------------------------------------------------------------ status panel */

.fz-st-panel {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--fz-line);
    font-size: 13px;
}

.fz-st-summary {
    font-weight: 700;
}

.fz-st-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.fz-st-legend-toggle {
    padding: 2px 10px;
    border: 0;
    border-radius: 999px;
    background: var(--fz-soft);
    color: var(--fz-blue);
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
}

.fz-st-legend-toggle::after {
    content: ' ▾';
    font-size: 11px;
}

.fz-st-legend-toggle[aria-expanded="false"]::after {
    content: ' ◂';
}

.fz-st-legend-items {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

.fz-st-key {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 10px;
    border: 1px solid var(--fz-line);
    border-radius: 999px;
    background: var(--fz-card);
    font-size: 12px;
    white-space: nowrap;
}

.fz-st-key b {
    font-weight: 400;
}

.fz-st-key-t1 b { color: var(--fz-t1); }
.fz-st-key-t2 b { color: var(--fz-t2); }
.fz-st-key-t3 b { color: var(--fz-t3); }
.fz-st-key-t4 b { color: var(--fz-t4); }
.fz-st-key-broken b { color: var(--fz-t4); }
.fz-st-key-down b { color: var(--fz-down); }

.fz-st-panel-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
}

/* sort: a switch instead of a raw checkbox */
.fz-st-sort {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
}

.fz-st-sort input {
    position: relative;
    width: 38px;
    height: 22px;
    margin: 0;
    border-radius: 999px;
    background: var(--fz-line);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color .2s;
}

.fz-st-sort input::after {
    content: '';
    position: absolute;
    top: 3px;
    right: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: right .2s;
}

.fz-st-sort input:checked {
    background: var(--fz-accent);
}

.fz-st-sort input:checked::after {
    right: 19px;
}

/* ------------------------------------------------------------ extension note + promo */

.fz-st-ext-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.8;
}

.fz-st-ext-note[data-state="hint"] {
    background: var(--fz-soft);
    color: var(--fz-text);
}

.fz-st-ext-note[data-state="active"] {
    background: rgba(46, 125, 50, .1);
    color: var(--fz-t1);
    font-weight: 700;
}

.fz-st-ext-link {
    color: var(--fz-blue);
    font-weight: 700;
    text-decoration: underline;
}

.fz-st-promo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px dashed rgba(255, 152, 0, .6);
    border-radius: 12px;
    background: var(--fz-accent-soft);
    color: var(--fz-text);
    text-decoration: none;
    transition: border-color .15s, transform .1s;
}

.fz-st-promo:hover,
.fz-st-promo:focus {
    border-style: solid;
    color: var(--fz-text);
    text-decoration: none;
    outline: none;
}

.fz-st-promo-icon {
    flex: 0 0 auto;
    font-size: 24px;
}

.fz-st-promo-body {
    flex: 1 1 auto;
    min-width: 0;
}

.fz-st-promo-title {
    font-weight: 800;
}

.fz-st-promo-points {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 12px;
    color: var(--fz-muted);
    font-size: 12.5px;
}

.fz-st-promo-points span::before {
    content: '✓ ';
    color: var(--fz-t1);
    font-weight: 700;
}

.fz-st-promo-cta {
    flex: 0 0 auto;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--fz-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

/* ------------------------------------------------------------ toast */

.fz-st-toast {
    position: fixed;
    bottom: 18px;
    left: 50%;
    z-index: 10050;
    width: max-content;
    max-width: calc(100% - 32px);
    padding: 12px 18px;
    border-radius: 12px;
    background: #263238;
    color: #fff;
    font-size: 14px;
    line-height: 1.8;
    text-align: right;
    direction: rtl;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .3);
    transform: translateX(-50%);
    cursor: pointer;
    animation: fz-st-rise .25s ease-out;
}

@keyframes fz-st-rise {
    from {
        opacity: 0;
        transform: translate(-50%, 10px);
    }
}

/* ------------------------------------------------------------ modals */

.fz-st-modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.fz-st-backdrop {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(10, 20, 28, .55);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    animation: fz-st-fade .2s ease-out;
}

@keyframes fz-st-fade {
    from {
        opacity: 0;
    }
}

.fz-st-dialog {
    position: relative;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 28px 22px 20px;
    border-radius: 20px;
    background: var(--fz-card);
    color: var(--fz-text);
    direction: rtl;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
    animation: fz-st-pop .22s ease-out;
}

@keyframes fz-st-pop {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.97);
    }
}

.fz-st-dlg-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 8px;
    border-radius: 50%;
    background: var(--fz-accent-soft);
    font-size: 26px;
}

.fz-st-dlg-title {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 800;
}

.fz-st-close {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--fz-soft);
    color: var(--fz-muted);
    font-size: 16px;
    line-height: 34px;
    cursor: pointer;
}

.fz-st-close:hover,
.fz-st-close:focus {
    color: var(--fz-text);
    outline: none;
}

.fz-st-text {
    margin: 0;
    color: var(--fz-muted);
    font-size: 14.5px;
    line-height: 1.9;
}

.fz-st-warn {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #fff8e1;
    color: #6d4c00;
    font-size: 13px;
    line-height: 1.8;
    text-align: right;
}

.fz-st-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
}

.fz-st-buttons .fz-st-btn {
    flex: 1 1 120px;
}

/* ------------------------------------------------------------ link cards */

.links-main .item.fz-st-card {
    position: relative;
}

.links-main .item > .fz-st-badge,
.item > .fz-st-badge {
    position: absolute;
    top: -3px;
    left: 50%;
    z-index: 3;
    max-width: calc(100% - 14px);
    overflow: hidden;
    padding: 0 8px;
    border-radius: 9px;
    background-color: #78909c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    white-space: nowrap;
    text-overflow: ellipsis;
    direction: rtl;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
    transform: translateX(-50%);
    /* never intercept clicks: on the dubbed_audio card the whole card is the download link */
    pointer-events: none;
}

/* «needs extension» is the one clickable badge: it opens the install guide in a new tab */
.item.fz-st-ext > .fz-st-badge {
    pointer-events: auto;
    cursor: pointer;
    text-decoration: underline dotted;
}

.item.fz-st-t1 > .fz-st-badge { background-color: var(--fz-c1, #2e7d32); }
.item.fz-st-t2 > .fz-st-badge { background-color: var(--fz-c2, #00897b); }
.item.fz-st-t3 > .fz-st-badge { background-color: var(--fz-c3, #ef6c00); }
.item.fz-st-t4 > .fz-st-badge { background-color: var(--fz-c4, #c62828); }
.item.fz-st-ext > .fz-st-badge { background-color: #78909c; }
.item.fz-st-down > .fz-st-badge { background-color: #455a64; }
.item.fz-st-broken > .fz-st-badge { background-color: #c62828; }

.item.fz-st-busy > .fz-st-badge {
    background-color: #0288d1;
    animation: fz-st-pulse 1.2s ease-in-out infinite;
}

@keyframes fz-st-pulse {
    50% {
        opacity: .55;
    }
}

/* thin colored bar along the whole top edge; the badge sits on it */
.links-main .item.fz-st-t1 > .in { border-top: 4px solid var(--fz-c1, #2e7d32) !important; }
.links-main .item.fz-st-t2 > .in { border-top: 4px solid var(--fz-c2, #00897b) !important; }
.links-main .item.fz-st-t3 > .in { border-top: 4px solid var(--fz-c3, #ef6c00) !important; }
.links-main .item.fz-st-t4 > .in { border-top: 4px solid var(--fz-c4, #c62828) !important; }

/* broken: faded card with a dashed red border; buttons keep working */
.links-main .item.fz-st-broken > .in {
    border: 1px dashed #c62828 !important;
    opacity: .6;
}

.links-main .item.fz-st-broken > .in:hover {
    opacity: .85;
}

/* ------------------------------------------------------------ player playlist */

/*
 * The player is always dark (black page, orange accent). Selectors are scoped to .fz-plist (the playlist
 * modal content) so they beat video.js' `.video-js button { background: none; ... }`.
 * Markup: player.blade.php (#playlist-modal); texts, progress and the choice box come from speed-test.js.
 */

.fz-pl[hidden],
.fz-plist .fz-pl[hidden] {
    display: none !important;
}

.fz-plist .fz-pl-fastest {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    flex: none;
    margin: 0;
    padding: 14px 16px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffa726 0%, #ff9800 45%, #f57c00 100%);
    box-shadow: 0 6px 20px rgba(255, 152, 0, .22);
    color: #fff;
    font-size: 15px;
    line-height: 1.6;
    text-align: right;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.fz-plist .fz-pl-fastest:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(255, 152, 0, .32);
    filter: brightness(1.05);
    outline: none;
}

/* remote / keyboard focus (:focus too, older TV browsers lack :focus-visible; .fz-nav-on: player-playlist.js) */
.fz-plist .fz-pl-fastest:focus,
.fz-plist .fz-pl-fastest.fz-nav-on {
    box-shadow: 0 0 0 3px #fff, 0 10px 26px rgba(255, 152, 0, .32);
    outline: none;
}

.fz-plist .fz-pl-fastest[disabled] {
    transform: none;
    filter: saturate(.85);
    cursor: progress;
}

/* «↻ تست مجدد همه سرورها»: a quiet secondary action under the fastest button */
.fz-plist .fz-pl-retest {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    flex: none;
    margin: -8px 0 0; /* closer to the fastest button than the list's gap */
    padding: 10px 14px;
    border: 1px solid #333;
    border-radius: 12px;
    background: transparent;
    color: #ffb74d;
    font-size: 14px;
    line-height: 1.6;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.fz-plist .fz-pl-retest:hover,
.fz-plist .fz-pl-retest:focus,
.fz-plist .fz-pl-retest.fz-nav-on {
    border-color: #ff9800;
    background: rgba(255, 152, 0, .08);
    outline: none;
}

.fz-plist .fz-pl-retest:focus,
.fz-plist .fz-pl-retest.fz-nav-on {
    box-shadow: 0 0 0 3px rgba(255, 152, 0, .6);
}

.fz-plist .fz-pl-retest[disabled] {
    opacity: .45;
    cursor: progress;
}

.fz-pl-fastest-icon {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .18);
    font-size: 19px;
}

.fz-pl-fastest[disabled] .fz-pl-fastest-icon {
    animation: fz-st-pulse 1.2s ease-in-out infinite;
}

.fz-pl-fastest-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.fz-pl-fastest-title {
    font-size: 16px;
    font-weight: 700;
}

.fz-pl-fastest-sub {
    color: rgba(255, 255, 255, .88);
    font-size: 12.5px;
}

.fz-pl-bar {
    display: block;
    height: 5px;
    margin-top: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(0, 0, 0, .2);
}

.fz-pl-bar > i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #fff;
    transition: width .35s ease;
}

.fz-plist .fz-pl-note {
    flex: none;
    padding: 8px 12px;
    border-radius: 10px;
    background: #1c1c1c;
    color: #cfcfcf;
    font-size: 13px;
    line-height: 1.8;
    text-align: center;
}

/* after a test: «پخش از دسته‌های دیگر»; a warning «لینک سالم دوبله پیدا نشد. از کدام دسته پخش شود؟» when
   the playing kind has no working link */
.fz-plist .fz-pl-choice {
    flex: none;
    padding: 12px 14px;
    border: 1px solid #2a2a2a;
    border-radius: 14px;
    background: #181818;
}

.fz-plist .fz-pl-choice.fz-pl-choice-warn {
    border-color: rgba(255, 152, 0, .45);
    background: rgba(255, 152, 0, .07);
}

.fz-pl-choice-title {
    margin-bottom: 10px;
    color: #cfcfcf;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.8;
}

.fz-pl-choice-warn .fz-pl-choice-title {
    color: #ffcc80;
}

.fz-pl-choice-opts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fz-plist .fz-pl-opt {
    display: flex;
    flex: 1 1 150px;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 9px 14px;
    border: 1px solid #3a3a3a;
    border-radius: 10px;
    background: #242424;
    color: #fff;
    font-size: 14px;
    line-height: 1.6;
    text-align: right;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.fz-plist .fz-pl-opt > span {
    color: #bdbdbd;
    font-size: 12px;
}

.fz-plist .fz-pl-opt:hover,
.fz-plist .fz-pl-opt:focus,
.fz-plist .fz-pl-opt.fz-nav-on {
    border-color: #ff9800;
    background: #2c2c2c;
    outline: none;
}

.fz-plist .fz-pl-opt:focus,
.fz-plist .fz-pl-opt.fz-nav-on {
    box-shadow: 0 0 0 3px rgba(255, 152, 0, .6);
}

.fz-plist .fz-pl-opt[disabled] {
    border-style: dashed;
    opacity: .45;
    cursor: not-allowed;
}

.fz-plist .fz-pl-opt[disabled]:hover {
    border-color: #3a3a3a;
    background: #242424;
}

.fz-plist .fz-pl-pill {
    flex: none;
    margin: 0;
    line-height: 20px;
}

@media only screen and (max-width: 600px) {
    .fz-plist .fz-pl-fastest {
        gap: 10px;
        padding: 12px;
    }

    .fz-pl-fastest-title {
        font-size: 15px;
    }

    .fz-pl-fastest-sub {
        font-size: 12px;
    }
}

.fz-pl-pill {
    display: inline-block;
    margin-right: 6px;
    padding: 0 8px;
    border-radius: 999px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    white-space: nowrap;
    vertical-align: middle;
}

.fz-pl-pill.t1 { background: var(--fz-c1, #2e7d32); }
.fz-pl-pill.t2 { background: var(--fz-c2, #00897b); }
.fz-pl-pill.t3 { background: var(--fz-c3, #ef6c00); }
.fz-pl-pill.t4 { background: var(--fz-c4, #c62828); }
.fz-pl-pill.ext { background: #78909c; }
.fz-pl-pill.down { background: #455a64; }
.fz-pl-pill.broken { background: #c62828; }
.fz-pl-pill.busy { background: #0288d1; animation: fz-st-pulse 1.2s ease-in-out infinite; }

/* ------------------------------------------------------------ small screens */

@media only screen and (max-width: 600px) {
    .fz-st {
        font-size: 13px;
    }

    .fz-st-box {
        padding: 12px;
        border-radius: 14px;
    }

    .fz-st-actions,
    .fz-st-actions .fz-st-btn {
        flex: 1 1 100%;
    }

    .fz-st-btn {
        white-space: normal;
    }

    .fz-st-promo {
        flex-wrap: wrap;
    }

    .fz-st-promo-cta {
        margin-right: auto;
    }

    /* modals become bottom sheets */
    .fz-st-modal {
        align-items: flex-end;
        padding: 0;
    }

    .fz-st-dialog {
        max-width: none;
        max-height: 88vh;
        padding: 26px 16px 18px;
        border-radius: 20px 20px 0 0;
        animation-name: fz-st-sheet;
    }

    @keyframes fz-st-sheet {
        from {
            transform: translateY(40px);
        }
    }

    .item > .fz-st-badge {
        font-size: 10px;
        padding: 0 6px;
    }
}

/* ------------------------------------------------------------ dark mode (rest) */

body.dark .fz-st-toast {
    background: #00374f;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .6);
}

body.dark .fz-st-warn {
    background: #3a2f00;
    color: #ffe082;
}

body.dark .fz-st-sort input::after {
    background: #cfd8dc;
}

/* same hues, darker so white text stays readable on the dark page */
/* (fallback first; browsers with color-mix darken the color chosen on the settings page) */
body.dark .item.fz-st-t1 > .fz-st-badge { background-color: #1b5e20; background-color: color-mix(in srgb, var(--fz-c1, #2e7d32) 72%, #000); }
body.dark .item.fz-st-t2 > .fz-st-badge { background-color: #00695c; background-color: color-mix(in srgb, var(--fz-c2, #00897b) 72%, #000); }
body.dark .item.fz-st-t3 > .fz-st-badge { background-color: #bf5600; background-color: color-mix(in srgb, var(--fz-c3, #ef6c00) 72%, #000); }
body.dark .item.fz-st-t4 > .fz-st-badge { background-color: #a31f1f; background-color: color-mix(in srgb, var(--fz-c4, #c62828) 80%, #000); }
body.dark .item.fz-st-broken > .fz-st-badge { background-color: #a31f1f; }
body.dark .item.fz-st-ext > .fz-st-badge { background-color: #546e7a; }
body.dark .item.fz-st-down > .fz-st-badge { background-color: #37474f; }
body.dark .item.fz-st-busy > .fz-st-badge { background-color: #01579b; }

body.dark .links-main .item.fz-st-broken > .in {
    border-color: #ef5350 !important;
}
