﻿/* Base app common styles */
:root {
    --blue: #0874ee;
    --dark: #121a2c;
    --muted: #68758a;
    --bg: #f5f7fb;
    --danger: #e53935;
    --ok: #12805c;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--dark);
    font-family: Pretendard,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    height: 58px;
    background: var(--blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
}
.brand {
    font-weight: 900;
    font-size: 20px;
}
.topbar nav {
    display: flex;
    gap: 14px;
    align-items: center;
}
.topbar a, .topbar span {
    color: white;
    text-decoration: none;
    font-weight: 800;
    font-size: 14px;
}
.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 28px;
}
.card {
    background: white;
    border-radius: 22px;
    min-width: 0;
    padding: 22px;
    box-shadow: 0 16px 40px rgba(20,30,60,.08);
    margin-bottom: 20px;
}
.card h1, .card h2 {
    margin-top: 0;
}
.metrics {
    display: grid;
    grid-template-columns: repeat(5,minmax(0,1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.metric {
    background: white;
    border-radius: 16px;
    padding: 16px;
    border: 1px solid #e6ebf2;
    box-shadow: 0 10px 24px rgba(20,30,60,.05);
}
.metric span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 6px;
}
.metric strong {
    font-size: 20px;
}
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.grid > * {
    min-width: 0;
}
label {
    display: block;
    font-size: 13px;
    color: #4a5568;
    margin: 12px 0 6px;
}
input, select, textarea {
    width: 100%;
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid #d7deea;
    padding: 0 12px;
    font-size: 15px;
}
textarea {
    padding: 12px;
    min-height: 80px;
}
button, .btn {
    border: 0;
    background: var(--blue);
    color: white;
    border-radius: 12px;
    padding: 11px 16px;
    font-weight: 900;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin-top: 10px;
}
button.secondary, .btn.secondary {
    background: #e2e8f0;
    color: var(--dark);
}
.table-wrap {
    overflow: auto;
    border-radius: 16px;
    border: 1px solid #e6ebf2;
}
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 14px;
}
th, td {
    padding: 12px 10px;
    border-bottom: 1px solid #edf1f7;
    text-align: left;
}
th {
    background: #f8fafc;
    color: #4a5568;
}
.badge {
    padding: 4px 8px;
    border-radius: 999px;
    background: #edf2ff;
    font-size: 12px;
    font-weight: 900;
}
.badge.red {
    background: #ffe8e8;
    color: #b42318;
}
.badge.green {
    background: #e8fff2;
    color: #087443;
}
.badge.gray {
    background: #edf2f7;
    color: #4a5568;
}
.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    background: #fff7e6;
    color: #8a5a00;
}
.error {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    background: #ffe8e8;
    color: #b42318;
}
.success {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    background: #e8fff2;
    color: #087443;
}
pre {
    background: #101828;
    color: #dbeafe;
    padding: 16px;
    border-radius: 16px;
    overflow: auto;
    min-height: 80px;
}
.footer {
    text-align: center;
    color: #718096;
    padding: 32px;
}
.footer span {
    display: inline-block;
}
.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.login-card {
    width: min(720px,100%);
    background: white;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(20,30,60,.14);
}
.login-title {
    background: var(--blue);
    color: white;
    padding: 22px;
    text-align: center;
    font-size: 24px;
    font-weight: 900;
}
.login-body {
    padding: 28px;
}
.row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}
.install-header {
    background: var(--blue);
    color: white;
    padding: 14px 20px;
    font-weight: 900;
    font-size: 20px;
}
.install-wrap {
    max-width: 860px;
    margin: 32px auto;
    background: white;
    border-radius: 26px;
    box-shadow: 0 24px 80px rgba(20,30,60,.14);
    overflow: hidden;
}
.install-body {
    padding: 28px;
}
.section-title {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #e6ebf2;
}
@media (max-width: 820px) {
    .topbar {
        height: auto;
        display: block;
        padding: 16px;
    }
    .topbar nav {
        margin-top: 10px;
        flex-wrap: wrap;
    }
    .metrics, .grid {
        grid-template-columns: 1fr;
    }
}
/* Developer raw JSON/details common styles */
.dev-raw-json {
    margin-top: 10px;
}
.dev-raw-json summary {
    cursor: pointer;
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid #d7deea;
    background: #f8fafc;
    color: #64748b;
    font-size: 13px;
    font-weight: 800;
}
.dev-raw-json summary:hover {
    background: #eef2f7;
    color: #0f172a;
}
.dev-raw-json pre {
    max-height: 180px !important;
    overflow: auto !important;
    white-space: pre-wrap !important;
    word-break: break-word !important;
    font-size: 12px !important;
    line-height: 1.45 !important;
}
/* Operation center styles */
.operation-sub-detail {
    margin-top: 4px;
}
.operation-sub-detail summary,
.operation-support-menu summary {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #d7deea;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    font-weight: 900;
}
.operation-sub-detail summary {
    padding: 8px 12px;
}
.operation-support-menu summary {
    padding: 7px 11px;
}
.operation-sub-detail summary:hover,
.operation-support-menu summary:hover {
    background: #eef2f7;
    color: #0f172a;
}
.operation-sub-detail[open] summary {
    margin-bottom: 12px;
}
.operation-sub-detail summary::-webkit-details-marker,
.operation-support-menu summary::-webkit-details-marker {
    display: none;
}
.operation-sub-detail summary::before,
.operation-support-menu summary::before {
    content: "??;
    font-size: 12px;
}
.operation-sub-detail[open] summary::before,
.operation-support-menu[open] summary::before {
    content: "??;
}
.operation-main-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}
.op-danger-btn {
    background: #dc2626 !important;
    color: #ffffff !important;
    border: 0 !important;
    font-weight: 900 !important;
}
.operation-support-menu {
    margin-top: 12px;
}
.operation-support-menu[open] {
    display: block !important;
}
.operation-support-menu[open] .operation-support-links {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 10px !important;
    margin-top: 12px !important;
    padding: 10px 0 0 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    overflow: visible !important;
}
.operation-support-links .btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}
.operation-support-menu:not([open]) .operation-support-links {
    display: none !important;
}
/* Operation readability polish */
@media (min-width: 1100px) {
    body:has(.operation-main-actions) .container {
        max-width: 1040px !important;
    }
}
body:has(.operation-main-actions) section.card > .alert:first-of-type {
    line-height: 1.55;
}
#autoBuyBox table,
#autoSellBox table,
#riskBox table,
#todayBox table {
    border: 1px solid #eef2f7 !important;
    background: #ffffff !important;
}
#autoBuyBox th,
#autoBuyBox td,
#autoSellBox th,
#autoSellBox td,
#riskBox th,
#riskBox td,
#todayBox th,
#todayBox td {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}
#autoBuyBox th,
#autoSellBox th,
#riskBox th,
#todayBox th {
    width: 36%;
    color: #334155;
    background: #f8fafc !important;
}
#autoBuyBox td,
#autoSellBox td,
#riskBox td,
#todayBox td {
    background: #ffffff !important;
}
#positionsBody td,
#candidatesBody td,
#ordersBody td {
    vertical-align: middle;
}
body:has(.operation-main-actions) section.card h2 {
    letter-spacing: 0;
}
/* Layout common extracted styles */
.top-log-btn {
    font-size: inherit;
}
.top-log-menu {
    position: relative;
}
.top-log-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 160px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.24);
    padding: 8px;
    z-index: 10000;
}
.top-log-menu:hover .top-log-dropdown,
.top-log-menu:focus-within .top-log-dropdown,
.top-log-menu.is-open .top-log-dropdown {
    display: block;
}
.top-log-dropdown a {
    display: block !important;
    color: #0f172a !important;
    text-decoration: none;
    font-weight: 800;
    padding: 9px 10px;
    border-radius: 9px;
    white-space: nowrap;
}
.top-log-dropdown a:hover {
    background: #eef4ff;
}
.top-log-menu {
    position: relative;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
    height: auto !important;
    line-height: inherit !important;
}
.top-log-btn {
    appearance: none;
    -webkit-appearance: none;
    border: 0 !important;
    background: transparent !important;
    color: #fff !important;
    font: inherit !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 8px !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    transform: translateY(0) !important;
}
.top-log-btn:hover {
    opacity: 0.85;
}
.top-log-dropdown {
    right: 0 !important;
}
.stock-modal-actions {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}
.top-log-menu.is-open .top-log-dropdown {
    display: block !important;
}
.top-log-menu {
    padding-bottom: 10px !important;
    margin-bottom: -10px !important;
}
.top-log-dropdown {
    top: 100% !important;
    margin-top: 0 !important;
}
.top-log-dropdown::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -10px;
    height: 10px;
}
.stock-modal.size-wide iframe,
.stock-modal.size-tall iframe {
    min-height: 0;
}
select:not([multiple]) {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    padding-right: 44px !important;
    background-color: #fff !important;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' fill='none' stroke='%230f172a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 18px 18px !important;
}
select::-ms-expand {
    display: none;
}
form select,
.card select {
    box-sizing: border-box !important;
}
.stock-select-wrap {
    position: relative !important;
    display: inline-block !important;
    vertical-align: middle !important;
}
.stock-select-wrap select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    padding-right: 44px !important;
    background-image: none !important;
}
.stock-select-wrap::after {
    content: "??;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: auto;
    font-size: 11px;
    line-height: 1;
    color: #0f172a;
    z-index: 5;
}
.stock-select-wrap select::-ms-expand {
    display: none;
}
.card form .stock-select-wrap,
form .stock-select-wrap {
    width: auto !important;
}
.card form .stock-select-wrap select,
form .stock-select-wrap select {
    width: 100% !important;
}
/* Global popup modal extracted style */
.stock-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: none;
    background: rgba(15, 23, 42, 0.58);
    padding: 28px;
}
.stock-modal-backdrop.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
}
.stock-modal {
    position: relative;
    width: min(1280px, 96vw);
    height: min(860px, 92vh);
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 30px 90px rgba(15, 23, 42, 0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.stock-modal.is-loading::after {
    content: "遺덈윭?ㅻ뒗 以?..";
    position: absolute;
    left: 0;
    right: 0;
    top: 58px;
    bottom: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f6fb;
    color: #334155;
    font-weight: 900;
}
.stock-modal-head {
    height: 58px;
    flex-shrink: 0;
    padding: 0 18px 0 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #0b7fea;
    color: #fff;
}
.stock-modal-title {
    font-weight: 800;
    font-size: 17px;
}
.stock-modal-actions button,
.stock-modal-actions a {
    height: 34px !important;
    min-width: 48px !important;
    padding: 0 13px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    border: 0;
    border-radius: 10px;
    font-weight: 800;
    cursor: pointer;
    background: rgba(255,255,255,0.18);
    color: #fff;
    text-decoration: none;
}
.stock-modal-actions button:hover,
.stock-modal-actions a:hover {
    background: rgba(255,255,255,0.28);
}
.stock-modal iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #f3f6fb !important;
}
.stock-modal.size-wide {
    width: min(1480px, 98vw);
    height: min(920px, 94vh);
}
.stock-modal.size-tall {
    width: min(1320px, 96vw);
    height: min(980px, 96vh);
}
.stock-modal.size-medium {
    width: min(1080px, 94vw);
    height: min(820px, 90vh);
}
.stock-modal.size-compact {
    width: min(860px, 92vw);
    height: min(680px, 86vh);
}
@media (max-width: 720px) {
    .stock-modal-backdrop {
        padding: 8px;
    }
    .stock-modal {
        width: 100vw;
        height: 96vh;
        border-radius: 16px;
    }
    .stock-modal-head {
        height: 54px;
    }
    .stock-modal.is-loading::after {
        top: 54px;
    }
}
/* Shared extracted utility styles */
.row.row-spaced {
    margin-top: 10px;
}
.paper-control-message {
    margin-top: 14px;
}
/* Investment target layout styles */
@media (min-width: 901px) {
    body:has(.investment-page) .topbar {
        max-width: 980px;
        margin: 0 auto;
        padding: 0 24px;
        border-radius: 8px 8px 0 0;
    }
    body:has(.investment-page) .topbar nav {
        gap: 6px;
    }
    body:has(.investment-page) .topbar a,
    body:has(.investment-page) .topbar span {
        font-size: 12px;
        white-space: nowrap;
    }
}
body:has(.investment-page) .container {
    max-width: 980px;
    padding-top: 14px;
}
body:has(.investment-page) .metrics {
    gap: 10px;
    margin-bottom: 10px;
}
@media (min-width: 901px) {
    body:has(.investment-page) .metrics {
        position: sticky;
        top: 58px;
        z-index: 4;
        padding: 8px 0;
        background: var(--bg);
        border-bottom: 1px solid rgba(214,226,242,.82);
        box-shadow: 0 10px 16px rgba(243,246,251,.88);
    }
    .investment-market-tabs {
        box-shadow: 0 10px 18px rgba(15,23,42,.10);
        isolation: isolate;
    }
}
body:has(.investment-page) .metric {
    border-radius: 8px;
    padding: 10px 14px;
}
body:has(.investment-page) .metric span {
    margin-bottom: 4px;
}
body:has(.investment-page) .metric strong {
    font-size: 18px;
}
body:has(.investment-page) .footer {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    max-width: 980px;
    min-height: 168px;
    margin: 0 auto 40px;
    padding: 112px 24px 22px;
    border-radius: 0 0 8px 8px;
    background: var(--blue);
    color: white;
    text-align: right;
    font-size: 12px;
    font-weight: 900;
    box-shadow: 0 18px 34px rgba(8,116,238,.15);
}
body:has(.investment-page) .footer-product,
body:has(.investment-page) .footer-mode,
body:has(.investment-page) .footer-separator {
    display: none;
}
body:has(.investment-page) .footer-version {
    line-height: 1;
    letter-spacing: 0;
}
body:has(.investment-page) .topbar nav > a:not([href="/kospi.php"]):not([href="/nasdaq.php"]):not([href="/info.php"]):not([href="/logout.php"]),
body:has(.investment-page) .topbar nav > .top-log-menu {
    display: inline-flex !important;
}
body:has(.investment-page) .topbar nav > a[href="/kospi.php"],
body:has(.investment-page) .topbar nav > a[href="/nasdaq.php"],
body:has(.investment-page) .topbar nav > a[href="/info.php"] {
    min-width: 72px;
    min-height: 24px;
    order: 1;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border: 1px solid #d6e2f2;
    background: white;
    color: #0e1d34;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
}
body:has(.investment-page) .topbar nav > a[href="/kospi.php"] {
    border-radius: 999px 0 0 999px;
}
body:has(.investment-page) .topbar nav > a[href="/nasdaq.php"] {
    order: 2;
    border-left: 0;
    border-radius: 0;
}
body:has(.investment-page) .topbar nav > a[href="/info.php"] {
    order: 3;
    border-left: 0;
    border-radius: 0 999px 999px 0;
}
body:has(.investment-market-tabs a[href="/kospi.php"].is-active) .topbar nav > a[href="/kospi.php"],
body:has(.investment-market-tabs a[href="/nasdaq.php"].is-active) .topbar nav > a[href="/nasdaq.php"],
body:has(.investment-market-tabs a[href="/info.php"].is-active) .topbar nav > a[href="/info.php"] {
    border-color: #f20d18;
    background: #f20d18;
    color: white;
}
body:has(.investment-page) .topbar nav > a[href="/logout.php"] {
    order: 10;
    margin-left: 18px;
    color: white;
    background: transparent;
    border: 0;
    min-width: 0;
    min-height: 0;
    padding: 0;
}
body:has(.investment-page) .topbar nav > span:not(.top-log-menu) {
    order: 11;
    color: white;
    font-size: 12px;
    font-weight: 900;
}
body:has(.investment-page) .topbar nav > a:not([href="/kospi.php"]):not([href="/nasdaq.php"]):not([href="/info.php"]) {
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: white;
}
body:has(.investment-page) .topbar nav > .top-log-menu {
    order: 4;
}
.investment-market-tabs {
    display: none;
}
.investment-market-tabs a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 98px;
    padding: 8px 18px;
    text-align: center;
    color: #0e1d34;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
    border-right: 1px solid #d6e2f2;
}
.investment-market-tabs a:last-child {
    border-right: 0;
}
.investment-market-tabs a.is-active {
    background: #f20d18;
    color: white;
}
.investment-page {
    display: flex;
    flex-direction: column;
}
.investment-market-page::before {
    display: none !important;
    content: none !important;
}
.investment-market-page > .investment-control-panel {
    order: 1;
    margin-top: 0;
    margin-bottom: 14px;
}
.investment-market-page > .investment-list-card {
    order: 2;
    margin-top: 0;
}
.investment-market-page > .investment-top-panel {
    order: 3;
    margin-top: 0;
}
.investment-fixed-panel {
    position: -webkit-sticky;
    position: sticky;
    top: 58px;
    z-index: 6;
    overflow: visible !important;
    border: 1px solid #2a72f2;
    border-radius: 16px;
    background: #f5f7fb;
    padding: 0 10px 10px;
    margin-bottom: 16px;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}
