:root {
    --primary: #7c3aed;
    --primary-hover: #8b5cf6;
    --bg-dark: #0f172a;
    --surface-dark: #1e293b;
    --surface-dark-hover: #273449;
    --bg-light: #f4f6fb;
    --surface-light: #ffffff;
    --text-light: #ffffff;
    --text-dark: #1e293b;
    --text-secondary: #94a3b8;
    --border-dark: rgba(255, 255, 255, 0.08);
    --border-light: rgba(15, 23, 42, 0.08);
    --shadow-card-dark: 0 8px 32px rgba(0, 0, 0, 0.25);
    --shadow-card-light: 0 8px 32px rgba(15, 23, 42, 0.08);
    --color-danger: #b42318;
    --color-success: #057a55;
    --promo-success: #16a34a;
    --promo-success-soft: rgba(22, 163, 74, 0.18);
    --promo-success-track: rgba(22, 163, 74, 0.28);
    --promo-danger: #dc2626;
    --promo-danger-soft: rgba(220, 38, 38, 0.18);
    --promo-danger-track: rgba(220, 38, 38, 0.24);
}

:root,
[data-theme="dark"] {
    --color-bg: var(--bg-dark);
    --color-surface: var(--surface-dark);
    --color-surface-muted: var(--surface-dark-hover);
    --color-border: var(--border-dark);
    --color-text: var(--text-light);
    --color-text-secondary: var(--text-secondary);
    --color-accent: var(--primary);
    --color-accent-hover: var(--primary-hover);
    --color-accent-soft: rgba(124, 58, 237, 0.16);
    --color-field-bg: rgba(15, 23, 42, 0.36);
    --color-field-border: rgba(148, 163, 184, 0.22);
    --promo-success-text: #86efac;
    --promo-danger-text: #fca5a5;
    --shadow-card: var(--shadow-card-dark);
    --color-topbar: rgba(15, 23, 42, 0.72);
    color-scheme: dark;
}

[data-theme="light"] {
    --color-bg: var(--bg-light);
    --color-surface: var(--surface-light);
    --color-surface-muted: #f8fafc;
    --color-border: var(--border-light);
    --color-text: var(--text-dark);
    --color-text-secondary: #64748b;
    --color-accent: var(--primary);
    --color-accent-hover: var(--primary-hover);
    --color-accent-soft: rgba(124, 58, 237, 0.1);
    --color-field-bg: #ffffff;
    --color-field-border: #d8e0ea;
    --promo-success-text: #057a55;
    --promo-danger-text: #b42318;
    --shadow-card: var(--shadow-card-light);
    --color-topbar: rgba(255, 255, 255, 0.82);
    color-scheme: light;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
    font: inherit;
}

.app-page {
    width: 100%;
    min-height: 100vh;
    padding: 0 clamp(14px, 2.4vw, 46px) clamp(14px, 2vh, 28px);
    overflow-x: hidden;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 12;
    display: flex;
    align-items: center;
    gap: clamp(14px, 1.6vw, 22px);
    min-height: clamp(66px, 8vh, 82px);
    margin: 0 calc(clamp(14px, 2.4vw, 46px) * -1) clamp(16px, 2.4vh, 34px);
    padding: clamp(8px, 1.2vh, 12px) clamp(14px, 2.4vw, 46px);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-topbar);
    backdrop-filter: blur(18px) saturate(1.12);
    -webkit-backdrop-filter: blur(18px) saturate(1.12);
}

