:root {
    color-scheme: dark;

    --page: #07111f;
    --page-soft: #0a1627;
    --surface: #0e1b2d;
    --surface-2: #13243a;
    --surface-3: #172a43;
    --border: #243850;
    --text: #f4f7fb;
    --muted: #91a3ba;
    --accent: #62a7ff;

    --buy: #29d987;
    --buy-soft: rgba(41, 217, 135, 0.13);
    --sell: #ff6478;
    --sell-soft: rgba(255, 100, 120, 0.13);
    --wait: #f4bc4e;
    --wait-soft: rgba(244, 188, 78, 0.13);

    --shadow: 0 20px 55px rgba(0, 0, 0, 0.22);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 280px;
    background: var(--page);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 90% -10%, rgba(71, 139, 255, 0.18), transparent 32rem),
        radial-gradient(circle at -10% 45%, rgba(41, 217, 135, 0.07), transparent 28rem),
        linear-gradient(180deg, var(--page-soft), var(--page));
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

button,
input,
select {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

.app-shell {
    width: min(1480px, calc(100% - 40px));
    margin-inline: auto;
    padding-block: 28px 20px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.brand-block {
    min-width: 0;
}


h1 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 1.1;
    letter-spacing: -0.04em;
}


.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.connection-status,
.refresh-button {
    min-height: 43px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(14, 27, 45, 0.9);
}

.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 750;
    white-space: nowrap;
}

.status-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--wait);
    box-shadow: 0 0 14px currentColor;
}

.connection-status.online .status-dot {
    background: var(--buy);
}

.connection-status.error .status-dot {
    background: var(--sell);
}

.refresh-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 15px;
    color: var(--text);
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.refresh-button:hover:not(:disabled) {
    border-color: var(--accent);
    background: var(--surface-2);
    transform: translateY(-1px);
}

.refresh-button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.refresh-button.is-loading .refresh-icon {
    animation: spin 0.8s linear infinite;
}


.toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(150px, 210px) minmax(190px, 250px);
    gap: 13px;
    padding: 16px;
    background: rgba(14, 27, 45, 0.88);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.control {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.control > span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 750;
}

.control input,
.control select {
    width: 100%;
    min-width: 0;
    height: 44px;
    padding: 0 13px;
    color: var(--text);
    outline: none;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.control input::placeholder {
    color: #71849d;
}

.control input:focus,
.control select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(98, 167, 255, 0.13);
}

.signal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
    gap: 18px;
    margin-top: 16px;
}

.signal-card {
    --signal-color: var(--wait);
    --signal-soft: var(--wait-soft);

    position: relative;
    overflow: hidden;
    display: flex;
    min-width: 0;
    min-height: 430px;
    flex-direction: column;
    padding: 20px;
    background: linear-gradient(150deg, rgba(19, 36, 58, 0.98), rgba(12, 25, 42, 0.98));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: transform 170ms ease, border-color 170ms ease;
}

.signal-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: var(--signal-color);
}

.signal-card::after {
    content: "";
    position: absolute;
    top: -75px;
    right: -75px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: var(--signal-color);
    opacity: 0.045;
    pointer-events: none;
}

.signal-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--signal-color) 48%, var(--border));
}

.signal-card.buy {
    --signal-color: var(--buy);
    --signal-soft: var(--buy-soft);
}

.signal-card.sell {
    --signal-color: var(--sell);
    --signal-soft: var(--sell-soft);
}

.signal-card.wait {
    --signal-color: var(--wait);
    --signal-soft: var(--wait-soft);
}

.card-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.symbol-block {
    min-width: 0;
}

