:root {
    font-family: system-ui, sans-serif;
    color: #192a3b;
    background: #f3f5f7;
    line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: #1457a6; }
.shell { width: min(1080px, calc(100% - 40px)); margin: 0 auto; }
.site-header { background: #fff; border-bottom: 1px solid #dce2e8; }
.site-header-sticky { position: sticky; top: 0; z-index: 100; }
.site-header nav { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0; }
.header-price { min-width: 0; text-align: center; font-variant-numeric: tabular-nums; }
.header-price-pair { margin-right: 12px; white-space: nowrap; }
.header-price-value { white-space: nowrap; }
.header-price-value strong { font-size: 1.15rem; }
.header-price [data-price-status], .header-price [data-connection-status] { display: none; }
.brand { font-size: 1.3rem; font-weight: 750; text-decoration: none; color: inherit; }
main { padding: 40px 0; }
h1 { margin: 0 0 24px; font-size: 1.8rem; }
h2 { margin: 0 0 20px; font-size: 1.2rem; }
.panel { background: #fff; padding: 28px; border: 1px solid #dce2e8; border-radius: 12px; }
.compact { max-width: 480px; margin: 24px auto; }
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.page-heading { margin-bottom: 28px; }
.page-heading h1 { margin: 12px 0; }
.eyebrow { color: #536478; font-size: 0.8rem; font-weight: 650; letter-spacing: 0.08em; }
.dashboard { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.section-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; width: 100%; color: inherit; text-decoration: none; cursor: pointer; }
.section-card:hover { border-color: #1457a6; background: #fafdff; }
.section-card:active { background: #e8edf3; }
.section-card > .eyebrow, .section-card h2, .section-card p { grid-column: 1; }
.section-card h2 { margin: 8px 0; font-size: 1.45rem; }
.section-card p { margin: 0; color: #536478; }
.card-action { grid-column: 2; grid-row: 1 / 4; align-self: center; color: #1457a6; font-weight: 600; }
.section-menu { margin-top: 16px; }
.master-name-editor > summary { cursor: pointer; }
.master-name-editor > summary:focus-visible { outline: 3px solid #85b8f5; outline-offset: 3px; }
.master-name-editor h1 { display: inline; margin: 0; }
.account-heading { display: flex; justify-content: space-between; align-items: start; gap: 24px; flex-wrap: wrap; }
.refresh-button { margin: 0; white-space: nowrap; }
.storage-settings { display: flex; justify-content: space-between; align-items: end; gap: 28px; flex-wrap: wrap; }
.storage-settings h2 { margin-bottom: 8px; }
.storage-settings p { margin: 0; }
.storage-settings form { min-width: min(100%, 360px); }
.storage-settings label { margin-top: 0; }
.storage-settings select { width: 100%; border: 1px solid #8898aa; border-radius: 6px; padding: 10px 12px; font: inherit; background: #fff; }
.strategy-settings { display: flex; justify-content: space-between; align-items: end; gap: 28px; flex-wrap: wrap; }
.strategy-settings h2 { margin-bottom: 8px; }
.strategy-settings p { margin: 0; }
.strategy-settings form { min-width: min(100%, 360px); }
.strategy-settings label { margin-top: 0; }
.strategy-settings select, .strategy-create select { width: 100%; border: 1px solid #8898aa; border-radius: 6px; padding: 10px 12px; font: inherit; background: #fff; }
.strategy-create { margin-top: 0; }
.strategy-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.strategy-card { cursor: default; }
.grinder-ranges { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.grinder-range-filter { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.grinder-range-filter .checkbox { margin: 0; }
.grinder-range[hidden] { display: none; }
.grinder-range.panel { padding: 0; background: #edf0f3; }
.grinder-range.grinder-range-active { background: #e5f4eb; border-color: #74ad88; }
.grinder-range p { margin: 6px 0; }
.grinder-range summary { cursor: pointer; }
.grinder-range-row { display: grid; grid-template-columns: 1em minmax(0, 1.2fr) minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)) auto; align-items: center; gap: 16px; padding: 10px 16px; list-style: none; font-variant-numeric: tabular-nums; }
.grinder-range-marker { visibility: hidden; color: #16733c; font-size: 1rem; font-weight: 700; text-align: center; }
.grinder-range-current > .grinder-range-row > .grinder-range-marker { visibility: visible; }
.grinder-range-row::-webkit-details-marker { display: none; }
.grinder-range-row::after { content: "▸"; color: #536478; transition: transform 0.15s; }
.grinder-range[open] > .grinder-range-row::after { transform: rotate(90deg); }
.grinder-range-row > span { min-width: 0; overflow-wrap: anywhere; }
.grinder-range-row strong, .grinder-range-row small { display: block; }
.grinder-range-status { font-size: 0.9rem; }
.grinder-range-edit-button { display: block; margin: 2px 0 0; padding: 0; border-radius: 2px; background: transparent; color: #1457a6; font-size: 0.82rem; text-align: left; text-decoration: underline; }
.grinder-range-edit-button:hover { background: transparent; color: #0f4483; }
.grinder-range-content { padding: 10px 16px 16px; border-top: 1px solid #dce2e8; }
.grinder-range-orders { margin-top: 12px; }
.grinder-range-orders h3 { margin: 0 0 8px; font-size: 1rem; }
.grinder-range-editor { margin-top: 12px; }
.grinder-range-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.strategy-create select:focus-visible, summary:focus-visible { outline: 3px solid #85b8f5; outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
.strategy-actions { display: flex; align-items: start; gap: 12px; flex-wrap: wrap; }
.strategy-disclosure[open] { width: 100%; }
.strategy-disclosure > summary { display: inline-block; list-style: none; }
.strategy-disclosure > summary::-webkit-details-marker { display: none; }
.strategy-disclosure > .panel { margin-top: 16px; }
.strategy-settings-actions > .key-action-button { margin-top: 0; }
.strategy-settings-actions > [aria-expanded="true"] { background: #215d37; color: #fff; }
.strategy-settings-actions > [aria-expanded="true"]:hover { background: #19482a; }
.strategy-journal-link { margin-left: auto; }
.strategy-settings-panel { margin-top: 16px; }
.strategy-settings-panel[hidden] { display: none; }
.slippage-dialog { width: min(560px, calc(100% - 32px)); max-height: calc(100% - 32px); margin: auto; color: inherit; box-shadow: 0 16px 48px #192a3b40; }
.slippage-dialog::backdrop { background: #192a3b80; }
.slippage-dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.slippage-dialog-actions button { margin: 0; }
.account-key-actions { max-width: 440px; margin-left: auto; }
.key-action-button { padding: 10px 18px; border-radius: 6px; background: #1457a6; color: #fff; cursor: pointer; }
label { display: block; margin-top: 18px; margin-bottom: 6px; font-weight: 600; }
input:not([type="checkbox"]):not([type="hidden"]) { width: 100%; border: 1px solid #8898aa; border-radius: 6px; padding: 10px 12px; font: inherit; }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid #85b8f5; outline-offset: 3px; }
.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 400; }
button { margin-top: 22px; padding: 10px 18px; border: 0; border-radius: 6px; background: #1457a6; color: #fff; font: inherit; cursor: pointer; }
button:hover { background: #0f4483; }
.secondary { margin: 0; background: #e8edf3; color: #192a3b; }
.secondary:hover { background: #dce2e8; }
.transfer-button { display: inline-block; padding: 8px 12px; border-radius: 6px; background: #1457a6; color: #fff; text-decoration: none; }
.transfer-button:hover { background: #0f4483; }
.transfer-form select { width: 100%; border: 1px solid #8898aa; border-radius: 6px; padding: 10px 12px; font: inherit; background: #fff; }
.transfer-form select:focus-visible { outline: 3px solid #85b8f5; outline-offset: 3px; }
.muted, .hint { color: #536478; }
.hint { font-size: 0.88rem; }
.validation { color: #a12424; display: block; }
.validation ul { padding-left: 20px; }
.notice { padding: 14px 18px; background: #e5f4eb; color: #215d37; border-radius: 6px; }
table { width: 100%; border-collapse: collapse; text-align: left; overflow-wrap: anywhere; }
th, td { padding: 12px 8px; border-bottom: 1px solid #e5e9ed; }
.table-scroll { overflow-x: auto; }
.position-long { color: #16733c; font-weight: 650; }
.position-short, .position-liquidation { color: #b42323; font-weight: 650; }
.market-prices { margin-bottom: 24px; }
.market-prices [data-price] { font-size: 1.15rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.price-up { color: #16733c; }
.price-down { color: #b42323; }
.price-detail { display: block; margin-top: 4px; }
.price-stale .price-detail { color: #925d13; }
.secret-field { position: relative; }
.secret-field input:not([type="hidden"]) { padding-right: 58px; }
.secret-toggle { position: absolute; top: 1px; right: 1px; bottom: 1px; width: 48px; margin: 0; padding: 10px; border-radius: 0 5px 5px 0; background: #e8edf3; color: #192a3b; }
.secret-toggle:hover { background: #dce2e8; }
.secret-toggle svg { display: block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.secret-toggle .eye-slash { display: none; }
.secret-toggle[aria-pressed="true"] .eye-slash { display: block; }
@media (max-width: 700px) {
    .site-header-sticky nav { flex-wrap: wrap; gap: 8px 12px; padding: 10px 0; }
    .header-price { order: 1; flex-basis: 100%; }
    .columns, .dashboard, .strategy-pair { grid-template-columns: 1fr; }
    .section-card { grid-template-columns: minmax(0, 1fr); }
    .card-action { grid-column: 1; grid-row: auto; margin-top: 16px; }
    .panel { padding: 20px; }
    .grinder-range-row { grid-template-columns: 1em minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px 12px; padding: 10px 12px; }
    .grinder-range-marker { grid-column: 1; grid-row: 1 / 3; }
    .grinder-range-row::after { grid-column: 4; grid-row: 1 / 3; }
    .grinder-range:not([open]) > .grinder-range-row > .grinder-range-marker { grid-row: 1; }
    .grinder-range:not([open]) > .grinder-range-row > .grinder-range-status,
    .grinder-range:not([open]) > .grinder-range-row > .grinder-range-available { display: none; }
    .grinder-range:not([open]) > .grinder-range-row::after { grid-row: 1; }
    .grinder-range-content { padding: 10px 12px 12px; }
    .grinder-range-fields { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
.reserve-surplus { color: #08783e; }
.grinder-range.grinder-range-disabled { background: #fbe6da; border-color: #d69b7b; border-style: dashed; }