.investment-market-page {
    overflow: visible !important;
}
body:has(.investment-page) .investment-fixed-panel {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 58px !important;
    z-index: 20 !important;
}
.investment-market-time {
    order: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 8px;
}
.investment-time-card {
    overflow: hidden;
    border: 1px solid #8f9aae;
    border-radius: 8px;
    background: #f1f3f5;
    text-align: center;
}
.investment-time-card-title {
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px 8px;
    background: #050505;
    color: white;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.1;
}
.investment-time-card.is-hot .investment-time-card-title {
    background: #f20d18;
}
.investment-time-card-value {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 9px 8px;
    color: #0e1d34;
    font-size: 15px;
    font-weight: 900;
}
.investment-summary-strip {
    display: grid;
    grid-template-columns: 1.15fr 1.15fr 0.9fr 0.9fr 1.1fr;
    gap: 8px;
    margin: 0;
}
.investment-summary-card {
    overflow: hidden;
    border: 1px solid #2a72f2;
    border-radius: 8px;
    background: #fff;
    text-align: center;
}
.investment-summary-label {
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1968ee;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.1;
}
.investment-summary-value {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #17233a;
    font-size: 16px;
    font-weight: 700;
}
.investment-summary-card.is-margin {
    border-color: #f20d18;
}
.investment-summary-card.is-margin .investment-summary-label {
    background: #f20d18;
}
.investment-floating-handle {
    position: absolute;
    left: 50%;
    bottom: -17px;
    transform: translateX(-50%);
    margin: 0;
    z-index: 30;
    pointer-events: auto;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    border-radius: 999px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.investment-floating-handle > span {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 0;
    background: var(--blue);
    position: relative;
    box-shadow: 0 4px 10px rgba(8, 116, 238, 0.45);
}
.investment-floating-handle > span::before,
.investment-floating-handle > span::after {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 7px;
    background: #556179;
    border-radius: 1px;
}
.investment-floating-handle > span::before { left: 8px; }
.investment-floating-handle > span::after { right: 8px; }
.investment-floating-handle > span::before {
    content: "▲";
    left: 50%;
    top: 50%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    background: none;
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    display: block;
    text-align: center;
}
.investment-floating-handle > span::after {
    content: "";
    left: 50%;
    top: 62%;
    right: auto;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    background: none;
    color: #24324a;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    display: block;
    text-align: center;
}

.investment-fixed-panel.is-collapsed .investment-market-time,
.investment-fixed-panel.is-collapsed .investment-summary-strip {
    display: none;
}
.investment-fixed-panel.is-collapsed .investment-floating-handle {
    bottom: -16px;
}
.investment-fixed-panel.is-collapsed .investment-floating-handle > span::before {
    content: "▼";
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.investment-fixed-panel.is-collapsed .investment-floating-handle > span::after {
    content: "";
}

@media (max-width: 900px) {
    .investment-fixed-panel {
        position: relative;
        top: auto;
    }
}
.investment-top-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    margin-bottom: 20px;
}
.investment-card,
.investment-list-card {
    border-radius: 8px;
}
.investment-control-panel {
    display: grid;
    grid-template-columns: minmax(180px, 0.75fr) minmax(0, 2.4fr) minmax(150px, 0.75fr);
    gap: 14px;
    align-items: end;
    background: var(--blue);
    color: white;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 16px;
    box-shadow: 0 14px 30px rgba(8,116,238,.16);
}
.investment-account-box {
    min-height: 58px;
    background: #071325;
    border-radius: 8px;
    padding: 10px 14px;
    display: grid;
    align-content: center;
    gap: 3px;
}
.investment-account-box span {
    font-size: 12px;
    font-weight: 800;
    opacity: .86;
}
.investment-account-box strong {
    font-size: 18px;
    line-height: 1.15;
}
.investment-setting-strip,
.investment-safe-state,
.investment-list-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.investment-safe-state {
    justify-content: flex-end;
    align-content: end;
}
.investment-setting-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 10px;
}
.investment-setting-field {
    margin: 0;
    display: grid;
    gap: 5px;
    color: white;
    font-size: 12px;
    font-weight: 900;
}
.investment-setting-field input {
    min-height: 34px;
    border: 0;
    border-radius: 999px;
    background: white;
    color: #0e1d34;
    font-size: 14px;
    font-weight: 900;
    text-align: right;
    padding: 0 12px;
}
.investment-risk-modes {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
}
.investment-risk-mode {
    min-height: 32px;
    margin: 0;
    padding: 6px 12px;
    border-radius: 999px;
    color: white;
    font-size: 13px;
    line-height: 1.1;
    cursor: pointer;
}
.investment-risk-mode strong {
    margin-left: 4px;
}
.investment-risk-mode.is-safe {
    background: #f5a400;
}
.investment-risk-mode.is-neutral {
    background: #f97316;
}
.investment-risk-mode.is-aggressive {
    background: #ef1f1f;
}
.investment-save-ghost {
    min-height: 34px;
    margin: 0;
    padding: 7px 15px;
    border-radius: 999px;
    background: #071325;
    color: white;
    font-size: 13px;
    font-weight: 900;
    opacity: 1;
    cursor: pointer;
    align-self: flex-end;
}
.investment-setting-field input[data-setting-field] {
    cursor: text;
    background: #ffffff;
}
.investment-risk-mode.is-selected {
    box-shadow: 0 0 0 2px rgba(255,255,255,.95), 0 0 0 4px rgba(12,36,74,.35);
}
.investment-save-ghost[data-setting-save] {
    transition: background .2s ease, transform .08s ease;
}
.investment-save-ghost[data-setting-save]:active {
    transform: translateY(1px);
}
.investment-save-ghost.is-saved {
    background: #0f9f5f;
}
.investment-balance-refresh {
    margin-top: 8px;
    border: 1px solid #d7deea;
    border-radius: 999px;
    background: #ffffff;
    color: #1f2b44;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 10px;
    cursor: pointer;
}
.investment-balance-refresh:disabled {
    opacity: 0.7;
    cursor: wait;
}
.investment-balance-updated {
    display: block;
    margin-top: 6px;
    color: #dbe6ff;
    font-size: 11px;
    line-height: 1.2;
}
.investment-limit-control {
    min-height: 26px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 8px 0 10px;
    border-radius: 999px;
    background: #edf2f7;
    color: #4a5568;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}
.investment-limit-control .stock-select-wrap,
.investment-limit-control select {
    width: auto;
    min-width: 54px;
}
.investment-limit-control select {
    width: 54px !important;
    min-height: 22px !important;
    height: 22px !important;
    padding: 0 22px 0 8px !important;
    border-radius: 999px;
    border: 0;
    background-position: right 5px center !important;
    background-size: 12px 12px !important;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    box-shadow: none;
}
.investment-auto-toggle {
    min-height: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid #c7d7ee;
    border-radius: 999px;
    background: white;
    color: #4a5568;
    font-size: 12px;
    font-weight: 900;
    pointer-events: auto;
}
.investment-auto-toggle-option {
    min-width: 40px;
    height: 100%;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
}
.investment-auto-toggle-option.is-active {
    background: var(--blue);
    color: white;
}
.investment-auto-toggle-option.is-disabled {
    color: #718096;
}
.investment-safe-state {
    justify-content: flex-end;
}
.investment-list-card {
    padding: 16px 18px 18px;
}
.investment-list-card .table-wrap {
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
}
@media (min-width: 901px) {
    .investment-market-page > .investment-list-card .table-wrap {
        min-height: 0;
    }
}
.investment-list-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.investment-list-toolbar h2 {
    margin: 0;
}
.investment-list-controls {
    justify-content: flex-end;
    gap: 6px;
    min-width: 0;
}
.investment-list-controls > .badge {
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 9px;
    line-height: 1;
    white-space: nowrap;
}
.investment-table {
    font-size: 12px;
}
.investment-list-card .investment-table {
    table-layout: fixed;
    width: 100%;
}
.investment-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--blue);
    color: white;
    font-size: 12px;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 1px 0 rgba(255,255,255,.25), 0 2px 8px rgba(8,116,238,.18);
}
.investment-table td {
    padding: 10px 8px;
    text-align: center;
    vertical-align: middle;
}
.investment-list-card .investment-table th {
    padding: 9px 8px;
    line-height: 1.15;
}
.investment-list-card .investment-table td {
    padding: 7px 6px;
    line-height: 1.22;
}
.investment-list-card .investment-table tbody tr {
    height: 52px;
}
.investment-list-card .investment-table .badge {
    min-height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 7px;
    line-height: 1;
}
.investment-list-card .investment-table td:last-child {
    white-space: nowrap;
}
.investment-symbol-line {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 4px;
}
.investment-list-card .investment-symbol-line {
    gap: 4px;
    margin-top: 2px;
}
.investment-symbol-copy {
    min-height: 22px;
    margin: 0;
    padding: 4px 7px;
    border-radius: 999px;
    background: #111827;
    color: white;
    font-size: 11px;
    line-height: 1;
}
.investment-list-card .investment-symbol-copy {
    min-height: 20px;
    padding: 3px 7px;
}
.investment-symbol-copy.is-copied {
    background: var(--ok);
}
.investment-stock-link {
    color: #071325;
    font-weight: 900;
    text-decoration: none;
}
.investment-list-card .investment-stock-link {
    display: inline-block;
    line-height: 1.15;
}
.investment-list-card .investment-table-target {
    min-width: 0;
    font-size: 11px;
}
.investment-list-card .investment-table-target th {
    padding: 7px 4px;
    font-size: 11px;
}
.investment-list-card .investment-table-target td {
    padding: 6px 4px;
}
.investment-table-target th:nth-child(1),
.investment-table-target td:nth-child(1) {
    width: 5%;
}
.investment-table-target th:nth-child(2),
.investment-table-target td:nth-child(2) {
    width: 14%;
}
.investment-table-target th:nth-child(3),
.investment-table-target td:nth-child(3),
.investment-table-target th:nth-child(11),
.investment-table-target td:nth-child(11) {
    width: 7%;
}
.investment-table-target th:nth-child(4),
.investment-table-target td:nth-child(4),
.investment-table-target th:nth-child(5),
.investment-table-target td:nth-child(5),
.investment-table-target th:nth-child(6),
.investment-table-target td:nth-child(6),
.investment-table-target th:nth-child(10),
.investment-table-target td:nth-child(10) {
    width: 9%;
}
.investment-table-target th:nth-child(7),
.investment-table-target td:nth-child(7),
.investment-table-target th:nth-child(8),
.investment-table-target td:nth-child(8),
.investment-table-target th:nth-child(9),
.investment-table-target td:nth-child(9),
.investment-table-target th:nth-child(12),
.investment-table-target td:nth-child(12) {
    width: 6%;
}
.investment-rank-cell {
    color: #4b5563;
    font-weight: 800;
}
.investment-stock-cell {
    font-weight: 800;
}
.investment-table-action {
    min-height: 22px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #111827;
    color: white;
    font-size: 11px;
    line-height: 1;
    opacity: .45;
    cursor: not-allowed;
}
@media (max-width: 760px) {
    .investment-list-card .investment-table-target {
        min-width: 980px;
    }
}
.investment-stock-link:hover,
.investment-stock-link:focus {
    color: var(--blue);
    text-decoration: underline;
}
.investment-info-modal {
    position: fixed;
    inset: 0;
    z-index: 9997;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15,23,42,.38);
}
.investment-info-modal.is-open {
    display: flex;
}
.investment-info-dialog {
    width: min(620px, calc(100vw - 32px));
    max-height: min(760px, calc(100vh - 48px));
    overflow: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 28px 80px rgba(15,23,42,.28);
}
.investment-info-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 10px;
}
.investment-info-head h2 {
    margin: 0;
    font-size: 20px;
}
.investment-info-close {
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border-radius: 999px;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 22px;
    line-height: 1;
}
.investment-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px 20px 20px;
}
.investment-info-grid section {
    min-width: 0;
    border: 1px solid #e6ebf2;
    border-radius: 8px;
    overflow: hidden;
}
.investment-info-grid h3 {
    margin: 0;
    padding: 9px 12px;
    background: #ff5a00;
    color: white;
    font-size: 13px;
}
.investment-info-grid p {
    margin: 0;
    padding: 12px;
    color: #1f2937;
    font-size: 13px;
    line-height: 1.55;
}
.investment-filter-bar {
    display: grid;
    grid-template-columns: minmax(145px, 1fr) minmax(145px, 1fr) minmax(110px, .7fr) auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 14px;
}
.investment-filter-bar label {
    margin: 0;
}
.investment-filter-bar button {
    min-height: 42px;
}
.investment-filter-bar [data-investment-info-limit] {
    min-width: 72px;
    font-weight: 900;
}
.investment-info-page .investment-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 10px;
}
.investment-info-page .investment-filter-bar label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #4a5568;
    font-size: 12px;
    font-weight: 800;
}
.investment-info-page .investment-filter-bar input,
.investment-info-page .investment-filter-bar select {
    min-height: 30px;
    width: auto;
    min-width: 118px;
    padding-top: 4px;
    padding-bottom: 4px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}