.brand-block {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    min-width: 0;
    width: clamp(252px, 22vw, 320px);
    padding: clamp(7px, 1vh, 10px) 14px clamp(7px, 1vh, 10px) 10px;
    border: 1px solid rgba(124, 58, 237, 0.56);
    border-radius: 18px;
    background: rgba(124, 58, 237, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.brand-mark {
    width: clamp(44px, 5.2vh, 52px);
    height: clamp(44px, 5.2vh, 52px);
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #8b5cf6, #38bdf8);
    color: #ffffff;
    font-size: 18px;
    font-weight: 900;
}

.brand-block strong,
.brand-block span {
    display: block;
}

.brand-block strong {
    font-size: 18px;
    line-height: 1.18;
    overflow-wrap: anywhere;
}

.brand-block span {
    margin-top: 2px;
    color: var(--color-text-secondary);
    font-size: 13px;
    font-weight: 700;
}

.page-switcher {
    display: inline-flex;
    align-items: center;
    flex: 1 1 auto;
    gap: 6px;
    min-width: 0;
    max-width: max-content;
    overflow-x: auto;
    padding: 5px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: var(--color-surface);
    scrollbar-width: none;
}

.page-switcher::-webkit-scrollbar {
    display: none;
}

.page-switcher-button {
    flex: 0 0 auto;
    min-height: clamp(38px, 4.8vh, 44px);
    padding: 0 22px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    font-weight: 900;
}

.page-switcher-button.active {
    background: var(--color-accent-soft);
    color: var(--color-text);
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.18);
}

.page-switcher-button:hover {
    background: var(--color-surface-muted);
}

.topbar-theme-toggle {
    margin-left: auto;
}

.start-dashboard {
    display: grid;
    gap: clamp(14px, 2vh, 22px);
}

.start-dashboard[hidden],
.directory-view[hidden] {
    display: none;
}

.dashboard-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding-top: clamp(4px, 0.8vh, 12px);
}

.dashboard-heading h1 {
    margin: 0;
    font-size: clamp(34px, min(4vw, 7vh), 58px);
    line-height: 1.05;
}

.dashboard-heading p {
    margin: clamp(6px, 1vh, 12px) 0 0;
    color: var(--color-text-secondary);
    font-size: clamp(16px, min(1.5vw, 2.8vh), 24px);
    font-weight: 700;
}

.dashboard-updated {
    margin-top: clamp(4px, 1vh, 12px);
    color: var(--color-text-secondary);
    font-weight: 800;
    white-space: nowrap;
}

.dashboard-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(14px, 2vh, 22px);
}

.dashboard-card {
    min-height: clamp(154px, 24vh, 220px);
    display: grid;
    align-content: space-between;
    gap: clamp(10px, 1.8vh, 24px);
    padding: clamp(18px, 3vh, 30px) clamp(20px, 2.4vw, 32px);
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
}

.dashboard-card-title {
    display: flex;
    align-items: center;
    gap: clamp(10px, 1.4vw, 16px);
    min-width: 0;
}

.dashboard-card-title strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: clamp(18px, min(1.5vw, 3vh), 26px);
    line-height: 1.18;
}

.dashboard-card-icon {
    flex: 0 0 auto;
    width: clamp(46px, 6vh, 58px);
    height: clamp(46px, 6vh, 58px);
    display: grid;
    place-items: center;
    border-radius: 16px;
    font-weight: 900;
}

.dashboard-card-icon--violet {
    background: rgba(124, 58, 237, 0.16);
    color: #a78bfa;
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.42);
}

.dashboard-card-icon--blue {
    background: rgba(59, 130, 246, 0.16);
    color: #93c5fd;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.36);
}

.dashboard-card-icon--teal {
    background: rgba(20, 184, 166, 0.16);
    color: #5eead4;
    box-shadow: inset 0 0 0 1px rgba(20, 184, 166, 0.32);
}

.dashboard-card-icon--green {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.34);
}

.dashboard-card-icon--cyan {
    background: rgba(14, 165, 233, 0.16);
    color: #67e8f9;
    box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.34);
}

.dashboard-card-icon--amber {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.34);
}

.dashboard-card-value {
    font-size: clamp(44px, min(4.7vw, 8vh), 72px);
    line-height: 0.95;
    font-weight: 950;
}

.dashboard-card p {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: clamp(15px, min(1.25vw, 2.6vh), 22px);
    font-weight: 700;
}

.positions-panel {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
}

.positions-header {
    padding: 20px 22px;
    border-bottom: 1px solid var(--color-border);
}

.one-c-points-header-row,
.positions-title-row,
.rms-list-controls,
.search-combo,
.pagination-row,
.modal-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.one-c-points-header-row {
    justify-content: space-between;
    flex-wrap: wrap;
}

.positions-title-row h1 {
    margin: 0;
    font-size: 24px;
    line-height: 1.2;
}

