* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: #0f172a;
    color: #e2e8f0;
    font-family: 'Courier New', monospace;
    min-height: 100vh;
    padding: 24px;
}

.wrap {
    max-width: 100%;
    margin: 40px;
}

.header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid #2a3458;
    padding-bottom: 14px;
}

.header_subject {
    color: #fff;
    font-size: 100px;
    font-weight: bold;
    padding-left: 20px;
}

.btn-refresh {
    margin-left: auto;
    background: #0c39ff;
    border: 1px solid #0428ca;
    color: #fff;
    font-size: 12px;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: background 0.15s, color 0.15s;
}
.btn-refresh:hover { background: #0c69ff;  }

.btn-mode {
    background: #0e1623;
    border: 1px solid #1e293b;
    color: #64748b;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: background 0.15s, color 0.15s;
}
.btn-mode:hover { background: #1e293b; color: #e2e8f0; }
.btn-mode.active { background: #1e3a5f; border-color: #3b82f6; color: #38bdf8; }

.header h1 {
    font-size: 15px;
    font-weight: normal;
    color: #94a3b8;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.header .badge {
    font-size: 12px;
    color: #64748b;
    letter-spacing: 1px;
    border-left: 3px solid #38bdf8;
    padding-left: 8px;
}

.meta {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
}

.meta-item {
    font-size: 12px;
    color: #475569;
}

.meta-item span {
    color: #cbd5e1;
    margin-left: 6px;
}

/* 범례 */
.legend {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #64748b;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

/* 차트 영역 */
.chart-block {
    background: #1a1f3a;
    border: 1px solid #1e293b;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 10px 10px rgba(0,0,0,0.5);
}
.chart-box {
    background: #040b1b;
    border: 1px solid #1e293b;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 10px 10px rgba(0,0,0,0.3);
}
.chart-outer {
    background: #040b1b;
    position: relative;
    padding-left: 40px;
}

.chart-wrap {
    position: relative;
    width: 100%;
    height: 450px;
    display: flex;
    align-items: flex-end;
    gap: 3px;
    padding-bottom: 28px;
    border-left: 1px solid #2a3458;
    border-bottom: 1px solid #2a3458;
}

.bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    position: relative;
}

/* 아이콘 영역 — 봉 바로 위 플로우 */
.bar-icons {
    display: flex;
    flex-direction: column-reverse; /* 아래부터 위로 쌓기 */
    align-items: center;
    gap: 1px;
    flex-shrink: 0;
}

.bar-icons img {
    width: 45px;
    object-fit: contain;
    display: block;
    margin-bottom: 5px;
}

.bar {
    width: 100%;
    position: relative;
    min-height: 2px;
}

.bar.empty {
    background: #1e293b;
    border-top: 1px solid #2a3458;
}

.bar-cnt {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    white-space: nowrap;
}

.bar-label {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: #475569;
    white-space: nowrap;
}

.bar-col.current .bar-label {
    color: #e2e8f0;
}

/* y축 */
.y-axis {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    pointer-events: none;
    width: 36px;
}

.y-tick {
    font-size: 10px;
    color: #334155;
    text-align: right;
    width: 32px;
}

/* 그리드 */
.grid-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: #1a2035;
    pointer-events: none;
}

.foot {
    margin-top: 28px;
    font-size: 11px;
    color: #aaa;
    letter-spacing: 1px;
}

/* 등급 요약 */
.grade-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
    margin-bottom: 20px;
}
.grade-card {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 10px;
    background: #040b1b;
    border: 1px solid #2a3458;
    border-radius: 4px;
    padding: 15px 20px;
    box-shadow: 0 10px 10px rgba(0,0,0,0.5);
}
.grade-card .gc-icon {
    width: 120px;
    object-fit: contain;
    flex-shrink: 0;
}
.grade-card .gc-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.grade-card .gc-name {
    font-size: 15px;
    color: #94a3b8;
}
.grade-card .gc-cnt {
    font-size: 25px;
    font-weight: bold;
}
.grade-card .gc-amt {
    font-size: 13px;
    color: #475569;
}
.icon-tip {
    position: relative;
    display: block;
}
.icon-tip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15,23,42,0.96);
    color: #e2e8f0;
    font-size: 10px;
    white-space: nowrap;
    padding: 4px 9px;
    border-radius: 4px;
    border: 1px solid #334155;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 200;
}
.icon-tip:hover::after {
    opacity: 1;
}

/* 도움말 */
.help-wrap {
    max-width: 100%;
    margin: 50px auto 20px auto;
    background: #1a1f3a;
    border: 1px solid #2a3458;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 10px 10px rgba(0,0,0,0.3);
}
.help-header {
    padding: 16px 24px 12px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    display: flex;
    align-items: center;
    gap: 10px;
}
.help-title  { font-size: 15px; font-weight: 700; color: #e2e8f0; letter-spacing: .5px; }
.help-sub    { font-size: 12px; color: rgba(255,255,255,.35); }
.help-tabs   { display: flex; gap: 4px; border-bottom: 1px solid #2a3458; padding: 12px 0px 0; flex-wrap: wrap; margin:0px 20px; }
.htab {
    padding: 7px 16px;
    border: 1px solid rgba(255,255,255,.1);
    border-bottom: 0px;
    border-radius: 4px 4px 0 0;
    background: #0f172a;
    color: rgba(255,255,255,.45);
    font-size: 12px;
    cursor: pointer;
    transition: all .2s;
    letter-spacing: .3px;
}
.htab:hover  { background: rgba(255,255,255,.09); color: rgba(255,255,255,.75); }
.htab.active { background: #040b1b; color: #e2e8f0; border-bottom-color: transparent; font-weight: 600; }
.help-body   { padding: 20px; }
.hpanel      { display: none; }
.hpanel.active { display: block; animation: hfade .25s ease; }
    @keyframes hfade { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }
.hgrid {
    display: flex;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}
.hcard {
    background: #040b1b;
    border: 1px solid #2a3458;
    border-radius: 4px;
    padding: 20px 35px;
    border-left: 3px solid rgba(206, 41, 41, 0.9);
}
.hcard.accent { border-left-color: #40ee40; }
.hcard.warn   { border-left-color: #f59e0b; }
.hcard-title  { font-size: 14px; font-weight: 700; color: #e2e8f0; margin-bottom: 8px; }
.hcard-desc   { font-size: 12px; color: rgba(255,255,255,.5); line-height: 1.7; }
.hcard-desc b { color: rgba(255,255,255,.8); }