.investment-info-page .investment-filter-bar input[type="date"] {
    min-width: 152px;
}
.investment-info-page .investment-filter-bar button {
    min-height: 30px;
    padding: 6px 13px;
    border-radius: 999px;
    font-size: 12px;
}
.investment-info-page > .investment-list-card:first-child .investment-list-toolbar {
    margin-bottom: 8px;
}
.investment-info-page > .investment-list-card:first-child .investment-list-toolbar .investment-list-controls {
    display: none;
}
@media (min-width: 901px) {
    .investment-info-page > .investment-list-card:first-child .investment-filter-bar {
        margin: -2px 0 8px;
        padding: 0;
        gap: 8px 10px;
    }
    .investment-info-page > .investment-list-card:first-child .investment-filter-bar label {
        flex: 0 0 auto;
    }
    .investment-info-page > .investment-list-card:first-child .investment-filter-bar label:has(input[name="end_date"])::before {
        content: "~";
        margin-right: 2px;
        color: #0874ee;
        font-weight: 900;
    }
    .investment-info-page > .investment-list-card:first-child .investment-filter-bar label:has([data-investment-info-limit]) {
        margin-left: auto;
    }
    .investment-info-page > .investment-list-card:first-child .investment-filter-bar button {
        min-width: 48px;
    }
    .investment-info-page > .investment-list-card:first-child .table-wrap {
        min-height: 620px;
    }
}
.investment-info-page .investment-table th,
.investment-info-page .investment-table td {
    white-space: nowrap;
}
.investment-info-page .investment-table td:nth-child(3) {
    white-space: normal;
}
.investment-info-page .investment-table td:nth-child(3) .badge {
    margin-top: 2px;
}
.investment-info-page .investment-table .badge.gray {
    text-transform: uppercase;
}
.investment-info-page .investment-table .badge.green,
.investment-info-page .investment-table .badge.red {
    min-width: 74px;
}
@media (max-width: 900px) {
    body:has(.investment-page) .container {
        padding-top: 20px;
    }
    body:has(.investment-page) .footer {
        margin: 0 28px 32px;
    }
    .investment-market-tabs {
        top: 112px;
    }
    .investment-market-time {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .investment-top-panel,
    .investment-control-panel,
    .investment-filter-bar {
        grid-template-columns: 1fr;
    }
    .investment-setting-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .investment-safe-state,
    .investment-list-toolbar {
        justify-content: flex-start;
    }
    .investment-list-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }
    .investment-list-controls {
        width: 100%;
        justify-content: flex-start;
    }
    .investment-list-card .table-wrap {
        max-height: none;
        overflow-x: auto;
        overflow-y: visible;
    }
    .investment-info-page .investment-filter-bar label {
        flex: 1 1 100%;
        justify-content: space-between;
    }
    .investment-info-page .investment-filter-bar input,
    .investment-info-page .investment-filter-bar select {
        flex: 1 1 auto;
        max-width: 220px;
    }
}
@media (max-width: 560px) {
    .investment-fixed-panel {
        padding: 0 8px 10px;
    }
    .investment-market-head {
        min-height: 52px;
        padding: 8px 12px;
        gap: 10px;
    }
    .investment-market-title {
        font-size: 22px;
        line-height: 1.05;
    }
    .investment-market-tabs-head {
        height: 32px;
    }
    .investment-market-tabs-head a {
        min-width: 72px;
        min-height: 30px;
        padding: 5px 9px;
        font-size: 12px;
    }
    .investment-market-tabs {
        width: 100%;
    }
    .investment-market-tabs a {
        flex: 1 1 0;
        min-width: 0;
        padding: 8px 6px;
    }
    body:has(.investment-page) .metric strong {
        font-size: 20px;
    }
    .investment-info-page .investment-filter-bar {
        gap: 6px;
        margin-bottom: 8px;
    }
    .investment-info-page .investment-filter-bar label {
        min-height: 28px;
        gap: 8px;
        font-size: 12px;
    }
    .investment-info-page .investment-filter-bar input,
    .investment-info-page .investment-filter-bar select {
        min-height: 28px;
        max-width: 218px;
        padding-top: 3px;
        padding-bottom: 3px;
    }
    .investment-info-page .investment-filter-bar input[type="date"] {
        min-width: 0;
    }
    .investment-info-page .investment-filter-bar button {
        min-height: 28px;
        padding: 5px 12px;
    }
    .investment-setting-grid {
        grid-template-columns: 1fr;
    }
    .investment-list-toolbar {
        gap: 8px;
    }
    .investment-list-controls {
        display: grid;
        grid-template-columns: 1fr auto auto;
        gap: 6px;
        align-items: center;
    }
    .investment-limit-control {
        justify-content: center;
    }
    .investment-auto-toggle {
        justify-self: end;
    }
    body:has(.investment-page) .footer {
        min-height: 112px;
        margin: 0 28px 28px;
        padding: 74px 16px 16px;
    }
    .investment-info-modal {
        padding: 12px;
    }
    .investment-info-grid {
        grid-template-columns: 1fr;
    }
}
.ai-log-detail-raw-pre {
    max-height: 520px;
    overflow: auto;
}
.watchlist-symbol-input {
    width: 90px;
}
.watchlist-name-input {
    width: 120px;
}
.watchlist-qty-input {
    width: 70px;
}
.watchlist-rate-input,
.watchlist-position-input {
    width: 80px;
}
.watchlist-memo-input {
    width: 180px;
}
/* System logs page styles */
.system-log-page .card th,
.system-log-page .card td {
    vertical-align: middle !important;
    line-height: 1.42 !important;
}
.system-log-page .card th:nth-child(1),
.system-log-page .card td:nth-child(1) {
    width: 54px !important;
    text-align: center !important;
    white-space: nowrap !important;
}
.system-log-page .card th:nth-child(2),
.system-log-page .card td:nth-child(2) {
    width: 150px !important;
    text-align: center !important;
    white-space: normal !important;
}
.system-log-page .card th:nth-child(3),
.system-log-page .card td:nth-child(3) {
    width: 72px !important;
    text-align: center !important;
    white-space: nowrap !important;
}
.system-log-page .card th:nth-child(4),
.system-log-page .card td:nth-child(4) {
    width: 86px !important;
    text-align: center !important;
    white-space: nowrap !important;
}
.system-log-page .card th:nth-child(5),
.system-log-page .card td:nth-child(5) {
    width: 130px !important;
    text-align: center !important;
    white-space: nowrap !important;
}
.system-log-page .card th:nth-child(6),
.system-log-page .card td:nth-child(6) {
    white-space: normal !important;
    word-break: keep-all !important;
    overflow-wrap: anywhere !important;
}
.system-log-page .card th:nth-child(7),
.system-log-page .card td:nth-child(7) {
    white-space: nowrap !important;
}
.system-log-page .card .badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 22px !important;
    min-width: 42px !important;
    line-height: 1 !important;
}
.system-log-page .card td:nth-child(7) a,
.system-log-page .card td:nth-child(7) button,
.system-log-page .card td:nth-child(7) summary,
.system-log-page .card details summary {
    list-style: none !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 30px !important;
    padding: 0 11px !important;
    border-radius: 9px !important;
    background: #e8eef6 !important;
    color: #0f172a !important;
    font-weight: 900 !important;
    border: 1px solid #d7e0eb !important;
    text-decoration: none !important;
    white-space: nowrap !important;
}
.system-log-page .card td:nth-child(7) a:hover,
.system-log-page .card td:nth-child(7) button:hover,
.system-log-page .card td:nth-child(7) summary:hover,
.system-log-page .card details summary:hover {
    background: #dfe8f3 !important;
}
.system-log-page .card details summary::-webkit-details-marker {
    display: none !important;
}
.system-log-page .card details summary::before {
    content: "??;
    margin-right: 5px;
    font-size: 12px;
}
.system-log-page .card details[open] summary::before {
    content: "??;
}
.system-log-page .card details[open] {
    padding: 10px 12px 14px !important;
    background: #fafcff !important;
    border-radius: 12px !important;
}
.system-log-page .card details[open] pre,
.system-log-page .card details[open] code {
    white-space: pre-wrap !important;
    word-break: break-word !important;
}
.system-log-page .table-wrap,
.system-log-page .card {
    overflow-x: auto;
}
.system-log-page .card form select,
.system-log-page .card form input {
    height: 42px !important;
    min-width: 170px !important;
    border: 1px solid #d8e1ec !important;
    border-radius: 12px !important;
    padding: 0 12px !important;
    background-color: #fff !important;
}
.system-log-page .card form .btn,
.system-log-page .card form button,
.system-log-page .card form a.btn {
    height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 18px !important;
    margin: 0 !important;
    white-space: nowrap !important;
}
.system-log-page .card table {
    table-layout: fixed !important;
    width: 100% !important;
}
.system-log-page .card th:nth-child(6),
.system-log-page .card td:nth-child(6) {
    width: auto !important;
    text-align: left !important;
}
.system-log-page .card th:nth-child(7),
.system-log-page .card td:nth-child(7) {
    width: 92px !important;
    text-align: center !important;
    position: relative !important;
    overflow: visible !important;
}
.system-log-page .card td:nth-child(7) details {
    position: relative !important;
    display: inline-block !important;
}
.system-log-page .card td:nth-child(7) summary {
    list-style: none !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 32px !important;
    padding: 0 12px !important;
    border-radius: 9px !important;
    background: #e8eef6 !important;
    color: #0f172a !important;
    font-weight: 900 !important;
    border: 1px solid #d7e0eb !important;
    white-space: nowrap !important;
}
.system-log-page .card td:nth-child(7) summary::-webkit-details-marker {
    display: none !important;
}
.system-log-page .card td:nth-child(7) summary::before {
    content: "??;
    margin-right: 5px;
    font-size: 11px;
}
.system-log-page .card td:nth-child(7) details[open] summary {
    background: #dbeafe !important;
    border-color: #bfdbfe !important;
}
.system-log-page .card td:nth-child(7) details[open] pre,
.system-log-page .card td:nth-child(7) details[open] code,
.system-log-page .card td:nth-child(7) details[open] div,
.system-log-page .card td:nth-child(7) details[open] p {
    position: absolute !important;
    right: 0 !important;
    top: 40px !important;
    z-index: 2000 !important;
    width: 460px !important;
    max-width: min(460px, 80vw) !important;
    max-height: 360px !important;
    overflow: auto !important;
    padding: 14px !important;
    border-radius: 14px !important;
    background: #0f172a !important;
    color: #e5e7eb !important;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.35) !important;
    white-space: pre-wrap !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    text-align: left !important;
    line-height: 1.55 !important;
    font-size: 12px !important;
}
.system-log-page .card td:nth-child(7) details[open] {
    padding: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
}
.system-log-page .card,
.system-log-page .table-wrap {
    overflow-x: auto !important;
    overflow-y: visible !important;
}
@media (max-width: 900px) {
    .system-log-page .card form {
        align-items: stretch !important;
    }
    .system-log-page .card form label,
    .system-log-page .card form select,
    .system-log-page .card form input,
    .system-log-page .card form .btn,
    .system-log-page .card form button,
    .system-log-page .card form a.btn {
        width: 100% !important;
    }
    .system-log-page .card table {
        min-width: 980px !important;
    }
    .system-log-page .card td:nth-child(7) details[open] pre,
    .system-log-page .card td:nth-child(7) details[open] code,
    .system-log-page .card td:nth-child(7) details[open] div,
    .system-log-page .card td:nth-child(7) details[open] p {
        right: auto !important;
        left: -360px !important;
        width: 420px !important;
    }
}
.system-log-page .card form label > span,
.system-log-page .card form label > strong {
    height: 18px !important;
    display: flex !important;
    align-items: center !important;
}
.system-log-page .card form select {
    width: 180px !important;
    height: 44px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}
