@charset "UTF-8";
.account-basis { font-size: 12px; margin-bottom: 8px; }
.account-capital { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 12px; color: var(--muted); padding-bottom: 14px; }
.profit-basis { color: var(--muted); font-size: 13px; margin-bottom: 24px; word-break: keep-all; }
.profit-details { margin-top: 34px; border-top: 1px solid var(--line); padding-top: 26px; }
.profit-table { font-variant-numeric: tabular-nums; }
.profit-table th:first-child { text-align: left; min-width: 140px; }
.profit-table thead th:not(:first-child) { min-width: 155px; max-width: 230px; white-space: normal; }
.profit-table tbody th { font-size: 13px; font-weight: 500; white-space: normal; }
.profit-table td { font-size: 15px; }
.profit-table td a { color: inherit; display: block; }
.profit-table a:hover { text-decoration: underline; text-underline-offset: 4px; }
.profit-table small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.profit-total { background: var(--surface); }
.profit-total td, .profit-total th { border-bottom: 2px solid var(--line); }
.profit-presets { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 16px; font-size: 13px; }
.profit-presets a { color: var(--muted); padding: 4px 0; border-bottom: 2px solid transparent; }
.profit-presets a[aria-current] { color: var(--accent); border-bottom-color: var(--accent); }
.profit-caption { font-size: 12px; margin: 12px 0; word-break: keep-all; }
.trade-holdings { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 18px; }
.trade-holdings > summary { cursor: pointer; font-weight: 600; margin-bottom: 12px; }
@media (max-width: 1100px) {
    .profit-toolbar > label:not(.option-filter) { flex: 1 1 130px; min-width: 0; }
    .profit-toolbar input { width: 100%; min-width: 0; }
    .profit-toolbar > .option-filter { flex-basis: 100%; }
    .profit-table th:first-child { position: sticky; left: 0; z-index: 1; background: var(--bg); min-width: 128px; max-width: 148px; border-right: 1px solid var(--line); }
    .profit-table thead th:first-child { background: var(--surface); }
    .profit-quick .table-wrap { border: 0; }
    .profit-shortcuts, .profit-shortcuts tbody { display: block; width: 100%; }
    .profit-shortcuts thead { display: none; }
    .profit-shortcuts tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px 0; border-bottom: 1px solid var(--line); gap: 10px 18px; }
    .profit-shortcuts tbody th:first-child { position: static; grid-column: 1 / -1; border: 0; padding: 0 0 4px; max-width: none; width: auto; font-size: 15px; background: transparent; }
    .profit-shortcuts td { padding: 0; border: 0; text-align: left; }
    .profit-shortcuts td::before { content: attr(data-label); color: var(--muted); font-size: 12px; display: block; }
}
@media (min-width: 601px) and (max-width: 1100px) {
    .profit-shortcuts tbody { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
}
.account-section { padding: 24px 0 28px; border-bottom: 1px solid var(--line); scroll-margin-top: 90px; }
.account-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.account-heading h2 { font-size: 19px; overflow-wrap: anywhere; }
.account-heading p { font-size: 12px; margin-top: 3px; }
.account-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.account-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; margin: 18px 0; }
.account-metrics dt { color: var(--muted); font-size: 12px; }
.account-metrics dd { margin: 3px 0 0; font-size: 18px; font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.account-metrics dd small { display: block; color: inherit; font-size: 12px; font-weight: 500; }
.holding-list { border-top: 1px solid var(--line); }
.holding-row { display: grid; grid-template-columns: minmax(140px,1.3fr) minmax(120px,1fr) minmax(180px,1.5fr) minmax(130px,1fr) 36px; gap: 12px; align-items: center; padding: 16px 0; border-bottom: 1px solid #252b2e; font-variant-numeric: tabular-nums; }
.holding-row > div { min-width: 0; }
.holding-exit-status { grid-column: 1 / -1; min-width: 0; font-size: 13px; color: #f3c966; overflow-wrap: anywhere; }
.holding-exit-status summary { cursor: pointer; }
.holding-exit-status p { margin: 8px 0 0; }
.holding-row span, .holding-row small { display: block; }
.holding-name strong { font-size: 16px; overflow-wrap: anywhere; }
.holding-pnl strong { display: block; font-size: 20px; line-height: 1.35; }
.holding-pnl > span:last-child { font-size: 13px; }
.holding-label { color: var(--muted); font-size: 11px; margin-bottom: 3px; }
.holding-prices > span:nth-child(2) { font-size: 13px; }
.holding-empty { color: var(--muted); padding: 22px 0; }
.account-list-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 18px; flex-wrap: wrap; margin: 18px 0 10px; font-size: 14px; }
.account-list-heading h3 { font-size: 14px; }
.account-list-heading > span, .account-list-heading h3 span { font-size: 12px; font-weight: 400; }
.account-sales { margin-top: 28px; scroll-margin-top: 90px; }
.sales-jump { display: inline-flex; align-items: center; gap: 4px; color: inherit; }
.sales-jump svg { width: 14px; height: 14px; }
.sold-row { grid-template-columns: minmax(140px,1.3fr) minmax(120px,1fr) minmax(180px,1.5fr) minmax(160px,1fr) 36px; }
.sold-row .holding-pnl strong { font-size: 18px; }
.sold-reason { font-size: 13px; overflow-wrap: anywhere; }
.sales-pagination { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 14px; font-size: 12px; }
@media (max-width: 760px) {
    .account-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px 18px; }
    .account-heading h2 { font-size: 17px; }
    .account-actions { width: 100%; justify-content: flex-end; gap: 12px; }
    .holding-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr) 32px; gap: 12px; padding: 16px 0 18px; }
    .holding-name { align-self: start; padding-top: 3px; }
    .holding-pnl { text-align: right; grid-column: 2 / 4; }
    .holding-time { text-align: right; }
    .holding-chart { width: 32px; }
    .holding-name strong { font-size: 15px; }
    .holding-row small { font-size: 11px; }
    .sold-row .holding-time { grid-column: 2 / 4; }
    .sold-row .holding-chart { grid-column: 3; justify-self: end; }
}
.rank-summary { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 16px 0; color: var(--muted); }
.rank-summary strong { color: var(--text); }
.rank-date-nav { display: flex; gap: 8px; }
.candidate-date-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.candidate-history-list .audit-list-head, .candidate-history-list .audit-row { grid-template-columns: minmax(160px,1fr) minmax(180px,1fr) 150px minmax(240px,1.5fr); }
.rank-toolbar label { display: flex; flex-direction: column; gap: 4px; }
.daily-rank-table { min-width: 1240px; table-layout: fixed; }
.daily-rank-table th:first-child { width: 64px; }
.daily-rank-table th:nth-child(2) { width: 156px; }
.daily-rank-table th:nth-child(3) { width: 108px; }
.daily-rank-table th:nth-child(7) { width: 164px; }
.daily-rank-table th:last-child { width: 252px; }
.daily-rank-table small { display: block; white-space: normal; }
.daily-rank-table .rank-index { font-weight: 650; font-variant-numeric: tabular-nums; }
.rank-component span { display: block; color: var(--accent); font-weight: 650; }
.rank-component small { margin: 2px 0; }
.daily-rank-table details { margin-top: 4px; }
.candidate-selection { margin: 20px 0; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.candidate-selection h2 { font-size: 16px; margin-bottom: 8px; }
.candidate-selection p { margin-bottom: 10px; }
.candidate-selection .status-list { margin-top: 8px; }
.rank-method { padding: 0 0 20px; }
.rank-method summary { cursor: pointer; color: var(--muted); }
:root {
    color-scheme: dark;
    --bg: #101214;
    --surface: #191c1f;
    --hover: #23272a;
    --line: #303639;
    --text: #edf1f0;
    --muted: #9fa9ad;
    --accent: #6cd6b2;
    --red: #ff8b91;
    --blue: #7ebcfa;
    --amber: #ebc675;
    --radius: 6px;
}
* {
    box-sizing: border-box;
    letter-spacing: 0;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font:
        14px/1.6 -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        sans-serif;
}
a {
    color: inherit;
    text-decoration: none;
}
button,
input,
select {
    font: inherit;
}
button,
a,
input {
    outline-offset: 4px;
}
button {
    cursor: pointer;
}
button:disabled {
    opacity: 0.45;
    cursor: wait;
}
svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
button svg,
a svg {
    vertical-align: middle;
}
input:not([type='checkbox']),
select {
    min-height: 40px;
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: var(--radius);
    padding: 8px 12px;
    max-width: 100%;
    min-width: 0;
}
input[type='checkbox'] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}
input::placeholder {
    color: #778287;
}
button {
    border: 0;
    color: inherit;
    background: none;
}
small {
    font-size: 12px;
}
h1,
h2,
p {
    margin: 0;
}
h1 {
    font-size: 28px;
    line-height: 1.4;
    font-weight: 650;
}
h2 {
    font-size: 18px;
    font-weight: 650;
}
.muted,
small {
    color: var(--muted);
}
strong {
    font-weight: 620;
}
.gain {
    color: var(--red);
}
.loss {
    color: var(--blue);
}
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 80px;
    background: #121517;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    gap: 16px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 700;
}
.brand > svg {
    width: 30px;
    height: 30px;
    color: var(--accent);
}
.brand small {
    display: block;
    font-size: 12px;
    font-weight: 450;
}
.top-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}
.switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #414a4e;
    border-radius: 24px;
    padding: 7px 9px 7px 16px;
    width: 90px;
    height: 40px;
    font-weight: 650;
}
.switch span {
    border-radius: 50%;
    background: #fff;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}
.switch.on {
    background: #237c60;
}
.switch[aria-checked='false'] span {
    background: #aeb8bb;
}
.run-label {
    font-size: 12px;
    color: var(--muted);
}
nav {
    display: flex;
    gap: 4px;
    padding: 0 24px;
    background: #121517;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 18px 15px;
    border-bottom: 2px solid transparent;
    color: var(--muted);
}
nav a:hover {
    color: var(--text);
    background: #181c1f;
}
nav a[aria-current] {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
main {
    max-width: 1680px;
    margin: auto;
    padding: 28px 32px 48px;
}
.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}
.eyebrow {
    font-size: 10px;
    color: var(--muted);
    margin-bottom: 6px;
}
.notice {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 15px 18px;
    border-left: 3px solid #54676f;
    background: #1b2327;
    margin: 16px 0 24px;
}
.notice p {
    margin-top: 4px;
    font-size: 13px;
    color: #b5c2c7;
}
.notice svg {
    margin-top: 3px;
    color: #a3bfc9;
}
.notice.warning {
    border-left-color: var(--amber);
    background: #29251b;
}
.notice.warning p {
    color: #d8c79f;
}
.state-band {
    display: flex;
    align-items: center;
    gap: 18px;
    border-bottom: 1px solid var(--line);
    padding: 18px 0 28px;
}
.state-band p {
    color: var(--muted);
    margin-top: 6px;
}
.state-band > .text-link {
    margin-left: auto;
}
.state-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #212629;
    color: var(--muted);
}
.state-icon.active {
    color: var(--accent);
}
.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0;
    border-bottom: 1px solid var(--line);
    padding: 24px 0;
}
.metrics > div {
    padding: 0 22px;
    border-left: 1px solid var(--line);
}
.metrics > div:first-child {
    padding-left: 0;
    border-left: 0;
}
.metrics span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}
.metrics strong {
    display: block;
    font-size: 26px;
    margin-top: 8px;
    overflow-wrap: anywhere;
}
.metrics small {
    margin-left: 6px;
    font-size: 13px;
    font-weight: 400;
}
.section {
    padding: 30px 0;
    border-bottom: 1px solid var(--line);
}
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 18px;
}
.text-link {
    color: var(--accent);
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: normal;
}
.text-link:hover {
    text-decoration: underline;
}
.status-list {
    margin: 16px 0 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 40px;
}
.status-list > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 0;
    border-bottom: 1px solid #252b2e;
}
.status-list dt {
    color: var(--muted);
    flex-shrink: 0;
}
.status-list dd {
    margin: 0;
    text-align: right;
    overflow-wrap: anywhere;
}
.toolbar {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
    margin: 22px 0;
}
.toolbar > label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    color: var(--muted);
}
.toolbar > label.search {
    position: relative;
    display: block;
    color: var(--muted);
}
.toolbar > label.option-filter {
    flex: 0 1 400px;
    min-width: 0;
    max-width: 100%;
}
.option-filter select {
    width: 100%;
}
.search > svg {
    position: absolute;
    left: 12px;
    top: 12px;
}
.search input {
    padding-left: 40px;
    width: 290px;
}
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    border: 1px solid #445057;
    border-radius: var(--radius);
    padding: 8px 14px;
    font-size: 13px;
    background: #202629;
    color: var(--text);
}
.button:hover {
    background: #303a3f;
}
.icon-button {
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--muted);
}
.icon-button:hover {
    background: var(--hover);
    color: var(--accent);
    border-color: var(--line);
}
.setting-line {
    display: flex;
    gap: 24px;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-bottom: 24px;
    border-block: 1px solid var(--line);
}
.setting-line p {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}
.check {
    display: flex;
    gap: 8px;
    align-items: center;
    white-space: nowrap;
}
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 6px;
}
table {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
}
th {
    text-align: left;
    font-size: 12px;
    color: var(--muted);
    background: #202427;
    font-weight: 600;
    white-space: nowrap;
}
th a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
th a svg {
    width: 13px;
    height: 13px;
}
th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}
td {
    white-space: nowrap;
    vertical-align: middle;
}
td small {
    display: block;
    margin-top: 3px;
}
tr:last-child td {
    border-bottom: 0;
}
tbody tr:hover {
    background: #191f22;
}
.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.wrap {
    white-space: normal;
    min-width: 180px;
    max-width: 420px;
    overflow-wrap: anywhere;
}
.condition-cell {
    min-width: 310px;
    white-space: normal;
    line-height: 1.7;
}
.condition-cell > .text-link {
    margin-top: 5px;
}
.condition-cell div:nth-child(2) {
    color: var(--muted);
}
.stop-text {
    color: #e8b3b5;
}
.options-table td:nth-child(2) {
    min-width: 200px;
    max-width: 290px;
    white-space: normal;
    overflow-wrap: anywhere;
}
.holdings-table [data-option-detail] {
    white-space: nowrap;
}
.badge {
    display: inline-flex;
    background: #2c3235;
    padding: 3px 8px;
    border-radius: 4px;
    color: var(--muted);
    font-size: 11px;
}
.badge.success {
    background: #203a31;
    color: var(--accent);
}
.empty {
    text-align: center;
    padding: 50px 20px;
    color: var(--muted);
    white-space: normal;
}
.pagination {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    margin: 24px 0;
    color: var(--muted);
    font-size: 12px;
}
.rule-list {
    list-style: none;
    padding: 0;
    counter-reset: rule;
}
.rule-list li {
    counter-increment: rule;
    padding: 18px 0 18px 44px;
    position: relative;
    border-bottom: 1px solid var(--line);
}
.rule-list li:before {
    content: counter(rule, decimal-leading-zero);
    position: absolute;
    left: 0;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}