.counter {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--color-accent-soft);
    color: var(--color-accent);
    font-weight: 700;
}

.one-c-points-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--color-text-secondary);
    font-size: 13px;
    font-weight: 700;
}

.one-c-points-view-toggle__options {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface-muted);
}

.one-c-points-view-toggle__options button,
.secondary-action,
.primary-action {
    min-height: 34px;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
}

.one-c-points-view-toggle__options button {
    padding: 6px 12px;
    background: transparent;
    color: var(--color-text-secondary);
}

.one-c-points-view-toggle__options button.active,
.primary-action {
    background: var(--color-accent);
    color: #ffffff;
}

.theme-toggle {
    position: relative;
    width: 78px;
    height: 40px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
        rgba(15, 23, 42, 0.52);
    color: var(--color-text-secondary);
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.22);
    backdrop-filter: blur(16px) saturate(1.12);
    -webkit-backdrop-filter: blur(16px) saturate(1.12);
    outline: none;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(139, 92, 246, 0.42);
    background:
        linear-gradient(135deg, rgba(139, 92, 246, 0.16), rgba(14, 165, 233, 0.08)),
        rgba(15, 23, 42, 0.62);
    box-shadow: 0 18px 38px rgba(2, 6, 23, 0.3);
}

.theme-toggle:focus-visible {
    border-color: rgba(139, 92, 246, 0.72);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.22), 0 18px 38px rgba(2, 6, 23, 0.3);
}

.theme-icon {
    position: relative;
    z-index: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 14px;
    line-height: 1;
    color: var(--color-text-secondary);
    transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

[data-theme="dark"] .theme-icon.moon,
[data-theme="light"] .theme-icon.sun {
    color: #ffffff;
    background:
        radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.46), transparent 36%),
        linear-gradient(135deg, #6d28d9, #8b5cf6 62%, #0ea5e9);
    box-shadow: 0 9px 20px rgba(124, 58, 237, 0.34);
    transform: scale(1.02);
}

html[data-theme="light"] .theme-toggle {
    border-color: rgba(148, 163, 184, 0.28);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(248, 250, 252, 0.68)),
        rgba(255, 255, 255, 0.72);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .theme-toggle:hover {
    border-color: rgba(124, 58, 237, 0.36);
    background:
        linear-gradient(135deg, rgba(250, 245, 255, 0.94), rgba(239, 246, 255, 0.76)),
        rgba(255, 255, 255, 0.82);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.14);
}

html[data-theme="light"] .theme-icon {
    color: #64748b;
}

.secondary-action {
    padding: 7px 12px;
    border-color: var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
}

.stats-grid.one-c-points-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 18px 22px 0;
}

.stat-card {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface-muted);
    padding: 14px;
}

.one-c-points-stat-card div {
    display: grid;
    gap: 3px;
}

.one-c-points-stat-card span,
.one-c-points-stat-card small {
    color: var(--color-text-secondary);
    font-size: 13px;
}

.one-c-points-stat-card strong {
    font-size: 26px;
}

.one-c-points-controls {
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 18px 22px;
}

.search-combo {
    flex: 1 1 520px;
}

.search-field {
    position: relative;
}

.id-search-field {
    width: 150px;
}

.name-search-field {
    flex: 1 1 auto;
}

.search-input,
.filter-select,
.page-size-select {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-field-bg);
    color: var(--color-text);
    padding: 8px 11px;
}

.search-clear-button {
    position: absolute;
    top: 50%;
    right: 8px;
    width: 24px;
    height: 24px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 50%;
    background: var(--color-surface-muted);
    color: var(--color-text-secondary);
    cursor: pointer;
}

.one-c-points-currency-filter {
    width: 220px;
}

.rms-status-filter {
    position: relative;
}

.rms-status-filter-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 10;
    display: grid;
    gap: 10px;
    width: 210px;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.14);
}

.checkbox-row,
.switch-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.switch-row {
    cursor: pointer;
    color: var(--color-text-secondary);
    font-size: 13px;
    font-weight: 850;
}

.positions-table {
    width: 100%;
    overflow-x: auto;
    border-top: 1px solid var(--color-border);
}

