@import url("/web/common-buttons.css");

:root {
    /* 参考 Notion：改为更中性的纸面背景与细边框体系。 */
    --bg: #fbfbfa;
    --bg-accent: linear-gradient(180deg, #fbfbfa 0%, #f7f7f5 100%);
    --card: rgba(255, 255, 255, 0.96);
    --card-strong: #ffffff;
    --border: rgba(55, 53, 47, 0.12);
    --panel: #ffffff;
    --panel-strong: #fcfcfb;
    --primary: #2f6feb;
    --primary-dark: #1d4ed8;
    --secondary: #6b7280;
    --text: #37352f;
    --muted: #787774;
    --success: #0f7b55;
    --danger: #d14343;
    --warning: #b7791f;
    --input-bg: #ffffff;
    --secondary-bg: #f7f7f5;
    --secondary-hover: #efefed;
    --danger-bg: rgba(193, 77, 59, 0.1);
    --danger-border: rgba(193, 77, 59, 0.24);
    --danger-hover: rgba(193, 77, 59, 0.16);
    --success-bg: rgba(35, 131, 101, 0.1);
    --success-border: rgba(35, 131, 101, 0.22);
    --success-hover: rgba(35, 131, 101, 0.16);
    --notice-info-bg: rgba(31, 76, 115, 0.09);
    --notice-info-border: rgba(31, 76, 115, 0.18);
    --notice-info-text: #1f4c73;
    --notice-error-bg: rgba(162, 56, 47, 0.1);
    --notice-error-border: rgba(162, 56, 47, 0.2);
    --notice-error-text: #8f2f27;
    --table-head: #f7f7f5;
    --table-row-hover: #f7f7f5;
    --table-row-border: rgba(55, 53, 47, 0.08);
    --page-btn-bg: #ffffff;
    --page-btn-hover: #f7f7f5;
    --page-btn-hover-border: rgba(55, 53, 47, 0.16);
    --badge-success-bg: rgba(35, 131, 101, 0.12);
    --badge-danger-bg: rgba(162, 56, 47, 0.12);
    --side-buy-bg: rgba(35, 131, 101, 0.14);
    --side-buy-text: #16624a;
    --side-sell-bg: rgba(162, 56, 47, 0.14);
    --side-sell-text: #8f2f27;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --transition: 0.18s ease;
}

:root[data-theme="dark"] {
    --bg: #191919;
    --bg-accent: linear-gradient(180deg, #191919 0%, #151515 100%);
    --card: rgba(25, 25, 25, 0.98);
    --card-strong: #202020;
    --border: rgba(255, 255, 255, 0.09);
    --panel: #202020;
    --panel-strong: #252525;
    --primary: #7cb7ff;
    --primary-dark: #96c5ff;
    --secondary: #a1a1aa;
    --text: rgba(255, 255, 255, 0.9);
    --muted: rgba(255, 255, 255, 0.5);
    --success: #4ade80;
    --danger: #f87171;
    --warning: #f6c453;
    --input-bg: #202020;
    --secondary-bg: #2a2a2a;
    --secondary-hover: #323232;
    --danger-bg: rgba(240, 143, 130, 0.12);
    --danger-border: rgba(240, 143, 130, 0.28);
    --danger-hover: rgba(240, 143, 130, 0.18);
    --success-bg: rgba(104, 215, 171, 0.12);
    --success-border: rgba(104, 215, 171, 0.26);
    --success-hover: rgba(104, 215, 171, 0.18);
    --notice-info-bg: rgba(142, 193, 239, 0.12);
    --notice-info-border: rgba(142, 193, 239, 0.24);
    --notice-info-text: #c4e4ff;
    --notice-error-bg: rgba(240, 143, 130, 0.12);
    --notice-error-border: rgba(240, 143, 130, 0.24);
    --notice-error-text: #ffbab0;
    --table-head: #202020;
    --table-row-hover: #242424;
    --table-row-border: rgba(255, 255, 255, 0.08);
    --page-btn-bg: #202020;
    --page-btn-hover: #2a2a2a;
    --page-btn-hover-border: rgba(255, 255, 255, 0.14);
    --badge-success-bg: rgba(104, 215, 171, 0.14);
    --badge-danger-bg: rgba(240, 143, 130, 0.14);
    --side-buy-bg: rgba(104, 215, 171, 0.14);
    --side-buy-text: #93ecc4;
    --side-sell-bg: rgba(240, 143, 130, 0.14);
    --side-sell-text: #ffc2bb;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.28), 0 12px 32px rgba(0, 0, 0, 0.22);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.24);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background: var(--bg);
}

body {
    min-height: 100vh;
    font-family: Inter, "Noto Sans SC", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-accent);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
}

a {
    color: inherit;
}

[hidden] {
    display: none !important;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 24px;
    backdrop-filter: blur(14px);
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    border-bottom: 1px solid var(--border);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}

.brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    color: var(--text);
    background: var(--secondary-bg);
    border: 1px solid var(--border);
    font-size: 15px;
}