.system-log-page .card form button,
.system-log-page .card form .btn,
.system-log-page .card form a.btn {
    height: 44px !important;
    min-width: 92px !important;
    padding: 0 18px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    vertical-align: bottom !important;
}
.system-log-page .card form button + a.btn,
.system-log-page .card form .btn + .btn,
.system-log-page .card form a.btn + a.btn {
    margin-left: 0 !important;
}
@media (max-width: 720px) {
    .system-log-page .card form label,
    .system-log-page .card form select,
    .system-log-page .card form button,
    .system-log-page .card form .btn,
    .system-log-page .card form a.btn {
        width: 100% !important;
        min-width: 0 !important;
    }
}
.system-log-page .card form label {
    overflow: visible !important;
}
.system-log-page .card form label .stock-select-wrap {
    margin-top: 9px !important;
}
.system-log-page .card form label .stock-select-wrap select,
.system-log-page .card form label select {
    width: 190px !important;
    height: 44px !important;
    box-sizing: border-box !important;
}
.system-log-page .card form > button,
.system-log-page .card form > a.btn,
.system-log-page .card form > .btn {
    margin-bottom: 0 !important;
}
.system-log-page .card:has(form) {
    overflow: visible !important;
    overflow-x: visible !important;
    overflow-y: visible !important;
}
.system-log-page .card:has(form) form {
    overflow: visible !important;
    min-height: auto !important;
}
.system-log-page .card:has(form) .stock-select-wrap {
    overflow: visible !important;
}
.system-log-page .card:has(table) {
    overflow-x: auto !important;
    overflow-y: visible !important;
}
.system-log-page .card:has(form) {
    padding-bottom: 26px !important;
}
.system-log-page .card form {
    display: flex !important;
    align-items: flex-end !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
}
.system-log-page .card form label {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    min-width: 190px !important;
    width: 190px !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    color: #64748b !important;
    line-height: 1 !important;
}
.system-log-page .card form label .stock-select-wrap {
    display: block !important;
    width: 190px !important;
    margin: 0 !important;
}
.system-log-page .card form label select,
.system-log-page .card form label .stock-select-wrap select {
    width: 190px !important;
    height: 46px !important;
    box-sizing: border-box !important;
    font-size: 15px !important;
}
.system-log-page .card form > button,
.system-log-page .card form > a.btn,
.system-log-page .card form > .btn {
    height: 46px !important;
    min-width: 98px !important;
    padding: 0 20px !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: flex-end !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
}
.system-log-page .card form > button,
.system-log-page .card form > a.btn {
    transform: translateY(0) !important;
}
@media (max-width: 720px) {
    .system-log-page .card form {
        align-items: stretch !important;
    }
    .system-log-page .card form label,
    .system-log-page .card form label .stock-select-wrap,
    .system-log-page .card form label select,
    .system-log-page .card form label .stock-select-wrap select,
    .system-log-page .card form > button,
    .system-log-page .card form > a.btn,
    .system-log-page .card form > .btn {
        width: 100% !important;
        min-width: 0 !important;
    }
}
.system-log-page .card:has(form):not(:has(table)) {
    overflow: visible !important;
    padding-bottom: 26px !important;
}
.system-log-page .card:has(form):not(:has(table)) form {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    flex-wrap: wrap !important;
    overflow: visible !important;
}
.system-log-page .card:has(form):not(:has(table)) form label {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 9px !important;
    width: auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    color: #64748b !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}
.system-log-page .card:has(form):not(:has(table)) form label .stock-select-wrap {
    display: inline-block !important;
    width: 170px !important;
    margin: 0 !important;
    vertical-align: middle !important;
}
.system-log-page .card:has(form):not(:has(table)) form label select,
.system-log-page .card:has(form):not(:has(table)) form label .stock-select-wrap select {
    width: 170px !important;
    height: 44px !important;
    box-sizing: border-box !important;
    font-size: 15px !important;
    margin: 0 !important;
}
.system-log-page .card:has(form):not(:has(table)) form > button,
.system-log-page .card:has(form):not(:has(table)) form > a.btn,
.system-log-page .card:has(form):not(:has(table)) form > .btn {
    height: 44px !important;
    min-width: 96px !important;
    padding: 0 20px !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: center !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    transform: none !important;
}
.system-log-page .card:has(form):not(:has(table)) form > button,
.system-log-page .card:has(form):not(:has(table)) form > a.btn {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
@media (max-width: 720px) {
    .system-log-page .card:has(form):not(:has(table)) form {
        align-items: stretch !important;
        gap: 14px !important;
    }
    .system-log-page .card:has(form):not(:has(table)) form label {
        display: block !important;
        width: 100% !important;
        min-height: 78px !important;
        font-size: 0 !important;
        line-height: 1.25 !important;
        white-space: normal !important;
    }
    .system-log-page .card:has(form):not(:has(table)) form label::before {
        display: block !important;
        margin-bottom: 8px !important;
        color: #64748b !important;
        font-size: 13px !important;
        font-weight: 900 !important;
        line-height: 1.25 !important;
    }
    .system-log-page .card:has(form):not(:has(table)) form label:nth-of-type(1)::before {
        content: "遺꾨쪟";
    }
    .system-log-page .card:has(form):not(:has(table)) form label:nth-of-type(2)::before {
        content: "?덈꺼";
    }
    .system-log-page .card:has(form):not(:has(table)) form label .stock-select-wrap,
    .system-log-page .card:has(form):not(:has(table)) form label select,
    .system-log-page .card:has(form):not(:has(table)) form label .stock-select-wrap select {
        width: 100% !important;
    }
    .system-log-page .card:has(form):not(:has(table)) form label .stock-select-wrap,
    .system-log-page .card:has(form):not(:has(table)) form label > select {
        display: block !important;
        margin-top: 8px !important;
    }
    .system-log-page .card:has(form):not(:has(table)) form > button,
    .system-log-page .card:has(form):not(:has(table)) form > a.btn,
    .system-log-page .card:has(form):not(:has(table)) form > .btn {
        width: 100% !important;
        margin-top: 2px !important;
    }
}
.system-log-page .log-user-cell {
    white-space: nowrap;
}
.system-log-page .log-user-cell .muted {
    line-height: 1.2;
}
.system-log-page .log-user-cell {
    min-width: 120px;
    max-width: 170px;
    width: 140px;
}
.system-log-page .log-user-cell strong {
    display: block;
    max-width: 150px;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}
.system-log-page .log-user-cell .muted {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: #64748b;
}
/* AI logs page styles */
.ai-logs-page .ai-log-table-wrap th:nth-child(5),
.ai-logs-page .ai-log-table-wrap td:nth-child(5) {
    width: 70px;
    white-space: nowrap;
}
.ai-logs-page .ai-log-table-wrap th:nth-child(6),
.ai-logs-page .ai-log-table-wrap td:nth-child(6) {
    width: 80px;
    white-space: nowrap;
}
.ai-logs-page .ai-log-table-wrap td:nth-child(9),
.ai-logs-page .ai-log-table-wrap td:nth-child(10) {
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.ai-logs-page .ai-log-table-wrap li {
    margin: 0 0 4px;
}
@media (max-width: 900px) {
    .ai-logs-page .ai-log-table-wrap table {
        min-width: 1180px;
    }
}
.ai-logs-page .ai-log-table-wrap th:nth-child(3),
.ai-logs-page .ai-log-table-wrap td:nth-child(3),
.ai-logs-page .ai-log-table-wrap th:nth-child(4),
.ai-logs-page .ai-log-table-wrap td:nth-child(4),
.ai-logs-page .ai-log-table-wrap th:nth-child(5),
.ai-logs-page .ai-log-table-wrap td:nth-child(5),
.ai-logs-page .ai-log-table-wrap th:nth-child(6),
.ai-logs-page .ai-log-table-wrap td:nth-child(6) {
    text-align: center !important;
    vertical-align: middle !important;
}
.ai-logs-page .ai-log-table-wrap td:nth-child(3),
.ai-logs-page .ai-log-table-wrap td:nth-child(4),
.ai-logs-page .ai-log-table-wrap td:nth-child(5),
.ai-logs-page .ai-log-table-wrap td:nth-child(6) {
    line-height: 1.35 !important;
    white-space: nowrap !important;
}
.ai-logs-page .ai-log-table-wrap td:nth-child(5),
.ai-logs-page .ai-log-table-wrap td:nth-child(6) {
    font-weight: 700;
}
.ai-logs-page .ai-log-table-wrap td:nth-child(5) .badge,
.ai-logs-page .ai-log-table-wrap td:nth-child(6) .badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 22px !important;
    line-height: 1 !important;
}
.ai-logs-page .ai-log-table-wrap td:nth-child(4) {
    min-width: 96px !important;
}
.ai-logs-page .ai-log-table-wrap table {
    border-collapse: separate;
    border-spacing: 0;
}
.ai-logs-page .ai-log-table-wrap th:nth-child(1),
.ai-logs-page .ai-log-table-wrap td:nth-child(1) {
    white-space: nowrap !important;
}
.ai-logs-page .ai-log-table-wrap th:nth-child(2),
.ai-logs-page .ai-log-table-wrap td:nth-child(2) {
    text-align: center !important;
    white-space: nowrap !important;
}
.ai-logs-page .ai-log-table-wrap th:nth-child(3),
.ai-logs-page .ai-log-table-wrap td:nth-child(3) {
    white-space: nowrap !important;
}
.ai-logs-page .ai-log-table-wrap th:nth-child(4),
.ai-logs-page .ai-log-table-wrap td:nth-child(4) {
    white-space: nowrap !important;
}
.ai-logs-page .ai-log-table-wrap th:nth-child(5),
.ai-logs-page .ai-log-table-wrap td:nth-child(5),
.ai-logs-page .ai-log-table-wrap th:nth-child(6),
.ai-logs-page .ai-log-table-wrap td:nth-child(6) {
    white-space: nowrap !important;
    font-weight: 800;
}
.ai-logs-page .ai-log-table-wrap th:nth-child(7),
.ai-logs-page .ai-log-table-wrap td:nth-child(7) {
    white-space: nowrap !important;
}
.ai-logs-page .ai-log-table-wrap th:nth-child(8),
.ai-logs-page .ai-log-table-wrap td:nth-child(8) {
    white-space: nowrap !important;
}
.ai-logs-page .ai-log-table-wrap th:nth-child(9),
.ai-logs-page .ai-log-table-wrap td:nth-child(9) {
    text-align: left !important;
    white-space: normal !important;
    word-break: keep-all;
    overflow-wrap: break-word;
}
.ai-logs-page .ai-log-table-wrap th:nth-child(10),
.ai-logs-page .ai-log-table-wrap td:nth-child(10) {
    text-align: left !important;
    white-space: normal !important;
    word-break: keep-all;
    overflow-wrap: break-word;
}
.ai-logs-page .ai-log-table-wrap .badge {
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    min-height: 22px !important;
    vertical-align: middle !important;
}
.ai-logs-page .ai-log-table-wrap td:nth-child(5) .badge,
.ai-logs-page .ai-log-table-wrap td:nth-child(6) .badge {
    min-width: 42px !important;
    margin-bottom: 4px !important;
}
.ai-logs-page .ai-log-table-wrap td:nth-child(3) .badge {
    margin-top: 4px !important;
}
.ai-logs-page .ai-log-table-wrap ul {
    margin: 0;
    padding-left: 18px;
}
.ai-logs-page .ai-log-table-wrap li {
    margin-bottom: 4px;
}
.ai-logs-page .ai-log-table-wrap details {
    margin-top: 10px !important;
}
.ai-logs-page .ai-log-table-wrap summary {
    list-style: none !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    min-height: 34px !important;
    padding: 0 14px !important;
    border-radius: 10px !important;
    background: #e8eef6 !important;
    color: #0f172a !important;
    font-weight: 900 !important;
    border: 1px solid #d7e0eb !important;
    width: auto !important;
}
.ai-logs-page .ai-log-table-wrap summary::-webkit-details-marker {
    display: none !important;
}
.ai-logs-page .ai-log-table-wrap summary::before {
    content: "??;
    font-size: 12px;
}
.ai-logs-page .ai-log-table-wrap details[open] summary::before {
    content: "??;
}
.ai-logs-page .ai-log-table-wrap summary:hover {
    background: #dfe8f3 !important;
}
.ai-logs-page .ai-log-table-wrap details[open] summary {
    background: #dbeafe !important;
    border-color: #bfdbfe !important;
}
.ai-logs-page .ai-log-table-wrap tr td[colspan],
.ai-logs-page .ai-log-table-wrap details {
    text-align: left !important;
}
.ai-logs-page .ai-log-table-wrap summary {
    margin-left: 0 !important;
    margin-bottom: 14px !important;
}
.ai-logs-page .ai-log-table-wrap details[open] {
    padding: 10px 12px 14px !important;
    background: #fafcff !important;
    border-radius: 12px !important;
}
.ai-logs-page .ai-log-table-wrap details[open] p,
.ai-logs-page .ai-log-table-wrap details[open] div {
    text-align: left !important;
    line-height: 1.65 !important;
}
.ai-logs-page .ai-log-table-wrap {
    width: 100% !important;
    max-width: 100% !important;
}
.ai-logs-page .ai-log-table-wrap table {
    table-layout: fixed !important;
}
.ai-logs-page .ai-log-table-wrap th,
.ai-logs-page .ai-log-table-wrap td {
    padding: 10px 8px !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
    vertical-align: top !important;
    white-space: normal !important;
    word-break: keep-all !important;
    overflow-wrap: anywhere !important;
}
.ai-logs-page .ai-log-table-wrap th:nth-child(1),
.ai-logs-page .ai-log-table-wrap td:nth-child(1) {
    width: 44px !important;
    text-align: center !important;
}
.ai-logs-page .ai-log-table-wrap th:nth-child(3),
.ai-logs-page .ai-log-table-wrap td:nth-child(3) {
    text-align: center !important;
}
.ai-logs-page .ai-log-table-wrap th:nth-child(4),
.ai-logs-page .ai-log-table-wrap td:nth-child(4) {
    text-align: right !important;
}
.ai-logs-page .ai-log-table-wrap th:nth-child(5),
.ai-logs-page .ai-log-table-wrap td:nth-child(5),
.ai-logs-page .ai-log-table-wrap th:nth-child(6),
.ai-logs-page .ai-log-table-wrap td:nth-child(6) {
    width: 76px !important;
    text-align: center !important;
}
.ai-logs-page .ai-log-table-wrap th:nth-child(7),
.ai-logs-page .ai-log-table-wrap td:nth-child(7) {
    text-align: center !important;
}
.ai-logs-page .ai-log-table-wrap th:nth-child(8),
.ai-logs-page .ai-log-table-wrap td:nth-child(8) {
    width: 56px !important;
    text-align: center !important;
}
.ai-logs-page .ai-log-table-wrap th:nth-child(9),
.ai-logs-page .ai-log-table-wrap td:nth-child(9) {
    width: auto !important;
}
.ai-logs-page .ai-log-table-wrap .badge {
    display: inline-flex !important;
    max-width: 100% !important;
    white-space: normal !important;
    word-break: break-word !important;
}
.ai-logs-page .ai-log-table-wrap td[colspan] {
    padding-bottom: 12px !important;
}
.ai-logs-page .ai-log-table-wrap details {
    max-width: 100% !important;
}
.ai-logs-page .ai-log-table-wrap details p {
    margin: 6px 0 !important;
    overflow-wrap: anywhere !important;
}
.ai-logs-page .ai-log-table-wrap th,
.ai-logs-page .ai-log-table-wrap td {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
}
.ai-logs-page .ai-log-table-wrap tbody tr:first-child td {
    vertical-align: top !important;
}
.ai-logs-page .ai-log-table-wrap .compact-risk-notes summary {
    display: inline-flex !important;
    align-items: center !important;
    padding: 6px 10px !important;
    border-radius: 10px !important;
    background: #eef3f8 !important;
    color: #23344d !important;
    font-weight: 800 !important;
    cursor: pointer !important;
}
.ai-logs-page .ai-log-table-wrap .compact-risk-notes ul {
    margin: 8px 0 0 18px !important;
    padding: 0 !important;
}
.ai-logs-page .ai-log-table-wrap .compact-risk-notes li {
    margin: 4px 0 !important;
    line-height: 1.42 !important;
}
.ai-logs-page .ai-log-table-wrap td[colspan] {
    padding-top: 4px !important;
}
.ai-logs-page .ai-log-table-wrap td[colspan] details summary {
    display: inline-flex !important;
    width: auto !important;
}
.ai-logs-page .ai-log-table-wrap td:nth-child(7) .badge {
    white-space: nowrap !important;
    word-break: normal !important;
}
.ai-logs-page section.card .table-wrap:has(.ai-log-table-wrap) {
    overflow-x: hidden !important;
}
.ai-logs-page .ai-log-table-wrap table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}
.ai-logs-page .ai-log-table-wrap th:nth-child(2),
.ai-logs-page .ai-log-table-wrap td:nth-child(2) {
    width: 108px !important;
}
.ai-logs-page .ai-log-table-wrap th:nth-child(3),
.ai-logs-page .ai-log-table-wrap td:nth-child(3) {
    width: 76px !important;
}
.ai-logs-page .ai-log-table-wrap th:nth-child(4),
.ai-logs-page .ai-log-table-wrap td:nth-child(4) {
    width: 82px !important;
}
.ai-logs-page .ai-log-table-wrap th:nth-child(7),
.ai-logs-page .ai-log-table-wrap td:nth-child(7) {
    width: 82px !important;
}
.ai-logs-page .ai-log-table-wrap .compact-risk-notes,
.ai-logs-page .ai-log-table-wrap .compact-risk-notes summary,
.ai-logs-page .ai-log-table-wrap .compact-risk-notes ul {
    max-width: 100% !important;
}
.ai-logs-page .ai-log-table-wrap th:nth-child(10),
.ai-logs-page .ai-log-table-wrap td:nth-child(10) {
    width: 120px !important;
    position: relative !important;
    overflow: visible !important;
}
.ai-logs-page .ai-log-table-wrap .compact-risk-notes {
    position: relative !important;
    display: inline-block !important;
    overflow: visible !important;
}
.ai-logs-page .ai-log-table-wrap .compact-risk-notes summary {
    white-space: nowrap !important;
}
.ai-logs-page .ai-log-table-wrap .compact-risk-notes[open] ul {
    position: absolute !important;
    top: 36px !important;
    right: 0 !important;
    z-index: 50 !important;
    width: 320px !important;
    max-width: 70vw !important;
    margin: 0 !important;
    padding: 12px 14px 12px 28px !important;
    background: #f8fafc !important;
    border: 1px solid #dbe4ef !important;
    border-radius: 14px !important;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16) !important;
    word-break: keep-all !important;
}
.ai-logs-page .ai-log-table-wrap .compact-risk-notes[open] li {
    margin: 6px 0 !important;
    line-height: 1.45 !important;
    white-space: normal !important;
    word-break: keep-all !important;
    overflow-wrap: break-word !important;
}
.ai-logs-page .ai-log-table-wrap td:nth-child(9) {
    word-break: keep-all !important;
    overflow-wrap: break-word !important;
}
.ai-logs-page .ai-log-table-wrap td:nth-child(10) * {
    word-break: keep-all !important;
}
.ai-logs-page .ai-log-table-wrap {
    overflow-x: auto !important;
    overflow-y: visible !important;
}