.one-c-points-table-head,
.one-c-points-table-row {
    display: grid;
    grid-template-columns:
        70px
        minmax(84px, 0.65fr)
        minmax(190px, 1.8fr)
        minmax(140px, 1fr)
        minmax(120px, 0.9fr)
        minmax(82px, 0.55fr)
        minmax(82px, 0.55fr)
        minmax(160px, 1.15fr)
        minmax(112px, 0.75fr);
    column-gap: 10px;
    align-items: center;
    width: 100%;
    min-width: min(1120px, calc(100vw - 20px));
}

.one-c-points-table-head {
    padding: 14px 18px;
    color: var(--color-text-secondary);
    border-bottom: 1px solid var(--color-border);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.one-c-points-table-row {
    min-height: 58px;
    padding: 0 18px;
    border-bottom: 1px solid var(--color-border);
}

.one-c-points-table-row--deleted {
    color: var(--color-text-secondary);
    opacity: 0.62;
}

.one-c-points-table-head > *,
.one-c-points-table-row > * {
    min-width: 0;
}

.one-c-points-table-row > div,
.one-c-points-table-row > label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.one-c-point-roll-button {
    width: 100%;
    min-height: 38px;
    padding: 8px 12px;
    overflow: hidden;
    border: 1px solid rgba(37, 99, 235, 0.22);
    border-radius: 6px;
    background: var(--color-accent-soft);
    color: inherit;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.one-c-point-roll-button:hover {
    border-color: rgba(37, 99, 235, 0.5);
}

.switch-row input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.switch-control {
    position: relative;
    width: 42px;
    height: 24px;
    flex: 0 0 auto;
    border: 1px solid rgba(220, 38, 38, 0.4);
    border-radius: 999px;
    background: var(--promo-danger-track);
    transition: border-color 0.18s ease, background 0.18s ease;
}

.switch-control__thumb {
    position: absolute;
    top: 50%;
    left: 4px;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: var(--promo-danger);
    box-shadow: 0 4px 10px rgba(2, 6, 23, 0.22);
    transition: left 0.18s ease, background 0.18s ease;
}

.switch-row input[type="checkbox"]:checked + .switch-control {
    border-color: rgba(22, 163, 74, 0.5);
    background: var(--promo-success-track);
}

.switch-row input[type="checkbox"]:checked + .switch-control .switch-control__thumb {
    left: 20px;
    background: var(--promo-success);
}

.switch-row input[type="checkbox"]:focus-visible + .switch-control {
    box-shadow: 0 0 0 3px rgba(5, 122, 85, 0.22);
}

html[data-theme="light"] .switch-control {
    border-color: rgba(180, 35, 24, 0.62);
    background: var(--promo-danger-track);
}

html[data-theme="light"] .switch-control__thumb {
    background: var(--promo-danger);
}

html[data-theme="light"] .switch-row input[type="checkbox"]:checked + .switch-control {
    border-color: rgba(22, 163, 74, 0.5);
    background: var(--promo-success-track);
}

html[data-theme="light"] .switch-row input[type="checkbox"]:checked + .switch-control .switch-control__thumb {
    background: var(--promo-success);
}

.switch-row input[type="checkbox"]:disabled + .switch-control,
.switch-row input[type="checkbox"]:disabled ~ .switch-row__text {
    cursor: progress;
    opacity: 0.58;
}

.positions-table-empty {
    min-width: 980px;
    padding: 42px 18px;
    color: var(--color-text-secondary);
    text-align: center;
}

.one-c-points-empty-state {
    display: grid;
    gap: 8px;
}

.one-c-points-empty-state strong {
    color: var(--color-text);
}

.pagination-row {
    justify-content: space-between;
    padding: 16px 22px;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pagination button {
    min-width: 34px;
    min-height: 34px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-field-bg);
    color: var(--color-text);
    cursor: pointer;
}

.pagination button.active {
    background: var(--color-accent);
    color: #ffffff;
}

.page-size-select {
    width: 160px;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.38);
}

.modal-overlay[hidden] {
    display: none;
}

.modal-card {
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100vh - 36px);
    overflow: hidden;
    border-radius: 8px;
    background: var(--color-surface);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h2,
.modal-header p {
    margin: 0;
}

.modal-header p {
    margin-top: 4px;
    color: var(--color-text-secondary);
}

.modal-close-button {
    width: 32px;
    height: 32px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-field-bg);
    color: var(--color-text);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.one-c-point-roll-modal-body {
    display: grid;
    gap: 16px;
    padding: 18px 20px;
}

.one-c-point-roll-search {
    display: grid;
    gap: 8px;
    color: var(--color-text-secondary);
    font-size: 13px;
    font-weight: 700;
}

.one-c-point-roll-list {
    display: grid;
    gap: 8px;
    max-height: min(52vh, 440px);
    overflow-y: auto;
    padding-right: 4px;
}

.one-c-point-roll-option {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.one-c-point-roll-option:hover,
.one-c-point-roll-option.active {
    border-color: rgba(37, 99, 235, 0.6);
    background: var(--color-accent-soft);
}

.one-c-point-roll-option small {
    display: block;
    margin-top: 4px;
    color: var(--color-text-secondary);
    font-size: 12px;
}

.modal-actions {
    justify-content: flex-end;
    padding: 16px 20px;
    border-top: 1px solid var(--color-border);
}

.toast-stack {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 30;
    display: grid;
    gap: 10px;
}

.toast {
    width: min(360px, calc(100vw - 36px));
    padding: 12px 14px;
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-accent);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.16);
}