.rule-list strong,
.rule-list span {
    display: block;
}
.rule-list span {
    color: var(--muted);
    margin-top: 6px;
}
.segmented {
    display: flex;
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
}
.segmented a {
    padding: 9px 16px;
    color: var(--muted);
    font-size: 13px;
}
.segmented a[aria-current] {
    color: var(--text);
    background: #343e43;
}
.timeline {
    border-top: 1px solid var(--line);
}
.timeline article {
    display: flex;
    align-items: baseline;
    gap: 18px;
    padding: 19px 0;
    border-bottom: 1px solid var(--line);
}
.timeline time {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.timeline p {
    margin-top: 4px;
    color: var(--muted);
}
.event-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}
.event-dot.warn {
    background: var(--amber);
}
footer {
    padding: 24px 32px;
    color: #7c888e;
    border-top: 1px solid var(--line);
    font-size: 11px;
}
#feedback {
    padding: 12px;
    background: #283c33;
    color: var(--accent);
    margin: 12px 0;
}
dialog {
    width: min(1120px, calc(100% - 32px));
    max-height: 90vh;
    background: var(--surface);
    color: var(--text);
    border: 1px solid #4c5c63;
    border-radius: 8px;
    padding: 0;
    overflow: auto;
}
dialog::backdrop {
    background: #000b;
}
.dialog-heading {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 16px 22px;
}
#dialog-body {
    padding: 22px;
}
.detail-rules h3 {
    font-size: 14px;
    color: var(--accent);
    margin: 20px 0 8px;
}
.detail-rules ul {
    padding-left: 20px;
    color: #cad1d4;
}
.chart {
    height: 360px;
    width: 100%;
    position: relative;
}
.osc-chart {
    height: 145px;
}
.chart-caption {
    margin: 14px 0 4px;
    font-size: 12px;
    color: var(--muted);
}
.login {
    max-width: 420px;
    margin: 12vh auto;
    padding: 28px;
}
.login form {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 28px;
}
.login input:not([type='checkbox']) {
    width: 100%;
}
.login label,
.form-grid label,
.form-stack > label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}
.login label.consent {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}
.login label.consent input[type='checkbox'] {
    width: 18px;
    height: 18px;
    min-height: 0;
    flex: 0 0 18px;
    margin: 0;
}
.primary {
    background: #276e57;
    border-color: #398b70;
}
.login-note,
.form-note {
    color: var(--muted);
    font-size: 13px;
    margin: 14px 0;
    max-width: 850px;
    overflow-wrap: anywhere;
}
.form-error {
    color: var(--red);
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    max-width: 900px;
    margin-top: 18px;
}
.form-stack {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 640px;
    margin-top: 18px;
}
.password-form {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 420px;
}
.password-form input {
    width: 100%;
}
.password-form > .form-buttons {
    margin-top: 0;
}
.form-buttons {
    display: flex;
    gap: 12px;
    grid-column: 1/-1;
    margin-top: 18px;
}
.form-stack > .button {
    align-self: flex-start;
}
.risk-notice {
    border-left: 3px solid var(--amber);
    padding: 12px 16px;
    background: #28251d;
    color: #e1d3ac;
    font-size: 13px;
}
.form-stack > label.consent {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
}
.consent input {
    flex: 0 0 18px;
}
.mode-options {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    border: 1px solid var(--line);
    padding: 16px;
    border-radius: 6px;
}
.mode-options input[type='radio'] {
    min-height: 0;
    width: 16px;
    height: 16px;
    padding: 0;
    accent-color: var(--accent);
}
.compact-form {
    min-width: 220px;
    white-space: normal;
}
details summary {
    cursor: pointer;
    color: var(--accent);
}
@media (max-width: 600px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    .section-heading {
        flex-wrap: wrap;
    }
    .section-heading > .muted {
        overflow-wrap: anywhere;
    }
    .top-actions {
        gap: 5px;
    }
    .form-stack {
        max-width: 100%;
    }
    .mode-options {
        flex-direction: column;
    }
}
tr[data-trade-row] {
    cursor: pointer;
}
@media (max-width: 800px) {
    .topbar {
        height: 70px;
        padding: 0 16px;
    }
    .brand {
        font-size: 18px;
    }
    .brand > svg {
        width: 25px;
    }
    .run-label {
        display: none;
    }
    .top-actions {
        gap: 8px;
    }
    nav {
        padding: 0 8px;
    }
    nav a {
        font-size: 12px;
        padding: 14px 12px;
    }
    main {
        padding: 22px 16px 36px;
    }
    .page-heading {
        gap: 12px;
    }
    .page-heading > .muted {
        font-size: 10px;
    }
    h1 {
        font-size: 24px;
    }
    .metrics {
        grid-template-columns: 1fr 1fr;
        gap: 24px 0;
    }
    .metrics > div:nth-child(odd) {
        padding-left: 0;
        border-left: 0;
    }
    .metrics strong {
        font-size: 23px;
    }
    .state-band {
        align-items: flex-start;
        flex-wrap: wrap;
    }
    .state-band > div:nth-child(2) {
        flex: 1;
        min-width: 190px;
    }
    .state-band > .text-link {
        margin-left: 66px;
    }
    .status-list {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .status-list > div {
        gap: 14px;
    }
    .status-list dd {
        font-size: 12px;
    }
    .search input {
        width: 250px;
    }
    .toolbar {
        gap: 10px;
    }
    .condition-cell {
        min-width: 270px;
    }
    th,
    td {
        padding: 12px;
    }
    .notice {
        padding: 13px 14px;
    }
    .notice strong {
        font-size: 13px;
    }
    .notice p {
        font-size: 12px;
    }
    .timeline article {
        gap: 10px;
    }
    .timeline time {
        font-size: 10px;
    }
    .timeline p {
        font-size: 12px;
    }
    .setting-line {
        gap: 12px;
    }
    .setting-line p {
        font-size: 11px;
    }
    dialog {
        width: calc(100% - 16px);
    }
    #dialog-body {
        padding: 14px;
    }
    .chart {
        height: 300px;
    }
    .osc-chart {
        height: 125px;
    }
    footer {
        padding: 20px 16px;
    }
}
/* 비활성 설정은 레이아웃 규칙보다 우선하여 감춥니다. */
[hidden] {
    display: none !important;
}
.choice-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    margin: 0;
    padding: 12px 0;
    border: 0;
}
.choice-row label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.choice-row legend {
    margin-bottom: 8px;
    font-weight: 600;
}
.site-menu { position: relative; }
.site-menu > summary { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 6px; cursor: pointer; list-style: none; }
.site-menu > summary::-webkit-details-marker { display: none; }
.site-menu > summary:hover, .site-menu[open] > summary { background: var(--hover); }
.site-menu-panel { position: absolute; right: 0; top: 48px; width: 260px; max-width: calc(100vw - 32px); padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; z-index: 30; box-shadow: 0 8px 24px #0006; }
.menu-account { display: block; padding: 8px 10px 12px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; border-bottom: 1px solid var(--line); }
.site-menu-panel a { display: flex; align-items: center; gap: 10px; padding: 10px; }
.site-menu-panel a:hover, .site-menu-panel a[aria-current] { background: var(--hover); color: var(--accent); }
.account-run-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 12px 0; border-block: 1px solid var(--line); margin-bottom: 24px; }
.account-run-status > span { display: flex; align-items: center; gap: 8px; }
.account-run-status > small { color: var(--muted); }
.account-run-status > a { margin-left: auto; }
.status-running { color: var(--accent); }
.account-run-status.status-warning { color: var(--amber); }
.comparison-table th:first-child { min-width: 200px; max-width: 270px; white-space: normal; text-align: left; }
.comparison-table tbody th { font-size: 14px; color: var(--text); background: transparent; }
.comparison-table tbody th > a { display: block; margin-bottom: 8px; }
.comparison-table tbody th > small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.comparison-table td { vertical-align: top; }
.comparison-table td strong { font-size: 16px; }
.comparison-table .return-value, .trade-table .return-value { color: inherit; }
.comparison-stocks { min-width: 205px; }
.comparison-stocks > a { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 3px 0; }
.comparison-stocks > a:hover span { text-decoration: underline; }
.comparison-stocks small { display: inline; }
.comparison-stocks .purchase-score { display: block; margin-top: 3px; }
.comparison-stocks > small { display: block; padding-top: 8px; }
.comparison-links { min-width: 125px; }
.comparison-links > a { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; font-size: 12px; }
.rule-summary { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 20px; margin: 24px 0; padding: 20px 0; border-block: 1px solid var(--line); }
.rule-summary dt { color: var(--muted); font-size: 12px; }
.rule-summary dd { margin: 4px 0 0; font-size: 22px; }
.rule-summary small { display: block; font-size: 11px; color: var(--muted); }
.rule-section { display: grid; grid-template-columns: 180px minmax(0,1fr); gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.rule-section h2 { font-size: 16px; }
.rule-section ul { margin: 0; padding-left: 20px; max-width: 900px; }
.rule-section li + li { margin-top: 8px; }
.settings-section > summary, .danger-section > summary, .secondary-analysis > summary { cursor: pointer; font-weight: 600; }
.settings-section[open] > summary, .danger-section[open] > summary, .secondary-analysis[open] > summary { margin-bottom: 18px; }
.page-shortcuts { display: flex; flex-wrap: wrap; gap: 12px 24px; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.page-shortcuts a { color: var(--accent); }
[id$='-settings'], [id^='account-'] { scroll-margin-top: 100px; }
.trade-toolbar > label { min-width: 0; }
.trade-toolbar > label:not(.option-filter) { flex: 1 1 125px; }
.trade-toolbar input, .trade-toolbar select { width: 100%; }
.trade-table .trade-option { min-width: 170px; max-width: 250px; white-space: normal; }
.trade-table .trade-name { min-width: 115px; }
.trade-table .trade-reason { min-width: 190px; font-size: 12px; }
.trade-option a:hover { color: var(--accent); text-decoration: underline; }
.broker-holding-row { grid-template-columns: minmax(150px,1.3fr) minmax(120px,1fr) minmax(180px,1.5fr) minmax(130px,1fr); }
.broker-account-metrics { margin: 18px 0; }
.broker-account-metrics strong { font-size: 20px; }
@media (max-width: 1200px) {
    .comparison-wrap { border: 0; }
    .comparison-table, .comparison-table tbody { display: block; }
    .comparison-table thead { display: none; }
    .comparison-table tr { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px 24px; padding: 22px 0; border-bottom: 1px solid var(--line); }
    .comparison-table tbody th:first-child { grid-column: 1 / -1; max-width: none; min-width: 0; padding: 0; border: 0; font-size: 17px; }
    .comparison-table tbody th small { display: inline-block; margin: 5px 16px 0 0; font-weight: 400; font-size: 11px; }
    .comparison-table td { padding: 0; min-width: 0; border: 0; text-align: left; white-space: normal; }
    .comparison-table td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; margin-bottom: 3px; }
    .comparison-table .comparison-stocks { grid-column: 1 / 3; }
    .comparison-links { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 22px; }
    .comparison-links > a { margin: 0; }
}
@media (max-width: 760px) {
    .top-actions { gap: 4px; }
    .brand { font-size: 16px; gap: 8px; }
    .brand > svg { width: 22px; }
    .top-actions .switch { width: 76px; padding: 5px 8px; gap: 6px; }
    .top-actions .switch span { width: 24px; height: 24px; }
    .site-menu-panel { right: -95px; }
    .account-run-status { font-size: 12px; }
    .account-run-status small { font-size: 10px; }
    .account-run-status > a { width: 100%; text-align: right; }
    .rule-section { grid-template-columns: minmax(0,1fr); gap: 12px; }
    .rule-summary { gap: 12px; }
    .rule-summary dd { font-size: 18px; }
    .trade-toolbar > .option-filter { flex-basis: 100%; }
    .trade-metrics > div:first-child { grid-column: 1 / -1; }
    .trade-metrics > div { border-left: 0; padding-left: 0; }
    .trade-table-wrap { border: 0; }
    .trade-table, .trade-table tbody { display: block; }
    .trade-table thead { display: none; }
    .trade-table tr[data-trade-row] { display: grid; grid-template-columns: minmax(0,1fr) 48px minmax(90px,1fr); gap: 7px 10px; padding: 18px 0; border-bottom: 1px solid var(--line); }
    .trade-table td { padding: 0; border: 0; min-width: 0 !important; max-width: none !important; white-space: normal; }
    .trade-table .trade-name { font-size: 15px; }
    .trade-side { text-align: center; }
    .trade-profit { font-size: 15px; }
    .trade-time { grid-column: 1 / 3; font-size: 12px; color: var(--muted); }
    .trade-option { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
    .trade-reason { grid-column: 1 / 3; align-self: center; }
    .trade-chart { text-align: right; }
    .broker-holding-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .broker-holding-row .holding-pnl { grid-column: 2; }
    .broker-account-metrics { grid-template-columns: minmax(0,1fr); gap: 12px; }
    .broker-account-metrics > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 0; border: 0; }
    .broker-account-metrics > div > span { font-size: 11px; max-width: 46%; }
    .broker-account-metrics strong { font-size: 16px; text-align: right; word-break: keep-all; }
}
@media (max-width: 480px) {
    .comparison-table tr { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
    .comparison-table td[data-label='총손익'] { grid-column: 1 / -1; }
    .comparison-table .comparison-stocks { grid-column: 1 / -1; }
    .comparison-table td[data-label='현재 자산'] { grid-column: 1 / -1; }
}

.audit-filters > label { min-width: 150px; max-width: 100%; }
.audit-filters select { max-width: 100%; }
.audit-change { margin: 16px 0; }
.audit-change > summary { color: var(--muted); font-size: 13px; cursor: pointer; }
.audit-totals { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border-block: 1px solid var(--line); margin: 24px 0; }
.audit-totals a { padding: 20px 12px; color: inherit; }
.audit-totals span { color: var(--muted); font-size: 13px; }
.audit-totals strong { display: block; font-size: 26px; margin-top: 8px; }
.audit-totals small { font-size: 12px; font-weight: 400; margin-left: 6px; }
.audit-list-head, .audit-row { display: grid; grid-template-columns: minmax(160px,1fr) 145px 160px minmax(260px,2fr); gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.audit-list-head { font-size: 12px; color: var(--muted); }
.audit-row > div { min-width: 0; overflow-wrap: anywhere; }
.audit-row p { margin: 5px 0; line-height: 1.6; }
.audit-row small, .audit-event small { display: block; color: var(--muted); margin-top: 6px; }
.audit-mobile-label { display: none; }
.audit-warning { color: #efc466 !important; }
.audit-detail { max-width: 1050px; }
.audit-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 25px 0; }
.audit-title h2 { font-size: 24px; margin: 0; overflow-wrap: anywhere; }
.audit-title small { font-size: 13px; color: var(--muted); font-weight: 400; }
.audit-answer { padding: 20px 0; border-block: 1px solid var(--line); margin-bottom: 30px; }
.audit-answer > strong { font-size: 20px; }
.audit-answer p { font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
.audit-timeline { padding: 0; list-style: none; }
.audit-event { display: grid; grid-template-columns: 105px minmax(0,1fr); gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.audit-event time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.audit-event p { margin: 8px 0; line-height: 1.6; overflow-wrap: anywhere; }
.audit-event details { margin-top: 12px; font-size: 12px; color: var(--muted); }
.audit-issue > div > .badge { color: #efc466; }
.audit-prices { margin-top: 40px; border-top: 1px solid var(--line); padding-top: 20px; }
.audit-price-table { min-width: 530px; }
@media (max-width: 1000px) {
    .audit-list-head { display: none; }
    .candidate-history-list .audit-list-head { display: none; }
    .candidate-history-list .audit-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
    .audit-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 15px; }
    .audit-row > div:last-child { grid-column: 1 / -1; }
    .audit-row > div:nth-child(3) { grid-column: 1 / -1; }
    .audit-mobile-label { display: block; color: var(--muted); font-size: 11px; margin-bottom: 6px; }
}
@media (max-width: 600px) {
    .audit-totals { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .audit-totals a { padding: 16px 0; }
    .audit-title { align-items: flex-start; flex-direction: column; gap: 8px; }
    .audit-title h2 { font-size: 21px; }
    .audit-event { grid-template-columns: minmax(0,1fr); gap: 8px; }
    .audit-filters > label { flex-basis: 100%; width: 100%; }
}