.ai-logs-page .ai-log-table-wrap td {
    overflow-wrap: anywhere !important;
    word-break: keep-all;
}
.ai-logs-page .ai-log-table-wrap td:nth-child(1),
.ai-logs-page .ai-log-table-wrap td:nth-child(2),
.ai-logs-page .ai-log-table-wrap td:nth-child(3),
.ai-logs-page .ai-log-table-wrap td:nth-child(4),
.ai-logs-page .ai-log-table-wrap td:nth-child(5),
.ai-logs-page .ai-log-table-wrap td:nth-child(6),
.ai-logs-page .ai-log-table-wrap td:nth-child(7) {
    white-space: nowrap !important;
}
.ai-logs-page .ai-log-table-wrap td:nth-child(8),
.ai-logs-page .ai-log-table-wrap td:nth-child(9),
.ai-logs-page .ai-log-table-wrap td:nth-child(10) {
    white-space: normal !important;
}
.ai-logs-page .ai-log-table-wrap details {
    position: relative;
    display: inline-block;
}
.ai-logs-page .ai-log-table-wrap summary {
    white-space: nowrap !important;
}
.ai-logs-page .ai-log-table-wrap .compact-risk-notes summary {
    border: 1px solid #d7deea;
    font-size: 12px;
}
.ai-logs-page .ai-log-table-wrap .compact-risk-notes[open] {
    z-index: 20;
}
.ai-logs-page .ai-log-table-wrap .compact-risk-notes[open] ul {
    left: 0;
    min-width: 260px;
    max-height: 260px;
    overflow: auto;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}