.toast span {
    color: var(--color-text-secondary);
}

.toast strong {
    display: block;
    margin-bottom: 3px;
}

.toast.error {
    border-left-color: var(--promo-danger);
}

.toast.success {
    border-left-color: var(--promo-success);
}

.broker-panel {
    display: grid;
    gap: 18px;
}

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

.broker-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-top: clamp(4px, 0.8vh, 12px);
}

.broker-section-heading h1 {
    margin: 0;
    font-size: clamp(34px, min(4vw, 7vh), 52px);
    line-height: 1.05;
}

.broker-section-heading p {
    margin: 8px 0 0;
    color: var(--color-text-secondary);
    font-size: clamp(15px, min(1.35vw, 2.6vh), 22px);
    font-weight: 700;
}

.section-pill {
    flex: 0 0 auto;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-accent-soft);
    color: var(--color-accent-hover);
    font-weight: 900;
}

.section-pill--danger {
    background: rgba(180, 35, 24, 0.14);
    color: #fca5a5;
}

.broker-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
}

.broker-table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
}

.broker-table th,
.broker-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

.broker-table th {
    color: var(--color-text-secondary);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.broker-table td {
    font-size: 14px;
    font-weight: 700;
}

.broker-table small {
    display: block;
    max-width: 420px;
    margin-top: 4px;
    overflow: hidden;
    color: var(--color-text-secondary);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--color-surface-muted);
    color: var(--color-text-secondary);
    font-size: 12px;
    font-weight: 900;
}

.status-pill--success {
    background: var(--promo-success-soft);
    color: var(--promo-success-text);
}

.status-pill--danger {
    background: var(--promo-danger-soft);
    color: var(--promo-danger-text);
}

.status-pill--processing {
    background: rgba(14, 165, 233, 0.16);
    color: #67e8f9;
}

.error-cell {
    max-width: 360px;
}

.table-action-cell {
    width: 58px;
    text-align: right;
}

.resolve-alert-button {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(5, 122, 85, 0.28);
    border-radius: 8px;
    background: rgba(5, 122, 85, 0.14);
    color: #86efac;
    cursor: pointer;
    font-weight: 900;
}

.resolve-alert-button:disabled {
    cursor: progress;
    opacity: 0.62;
}

.faq-section {
    align-content: start;
}

.faq-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
}

.faq-nav a {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    padding: 0 13px;
    border-radius: 6px;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 900;
}

.faq-nav a:hover,
.faq-nav a:focus-visible {
    background: var(--color-accent-soft);
    color: var(--color-accent-hover);
    outline: none;
}

.faq-grid {
    display: grid;
    gap: 16px;
}

