:root {
    --bg-color: #020617;
    --card-bg: #0b1220;
    --card-bg-2: #111827;
    --accent-blue: #38bdf8;
    --accent-green: #86efac;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --line-color: rgba(148, 163, 184, 0.25);
    --memo-panel-width: 360px;
    --memo-panel-gap: 14px;
    --memo-open-space: calc(var(--memo-panel-width) + var(--memo-panel-gap) + 12px);
}

#LIST {
    position: relative;
    background: var(--bg-color);
    color: var(--text-main);
    font-family: 'Noto Sans KR', sans-serif;
    width: 100%;
    margin: 0 auto;
    padding: 18px 0 28px;
    min-height: 100vh;
    transition: padding-left .24s ease;
}

#LIST.memo-open {
    padding-left: var(--memo-open-space);
}

.TopTitle {
    margin: 0 12px 12px;
    padding: 18px 12px;
    border: 1px solid var(--line-color);
    border-radius: 6px;
    text-align: center;
    background: var(--card-bg);
}

.TopTitle p {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--accent-blue);
}

.TopTitle span {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.9rem;
    color: var(--text-dim);
}

.Control-Bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 0 12px 12px;
    padding: 10px;
    border: 1px solid var(--line-color);
    border-radius: 6px;
    background: var(--card-bg);
}

.Left,
.Right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn,
.control-select {
    height: 34px;
    padding: 0 12px;
    border-radius: 6px;
    border: 1px solid var(--line-color);
    background: var(--card-bg-2);
    color: var(--text-main);
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}

.btn:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.btn.is-active {
    border-color: var(--accent-blue);
    color: #03101d;
    background: #7dd3fc;
}

.control-select:hover,
.control-select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25) inset;
    outline: none;
}

.btn-admin {
    background: #1f2937;
}

.btn-write {
    color: #03101d;
    background: #7dd3fc;
    border-color: #7dd3fc;
    font-weight: 700;
}

.btn-write:hover {
    color: #03101d;
    background: #a5f3fc;
    border-color: #a5f3fc;
}

.realtime-search-wrap {
    display: flex;
    align-items: center;
    height: 34px;
    min-width: 220px;
    max-width: 300px;
    padding: 0 10px;
    border-radius: 6px;
    border: 1px solid var(--line-color);
    background: var(--card-bg-2);
    gap: 8px;
}

.realtime-search-wrap i {
    color: var(--text-dim);
    font-size: 0.8rem;
}

#realtimeSearch {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text-main);
    font-size: 0.84rem;
    outline: none;
}

#realtimeSearch::placeholder {
    color: #64748b;
}

.List-Table {
    width: calc(100% - 24px);
    margin: 0 12px;
    border-collapse: collapse;
    table-layout: fixed;
    border: 1px solid var(--line-color);
    border-radius: 6px;
    overflow: hidden;
    background: var(--card-bg);
}

.List-Header {
    background: #0f172a;
    border-bottom: 1px solid var(--line-color);
}