.ai-logs-page .ai-log-table-wrap td[colspan] {
    background: #f8fafc;
}
.ai-logs-page .ai-log-table-wrap td[colspan] details {
    display: block;
    width: 100%;
}
.ai-logs-page .ai-log-table-wrap td[colspan] p {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}
/* Install page styles */
body.install-page {
    margin: 0;
    background: var(--bg);
    color: var(--dark);
    font-family: Pretendard, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.install-page .wrap {
    max-width: 940px;
    margin: 28px auto;
    background: white;
    border-radius: 26px;
    box-shadow: 0 24px 80px rgba(20, 30, 60, .14);
    overflow: hidden;
}
.install-page .head {
    background: var(--blue);
    color: white;
    padding: 18px 24px;
    font-size: 24px;
    font-weight: 900;
}
.install-page .body {
    padding: 28px;
}
.install-page .grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.install-page h2 {
    margin: 26px 0 8px;
    padding-top: 20px;
    border-top: 1px solid #e6ebf2;
}
.install-page h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}
.install-page label {
    display: block;
    font-size: 13px;
    color: #4a5568;
    margin: 12px 0 6px;
}
.install-page input,
.install-page select {
    width: 100%;
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid #d7deea;
    padding: 0 12px;
    font-size: 15px;
}
.install-page button,
.install-page .btn {
    border: 0;
    background: var(--blue);
    color: white;
    border-radius: 12px;
    padding: 13px 18px;
    font-weight: 900;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    margin-top: 14px;
}
.install-page .btn.secondary {
    background: #e2e8f0;
    color: var(--dark);
}
.install-page .alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    background: #fff7e6;
    color: #8a5a00;
}
.install-page .error {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    background: #ffe8e8;
    color: #b42318;
}
.install-page .success {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    background: #e8fff2;
    color: #087443;
}
.install-page .small {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
}
.install-page .check {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
}
.install-page .check input {
    width: auto;
    min-height: auto;
}
.install-page pre {
    background: #101828;
    color: #dbeafe;
    padding: 16px;
    border-radius: 16px;
    overflow: auto;
}
.install-full-grid {
    grid-column: 1 / -1;
}
/* Common operation output boxes */
.stock-output-box,
.stock-json-box,
.stock-command-box {
    max-height: 280px;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.5;
}
.stock-output-box {
    min-height: 72px;
}
.stock-json-box {
    max-height: 360px;
}
.stock-command-box {
    max-height: none;
    font-size: 13px;
}
@media (max-width: 820px) {
    .install-page .grid {
        grid-template-columns: 1fr;
    }
    .install-page .wrap {
        margin: 0;
        min-height: 100vh;
        border-radius: 0;
    }
}