.faq-chapter {
    display: grid;
    gap: 14px;
    padding: clamp(16px, 2vw, 22px);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
    scroll-margin-top: 96px;
}

.faq-chapter__heading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.faq-chapter__badge {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--color-accent-soft);
    color: var(--color-accent-hover);
    font-weight: 950;
}

.faq-chapter h3,
.faq-chapter p {
    margin: 0;
}

.faq-chapter h3 {
    font-size: 20px;
    line-height: 1.2;
}

.faq-chapter__heading p {
    margin-top: 4px;
    color: var(--color-text-secondary);
    font-weight: 700;
}

.faq-stack {
    display: grid;
    gap: 10px;
}

.faq-item {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface-muted);
}

.faq-item summary {
    padding: 14px 16px;
    cursor: pointer;
    font-weight: 950;
}

.faq-item p,
.faq-item ul {
    margin: 0;
    padding: 0 16px 14px;
    color: var(--color-text-secondary);
    font-weight: 700;
    line-height: 1.55;
}

.faq-item pre {
    margin: 0 16px 16px;
    overflow-x: auto;
    padding: 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.42);
    color: var(--color-text);
}

.faq-item code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.faq-status-list {
    display: grid;
    gap: 8px;
    list-style: none;
}

@media (max-width: 900px) {
    .app-page {
        padding: 0 12px 12px;
    }

    .app-topbar,
    .dashboard-heading,
    .broker-section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .app-topbar {
        margin: 0 -12px 22px;
        padding: 12px;
    }

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

    .page-switcher {
        width: 100%;
        max-width: none;
    }

    .page-switcher-button {
        flex: 1 1 0;
        padding: 0 12px;
    }

    .topbar-theme-toggle {
        margin-left: 0;
    }

    .dashboard-card-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-card {
        min-height: 190px;
        padding: 24px;
    }

    .one-c-points-header-row,
    .one-c-points-controls,
    .search-combo,
    .pagination-row {
        align-items: stretch;
        flex-direction: column;
    }

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

    .positions-header,
    .one-c-points-controls,
    .pagination-row {
        padding-left: 14px;
        padding-right: 14px;
    }

    .id-search-field,
    .one-c-points-currency-filter,
    .page-size-select {
        width: 100%;
    }
}

@media (max-height: 820px) and (min-width: 901px) {
    .app-page {
        padding-left: clamp(18px, 2.2vw, 36px);
        padding-right: clamp(18px, 2.2vw, 36px);
        padding-bottom: 12px;
    }

    .app-topbar {
        min-height: 64px;
        margin-right: calc(clamp(18px, 2.2vw, 36px) * -1);
        margin-bottom: 16px;
        margin-left: calc(clamp(18px, 2.2vw, 36px) * -1);
        padding-top: 8px;
        padding-bottom: 8px;
        padding-left: clamp(18px, 2.2vw, 36px);
        padding-right: clamp(18px, 2.2vw, 36px);
    }

    .brand-block {
        min-width: 250px;
    }

    .brand-mark {
        width: 44px;
        height: 44px;
    }

    .brand-block strong {
        font-size: 16px;
    }

    .brand-block span {
        font-size: 12px;
    }

    .page-switcher-button {
        min-height: 38px;
        padding: 0 18px;
    }

    .theme-toggle {
        width: 70px;
        height: 36px;
    }

    .theme-icon {
        width: 26px;
        height: 26px;
    }

    .start-dashboard {
        gap: 14px;
    }

    .dashboard-heading h1 {
        font-size: 40px;
    }

    .dashboard-heading p {
        margin-top: 6px;
        font-size: 17px;
    }

    .dashboard-updated {
        margin-top: 6px;
    }

    .dashboard-card-grid {
        gap: 14px;
    }

    .dashboard-card {
        min-height: 160px;
        padding: 18px 22px;
        gap: 10px;
    }

    .dashboard-card-icon {
        width: 46px;
        height: 46px;
        border-radius: 13px;
    }

    .dashboard-card-title strong {
        font-size: 19px;
    }

    .dashboard-card-value {
        font-size: 52px;
    }

    .dashboard-card p {
        font-size: 15px;
    }
}