.symbol {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.symbol-caption {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.75rem;
}

.signal-badge {
    flex: 0 0 auto;
    min-width: 66px;
    padding: 7px 11px;
    color: var(--signal-color);
    background: var(--signal-soft);
    border: 1px solid color-mix(in srgb, var(--signal-color) 28%, transparent);
    border-radius: 999px;
    text-align: center;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.05em;
}

.price-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin: 21px 0 17px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.price-label {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
}

.price-value {
    display: block;
    margin-top: 3px;
    font-size: 1.75rem;
    line-height: 1.1;
    letter-spacing: -0.035em;
}

.price-value.unavailable {
    color: #6f8198;
}

.price-note {
    max-width: 122px;
    color: var(--muted);
    text-align: right;
    font-size: 0.66rem;
    line-height: 1.35;
}

.probability-box {
    padding: 15px;
    background: rgba(4, 12, 22, 0.34);
    border: 1px solid var(--border);
    border-radius: 13px;
}

.probability-values {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 0.82rem;
    font-weight: 850;
}

.up-value {
    color: var(--buy);
}

.down-value {
    color: var(--sell);
    text-align: right;
}

.probability-track {
    display: flex;
    overflow: hidden;
    width: 100%;
    height: 10px;
    background: var(--surface-3);
    border-radius: 999px;
}

.probability-up-bar {
    height: 100%;
    background: var(--buy);
    transition: width 280ms ease;
}

.probability-down-bar {
    flex: 1;
    height: 100%;
    background: var(--sell);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 13px;
}

.stat-item {
    min-width: 0;
    padding: 11px 12px;
    background: rgba(4, 12, 22, 0.29);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

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

.stat-value {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: 0.86rem;
    font-weight: 820;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-value.strong {
    color: var(--signal-color);
}

.stat-value.medium {
    color: var(--wait);
}

.stat-value.weak {
    color: var(--muted);
}

.reasons {
    flex: 1;
    margin-top: 17px;
}

.reasons-title {
    margin: 0 0 9px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.reason-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.reason-list li {
    max-width: 100%;
    padding: 6px 8px;
    overflow-wrap: anywhere;
    color: #c8d5e5;
    background: rgba(98, 167, 255, 0.07);
    border: 1px solid rgba(98, 167, 255, 0.14);
    border-radius: 8px;
    font-size: 0.69rem;
    line-height: 1.35;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 16px;
    padding-top: 13px;
    color: var(--muted);
    border-top: 1px solid var(--border);
    font-size: 0.67rem;
}

.state-panel {
    display: grid;
    justify-items: center;
    gap: 10px;
    min-height: 300px;
    margin-top: 18px;
    padding: 60px 18px;
    color: var(--muted);
    background: rgba(14, 27, 45, 0.62);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
}

.state-panel[hidden] {
    display: none;
}

.state-panel h2,
.state-panel p {
    margin: 0;
}

.state-panel h2 {
    color: var(--text);
    font-size: 1.1rem;
}

.loader {
    width: 31px;
    height: 31px;
    margin-bottom: 4px;
    border: 3px solid rgba(255, 255, 255, 0.13);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.retry-button {
    margin-top: 5px;
    padding: 9px 15px;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--accent);
    border-radius: 9px;
}

.footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 5px 16px;
    margin-top: 24px;
    padding: 16px 2px 0;
    color: var(--muted);
    border-top: 1px solid rgba(36, 56, 80, 0.65);
    font-size: 0.72rem;
}

.footer > span {
    flex: 0 0 auto;
    max-width: 100%;
    white-space: nowrap;
}

#lastUpdatedText {
    overflow: hidden;
    text-overflow: ellipsis;
}

[hidden] {
    display: none !important;
}

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

@media (max-width: 920px) {
    .topbar {
        align-items: flex-start;
    }


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

    .control-search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .app-shell {
        width: min(100% - 24px, 1480px);
        padding-top: 18px;
    }

    .topbar {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        margin-bottom: 20px;
    }

    .topbar h1 {
        font-size: clamp(1.45rem, 7vw, 1.8rem);
        white-space: nowrap;
    }

    .topbar-actions {
        width: auto;
        min-width: 0;
        flex: 0 1 auto;
        justify-content: flex-end;
    }

    .connection-status {
        min-width: 0;
        min-height: 36px;
        padding: 7px 10px;
        font-size: 0.72rem;
        white-space: nowrap;
    }

    #connectionText {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }


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

    .control-search {
        grid-column: auto;
    }

}

@media (max-width: 410px) {

    .signal-card {
        min-height: 0;
        padding: 17px;
        border-radius: 16px;
    }

    .price-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    .price-note {
        max-width: none;
        text-align: left;
    }

    .probability-values {
        font-size: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Responsive card, compact mobile controls, and detail dialogs */

html.dialog-open {
    overflow: hidden;
}

.app-shell {
    width: min(1760px, calc(100% - 40px));
}

.search-field {
    position: relative;
    display: block;
    min-width: 0;
}

.search-field .search-icon {
    position: absolute;
    top: 50%;
    left: 13px;
    z-index: 1;
    width: 17px;
    height: 17px;
    fill: none;
    stroke: var(--muted);
    stroke-width: 1.8;
    stroke-linecap: round;
    transform: translateY(-50%);
    pointer-events: none;
}

.search-field input {
    padding-left: 39px;
    padding-right: 40px;
}

.clear-search-button {
    position: absolute;
    top: 50%;
    right: 7px;
    display: grid;
    width: 30px;
    height: 30px;
    padding: 0;
    place-items: center;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 50%;
    font-size: 1.25rem;
    line-height: 1;
    transform: translateY(-50%);
}

.clear-search-button:hover,
.clear-search-button:focus-visible {
    color: var(--text);
    background: rgba(255, 255, 255, 0.07);
    outline: none;
}

.mobile-filter-button {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 94px;
    height: 44px;
    padding: 0 12px;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 800;
}

.mobile-filter-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.mobile-filter-button:focus-visible,
.mobile-filter-button:hover {
    border-color: var(--accent);
    outline: none;
}

.filter-count-badge {
    display: inline-grid;
    min-width: 19px;
    height: 19px;
    padding-inline: 5px;
    place-items: center;
    color: #07111f;
    background: var(--accent);
    border-radius: 999px;
    font-size: 0.67rem;
    font-weight: 950;
}

.active-filter-chips {
    display: none;
    min-width: 0;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    padding: 5px 8px;
    color: #cbd8e8;
    background: rgba(98, 167, 255, 0.09);
    border: 1px solid rgba(98, 167, 255, 0.2);
    border-radius: 999px;
    font-size: 0.67rem;
    font-weight: 750;
}

.filter-chip span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-chip span:last-child {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1;
}

.filter-chip:hover,
.filter-chip:focus-visible {
    border-color: var(--accent);
    outline: none;
}

.signal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.signal-card {
    cursor: pointer;
}

.signal-card:focus-visible {
    border-color: var(--signal-color);
    outline: 3px solid color-mix(in srgb, var(--signal-color) 24%, transparent);
    outline-offset: 3px;
}

.desktop-card-content {
    display: flex;
    flex: 1;
    min-height: 0;
    flex-direction: column;
}

.compact-card-content {
    display: none;
}

/* Native dialogs are centered on larger screens and become bottom sheets on mobile. */
.app-dialog {
    --signal-color: var(--wait);
    --signal-soft: var(--wait-soft);

    position: fixed;
    inset: 0;
    width: min(720px, calc(100% - 32px));
    max-width: none;
    max-height: min(86dvh, 850px);
    margin: auto;
    padding: 0;
    overflow: auto;
    overscroll-behavior: contain;
    color: var(--text);
    background: linear-gradient(150deg, rgba(19, 36, 58, 0.995), rgba(9, 20, 34, 0.995));
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.58);
}

.app-dialog::backdrop {
    background: rgba(1, 7, 15, 0.72);
    backdrop-filter: blur(5px);
}

.app-dialog[open] {
    animation: dialog-fade-in 170ms ease-out;
}

.detail-dialog.buy {
    --signal-color: var(--buy);
    --signal-soft: var(--buy-soft);
}

.detail-dialog.sell {
    --signal-color: var(--sell);
    --signal-soft: var(--sell-soft);
}

.detail-dialog.wait {
    --signal-color: var(--wait);
    --signal-soft: var(--wait-soft);
}

.filter-dialog {
    width: min(520px, calc(100% - 32px));
}

.dialog-topbar {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 60px;
    padding: 15px 18px;
    background: rgba(13, 27, 45, 0.96);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
}

.dialog-topbar > span {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 820;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dialog-topbar h2 {
    margin: 2px 0 0;
    font-size: 1.15rem;
    line-height: 1.2;
}

.dialog-eyebrow {
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.dialog-close-button {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    padding: 0;
    place-items: center;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 50%;
    font-size: 1.4rem;
    line-height: 1;
}

.dialog-close-button:hover,
.dialog-close-button:focus-visible {
    color: var(--text);
    border-color: var(--accent);
    outline: none;
}

.detail-dialog-content {
    padding: 22px;
}

.detail-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.detail-identity {
    min-width: 0;
}

.detail-kicker {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.detail-identity h2 {
    margin: 4px 0 14px;
    overflow-wrap: anywhere;
    font-size: clamp(1.9rem, 7vw, 3rem);
    line-height: 1;
    letter-spacing: -0.045em;
}

.detail-price {
    display: grid;
    gap: 2px;
}

.detail-price span {
    color: var(--muted);
    font-size: 0.7rem;
}

.detail-price strong {
    font-size: 1.2rem;
}

.detail-price strong.unavailable {
    color: #6f8198;
}

.detail-signal-badge {
    min-width: 78px;
    padding: 9px 13px;
}

.detail-probability-box {
    margin-top: 22px;
}

.detail-probability-values {
    font-size: 0.9rem;
}

.detail-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.detail-reasons {
    margin-top: 20px;
}

.detail-reasons h3 {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.detail-reason-list li {
    font-size: 0.75rem;
}

.filter-dialog-body {
    display: grid;
    gap: 22px;
    padding: 20px 18px;
}

.filter-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.filter-fieldset legend {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mobile-signal-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.mobile-signal-option {
    min-width: 0;
    height: 42px;
    padding: 0 8px;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 850;
    text-transform: uppercase;
}

.mobile-signal-option.selected {
    color: var(--text);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(98, 167, 255, 0.11);
}

.mobile-signal-option.buy-option.selected {
    color: var(--buy);
    border-color: var(--buy);
    box-shadow: 0 0 0 3px var(--buy-soft);
}

.mobile-signal-option.sell-option.selected {
    color: var(--sell);
    border-color: var(--sell);
    box-shadow: 0 0 0 3px var(--sell-soft);
}

.mobile-signal-option.wait-option.selected {
    color: var(--wait);
    border-color: var(--wait);
    box-shadow: 0 0 0 3px var(--wait-soft);
}

.mobile-sort-options {
    display: grid;
    gap: 8px;
}

.mobile-sort-option {
    position: relative;
    display: block;
}

.mobile-sort-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.mobile-sort-option > span {
    display: grid;
    gap: 2px;
    min-height: 52px;
    padding: 10px 13px 10px 42px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 11px;
}

.mobile-sort-option > span::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 14px;
    width: 15px;
    height: 15px;
    border: 2px solid #62748a;
    border-radius: 50%;
    transform: translateY(-50%);
}

.mobile-sort-option input:checked + span {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(98, 167, 255, 0.1);
}

.mobile-sort-option input:checked + span::before {
    border: 5px solid var(--accent);
}

.mobile-sort-option input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.mobile-sort-option strong {
    font-size: 0.78rem;
}

.mobile-sort-option small {
    color: var(--muted);
    font-size: 0.66rem;
}

.filter-dialog-actions {
    position: sticky;
    bottom: 0;
    z-index: 3;
    display: grid;
    grid-template-columns: minmax(90px, 0.7fr) minmax(150px, 1.3fr);
    gap: 10px;
    padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
    background: rgba(13, 27, 45, 0.97);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(14px);
}

.secondary-dialog-button,
.primary-dialog-button {
    height: 44px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 850;
}

.secondary-dialog-button {
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
}

.primary-dialog-button {
    color: #07111f;
    background: var(--accent);
    border: 1px solid var(--accent);
}

.secondary-dialog-button:hover,
.secondary-dialog-button:focus-visible,
.primary-dialog-button:hover,
.primary-dialog-button:focus-visible {
    filter: brightness(1.08);
    outline: none;
}

@keyframes dialog-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (min-width: 600px) {
    .signal-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 14px;
    }
}

@media (min-width: 1120px) {
    .signal-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 18px;
    }
}

@media (min-width: 1480px) {
    .signal-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (min-width: 1880px) {
    .signal-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .signal-grid {
        margin-top: 10px;
    }

    .app-shell {
        width: min(100% - 20px, 1760px);
        padding-top: 16px;
    }

    .toolbar {
        position: sticky;
        top: 8px;
        z-index: 30;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        padding: 8px;
        background: rgba(10, 22, 39, 0.93);
        border-radius: 12px;
        box-shadow: 0 12px 35px rgba(0, 0, 0, 0.22);
        backdrop-filter: blur(16px);
    }

    .control-search {
        grid-column: auto;
    }

    .control > span:first-child,
    .desktop-filter-control {
        display: none;
    }

    .control input,
    .mobile-filter-button {
        height: 40px;
    }

    .control input {
        font-size: 0.78rem;
    }

    .search-field .search-icon {
        left: 12px;
        width: 16px;
        height: 16px;
    }

    .search-field input {
        padding-left: 36px;
        padding-right: 36px;
    }

    .clear-search-button {
        right: 4px;
    }

    .mobile-filter-button {
        display: inline-flex;
        min-width: 88px;
        padding-inline: 10px;
    }

    .active-filter-chips {
        display: flex;
        grid-column: 1 / -1;
    }

    .signal-card {
        min-height: 142px;
        padding: 11px;
        border-radius: 14px;
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
        transition: border-color 150ms ease, transform 150ms ease;
    }

    .signal-card:hover {
        transform: none;
    }

    .signal-card:active {
        transform: scale(0.985);
    }

    .signal-card::before {
        height: 2px;
    }

    .signal-card::after {
        top: -58px;
        right: -58px;
        width: 128px;
        height: 128px;
    }

    .card-header {
        gap: 6px;
    }

    .symbol {
        overflow: hidden;
        font-size: clamp(0.82rem, 4vw, 1rem);
        line-height: 1.1;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .symbol-caption {
        display: none;
    }

    .signal-badge {
        min-width: 0;
        padding: 4px 6px;
        font-size: 0.56rem;
        letter-spacing: 0.035em;
    }

    .desktop-card-content {
        display: none;
    }

    .compact-card-content {
        position: relative;
        z-index: 1;
        display: flex;
        flex: 1;
        min-height: 0;
        flex-direction: column;
        justify-content: flex-end;
        margin-top: 9px;
    }

    .compact-probability {
        display: grid;
        gap: 0;
        align-content: end;
    }

    .compact-probability > span {
        color: var(--muted);
        font-size: 0.57rem;
        font-weight: 850;
        letter-spacing: 0.08em;
    }

    .compact-probability.up > strong {
        color: var(--buy);
    }

    .compact-probability.down > strong {
        color: var(--sell);
    }

    .compact-probability > strong {
        overflow: hidden;
        font-size: clamp(1.2rem, 7vw, 1.65rem);
        line-height: 1.05;
        letter-spacing: -0.045em;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .compact-price {
        display: block;
        margin-top: 3px;
        overflow: hidden;
        color: #bdcadd;
        font-size: 0.62rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .compact-card-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 5px;
        margin-top: 7px;
        padding-top: 6px;
        color: var(--muted);
        border-top: 1px solid rgba(36, 56, 80, 0.72);
        font-size: 0.58rem;
    }

    .compact-strength {
        overflow: hidden;
        font-weight: 850;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .compact-strength.strong {
        color: var(--signal-color);
    }

    .compact-strength.medium {
        color: var(--wait);
    }

    .compact-strength.weak {
        color: var(--muted);
    }

    .compact-details-hint {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .compact-details-hint span {
        font-size: 0.8rem;
    }

    .app-dialog {
        inset: auto 0 0;
        width: 100%;
        max-width: none;
        max-height: 89dvh;
        margin: 0;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 21px 21px 0 0;
        animation-name: sheet-slide-in;
    }

    .detail-dialog,
    .filter-dialog {
        width: 100%;
    }

    .dialog-topbar {
        min-height: 55px;
        padding: 12px 14px;
    }

    .detail-dialog-content {
        padding: 17px 14px calc(22px + env(safe-area-inset-bottom));
    }

    .detail-hero {
        gap: 12px;
    }

    .detail-identity h2 {
        margin-bottom: 12px;
        font-size: clamp(1.75rem, 11vw, 2.55rem);
    }

    .detail-signal-badge {
        min-width: 70px;
        padding: 8px 10px;
        font-size: 0.68rem;
    }

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

    .filter-dialog-body {
        padding: 17px 14px;
    }

    .filter-dialog-actions {
        padding-right: 14px;
        padding-left: 14px;
    }
}

@media (max-width: 360px) {
    .app-shell {
        width: min(100% - 14px, 1760px);
    }

    .signal-grid {
        gap: 6px;
    }

    .signal-card {
        min-height: 136px;
        padding: 9px;
    }

    .mobile-filter-button {
        min-width: 78px;
        padding-inline: 8px;
    }

    .mobile-filter-button > span:not(.filter-count-badge) {
        display: none;
    }

    .compact-details-hint {
        font-size: 0;
    }

    .compact-details-hint span {
        font-size: 0.82rem;
    }
}

@keyframes sheet-slide-in {
    from {
        opacity: 0;
        transform: translateY(28px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-dialog[open],
    .signal-card,
    .probability-up-bar,
    .refresh-button {
        animation: none;
        transition: none;
    }
}

/* Search control semantics and typography */
.control-label {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 750;
}

.search-field {
    color: var(--text);
    font-size: 1rem;
    font-weight: 400;
}

.search-field input {
    font-size: 0.82rem;
    font-weight: 400;
}

.app-dialog {
    max-height: 86vh;
    max-height: min(86dvh, 850px);
}

@media (max-width: 767px) {
    .control-label {
        display: none;
    }

    .app-dialog {
        max-height: 89vh;
        max-height: 89dvh;
    }
}

.search-field input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

@media (max-width: 767px) {
    .app-dialog[open] {
        animation-name: sheet-slide-in;
    }
}


/* Prevent iOS Safari from zooming the page when the mobile search field receives focus. */
@media (max-width: 767px) {
    .search-field input[type="search"] {
        font-size: 16px;
        line-height: 1.2;
        touch-action: manipulation;
    }
}


/* Language selector */
.language-control select {
    min-height: 43px;
    max-width: 150px;
    padding: 0 34px 0 12px;
    color: var(--text);
    background: rgba(14, 27, 45, 0.9);
    border: 1px solid var(--border);
    border-radius: 999px;
    outline: none;
}
.language-control select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(98, 167, 255, 0.13);
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Symbol icons */
.symbol-with-icon {
    display: flex;
    align-items: center;
    gap: 10px;
}
.symbol-copy { min-width: 0; }
.symbol-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    color: var(--icon-foreground);
    background: var(--icon-background);
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.16), 0 6px 16px rgba(0,0,0,.18);
    font-size: .87rem;
    font-weight: 900;
    letter-spacing: -.02em;
}
.detail-symbol-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.detail-symbol-row h2 { margin: 0; }
.detail-symbol-icon {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    font-size: 1rem;
}

html[dir="rtl"] .topbar-actions,
html[dir="rtl"] .card-header,
html[dir="rtl"] .price-row,
html[dir="rtl"] .probability-values,
html[dir="rtl"] .footer {
    direction: rtl;
}

@media (max-width: 640px) {
    .topbar-actions { gap: 7px; }
    .language-control select {
        max-width: 112px;
        min-height: 38px;
        padding-inline: 9px 26px;
        font-size: .75rem;
    }
    .symbol-icon {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
        font-size: .72rem;
    }
    .symbol-with-icon { gap: 7px; }
}

/* Footer controls, inactive markets, and terms dialog (v1.4.0) */
.footer {
    align-items: center;
    gap: 10px 18px;
}

.footer-info {
    display: flex;
    min-width: 0;
    flex: 1 1 360px;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px 16px;
}

.footer-info > span {
    max-width: 100%;
    flex: 0 0 auto;
    white-space: nowrap;
}

.footer-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-inline-start: auto;
}

.footer-action-button {
    min-height: 36px;
    padding: 0 12px;
    color: #c6d3e4;
    background: rgba(14, 27, 45, 0.82);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 760;
    white-space: nowrap;
    transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.footer-action-button:hover,
.footer-action-button:focus-visible {
    color: var(--text);
    background: var(--surface-2);
    border-color: var(--accent);
    outline: none;
}

.footer-language-control {
    display: inline-flex;
    flex: 0 0 auto;
}

.footer-language-control select {
    min-height: 36px;
    max-width: 145px;
    padding-inline: 11px 31px;
    font-size: 0.72rem;
}

.signal-card.inactive,
.detail-dialog.inactive {
    --signal-color: #71849d;
    --signal-soft: rgba(113, 132, 157, 0.14);
}

.signal-card.inactive {
    background: linear-gradient(150deg, rgba(24, 38, 57, 0.96), rgba(11, 23, 38, 0.98));
}

.signal-card.inactive .symbol-icon {
    opacity: 0.78;
    filter: saturate(0.55);
}

.inactive-card-content {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 24px 8px 10px;
    color: var(--muted);
    text-align: center;
}

.inactive-status-icon {
    width: 34px;
    height: 34px;
    color: #8fa1b8;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
}

.inactive-card-content strong {
    color: #d5deea;
    font-size: 0.95rem;
}

.inactive-card-content p {
    max-width: 250px;
    margin: 0;
    font-size: 0.72rem;
}

.inactive-details-hint {
    margin-top: 5px;
    color: #a8b7ca;
    font-size: 0.68rem;
    font-weight: 760;
}

.inactive-detail-panel {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-top: 22px;
    padding: 18px;
    color: var(--muted);
    background: rgba(113, 132, 157, 0.08);
    border: 1px solid rgba(113, 132, 157, 0.25);
    border-radius: 14px;
}

.detail-inactive-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
}

.inactive-detail-panel h3 {
    margin: 0 0 5px;
    color: var(--text);
    font-size: 1rem;
}

.inactive-detail-panel p {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.65;
}

.terms-dialog {
    width: min(790px, calc(100% - 32px));
}

.terms-dialog-content {
    display: grid;
    gap: 22px;
    padding: 22px;
}

.terms-intro-panel {
    padding: 16px 17px;
    color: #c9d5e4;
    background: rgba(98, 167, 255, 0.08);
    border: 1px solid rgba(98, 167, 255, 0.2);
    border-radius: 13px;
}

.terms-intro-panel p {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.7;
}

.terms-section h3 {
    margin: 0 0 12px;
    color: var(--text);
    font-size: 0.96rem;
}

.terms-parameter-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.terms-parameter-item {
    min-width: 0;
    padding: 13px 14px;
    background: rgba(7, 17, 31, 0.38);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.terms-parameter-item h4 {
    margin: 0 0 5px;
    color: #dce6f2;
    font-size: 0.76rem;
}

.terms-parameter-item p {
    margin: 0;
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1.58;
}

.terms-risk-panel {
    padding: 17px;
    background: rgba(244, 188, 78, 0.07);
    border: 1px solid rgba(244, 188, 78, 0.25);
    border-radius: 14px;
}

.terms-risk-panel ul {
    display: grid;
    gap: 9px;
    margin: 0;
    padding-inline-start: 20px;
    color: #c8d3e1;
}

.terms-risk-panel li {
    padding-inline-start: 2px;
    font-size: 0.72rem;
    line-height: 1.62;
}

.terms-acknowledgement {
    margin: 14px 0 0;
    padding-top: 13px;
    color: #e4eaf2;
    border-top: 1px solid rgba(244, 188, 78, 0.2);
    font-size: 0.74rem;
    font-weight: 720;
    line-height: 1.6;
}

html[dir="rtl"] .footer-info,
html[dir="rtl"] .footer-actions,
html[dir="rtl"] .inactive-detail-panel {
    direction: rtl;
}

@media (max-width: 767px) {
    .inactive-card-content {
        align-items: flex-start;
        justify-content: flex-start;
        gap: 3px;
        padding: 8px 0 0;
        text-align: start;
    }

    .inactive-status-icon {
        width: 20px;
        height: 20px;
    }

    .inactive-card-content strong {
        overflow: hidden;
        max-width: 100%;
        font-size: 0.68rem;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .inactive-card-content p {
        display: -webkit-box;
        overflow: hidden;
        max-width: 100%;
        font-size: 0.56rem;
        line-height: 1.35;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .inactive-details-hint {
        align-self: flex-end;
        margin-top: auto;
        font-size: 0.56rem;
    }

    .terms-dialog-content {
        gap: 17px;
        padding: 17px 14px calc(22px + env(safe-area-inset-bottom));
    }

    .terms-parameter-list {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .terms-intro-panel,
    .terms-risk-panel {
        padding: 14px;
    }

    .terms-intro-panel p {
        font-size: 0.76rem;
    }
}

@media (max-width: 540px) {
    .footer {
        align-items: flex-start;
    }

    .footer-info {
        flex-basis: 100%;
        width: 100%;
    }

    .footer-actions {
        width: 100%;
        justify-content: space-between;
        margin-inline-start: 0;
    }

    .footer-language-control select {
        max-width: 125px;
    }
}

/* Footer alignment, real market logos, and dialog refinements (v1.4.1) */
.footer-info {
    justify-content: flex-start;
}

#lastUpdatedText {
    margin-inline-start: auto;
    text-align: end;
}

.footer-action-button,
.footer-language-control {
    height: 38px;
    min-height: 38px;
}

.footer-language-control {
    position: relative;
    display: grid;
    min-width: 138px;
    grid-template-columns: 18px minmax(0, 1fr) 14px;
    align-items: center;
    gap: 7px;
    padding-inline: 11px 9px;
    color: #c6d3e4;
    background: rgba(14, 27, 45, 0.82);
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.footer-language-control:hover,
.footer-language-control:focus-within {
    color: var(--text);
    background: var(--surface-2);
    border-color: var(--accent);
}

.footer-language-control select,
.language-control.footer-language-control select {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-width: none;
    padding: 0;
    color: inherit;
    background: transparent;
    border: 0;
    border-radius: 0;
    outline: 0;
    appearance: none;
    -webkit-appearance: none;
    font-size: 0.72rem;
    font-weight: 760;
}

.footer-language-control select:focus {
    border: 0;
    box-shadow: none;
}

.language-control-icon,
.language-control-chevron {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.language-control-chevron {
    width: 14px;
    height: 14px;
}

.symbol-icon {
    overflow: hidden;
    padding: 6px;
    color: transparent;
    background: var(--icon-background);
    border: 1px solid rgba(255, 255, 255, 0.13);
}

.symbol-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.detail-symbol-icon {
    padding: 8px;
}

.terms-dialog {
    inset: 0;
    width: min(720px, calc(100% - 32px));
    margin: auto;
}

html[dir="rtl"] #lastUpdatedText {
    text-align: start;
}

@media (max-width: 767px) {
    .terms-dialog {
        inset: auto 0 0;
        width: 100%;
        max-width: none;
        margin: 0;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 21px 21px 0 0;
    }

    .symbol-icon {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
        padding: 5px;
    }

    .detail-symbol-icon {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
        padding: 7px;
    }
}

@media (max-width: 540px) {
    .footer-info {
        justify-content: space-between;
    }

    .footer-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .footer-action-button,
    .footer-language-control {
        width: 100%;
        min-width: 0;
        height: 40px;
        min-height: 40px;
    }

    .footer-language-control {
        grid-template-columns: 18px minmax(0, 1fr) 14px;
        padding-inline: 11px 9px;
    }

    .footer-language-control select,
    .language-control.footer-language-control select {
        font-size: 0.72rem;
    }
}

@media (max-width: 360px) {
    #lastUpdatedText {
        width: 100%;
        flex-basis: 100%;
        margin-inline-start: 0;
        text-align: end;
    }
}

/* Stable local logos, compact footer language control, and native select fixes (v1.4.2) */
.desktop-filter-control select {
    appearance: none;
    -webkit-appearance: none;
    color-scheme: dark;
    padding-inline-end: 42px;
    background-color: var(--surface-2);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2391a3ba' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 9 5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    background-size: 16px 16px;
    background-clip: padding-box;
}

.desktop-filter-control select:hover {
    color: var(--text);
    background-color: var(--surface-3);
    border-color: #36516f;
}

.desktop-filter-control select::-ms-expand {
    display: none;
}

.desktop-filter-control select option {
    color: var(--text);
    background-color: var(--surface-2);
}

html[dir="rtl"] .desktop-filter-control select {
    padding-inline: 42px 13px;
    background-position: left 13px center;
}

.footer-language-control select option {
    color: #111827;
    background-color: #ffffff;
}

.symbol-logo {
    backface-visibility: hidden;
    transform: translateZ(0);
}

@media (max-width: 540px) {
    .footer-actions {
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .footer-action-button,
    .footer-language-control {
        width: auto;
        min-width: 0;
        height: 40px;
        min-height: 40px;
        flex: 0 0 auto;
    }

    .footer-action-button {
        justify-self: flex-start;
        padding-inline: 12px;
    }

    .footer-language-control {
        display: inline-flex;
        justify-self: flex-end;
        align-items: center;
        gap: 7px;
        margin-inline-start: auto;
        padding-inline: 11px 9px;
    }

    .footer-language-control select,
    .language-control.footer-language-control select {
        width: auto;
        min-width: 0;
        max-width: 126px;
        flex: 0 0 auto;
        font-size: 0.72rem;
    }
}

/* Custom language menu and desktop footer alignment (v1.4.3) */
.footer-info {
    justify-content: flex-start;
}

#lastUpdatedText {
    margin-inline-start: 0;
    text-align: start;
}

.footer-actions {
    overflow: visible;
}

.language-picker {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    z-index: 30;
}

.language-button {
    display: inline-flex;
    width: auto;
    min-width: 0;
    height: 38px;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 10px 0 11px;
    color: #c6d3e4;
    background: rgba(14, 27, 45, 0.82);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 760;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: color 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.language-button > * {
    pointer-events: none;
}

.language-button:hover,
.language-button:focus-visible,
.language-picker.is-open .language-button {
    color: var(--text);
    background: var(--surface-2);
    border-color: var(--accent);
    outline: none;
}

.language-button:focus-visible {
    box-shadow: 0 0 0 3px rgba(98, 167, 255, 0.13);
}

.language-button-text {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.language-picker .language-control-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.language-picker .language-control-chevron {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    transition: transform 150ms ease;
}

.language-picker.is-open .language-control-chevron {
    transform: rotate(180deg);
}

.language-menu {
    position: absolute;
    inset-inline-end: 0;
    bottom: calc(100% + 9px);
    width: max-content;
    min-width: 178px;
    max-width: min(240px, calc(100vw - 28px));
    max-height: min(360px, 70vh);
    padding: 6px;
    overflow-x: hidden;
    overflow-y: auto;
    color: var(--text);
    background: #0d1b2d;
    border: 1px solid #2a405d;
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.46), 0 0 0 1px rgba(255, 255, 255, 0.025) inset;
    z-index: 1000;
    color-scheme: dark;
}

.language-menu-option {
    display: flex;
    width: 100%;
    min-height: 39px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 10px;
    color: #c7d3e3;
    background: transparent;
    border: 0;
    border-radius: 9px;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 680;
    line-height: 1.25;
    text-align: start;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.language-menu-option:hover,
.language-menu-option:focus-visible {
    color: #ffffff;
    background: rgba(98, 167, 255, 0.13);
    outline: none;
}

.language-menu-option.is-selected {
    color: #ffffff;
    background: rgba(98, 167, 255, 0.18);
}

.language-menu-option svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    fill: none;
    stroke: var(--accent);
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0;
}

.language-menu-option.is-selected svg {
    opacity: 1;
}

html[dir="rtl"] .language-menu-option {
    text-align: start;
}

@media (max-width: 540px) {
    .footer-info {
        justify-content: space-between;
    }

    #lastUpdatedText {
        margin-inline-start: auto;
        text-align: end;
    }

    .footer-actions {
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .language-picker {
        width: auto;
        min-width: 0;
        margin-inline-start: auto;
    }

    .footer-action-button,
    .language-button {
        width: auto;
        min-width: 0;
        height: 40px;
        min-height: 40px;
        flex: 0 0 auto;
    }

    .language-button {
        max-width: 170px;
        padding-inline: 11px 9px;
    }

    .language-menu {
        max-width: calc(100vw - 28px);
    }
}

@media (max-width: 360px) {
    #lastUpdatedText {
        width: 100%;
        flex-basis: 100%;
        margin-inline-start: 0;
        text-align: end;
    }
}