/* Investment pages: keep global top menu visible */
body:has(.investment-page) .topbar {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    padding-left: 28px !important;
    padding-right: 28px !important;
}
body:has(.investment-page) .topbar nav > a,
body:has(.investment-page) .topbar nav > .top-log-menu {
    display: inline-flex !important;
}
body:has(.investment-page) .topbar nav > a {
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #fff !important;
}
body:has(.investment-page) .topbar nav > .top-log-menu {
    position: relative;
}
body:has(.investment-page) .topbar nav > .top-log-menu .top-log-dropdown {
    display: none;
}
body:has(.investment-page) .topbar nav > .top-log-menu:hover .top-log-dropdown,
body:has(.investment-page) .topbar nav > .top-log-menu:focus-within .top-log-dropdown,
body:has(.investment-page) .topbar nav > .top-log-menu.is-open .top-log-dropdown {
    display: block;
}

/* KOSPI top fixed blue head band */
.investment-market-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 58px;
    padding: 9px 18px;
    border-radius: 14px 14px 0 0;
    background: var(--blue);
    margin: 0 -10px 8px;
}
.investment-market-title {
    margin: 0;
    color: #fff;
    font-size: 30px;
    font-weight: 900;
    line-height: 1.05;
}
.investment-market-tabs-head {
    display: inline-flex !important;
    align-items: center;
    height: 36px;
    border-radius: 999px;
    overflow: hidden;
    background: #e9eff8;
    border: 1px solid #cfdcf0;
}
.investment-market-tabs-head a {
    min-width: 82px;
    min-height: 34px;
    padding: 6px 12px;
    border-right: 1px solid #cfdcf0;
    color: #0e1d34;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: #f4f7fc;
}
.investment-market-tabs-head a:last-child {
    border-right: 0;
}
.investment-market-tabs-head a.is-active {
    background: #f20d18;
    color: #fff;
}