.List-Header th {
    padding: 12px 8px;
    color: #cbd5e1;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

.List-Table tbody tr {
    border-bottom: 1px solid var(--line-color);
    cursor: pointer;
}

.List-Table tbody tr:hover {
    background: rgba(56, 189, 248, 0.08);
}

.List-Table tbody tr.is-core {
    background: #1f2937;
}

.List-Table tbody tr.is-core:hover {
    background: #334155;
}

.List-Table td {
    padding: 11px 8px;
    text-align: center;
    vertical-align: middle;
    color: var(--text-main);
}

.Num { width: 80px; color: var(--text-dim); font-size: 0.85rem; }
.Run { width: 120px; }
.Subject { text-align: left !important; }
.CompleteDay,
.Day,
.BaseAmt,
.CurrentAmt,
.TargetAmt,
.ProfitAmt,
.ProfitRate,
.ReachRate,
.UnitBase,
.UnitAdd,
.TradeItem {
    font-size: 0.83rem;
    color: #dbe7ff;
}

.CompleteDay { width: 140px; }
.Day { width: 120px; }
.BaseAmt, .CurrentAmt, .TargetAmt, .ProfitAmt { width: 140px; }
.ProfitRate, .ReachRate { width: 110px; }
.UnitBase, .UnitAdd { width: 120px; }
.TradeItem { width: 150px; }

.List-Table td.Day,
.List-Table td.CompleteDay {
    font-size: 0.78rem;
    color: #64748b;
    letter-spacing: 0.1px;
}

.List-Table td.val-up-bright { color: #86efac; font-weight: 700; }
.List-Table td.val-down-bright { color: #fca5a5; font-weight: 700; }
.List-Table td.val-up-deep { color: #22c55e; font-weight: 700; }
.List-Table td.val-down-deep { color: #dc2626; font-weight: 700; }
.List-Table td.val-up-blue { color: #7dd3fc; font-weight: 700; }

.metric-value {
    display: inline-block;
}

.metric-arrow {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.72rem;
    font-weight: 800;
}

.arrow-up-bright { color: #86efac; }
.arrow-down-bright { color: #fca5a5; }
.arrow-up-deep { color: #22c55e; }
.arrow-down-deep { color: #dc2626; }

.coin-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1.35;
    padding-left: 20px;
}

.coin-symbol {
    font-size: 0.95rem;
    color: var(--accent-green);
    font-weight: 600;
    word-break: break-word;
}

.coin-badge-top {
    color: #86efac;
    font-size: 0.82rem;
}

.coin-badge-label {
    color: #facc15;
    font-size: 0.82rem;
}

.coin-badge-core {
    color: #ef4444;
    font-size: 0.82rem;
}

.coin-badge-meta {
    color: #7dd3fc;
    font-size: 0.8rem;
}

.comment-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 7px;
    font-size: 0.75rem;
    border-radius: 999px;
    color: #03101d;
    background: #a5f3fc;
    font-family: 'Orbitron', sans-serif;
}

.tag-pill {
    display: inline-block;
    max-width: 100%;
    padding: 5px 15px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #111827;
    color: #dbeafe;
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
}

.run_btn {
    display: inline-block;
    min-width: 58px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.3;
}

.run_on {
    color: #052e16;
    background: #86efac;
    border: 1px solid #22c55e;
}

.run_off {
    color: #fecaca;
    background: #7f1d1d;
    border: 1px solid #991b1b;
}

.row-pin {
    color: var(--accent-blue);
}

.empty-row td {
    padding: 36px 10px;
    color: var(--text-dim);
    text-align: center;
}

.NoticeLayer {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 92%;
    max-width: 520px;
    border-radius: 8px;
    border: 1px solid var(--line-color);
    background: #0b1220;
    box-shadow: 0 18px 36px rgba(2, 6, 23, 0.55);
    z-index: 10001;
}

.notice-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line-color);
}

.notice-head h3 {
    margin: 0;
    font-size: 1rem;
    color: #dbeafe;
    min-width: 0;
    word-break: break-word;
}

.btn-icon {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--line-color);
    background: #111827;
    color: var(--text-dim);
    cursor: pointer;
}

.notice-body {
    max-height: 360px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    color: var(--text-main);
    line-height: 1.6;
    white-space: pre-line;
    text-indent: 0;
    word-break: break-word;
}

.notice-body * {
    max-width: 100%;
    box-sizing: border-box;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.notice-body p {
    margin: 0 0 8px;
}

.notice-body p:last-child {
    margin-bottom: 0;
}

.MemoLayer {
    display: flex;
    position: fixed;
    left: var(--memo-panel-gap);
    top: var(--memo-panel-gap);
    width: var(--memo-panel-width);
    height: calc(100vh - (var(--memo-panel-gap) * 2));
    transform: translateX(-105%);
    transition: transform .24s ease;
    border: 1px solid var(--line-color);
    background: #0b1220;
    box-shadow: 0 18px 36px rgba(2, 6, 23, 0.55);
    z-index: 10002;
    flex-direction: column;
}

.MemoLayer.is-open {
    transform: translateX(0);
}

.memo-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line-color);
}

.memo-head h3 {
    margin: 0;
    font-size: 1rem;
    color: #dbeafe;
}

.memo-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.memo-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.memo-view-btn {
    height: 30px;
    min-width: 48px;
    padding: 0 10px;
    border-radius: 6px;
    border: 1px solid var(--line-color);
    background: #111827;
    color: var(--text-dim);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.memo-view-btn.is-active {
    border-color: var(--accent-blue);
    color: #03101d;
    background: #7dd3fc;
}

.memo-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-content: start;
}

.MemoLayer.view-1x1 .memo-body {
    grid-template-columns: 1fr;
}

.MemoLayer.view-1x2 .memo-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.memo-item {
    display: block;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--line-color);
    border-radius: 6px;
    background: #111827;
    padding: 10px 12px;
    min-height: 88px;
}

.memo-item:hover {
    border-color: var(--accent-blue);
    background: rgba(56, 189, 248, 0.08);
}

.memo-item-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.memo-subject {
    font-size: 0.9rem;
    color: #e2e8f0;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.memo-date {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
}

.memo-preview {
    font-size: 0.83rem;
    color: #cbd5e1;
    line-height: 1.45;
    word-break: break-word;
}

.memo-preview.is-deleted {
    color: #f87171;
}

.memo-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px 16px;
    border-top: 1px solid var(--line-color);
}

.memo-empty {
    grid-column: 1 / -1;
    color: #94a3b8;
    font-size: 0.9rem;
    text-align: center;
    padding: 24px 10px;
}

.notice-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px 16px;
    border-top: 1px solid var(--line-color);
}

#SCH {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.86);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.search-panel {
    width: 92%;
    max-width: 430px;
    border-radius: 8px;
    border: 1px solid var(--line-color);
    background: #0b1220;
    padding: 18px;
}

