html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

body { background: #f5f7fb; color: #182230; }
h1 { font-size: 1.8rem; font-weight: 750; margin-bottom: 1.25rem; }
h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 1rem; }
.panel { background: #fff; border: 1px solid #e3e8ef; border-radius: 14px; padding: 1.25rem; margin: 1rem 0; box-shadow: 0 3px 14px rgba(16,24,40,.04); }
.metric-grid { display:grid; grid-template-columns:repeat(4,minmax(150px,1fr)); gap:1rem; }
.plan-grid { display:grid; grid-template-columns:repeat(3,minmax(210px,1fr)); gap:1rem; }
.metric { background:#fff; border:1px solid #e3e8ef; border-radius:14px; padding:1rem 1.2rem; }
.metric span { display:block; color:#667085; font-size:.9rem; }
.metric strong { display:block; margin-top:.35rem; font-size:1.45rem; }
.form-grid { display:grid; grid-template-columns:repeat(3,minmax(190px,1fr)); gap:1rem; }
.form-grid label { display:flex; flex-direction:column; gap:.35rem; font-weight:650; color:#344054; }
.form-grid input,.form-grid select,.panel select { min-height:42px; border:1px solid #cfd6e0; border-radius:8px; padding:.5rem .65rem; background:#fff; }
.check { display:flex; align-items:flex-start; gap:.55rem; margin:1rem 0; font-weight:600; }
.check input { margin-top:.25rem; }
.check.danger { color:#b42318; }
.button-row { display:flex; gap:.6rem; margin-top:1rem; }
.safety-banner { padding:1rem 1.2rem; border-left:5px solid #f79009; border-radius:8px; background:#fffaeb; color:#7a2e0e; }
.status-list>div { display:flex; justify-content:space-between; padding:.7rem 0; border-bottom:1px solid #eef1f5; }
.status-list>div:last-child { border-bottom:0; }
.profit,.buy { color:#d92d20 !important; }
.loss,.sell { color:#175cd3 !important; }
.ok { color:#067647 !important; }
.status { border-radius:999px; padding:.2rem .55rem; font-size:.8rem; font-weight:700; }
.status.on { background:#dcfae6; color:#067647; }.status.off { background:#f2f4f7; color:#667085; }
.event { display:grid; grid-template-columns:130px 110px 1fr; gap:.8rem; padding:.65rem 0; border-bottom:1px solid #eef1f5; font-size:.9rem; }
.event.critical { color:#b42318; }.event.warning { color:#b54708; }
.muted { color:#667085; }
.auth-wrap { min-height:78vh; display:grid; place-items:center; padding:1rem; }
.auth-card { width:min(520px,100%); background:#fff; border:1px solid #dfe5ec; border-radius:16px; padding:2rem; box-shadow:0 14px 35px rgba(16,24,40,.09); }
.auth-card label:not(.check) { display:block; margin-top:1rem; font-weight:650; }
.auth-card input:not([type=checkbox]) { width:100%; border:1px solid #cfd6e0; border-radius:8px; padding:.65rem; }
.auth-card small { color:#667085; }
.stock-search-button { min-width:48px; font-size:1.05rem; }
.stock-modal-backdrop { position:fixed; inset:0; z-index:1800; display:grid; place-items:center; padding:1rem; background:rgba(16,24,40,.55); }
.stock-modal { width:min(700px,100%); height:min(700px,88vh); display:flex; flex-direction:column; gap:1rem; padding:1.25rem; background:#fff; border-radius:14px; box-shadow:0 24px 60px rgba(16,24,40,.25); }
.stock-modal-header { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; }
.stock-modal-header h2 { margin-bottom:.2rem; }
.stock-search-tools { display:grid; grid-template-columns:1fr auto; gap:.6rem; }
.stock-result-list { min-height:0; flex:1 1 auto; overflow:auto; border:1px solid #e3e8ef; border-radius:10px; }
.stock-result { width:100%; display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.75rem .9rem; border:0; border-bottom:1px solid #eef1f5; background:#fff; color:#182230; text-align:left; }
.stock-result:last-child { border-bottom:0; }
.stock-result:hover,.stock-result:focus { background:#f0f7ff; }
.stock-result span { display:flex; flex-direction:column; gap:.1rem; }
.stock-result small { color:#667085; }
.stock-result code { color:#175cd3; font-weight:700; }
.stock-picker-status { flex:1 1 auto; display:grid; place-items:center; min-height:0; color:#667085; border:1px dashed #cfd6e0; border-radius:10px; }
.stock-result-list-fixed { height:100%; }
.stock-result-footer { min-height:20px; }
.order-modal { width:min(720px,100%); max-height:90vh; overflow:auto; display:flex; flex-direction:column; gap:1rem; padding:1.25rem; background:#fff; border-radius:14px; box-shadow:0 24px 60px rgba(16,24,40,.25); }
.order-form-grid { grid-template-columns:repeat(2,minmax(220px,1fr)); }
.quote-summary { display:flex; flex-wrap:wrap; align-items:center; gap:.55rem 1rem; padding:.8rem 1rem; border:1px solid #e3e8ef; border-radius:10px; background:#f8fafc; }
.quote-summary span { color:#667085; }
.quote-summary strong { margin-right:1rem; }
.account-toolbar { display:flex; align-items:end; gap:.8rem; flex-wrap:wrap; }
.account-toolbar label { display:flex; flex-direction:column; gap:.3rem; min-width:260px; font-weight:650; }
.holdings-table td:first-child strong,.holdings-table td:first-child small,.price-time { display:block; }
.holdings-table td:first-child small,.price-time { color:#667085; font-size:.78rem; }
.table-subtext { display:block; color:#667085; font-size:.78rem; }
.list-heading,.table-pager { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.list-heading select { min-width:120px; }
.table-pager { margin-top:12px; color:#667085; }
.table-pager div { display:flex; gap:6px; }
.nav-order-button { width:100%; border:0; background:transparent; text-align:left; }
.schedule-options { display:flex; flex-wrap:wrap; gap:0 2rem; }
.schedule-form { display:grid; grid-template-columns:minmax(180px,240px) minmax(200px,280px) auto 1fr; align-items:end; gap:1rem; }
.schedule-form>label:not(.check) { display:flex; flex-direction:column; gap:.35rem; font-weight:650; color:#344054; }
.schedule-enabled { align-self:end; min-height:42px; margin:0; align-items:center; }
.schedule-form-buttons { margin:0; align-self:end; }
.schedule-heading { display:flex; justify-content:space-between; align-items:center; gap:1rem; }
.schedule-heading h2 { margin:0; }
.schedule-actions { display:flex; justify-content:flex-end; gap:.4rem; white-space:nowrap; }
@media(max-width:1000px){.metric-grid,.plan-grid{grid-template-columns:repeat(2,1fr)}.form-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:650px){.metric-grid,.plan-grid,.form-grid,.order-form-grid,.schedule-form{grid-template-columns:1fr}.panel{padding:.9rem}.event{grid-template-columns:1fr;gap:.15rem}.stock-search-tools{grid-template-columns:1fr}.stock-modal{height:90vh}.order-modal{padding:1rem}.schedule-form-buttons{width:100%}.schedule-actions{justify-content:flex-start}}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after { content: "화면을 처리하는 중 오류가 발생했습니다." }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* EngineeringTools 기준: 고정 상단바 + 모바일 오프캔버스 메뉴 */
:root { --trading-sidebar-width:248px; --trading-topbar-height:58px; --trading-sidebar-bg:#343a40; --trading-topbar-bg:#212529; --trading-overlay:rgba(20,28,40,.35); --trading-transition:180ms ease; }
.trading-shell { min-height:100vh; background:#f5f7fb; }
.trading-topbar { position:fixed; inset:0 0 auto 0; z-index:1050; min-height:var(--trading-topbar-height); display:flex; align-items:center; justify-content:space-between; padding:0 18px; border-top:3px solid #dc392d; background:var(--trading-topbar-bg); color:#fff; }
.trading-topbar-left,.trading-user-menu { display:flex; align-items:center; gap:12px; min-width:0; }
.trading-user-menu { position:relative; }
.trading-user-menu form { margin:0; }
.trading-user-button { width:40px; height:40px; display:grid; place-items:center; padding:0; border:0; border-radius:50%; background:transparent; color:#fff; }
.trading-user-button:hover,.trading-user-button:focus { background:rgba(255,255,255,.12); }
.trading-user-button svg { width:20px; height:20px; }
.trading-brand,.trading-brand:hover,.trading-brand:focus,.trading-brand:active,.trading-brand:visited { display:flex; flex-direction:column; color:#fff !important; line-height:1.05; text-decoration:none !important; }
.trading-brand small { color:rgba(255,255,255,.6); font-size:.68rem; }
.trading-brand span { font-size:1rem; }
.trading-menu-toggle { width:36px; height:36px; display:none; align-items:center; justify-content:center; flex-direction:column; gap:4px; padding:0; border:0; border-radius:6px; background:transparent; color:rgba(255,255,255,.7); }
.trading-menu-toggle:hover { background:var(--trading-sidebar-bg); }
.trading-menu-toggle span { width:18px; height:2px; display:block; border-radius:2px; background:currentColor; }
.trading-sidebar { position:fixed; top:var(--trading-topbar-height); bottom:0; left:0; z-index:1040; width:var(--trading-sidebar-width); display:flex; flex-direction:column; overflow:hidden; background:var(--trading-sidebar-bg); transition:transform var(--trading-transition); }
.trading-sidebar-nav { flex:1 1 auto; min-height:0; overflow-y:auto; padding:14px 10px 24px; }
.trading-nav-section { padding:18px 12px 6px; color:rgba(255,255,255,.48); font-size:.72rem; letter-spacing:.08em; }
.trading-nav-section:first-child { padding-top:6px; }
.trading-side-link,.trading-side-link:hover,.trading-side-link:focus,.trading-side-link:active,.trading-side-link:visited { min-height:40px; width:100%; display:flex; align-items:center; gap:10px; margin:2px 0; padding:8px 12px; border:0; border-radius:6px; color:#dee2e6 !important; background:transparent; font:inherit; text-align:left; text-decoration:none !important; -webkit-text-decoration:none !important; }
.trading-side-link:hover { color:#fff !important; background:rgba(255,255,255,.08); }
.trading-side-link.active { color:#fff !important; background:rgba(255,255,255,.14); text-decoration:none !important; }
.trading-side-link span { text-decoration:none !important; }
.trading-order-button { cursor:pointer; }
.trading-sidebar-footer { padding:14px 18px; color:rgba(255,255,255,.48); background:#212529; text-align:center; }
.trading-sidebar-backdrop { position:fixed; inset:0; z-index:1035; display:none; padding:0; border:0; background:var(--trading-overlay); }
.trading-main { min-height:100vh; margin-left:var(--trading-sidebar-width); padding-top:var(--trading-topbar-height); }
.trading-content { padding:22px 24px 40px; }
.trading-page-content { width:100%; max-width:1240px; margin:0 auto; }
.trading-user-dropdown-dismiss { position:fixed; inset:0; z-index:1990; padding:0; border:0; background:transparent; }
.trading-user-dropdown { position:absolute; top:calc(100% + 8px); right:0; z-index:2000; width:min(310px,calc(100vw - 24px)); overflow:hidden; border:1px solid #dfe5ec; border-radius:12px; background:#fff; color:#182230; box-shadow:0 18px 48px rgba(16,24,40,.24); }
.trading-user-dropdown-profile { display:flex; align-items:center; gap:12px; padding:16px; border-bottom:1px solid #e9edf2; }
.trading-user-dropdown-profile>div:last-child { min-width:0; display:flex; flex-direction:column; }
.trading-user-dropdown-profile strong { overflow:hidden; text-overflow:ellipsis; }
.trading-user-dropdown-profile small { color:#667085; }
.trading-user-avatar { width:42px; height:42px; flex:0 0 42px; display:grid; place-items:center; border-radius:50%; background:#edf3ff; color:#3b71ca; }
.trading-user-avatar svg { width:20px; height:20px; }
.trading-user-dropdown-links { padding:7px; border-bottom:1px solid #e9edf2; }
.trading-user-dropdown-links a,.trading-user-logout { width:100%; display:block; padding:10px 12px; border:0; border-radius:7px; background:transparent; color:#344054; text-align:left; text-decoration:none !important; }
.trading-user-dropdown-links a:hover { background:#f2f4f7; color:#182230; }
.trading-user-dropdown form { padding:7px; }
.trading-user-logout { color:#b42318; }
.trading-user-logout:hover { background:#fff1f0; }
.settings-panel { max-width:1000px; }
.strategy-page-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:16px; }
.strategy-page-heading h1 { margin-bottom:4px; }
.strategy-page-heading p { margin:0; }
.strategy-list-summary { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:14px; }
.strategy-list-summary h2 { margin:0; }
.strategy-list-summary span { color:#667085; font-size:.9rem; }
.strategy-stock-code,.strategy-mobile-card small { display:block; color:#667085; font-size:.78rem; }
.strategy-row-actions { white-space:nowrap; }
.strategy-row-actions .btn { margin:2px; }
.empty-strategy-list { min-height:180px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; color:#667085; text-align:center; }
.empty-strategy-list strong { color:#344054; }
.strategy-editor-backdrop { z-index:1600; }
.strategy-editor-modal { width:min(1040px,96vw); max-height:92vh; overflow:auto; padding:22px; border-radius:14px; background:#fff; box-shadow:0 24px 60px rgba(16,24,40,.3); }
.strategy-editor-header { align-items:center; padding-bottom:4px; }
.strategy-editor-title-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:8px; }
.strategy-editor-title-actions .btn-close { margin-left:6px; }
.strategy-editor-section h3 { margin:0 0 14px; color:#344054; font-size:1rem; }
.strategy-editor-divider { margin:20px 0; border:0; border-top:1px solid #dfe5ec; opacity:1; }
.strategy-editor-footer { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.strategy-editor-footer .button-row { margin:0; }
.strategy-subject-grid { grid-template-columns:repeat(4,minmax(180px,1fr)); }
.strategy-mobile-cards { display:none; }
.status.ready { background:#fff3cd; color:#8a6116; }
.status.complete { background:#edf3ff; color:#175cd3; }
.strategy-wide-table { min-width:1260px; }
.strategy-wide-table thead th>small { display:block; color:#667085; font-size:.74rem; font-weight:600; }
.strategy-stacked-value strong,.strategy-stacked-value small { display:block; }
.strategy-stacked-value small { margin-top:3px; color:#667085; font-size:.78rem; }
.strategy-stacked-value.profit small { color:#d92d20; }
.strategy-stacked-value.loss small { color:#175cd3; }
.strategy-decision { min-width:360px; max-width:560px; white-space:normal; line-height:1.45; }
.strategy-decision small { display:block; margin-top:4px; color:#667085; }
.strategy-mobile-card { padding:16px; border:1px solid #e3e8ef; border-radius:12px; background:#fff; }
.strategy-card-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.strategy-card-head strong { font-size:1.05rem; }
.strategy-card-price { display:flex; align-items:center; justify-content:space-between; margin:14px 0; padding:10px 12px; border-radius:8px; background:#f8fafc; }
.strategy-card-price span { color:#667085; }
.strategy-mobile-card dl { margin:0; }
.strategy-mobile-card dl>div { display:flex; justify-content:space-between; gap:16px; padding:6px 0; border-bottom:1px solid #eef1f5; }
.strategy-mobile-card dt { color:#667085; font-weight:500; }
.strategy-mobile-card dd { margin:0; text-align:right; }
.preset-toolbar { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 14px; }
.preset-picker-modal,.preset-save-modal,.preset-editor-modal { width:min(620px,96vw); max-height:90vh; overflow:auto; padding:20px; border-radius:14px; background:#fff; box-shadow:0 24px 60px rgba(16,24,40,.3); }
.preset-editor-modal { width:min(980px,96vw); }
.preset-picker-list { display:flex; flex-direction:column; gap:8px; margin-top:12px; max-height:60vh; overflow:auto; }
.preset-picker-list button { display:flex; flex-direction:column; gap:3px; width:100%; padding:12px 14px; border:1px solid #dfe5ec; border-radius:9px; background:#fff; color:#182230; text-align:left; }
.preset-picker-list button:hover { border-color:#84adff; background:#f5f8ff; }
.preset-picker-list span { color:#667085; font-size:.88rem; }
.preset-save-modal>label { display:flex; flex-direction:column; gap:6px; margin-top:12px; font-weight:650; color:#344054; }
@media (max-width:991.98px) {
    .trading-menu-toggle { display:inline-flex; }
    .trading-sidebar { width:min(var(--trading-sidebar-width),86vw); transform:translateX(-100%); box-shadow:6px 0 22px rgba(20,28,40,.18); }
    .trading-shell.sidebar-open .trading-sidebar { transform:translateX(0); }
    .trading-shell.sidebar-open .trading-sidebar-backdrop { display:block; }
    .trading-main { margin-left:0; }
    .trading-content { padding:18px 16px 32px; }
    body.sidebar-modal-open { overflow:hidden; }
}
@media (max-width:575.98px) { .trading-topbar { padding:0 12px; } .trading-user-menu > span { display:none; } }
@media (max-width:767.98px) {
    .strategy-page-heading { align-items:stretch; flex-direction:column; }
    .strategy-page-heading .btn { align-self:flex-end; }
    .strategy-desktop-table { display:none; }
    .strategy-mobile-cards { display:grid; gap:12px; }
    .strategy-list-summary { align-items:flex-start; flex-direction:column; gap:4px; }
    .strategy-editor-modal { width:100%; max-height:94vh; padding:16px; }
    .strategy-editor-header { align-items:flex-start; flex-direction:column; }
    .strategy-editor-title-actions { width:100%; justify-content:flex-start; }
    .strategy-editor-title-actions .btn-close { margin-left:auto; }
    .strategy-editor-footer { align-items:stretch; flex-direction:column; }
    .strategy-editor-footer .button-row { justify-content:flex-end; }
    .strategy-subject-grid { grid-template-columns:1fr; }
}
@media (max-width:1100px) and (min-width:768px) { .strategy-subject-grid { grid-template-columns:repeat(2,minmax(190px,1fr)); } }