.topbar-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.topbar-subtitle {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

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

.topbar-link,
.topbar-theme-btn {
    min-height: auto;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    border: none;
    background: transparent;
    color: var(--muted);
    text-decoration: none;
    transition: color var(--transition), opacity var(--transition);
}

.topbar-theme-btn {
    min-width: 32px;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.theme-icon {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.topbar-link:hover,
.topbar-theme-btn:hover {
    color: var(--text);
    background: var(--secondary-bg);
}

.topbar-link-active {
    color: var(--text);
    background: var(--secondary-bg);
    font-weight: 700;
}

:root[data-theme="dark"] .topbar-link-active {
    color: var(--text);
    background: transparent;
    box-shadow: none;
}

.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 28px 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.page-shell {
    min-height: calc(100vh - 56px);
}

.page-shell > * {
    min-height: 0;
}

.hero {
    position: relative;
    overflow: hidden;
    padding: 24px;
    border-radius: 18px;
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.hero::after {
    display: none;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 8%, var(--card));
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hero h1 {
    margin-top: 12px;
    font-size: clamp(22px, 3.6vw, 34px);
    line-height: 1.12;
}

.hero p {
    margin-top: 10px;
    max-width: 760px;
    color: var(--muted);
    font-size: 14px;
}

.hero-compact {
    padding: 18px 20px;
}

.hero-actions,
.quick-actions,
.section-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.hero-actions {
    margin-top: 16px;
}

.dashboard-entry-description {
    max-width: 760px;
}

.dashboard-entry-actions {
    margin-top: 14px;
}

.summary-grid,
.metric-grid,
.portal-grid,
.page-grid {
    display: grid;
    gap: 14px;
}

.summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.portal-grid,
.page-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.card,
.portal-card,
.summary-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow-sm);
}

.card {
    padding: 18px;
}

.dashboard-entry-card {
    padding: 22px;
}

.portal-card,
.summary-card {
    padding: 18px;
}

.portal-card {
    position: relative;
    overflow: hidden;
}

.portal-card::after {
    display: none;
}

.summary-card {
    background: var(--card-strong);
}

.summary-label,
.metric-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.summary-value,
.metric-value {
    margin-top: 8px;
    font-size: clamp(18px, 2.2vw, 24px);
    font-weight: 700;
    line-height: 1.15;
}

.summary-hint,
.metric-hint,
.portal-card p,
.card-description,
.section-subtitle {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.card-header-compact {
    margin-bottom: 10px;
}

.card-header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
}

.card-title::before {
    content: "";
    display: block;
    width: 4px;
    height: 16px;
    border-radius: 999px;
    background: var(--primary);
}

.section-lead {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.section-title {
    font-size: 18px;
    font-weight: 800;
}

.metric {
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--panel-strong);
}

.metric-hint {
    min-height: 20px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.badge::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.badge-success {
    background: var(--badge-success-bg);
    color: var(--success);
}

.badge-danger {
    background: var(--badge-danger-bg);
    color: var(--danger);
}

.notice {
    display: none;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 600;
}

.notice-info {
    color: var(--notice-info-text);
    background: var(--notice-info-bg);
    border-color: var(--notice-info-border);
}

.notice-error {
    color: var(--notice-error-text);
    background: var(--notice-error-bg);
    border-color: var(--notice-error-border);
}

body.dialog-open {
    overflow: hidden;
}

.access-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
}

.access-dialog-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top, rgba(47, 111, 235, 0.18), transparent 42%),
        rgba(17, 24, 39, 0.44);
    backdrop-filter: blur(10px);
}

