:root {
  color-scheme: dark;
  --bg: #090c18;
  --bg-soft: #0e1324;
  --panel: rgba(19, 25, 45, .86);
  --panel-strong: #151c32;
  --line: rgba(148, 163, 184, .16);
  --line-strong: rgba(148, 163, 184, .28);
  --text: #f4f7ff;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --accent: #7c8cff;
  --accent-2: #4fd1c5;
  --danger: #fb7185;
  --warning: #f6ad55;
  --success: #4ade80;
  --shadow: 0 18px 50px rgba(0, 0, 0, .22);
  font-family: Inter, "Noto Sans KR", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(circle at 80% -10%, rgba(124,140,255,.17), transparent 34%), var(--bg); color: var(--text); }
body { min-width: 1180px; }
button, input, select { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 238px; padding: 28px 18px; border-right: 1px solid var(--line); background: rgba(8, 11, 23, .92); backdrop-filter: blur(18px); display: flex; flex-direction: column; z-index: 10; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 32px; }
.brand-mark { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; background: linear-gradient(135deg, var(--accent), #a855f7); box-shadow: 0 10px 28px rgba(124,140,255,.32); }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 13px; letter-spacing: .12em; }
.brand span { color: var(--muted); font-size: 11px; margin-top: 3px; }
.sidebar nav { display: grid; gap: 8px; }
.nav-button { border: 0; background: transparent; border-radius: 13px; padding: 13px 14px; display: flex; align-items: center; gap: 12px; color: var(--muted); cursor: pointer; text-align: left; }
.nav-button svg { width: 20px; height: 20px; fill: currentColor; }
.nav-button:hover { background: rgba(124,140,255,.08); color: var(--text); }
.nav-button.active { color: white; background: linear-gradient(90deg, rgba(124,140,255,.22), rgba(124,140,255,.05)); box-shadow: inset 3px 0 var(--accent); }
.sidebar-note { margin-top: auto; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); }
.sidebar-note span { color: var(--accent-2); font-size: 10px; letter-spacing: .14em; font-weight: 700; }
.sidebar-note p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
main { margin-left: 238px; min-height: 100vh; }
.page { padding: 46px 42px 70px; max-width: 1680px; margin: 0 auto; }
.page-title-row { display: flex; justify-content: space-between; gap: 32px; align-items: flex-end; margin-bottom: 28px; }
.eyebrow, .panel-kicker { color: var(--accent-2); font-weight: 700; letter-spacing: .14em; font-size: 10px; }
h1 { font-size: 32px; line-height: 1.15; margin: 7px 0 8px; letter-spacing: -.04em; }
.page-title-row p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 14px; }
.header-actions { display: flex; gap: 10px; }
.button { border: 1px solid transparent; border-radius: 11px; padding: 11px 16px; font-weight: 700; font-size: 13px; cursor: pointer; transition: .18s ease; }
.button:disabled { opacity: .45; cursor: wait; }
.button.primary { background: linear-gradient(135deg, var(--accent), #6d5ce7); box-shadow: 0 10px 28px rgba(124,140,255,.22); }
.button.primary:hover { transform: translateY(-1px); box-shadow: 0 14px 34px rgba(124,140,255,.3); }
.button.secondary, .button.ghost { background: rgba(255,255,255,.035); border-color: var(--line-strong); }
.button.secondary:hover, .button.ghost:hover { background: rgba(255,255,255,.07); }
.button.ghost { padding: 8px 12px; }
.button.danger-outline { background: rgba(251,113,133,.06); border-color: rgba(251,113,133,.4); color: #fda4af; }
.summary-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.compact-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.summary-card { padding: 19px 20px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(145deg, rgba(25,33,59,.9), rgba(14,19,36,.9)); box-shadow: var(--shadow); }
.summary-card.good { border-color: rgba(79,209,197,.28); background: linear-gradient(145deg, rgba(22,57,61,.55), rgba(14,19,36,.9)); }
.summary-card span, .summary-card small { display: block; color: var(--muted); }
.summary-card span { font-size: 12px; }
.summary-card strong { display: block; margin: 10px 0 7px; font-size: 22px; letter-spacing: -.03em; }
.summary-card small { font-size: 11px; }
.panel { border: 1px solid var(--line); border-radius: 19px; background: var(--panel); box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 22px 0; }
.panel-head h2 { margin: 5px 0 0; font-size: 17px; letter-spacing: -.02em; }
.panel-head > strong { color: var(--muted); font-size: 12px; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.chart-grid.single { align-items: stretch; }
.donut-wrap { display: grid; grid-template-columns: 220px 1fr; gap: 14px; align-items: center; padding: 14px 22px 24px; min-height: 270px; }
.donut { width: 220px; height: 220px; overflow: visible; }
.donut-center-label { fill: var(--muted); font-size: 9px; }
.donut-center-value { fill: var(--text); font-size: 15px; font-weight: 800; }
.legend { display: grid; gap: 8px; max-height: 220px; overflow: auto; padding-right: 6px; }
.legend-row { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 9px; font-size: 11px; }
.legend-dot { width: 8px; height: 8px; border-radius: 3px; }
.legend-name { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-chart { min-height: 270px; display: grid; place-items: center; align-content: center; color: var(--muted); }
.empty-ring { width: 130px; height: 130px; border: 20px solid rgba(148,163,184,.12); border-radius: 50%; }
.content-grid { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; }
.block-list { padding: 12px 22px 22px; }
.block-row { display: grid; grid-template-columns: 180px 1fr 120px; gap: 18px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.block-row:last-child { border: 0; }
.block-row strong, .block-row small { display: block; }
.block-row small { color: var(--muted); margin-top: 4px; font-size: 10px; }
.progress-track { height: 7px; background: rgba(148,163,184,.12); border-radius: 999px; overflow: hidden; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.block-numbers { display: flex; justify-content: space-between; font-size: 11px; }
.positive { color: #fda4af !important; }
.negative { color: #67e8f9 !important; }
.insight-panel { padding-bottom: 22px; }
.insight { margin: 16px 22px 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; display: flex; align-items: center; gap: 13px; background: rgba(255,255,255,.025); }
.insight-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; font-weight: 800; }
.insight-icon.down { color: #67e8f9; background: rgba(103,232,249,.09); }
.insight-icon.up { color: #fda4af; background: rgba(253,164,175,.09); }
.insight small, .insight strong, .insight p { display: block; margin: 0; }
.insight small { color: var(--muted); font-size: 10px; }
.insight strong { margin-top: 3px; }
.insight p { color: var(--muted); font-size: 11px; margin-top: 4px; }
.data-note { margin: 18px 22px 0; padding-top: 18px; border-top: 1px solid var(--line); }
.data-note strong { font-size: 12px; }
.data-note p { color: var(--muted); font-size: 11px; line-height: 1.65; }
.alert { border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.alert.error { border: 1px solid rgba(251,113,133,.34); background: rgba(251,113,133,.08); }
.alert span { color: #fecdd3; }
.inline-status { display: flex; align-items: center; gap: 14px; width: fit-content; margin-bottom: 14px; padding: 10px 14px; border-radius: 12px; font-size: 12px; }
.inline-status.ok { background: rgba(74,222,128,.08); border: 1px solid rgba(74,222,128,.22); }
.inline-status.warn { background: rgba(246,173,85,.08); border: 1px solid rgba(246,173,85,.25); }
.inline-status small { color: var(--muted); }
.table-panel { margin-bottom: 18px; }
.table-scroll { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 1160px; }
.data-table th { position: sticky; top: 0; z-index: 2; background: #151b30; color: var(--muted); font-size: 10px; text-align: left; font-weight: 700; letter-spacing: .04em; padding: 12px 13px; white-space: nowrap; }
.data-table td { border-top: 1px solid var(--line); padding: 11px 13px; font-size: 11px; vertical-align: middle; }
.data-table tr:hover td { background: rgba(124,140,255,.025); }
.table-input, .table-select, .form-grid input, .form-grid select, .wallet-card input, .group-chip input { width: 100%; min-width: 88px; border: 1px solid var(--line); border-radius: 9px; background: rgba(8,12,24,.75); color: var(--text); padding: 8px 9px; outline: none; }
.table-input:focus, .table-select:focus, .form-grid input:focus, .form-grid select:focus, .wallet-card input:focus, .group-chip input:focus { border-color: rgba(124,140,255,.75); box-shadow: 0 0 0 3px rgba(124,140,255,.1); }
.table-input.symbol { min-width: 95px; font-weight: 700; }
.table-input.wide { min-width: 160px; }
.table-input.number { min-width: 84px; text-align: right; }
.table-select { min-width: 110px; }
.table-select.compact { min-width: 78px; }
.price-cell strong, .price-cell small { display: block; }
.price-cell small { color: var(--muted-2); margin-top: 4px; font-size: 9px; min-width: 100px; }
.badge { display: inline-block; margin-left: 7px; padding: 2px 6px; border-radius: 999px; font-size: 8px; font-weight: 800; }
.badge.ok { color: #86efac; background: rgba(74,222,128,.1); }
.badge.warn { color: #fdba74; background: rgba(246,173,85,.12); }
.badge.error { color: #fda4af; background: rgba(251,113,133,.12); }
.badge.manual { color: #c4b5fd; background: rgba(167,139,250,.12); }
.badge.neutral { color: var(--muted); background: rgba(148,163,184,.1); }
.switch input { display: none; }
.switch span { display: block; width: 34px; height: 19px; border-radius: 999px; background: #334155; position: relative; cursor: pointer; }
.switch span::after { content: ''; position: absolute; width: 13px; height: 13px; top: 3px; left: 3px; border-radius: 50%; background: white; transition: .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(15px); }
.icon-button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.icon-button.danger:hover { color: var(--danger); border-color: rgba(251,113,133,.45); }
.group-editor { display: flex; flex-wrap: wrap; gap: 10px; padding: 18px 22px 22px; }
.group-chip { display: flex; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.group-chip input { border: 0; border-radius: 0; min-width: 130px; }
.group-chip button { width: 32px; border: 0; border-left: 1px solid var(--line); background: rgba(255,255,255,.025); cursor: pointer; }
.empty-state { padding: 70px 24px; border: 1px dashed var(--line-strong); border-radius: 19px; text-align: center; margin-bottom: 18px; background: rgba(255,255,255,.015); }
.empty-state-icon { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto 16px; color: var(--accent-2); background: rgba(79,209,197,.08); font-size: 24px; }
.empty-state h2 { margin: 0; font-size: 18px; }
.empty-state p { color: var(--muted); font-size: 12px; margin: 10px 0 20px; }
.empty-row { text-align: center; color: var(--muted); padding: 50px !important; }
.asset-name strong, .asset-name small { display: block; }
.asset-name small { color: var(--muted); margin-top: 4px; }
.action-pill { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 9px; font-weight: 800; }
.action-pill.buy { color: #86efac; background: rgba(74,222,128,.1); }
.action-pill.sell { color: #fda4af; background: rgba(251,113,133,.1); }
.action-pill.hold { color: var(--muted); background: rgba(148,163,184,.1); }
.cycle-card { padding-bottom: 20px; }
.cycle-total { margin: 20px 22px 10px; padding: 18px; border-radius: 15px; background: linear-gradient(135deg, rgba(124,140,255,.16), rgba(79,209,197,.07)); }
.cycle-total span, .cycle-total small, .cycle-total strong { display: block; }
.cycle-total span, .cycle-total small { color: var(--muted); font-size: 10px; }
.cycle-total strong { font-size: 24px; margin: 7px 0; }
.cycle-list { max-height: 205px; overflow: auto; padding: 0 22px; }
.cycle-list > div { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.cycle-list small { color: var(--muted); }
.settings-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: start; }
.settings-panel { padding-bottom: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 18px 22px 0; }
.form-grid label, .wallet-card label { color: var(--muted); font-size: 10px; display: grid; gap: 7px; }
.form-grid input, .form-grid select, .wallet-card input { padding: 10px 11px; }
.wallet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 18px 22px 0; }
.wallet-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 11px; background: rgba(255,255,255,.02); }
.wallet-head { display: flex; justify-content: space-between; align-items: center; }
.wallet-head strong { color: var(--accent-2); }
.wallet-head span { color: var(--muted); font-size: 9px; }
.fx-row { align-items: end; }
.field-note span, .field-note strong, .field-note small { display: block; }
.field-note span, .field-note small { color: var(--muted); font-size: 9px; }
.field-note strong { font-size: 11px; margin: 4px 0; }
.button-stack { padding: 18px 22px 0; display: grid; gap: 10px; }
.file-button { position: relative; text-align: center; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.policy-list { padding: 10px 22px 0; }
.policy-list > div { padding: 15px 0; border-bottom: 1px solid var(--line); }
.policy-list > div:last-child { border: 0; }
.policy-list strong { font-size: 12px; }
.policy-list p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.toast { position: fixed; right: 26px; bottom: 24px; transform: translateY(20px); opacity: 0; pointer-events: none; padding: 13px 16px; border-radius: 12px; border: 1px solid var(--line); background: #182038; box-shadow: var(--shadow); font-size: 12px; transition: .2s; z-index: 30; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: rgba(74,222,128,.4); }
.toast.error { border-color: rgba(251,113,133,.5); }
.toast.warn { border-color: rgba(246,173,85,.5); }
@media (max-width: 1280px) {
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
}
.cash-settings { grid-column: 1 / -1; }
.fx-rate-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fx-source-row { margin: 16px 22px 0; padding: 15px 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.02); display: grid; grid-template-columns: 230px 1fr; gap: 20px; align-items: center; }
.fx-source-row > div { display: grid; grid-template-columns: auto 1fr; column-gap: 9px; align-items: center; }
.fx-source-row .badge { margin-left: 0; }
.fx-source-row strong { font-size: 11px; }
.fx-source-row small { grid-column: 1 / -1; color: var(--muted); margin-top: 6px; font-size: 9px; }
.fx-source-row p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.fx-source-row b { color: var(--text); }
.fx-conversion-card { padding-bottom: 20px; }
.fx-flow { margin: 20px 22px 14px; padding: 20px; border-radius: 16px; border: 1px solid rgba(124,140,255,.22); background: linear-gradient(135deg, rgba(124,140,255,.14), rgba(79,209,197,.06)); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; }
.fx-flow > div { min-width: 0; }
.fx-flow span, .fx-flow small, .fx-flow strong { display: block; }
.fx-flow span, .fx-flow small { color: var(--muted); font-size: 9px; }
.fx-flow strong { margin: 7px 0 5px; font-size: 18px; overflow: hidden; text-overflow: ellipsis; }
.fx-flow b { color: var(--accent-2); font-size: 22px; }
.fx-detail-list { margin: 0 22px; display: grid; gap: 0; }
.fx-detail-list > div { display: grid; grid-template-columns: 150px 1fr; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 10px; }
.fx-detail-list span { color: var(--muted); }
.fx-detail-list strong { text-align: right; font-weight: 600; }
.fx-footnote { margin: 14px 22px 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
@media (max-width: 1280px) {
  .fx-rate-grid { grid-template-columns: 1fr 1fr; }
}

/* Country-aware security names */
.display-controls { margin: 0 0 16px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.018); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.display-controls > div { min-width: 150px; margin-right: 4px; }
.display-controls > div span, .display-controls > div strong { display: block; }
.display-controls > div span { color: var(--accent-2); font-size: 8px; font-weight: 800; letter-spacing: .12em; }
.display-controls > div strong { margin-top: 4px; font-size: 11px; }
.display-controls label { display: flex; align-items: center; gap: 7px; padding: 5px 7px 5px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 9px; background: rgba(8,12,24,.62); }
.display-controls select { border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--text); padding: 4px 7px; outline: none; }
.display-controls option { background: #151b30; }
.asset-table { min-width: 1990px; }
.table-input.name-input { min-width: 150px; }
.table-input.name-input.english { min-width: 205px; }
@media (max-width: 760px) {
  .display-controls { align-items: stretch; }
  .display-controls > div { width: 100%; }
  .display-controls label { flex: 1 1 180px; justify-content: space-between; }
}

.naming-note { margin: -2px 0 14px; padding: 11px 14px; border-left: 3px solid var(--accent-2); border-radius: 0 11px 11px 0; background: rgba(79,209,197,.055); display: flex; gap: 10px; align-items: baseline; font-size: 10px; }
.naming-note strong { white-space: nowrap; color: #99f6e4; }
.naming-note span { color: var(--muted); line-height: 1.6; }

.table-input.quote-symbol { min-width: 125px; font-family: Inter, sans-serif; }