.investment-auto-toggle-option:hover,
.investment-auto-toggle-option:focus-visible {
    filter: brightness(0.96);
}


/* Toggle cursor force fix */
.investment-auto-toggle,
.investment-auto-toggle * {
    pointer-events: auto !important;
}
.investment-auto-toggle-option,
.investment-auto-toggle-option.is-active,
.investment-auto-toggle-option.is-disabled {
    cursor: pointer !important;
}

/* Investment final alignment polish (safe override) */
.investment-list-toolbar {
    flex-wrap: wrap;
}
.investment-list-controls {
    min-width: 0;
    flex-wrap: wrap;
}
.investment-info-page .investment-filter-bar {
    align-items: end;
}
@media (max-width: 900px) {
    .investment-list-toolbar {
        align-items: flex-start;
    }
    .investment-list-controls {
        justify-content: flex-start;
        width: 100%;
    }
    .investment-info-page .investment-filter-bar {
        grid-template-columns: 1fr;
    }
    .investment-info-page .investment-filter-bar button {
        width: 100%;
    }
}


/* KIS read-only account panel */
.operation-kis-readonly .alert {
    margin-bottom: 12px;
}
.kis-source-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    color: #334155;
}
.kis-source-box strong {
    font-size: 13px;
}
.kis-source-box span {
    font-size: 13px;
}
.kis-source-box.green {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #087443;
}
.kis-source-box.red {
    border-color: #fecaca;
    background: #fff1f2;
    color: #b42318;
}
.kis-summary-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
#kisAccountSummaryBox table,
#kisOrderableBox table {
    margin-top: 0;
    border: 1px solid #eef2f7;
}
#kisAccountSummaryBox th,
#kisOrderableBox th {
    background: #f8fafc;
    color: #334155;
}
#kisAccountSummaryBox td,
#kisOrderableBox td {
    background: #ffffff;
}
.kis-orders-detail {
    margin-top: 14px;
}
/* KOSPI guarded live-order panel */
.investment-live-order-panel {
    border: 1px solid #dbeafe;
    background: #ffffff;
}

.investment-live-order-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.investment-live-order-head h2 {
    margin: 0;
}

.investment-live-order-badges,
.investment-live-order-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.investment-live-order-grid {
    display: grid;
    grid-template-columns: minmax(110px, 0.8fr) minmax(140px, 1.2fr) minmax(100px, 0.8fr) minmax(80px, 0.6fr) minmax(110px, 0.9fr) minmax(180px, 1.4fr);
    gap: 10px;
    align-items: end;
}

.investment-live-order-grid .investment-setting-field {
    margin: 0;
}

.investment-live-order-grid input,
.investment-live-order-grid select {
    min-height: 36px;
    border-radius: 12px;
    font-weight: 800;
}

.investment-live-order-fill {
    min-width: 48px;
    padding: 6px 9px !important;
    margin: 0 !important;
    background: #0f172a !important;
    color: #ffffff !important;
}

.investment-live-order-actions {
    margin-top: 12px;
}

.investment-live-order-actions button {
    margin-top: 0;
}

.investment-live-order-actions button:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

@media (max-width: 900px) {
    .investment-live-order-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .investment-live-order-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .investment-live-order-grid {
        grid-template-columns: 1fr;
    }
}
.investment-auto-engine-panel {
    display: grid;
    gap: 12px;
    margin: 0 0 16px;
    padding: 14px 18px;
    border: 1px solid #c8d7ee;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}
.investment-auto-engine-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.investment-auto-engine-head h2 {
    margin: 0;
    color: #0e1d34;
    font-size: 18px;
    font-weight: 900;
}
.investment-auto-engine-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}
.investment-auto-engine-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}
.investment-auto-engine-grid article {
    min-height: 62px;
    display: grid;
    align-content: center;
    gap: 5px;
    padding: 10px 12px;
    border: 1px solid #e1e7f2;
    border-radius: 8px;
    background: #f8fafc;
}
.investment-auto-engine-grid span {
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
}
.investment-auto-engine-grid strong {
    color: #0f172a;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.2;
}
.investment-table [data-auto-decision] {
    min-width: 68px;
    justify-content: center;
}
.investment-table-target tr.is-kis-holding > td {
    background: #f0fdf4;
}
.investment-table-target tr.is-kis-holding .investment-rank-cell {
    color: #047857;
    font-weight: 900;
}
.investment-table-target tr.is-kis-holding .investment-stock-cell a {
    color: #064e3b;
}
@media (max-width: 900px) {
    .investment-auto-engine-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .investment-auto-engine-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 560px) {
    .investment-auto-engine-grid {
        grid-template-columns: 1fr;
    }
}
/* Shared header menu: market-first navigation */
.topbar.app-market-header {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    max-width: none;
    height: 58px;
    margin: 0;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-radius: 0;
    background: var(--blue);
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
}
.topbar.app-market-header .brand {
    flex: 0 0 auto;
    color: #fff !important;
    text-decoration: none;
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}
.topbar.app-market-header .market-header-nav {
    min-width: 0;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}
.topbar.app-market-header .market-nav-link {
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #fff !important;
    text-decoration: none;
    font-size: 22px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    white-space: nowrap;
}
.topbar.app-market-header .market-nav-link.is-active {
    text-shadow: 0 0 0 #fff;
}
.topbar.app-market-header .market-nav-kospi {
    order: 1 !important;
}
.topbar.app-market-header .market-nav-separator-first {
    order: 2 !important;
}
.topbar.app-market-header .market-nav-nasdaq {
    order: 3 !important;
}
.topbar.app-market-header .market-nav-separator-second {
    order: 4 !important;
}
.topbar.app-market-header .market-nav-info {
    order: 5 !important;
}
.topbar.app-market-header .market-nav-separator {
    color: rgba(255, 255, 255, .9) !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
}
.topbar.app-market-header .market-user,
.topbar.app-market-header .market-logout {
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #fff !important;
    text-decoration: none;
    font-size: 13px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    white-space: nowrap;
}
.topbar.app-market-header .market-user {
    order: 6 !important;
    margin-left: 18px;
}
.topbar.app-market-header .market-logout {
    order: 7 !important;
    margin-left: 10px;
}
.topbar.app-market-header + .container {
    padding-top: 28px;
}
body:has(.investment-page) .topbar.app-market-header {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    padding-left: 28px !important;
    padding-right: 28px !important;
}
body:has(.investment-page) .topbar.app-market-header .market-header-nav > a,
body:has(.investment-page) .topbar.app-market-header .market-header-nav > span {
    display: inline-flex !important;
}
body:has(.investment-page) .topbar.app-market-header .market-nav-link,
body:has(.investment-page) .topbar.app-market-header .market-logout {
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    color: #fff !important;
}
@media (max-width: 760px) {
    .topbar.app-market-header {
        height: auto;
        min-height: 58px;
        align-items: flex-start;
        flex-direction: column;
        padding: 12px 18px;
        gap: 10px;
    }
    .topbar.app-market-header .market-header-nav {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 8px 10px;
    }
    .topbar.app-market-header .market-nav-link {
        font-size: 18px !important;
    }
    .topbar.app-market-header .market-nav-separator {
        font-size: 17px !important;
    }
}
.investment-settings-save-state {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 116px;
}
.investment-settings-save-state .investment-save-ghost {
    min-height: 34px;
}
.investment-list-controls .investment-auto-engine-message {
    color: #475569;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}
.investment-list-controls [data-auto-engine-state],
.investment-list-controls [data-auto-watch-state],
.investment-list-controls [data-kis-holding-count] {
    min-height: 22px;
    white-space: nowrap;
}
/* KOSPI score and change-rate cells */
.investment-score-pill {
    width: 74px;
    min-height: 44px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 999px;
    color: #ffffff;
    font-weight: 900;
    line-height: 1.05;
    text-align: center;
    box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.12);
}
.investment-score-pill span {
    display: block;
    font-size: 15px;
}
.investment-score-pill strong {
    display: block;
    font-size: 12px;
    font-weight: 900;
}
.investment-score-pill--safe {
    background: #ffb000;
}
.investment-score-pill--neutral {
    background: #ff7a00;
}
.investment-score-pill--aggressive {
    background: #ef1c24;
}
.investment-score-pill--wait {
    background: #94a3b8;
}
.investment-price-stack {
    min-height: 42px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    line-height: 1.05;
}
.investment-price-stack strong {
    display: block;
    color: #111827;
    font-size: 15px;
    font-weight: 900;
    white-space: nowrap;
}
.investment-change-rate {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}
.investment-change-rate.is-up {
    color: #ef1c24;
}
.investment-change-rate.is-down {
    color: #64748b;
}
.investment-change-rate.is-flat {
    color: #94a3b8;
}
.investment-table-target th:nth-child(3),
.investment-table-target td:nth-child(3) {
    min-width: 88px;
    width: 88px;
}
.investment-table-target th:nth-child(4),
.investment-table-target td:nth-child(4) {
    min-width: 98px;
    width: 98px;
}
.investment-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 14px 10px 4px;
}
.investment-page-link {
    min-width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d8e2ef;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    text-decoration: none;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
}
.investment-page-link:hover,
.investment-page-link.is-active {
    border-color: #0d7df2;
    background: #0d7df2;
    color: #ffffff;
}