.access-dialog {
    position: relative;
    z-index: 1;
    width: min(440px, calc(100vw - 32px));
    margin: min(14vh, 120px) auto 0;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--card-strong) 96%, white) 0%, var(--card) 100%);
    box-shadow: 0 28px 90px rgba(15, 23, 42, 0.22);
}

.access-dialog-confirm {
    width: min(460px, calc(100vw - 32px));
}

.access-dialog-header {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.access-dialog-badge {
    display: inline-flex;
    width: fit-content;
    padding: 6px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.access-dialog-title {
    font-size: 24px;
    line-height: 1.25;
}

.access-dialog-description,
.access-dialog-tip {
    color: var(--muted);
}

.access-dialog-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.access-dialog-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}

.access-dialog-input {
    min-height: 52px;
    padding-inline: 16px;
    border-radius: 16px;
    font-size: 15px;
}

.access-dialog-message {
    min-height: 22px;
    color: var(--danger);
    font-size: 13px;
    font-weight: 600;
}

.access-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: end;
}

.controls-compact {
    gap: 10px;
}

.field,
.field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-group {
    gap: 12px;
}

.field {
    min-width: 160px;
}

.field-tight {
    min-width: 0;
    flex: 1 1 180px;
}

.controls-inline-card {
    align-items: end;
}

.trader-form-row {
    flex-direction: row;
    align-items: end;
    flex-wrap: wrap;
    gap: 14px;
}

.trader-form-field {
    min-width: 0;
    flex: 1 1 180px;
}

.trader-form-field-name {
    flex: 1.5 1 280px;
}

.trader-form-field-amount,
.trader-form-field-exposure {
    flex: 1 1 170px;
}

.trader-form-field-status {
    flex: 0 0 120px;
}

.trader-form-actions {
    flex: 0 0 auto;
    align-self: end;
    padding-bottom: 1px;
}

.field label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
textarea {
    width: 100%;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
    outline: none;
    transition: box-shadow var(--transition), background var(--transition), border-color var(--transition);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="datetime-local"]:focus,
textarea:focus {
    border-color: color-mix(in srgb, var(--primary) 46%, var(--border));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}

select.custom-select-native {
    position: absolute;
    inset: auto;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.field:has(.custom-select),
.trader-form-field:has(.custom-select) {
    position: relative;
}

.custom-select {
    position: relative;
    width: 100%;
}

.custom-select.is-disabled {
    opacity: 0.7;
}

.custom-select-trigger {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 11px 42px 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    outline: none;
    transition: box-shadow var(--transition), background var(--transition), border-color var(--transition);
}

.custom-select-trigger:focus,
.custom-select.is-open .custom-select-trigger {
    border-color: color-mix(in srgb, var(--primary) 46%, var(--border));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}

.custom-select-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-select-arrow {
    position: absolute;
    top: 50%;
    right: 14px;
    width: 10px;
    height: 10px;
    border-right: 1.5px solid var(--muted);
    border-bottom: 1.5px solid var(--muted);
    transform: translateY(-65%) rotate(45deg);
    transition: transform var(--transition), border-color var(--transition);
    pointer-events: none;
}

.custom-select.is-open .custom-select-arrow {
    transform: translateY(-35%) rotate(-135deg);
    border-color: var(--text);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 30;
    display: none;
    max-height: 260px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.custom-select.is-open .custom-select-options {
    display: block;
}

.custom-select-option {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.custom-select-option:hover {
    background: var(--secondary-bg);
}

.custom-select-option.is-selected {
    background: color-mix(in srgb, var(--primary) 12%, var(--panel));
    color: var(--primary);
    font-weight: 600;
}

.custom-select-option:disabled {
    color: var(--muted);
    cursor: not-allowed;
}

.setup-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-radius: var(--radius);
    border: 1px solid color-mix(in srgb, var(--warning) 24%, var(--border));
    background: color-mix(in srgb, var(--warning) 8%, var(--card));
}

.setup-alert-title {
    font-size: 16px;
    font-weight: 800;
}

.setup-alert-text,
.control-panel-hint,
.helper-text {
    color: var(--muted);
    font-size: 13px;
}

.split-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.28fr) minmax(320px, 0.9fr);
    gap: 14px;
    align-items: start;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.list-item {
    display: block;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--panel);
}