.search-form h3 {
    margin: 0 0 14px;
    color: #dbeafe;
    font-size: 1.05rem;
}

.search-input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--line-color);
    border-radius: 6px;
    background: #111827;
    color: #fff;
    padding: 0 10px;
    outline: none;
}

.search-input:focus {
    border-color: var(--accent-blue);
}

.search-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.search-actions .btn {
    flex: 1;
}

#TERM_PAGING_DIRECT {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 18px 12px 4px;
    flex-wrap: wrap;
}

#TERM_PAGING_DIRECT .trm-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 34px;
    height: 34px;
    border: 1px solid var(--line-color);
    border-radius: 6px;
    background: #0f172a;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
}

#TERM_PAGING_DIRECT .trm-btn:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

#TERM_PAGING_DIRECT .trm-current {
    color: #03101d;
    background: #7dd3fc;
    border-color: #7dd3fc;
    font-weight: 700;
}

.trm-ico-start::before { content: '≪'; }
.trm-ico-prev::before { content: '‹'; }
.trm-ico-next::before { content: '›'; }
.trm-ico-end::before { content: '≫'; }

@media (max-width: 1100px) {
    .Control-Bar { flex-direction: column; align-items: flex-start; }
    .Left, .Right { width: 100%; }
    .Right { justify-content: flex-start; }

    :root {
        --memo-panel-width: 320px;
        --memo-open-space: calc(var(--memo-panel-width) + 8px);
    }
}

@media (max-width: 860px) {
    .List-Header th,
    .List-Table td {
        font-size: 0.82rem;
    }

    .Subject { width: auto; }
    .Day { white-space: nowrap; }

    .memo-body {
        grid-template-columns: 1fr;
    }

    :root {
        --memo-panel-width: min(88vw, 340px);
        --memo-panel-gap: 0px;
        --memo-open-space: 0px;
    }

    #LIST.memo-open {
        padding-left: 0;
    }
}