.dashboard-nav-link {
    text-decoration: none;
    transition: transform var(--transition), background var(--transition);
}

.dashboard-nav-link:hover {
    transform: translateY(-1px);
    background: color-mix(in srgb, var(--primary) 4%, var(--panel));
}

.list-item strong {
    display: block;
    font-size: 14px;
    font-weight: 800;
}

.list-item span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--card-strong);
}

.table-wrap.table-wrap-scroll {
    max-height: min(44vh, 420px);
}

.table-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.table-panel .table-wrap {
    flex: 1;
    min-height: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--table-head);
}

th {
    padding: 11px 12px;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-align: left;
    white-space: nowrap;
}

td {
    padding: 11px 12px;
    border-bottom: 1px solid color-mix(in srgb, var(--table-row-border) 40%, transparent);
    vertical-align: top;
    font-size: 13px;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: var(--table-row-hover);
}

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

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 16px;
}

.page-info {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--page-btn-bg);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
}

.page-btn:hover {
    background: var(--page-btn-hover);
    border-color: var(--page-btn-hover-border);
}

.page-btn.active {
    color: #191919;
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.12);
}

:root[data-theme="dark"] .page-btn.active {
    color: #191919;
    background: #ffffff;
    border-color: rgba(255, 255, 255, 0.72);
    box-shadow: none;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-ellipsis {
    color: var(--muted);
    padding: 0 4px;
}

.side-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.side-buy {
    background: var(--side-buy-bg);
    color: var(--side-buy-text);
}

.side-sell {
    background: var(--side-sell-bg);
    color: var(--side-sell-text);
}

.result-box {
    width: 100%;
    min-height: 96px;
    max-height: min(28vh, 240px);
    overflow-y: auto;
    overflow-x: auto;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--panel-strong);
    color: var(--text);
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.loading-text {
    color: var(--muted);
    font-style: italic;
}

.muted {
    color: var(--muted);
}

.mini-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.mini-stat {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--panel-strong);
    border: 1px solid var(--border);
}

.mini-stat strong {
    display: block;
    font-size: 18px;
    font-weight: 800;
}

.page-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.card-subtitle {
    color: var(--muted);
    font-size: 13px;
}

.inline-tip,
.status-tip-text {
    cursor: help;
}

.inline-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 4px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
}

.dashboard-shell .summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.follow-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: stretch;
}

.follow-grid-full {
    grid-column: 1 / -1;
}

.okx-grid {
    grid-template-columns: minmax(320px, 0.88fr) minmax(0, 1.12fr);
    align-items: stretch;
}

.follow-grid .card,
.okx-grid .card {
    min-height: 0;
}

.table-wrap.table-wrap-scroll-compact {
    max-height: min(32vh, 320px);
}

.mini-stat span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 960px) {
    .topbar {
        padding: 10px 16px;
    }

    .split-layout,
    .follow-grid,
    .okx-grid,
    .dashboard-shell .summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .container {
        padding: 18px 14px 24px;
    }

    .hero,
    .card,
    .portal-card,
    .summary-card {
        padding: 18px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .topbar-actions,
    .hero-actions,
    .quick-actions,
    .section-actions,
    .controls {
        width: 100%;
    }

    .topbar-actions > *,
    .hero-actions > *,
    .quick-actions > *,
    .section-actions > *,
    .controls > * {
        flex: 1 1 100%;
    }

    .topbar-link {
        width: 100%;
    }

    .topbar-theme-btn {
        flex: 0 0 auto;
        width: 32px;
        margin-left: 0;
    }

    .field {
        width: 100%;
        min-width: 0;
    }

    .trader-form-row {
        flex-direction: column;
        align-items: stretch;
    }

    .trader-form-field,
    .trader-form-field-name,
    .trader-form-field-amount,
    .trader-form-field-exposure,
    .trader-form-field-status,
    .trader-form-actions {
        width: 100%;
        flex: 1 1 auto;
    }

    .setup-alert {
        flex-direction: column;
        align-items: stretch;
    }

    .table-wrap.table-wrap-scroll,
    .result-box {
        max-height: none;
    }
}
