:root{
    --max: 1100px;
    --text: #1f2328;
    --muted: #6b7280;
    --border: #e5e7eb;
    --bg: #ffffff;
    --topbar: #2b2f34;
    --primary: #2563eb;
}

*{ box-sizing:border-box; }
body{
    margin:0;
    font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    color:var(--text);
    background:var(--bg);
}

.layout{
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar{
    background: var(--topbar);
    color:#fff;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.topbar__inner{
    max-width: var(--max);
    margin: 0 auto;
    padding: 14px 18px;
    display:flex;
    align-items:center;
    justify-content:space-between;
}

.brand{
    color:#fff;
    text-decoration:none;
    font-weight:700;
    letter-spacing:0.3px;
}

.nav{ display:flex; gap:16px; }
.nav__link{
    color: rgba(255,255,255,0.75);
    text-decoration:none;
    font-weight:600;
}
.nav__link:hover{ color:#fff; }

main{
    max-width: var(--max);
    margin: 0 auto;
    padding: 42px 18px 60px;
}

.layout__main{
    width: 100%;
    flex: 1 0 auto;
}

.layout__footer{
    width: 100%;
    padding: 20px 18px 28px;
    text-align: center;
    color: var(--muted);
    flex-shrink: 0;
}

.layout__footerText{
    display: inline-block;
    font-size: 13px;
}

.hero{
    text-align:center;
    margin-top: 10px;
}

.hero__logo{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:14px;
    margin-top: 10px;
}

.logoText{
    font-size: 54px;
    font-weight: 300;
    letter-spacing: 1px;
}

.logoIcon{
    width: 64px;
    height: 64px;
    color: var(--primary);
}

.hero__subtitle{
    margin: 12px 0 10px;
    color: var(--muted);
    font-size: 18px;
}

.hero__count{
    margin: 12px 0 28px;
    color: #374151;
    font-size: 16px;
}

.badge{
    display:inline-block;
    margin: 0 4px;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--primary);
    color:#fff;
    font-weight:700;
    font-size: 13px;
    vertical-align: middle;
}

.search{
    max-width: 720px;
    margin: 0 auto;
    display:flex;
    align-items:center;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow:hidden;
    background:#fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.search__icon{
    width: 56px;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#6b7280;
    font-size: 22px;
    border-right: 1px solid var(--border);
}

.search__input{
    flex:1;
    border:0;
    outline:none;
    padding: 18px 16px;
    font-size: 18px;
}

.search__btn{
    border:0;
    background: var(--primary);
    color:#fff;
    font-size: 18px;
    padding: 18px 28px;
    cursor:pointer;
}
.search__btn:hover{ filter: brightness(0.95); }

.hint{
    margin-top: 10px;
    color:#b00020;
}

.popularStocks{
    max-width: 880px;
    margin: 34px auto 0;
    text-align: left;
}

.popularStocks__head{
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.popularStocks__title{
    margin: 0;
    font-size: 22px;
    font-weight: 800;
}

.popularStocks__subtitle{
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.popularStocks__grid{
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.popularStocks__item{
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    text-decoration: none;
    color: var(--text);
    background: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.popularStocks__item:hover{
    border-color: #c7d2fe;
    transform: translateY(-1px);
}

.popularStocks__rank{
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: var(--primary);
    font-weight: 800;
    flex-shrink: 0;
}

.popularStocks__body{
    min-width: 0;
    flex: 1 1 auto;
}

.popularStocks__name{
    font-size: 16px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.popularStocks__meta{
    margin-top: 4px;
    display: flex;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.popularStocks__count{
    color: #111827;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.popularStocks__empty{
    padding: 18px 16px;
    border: 1px dashed var(--border);
    border-radius: 14px;
    text-align: center;
    color: var(--muted);
    background: #fff;
    grid-column: 1 / -1;
}

.page { max-width: var(--max); margin: 0 auto; }
.page__title { margin: 10px 0 14px; font-size: 26px; }

.searchInline{
    display:flex;
    gap:8px;
    align-items:center;
    margin: 12px 0 14px;
}
.searchInline__input{
    flex: 1 1 auto;
    min-width: 0;
    padding: 12px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
}
.searchInline__btn{
    padding: 12px 14px;
    border: 0;
    border-radius: 10px;
    background: var(--primary);
    color:#fff;
    font-weight: 700;
    cursor:pointer;
}

.tableWrap{
    margin-top: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}
.table{
    width:100%;
    border-collapse: collapse;
}
.table th, .table td{
    padding: 12px 12px;
    border-bottom: 1px solid var(--border);
    text-align:left;
    font-size: 14px;
}
.table thead th{
    background: #f9fafb;
    font-weight: 800;
}
.link{
    color: var(--primary);
    text-decoration: none;
    font-weight: 800;
}
.link:hover{ text-decoration: underline; }

.empty{
    margin-top: 18px;
    color: var(--muted);
}

.pager{
    display:flex;
    align-items:center;
    justify-content:center;
    gap: 12px;
    margin-top: 16px;
}
.pager__btn{
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration:none;
    color: var(--text);
}
.pager__btn:hover{ background: #f3f4f6; }
.pager__info{ color: var(--muted); font-weight: 700; }

.pager__num{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration:none;
    color: var(--text);
    font-weight: 700;
}

.pager__num:hover{ background:#f3f4f6; }

.pager__num.is-active{
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pager__btn--disabled{
    opacity: 0.5;
    pointer-events: none;
}

.meta{
    margin: 12px auto 18px;
    max-width: 920px;
    display:flex;
    gap: 12px;
    justify-content:center;
    flex-wrap: wrap;
}

.meta__item{
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    min-width: 180px;
    background:#fff;
}

.meta__label{ display:block; color: var(--muted); font-size: 12px; font-weight: 700; }
.meta__value{ display:block; margin-top: 4px; font-size: 16px; font-weight: 800; }

.backLink{
    display:inline-block;
    margin-top: 8px;
    color: var(--primary);
    text-decoration:none;
    font-weight: 800;
}
.backLink:hover{ text-decoration: underline; }

.divider{
    border: 0;
    border-top: 1px solid var(--border);
    margin: 18px 0;
}

.detailHead{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap: 16px;
    padding: 14px 0 10px;
}

.detailHead__meta{
    display:flex;
    gap: 10px;
    align-items:center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.code{ font-weight: 800; color: #db2777; } /* 기존 핑크 느낌 */

.btnOutline{
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration:none;
    color: var(--text);
    font-weight: 800;
    white-space: nowrap;
}
.btnOutline:hover{ background:#f3f4f6; }

.tabs{
    display:flex;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    margin-top: 12px;
}

.tab{
    border: 1px solid var(--border);
    border-bottom: none;
    background: #fff;
    padding: 10px 14px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    cursor:pointer;
    font-weight: 800;
}
.tab.is-active{
    border-color: var(--primary);
    color: var(--primary);
}

.tabPanels{
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    background: #fff;
}

.srimGrid{
    display:grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.srimTopGrid{
    display: grid;
    grid-template-columns: minmax(340px, 420px) max-content;
    gap: 12px;
    align-items: stretch;
    justify-content: space-between;
}
@media (max-width: 1100px){
    .srimTopGrid{
        grid-template-columns: 1fr;
    }
}

.srimResultGrid{
    display:grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}
@media (max-width: 1100px){
    .srimResultGrid{
        grid-template-columns: 1fr;
    }
}

.srimCard{
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    background: #fff;
}
.srimSideSlot{
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: #f8fafc;
    min-height: 100%;
    padding: 14px;
}
.srimSideSlot__content{
    display: grid;
    gap: 10px;
}
.srimTitle--stack{
    display: block;
    margin-bottom: 0;
}
.srimMiniTableWrap{
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.srimMiniTable{
    width: 100%;
    border-collapse: collapse;
}
.srimMiniTable__head,
.srimMiniTable__rowHead,
.srimMiniTable__cell{
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    font-size: 12px;
}
.srimMiniTable__head:last-child,
.srimMiniTable__rowHead:last-child,
.srimMiniTable__cell:last-child{
    border-right: none;
}
.srimMiniTable__head{
    text-align: center;
    color: var(--muted);
    background: #f7f7fb;
    font-weight: 600;
}
.srimMiniTable__rowHead{
    text-align: left;
    width: 40%;
    background: #fbfbff;
    font-weight: 600;
    color: #2d3640;
}
.srimMiniTable__cell{
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: #1f2933;
}
.srimMiniTable tbody tr:last-child .srimMiniTable__rowHead,
.srimMiniTable tbody tr:last-child .srimMiniTable__cell{
    border-bottom: none;
}
.srimMetaTableWrap{
    margin-top: 6px;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.srimMetaTable{
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.srimMetaTable__head,
.srimMetaTable__cell{
    padding: 10px 12px;
    border-right: 1px solid var(--border);
    font-size: 13px;
}
.srimMetaTable__head:last-child,
.srimMetaTable__cell:last-child{
    border-right: none;
}
.srimMetaTable__head{
    text-align: center;
    color: var(--muted);
    background: #f7f7fb;
    font-weight: 600;
}
.srimMetaTable__cell{
    text-align: center;
    font-variant-numeric: tabular-nums;
    color: #1f2933;
    font-weight: 600;
}
.srimCard--empty{
    display:flex;
    align-items:center;
}

.srimTitle{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom: 10px;
}
.srimTitle h3{ margin:0; font-size: 16px; }
.srimHint{ color: var(--muted); font-size: 13px; }
.srimChips{
    display:flex;
    gap: 6px;
    flex-wrap: wrap;
}

.chip{
    display:inline-flex;
    align-items:center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    background: #f6f7fb;
    color: #394150;
}
.chip--accent{
    background: #eef6ff;
    border-color: #d7e8ff;
    color: #1c4aa0;
}
.chip--neutral{
    background: #f2f4f8;
    border-color: #e3e7ee;
    color: #2d3640;
}
.chip--muted{
    background: #f7f7fb;
    border-color: #ececf3;
    color: #5d6674;
}
.chip--dark{
    background: #111827;
    border-color: #111827;
    color: #f9fafb;
}

.srimList{ margin:0; padding-left: 18px; }
.srimList li{ margin: 6px 0; }
.srimList--tight{ padding-left: 14px; }

.srimScenarioLayout{
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 1fr;
    gap: 14px;
    align-items: center;
}
@media (max-width: 900px){
    .srimScenarioLayout{
        grid-template-columns: 1fr;
    }
}

.srimTableWrap{
    margin-top: 6px;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.srimTableWrap--flush{
    margin-top: 0;
}
.srimTable{
    width: 100%;
    border-collapse: collapse;
}
.srimTable__head,
.srimTable__rowHead,
.srimTable__cell{
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    font-size: 13px;
}
.srimTable__head:last-child,
.srimTable__rowHead:last-child,
.srimTable__cell:last-child{
    border-right: none;
}
.srimTable__head{
    text-align: left;
    color: var(--muted);
    background: #f7f7fb;
    font-weight: 600;
}
.srimTable__rowHead{
    text-align: left;
    width: 44%;
    background: #fbfbff;
    font-weight: 600;
    color: #2d3640;
}
.srimTable__cell{
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: #1f2933;
}
.srimTable--center .srimTable__head,
.srimTable--center .srimTable__cell{
    text-align: center;
}
.srimTable--rowLabels .srimTable__rowHead{
    text-align: left;
    width: 26%;
}
.srimSubTitle{
    margin: 12px 0 6px;
    font-size: 13px;
    font-weight: 700;
    color: #4b5563;
}

.srimSummaryGrid{
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
}
@media (max-width: 860px){
    .srimSummaryGrid{
        grid-template-columns: 1fr;
    }
}

.srimTable__cell--em{
    font-weight: 700;
    color: #0f172a;
    background: #f6f8ff;
}
.srimTable__cell--muted{
    color: var(--muted);
    background: #fbfbff;
}

.srimTable--compact{
    width: fit-content;
    min-width: 0;
    table-layout: auto;
}
.srimTable--compact .srimTable__rowHead{
    width: auto;
    white-space: nowrap;
}
.srimTable--scenario .srimTable__head{
    text-align: left;
}
.srimTable--scenario .srimTable__cell{
    text-align: right;
}
.srimTable--calc .srimTable__rowHead{
    width: 70%;
}
.srimCalcNote{
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted);
}

.srimChart{
    position: relative;
    height: 180px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fbfbff;
}
.srimBars{
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    height: 100%;
    align-items: end;
}
.srimBars--grouped{
    grid-template-columns: repeat(5, minmax(88px, 1fr));
    justify-content: stretch;
    gap: 18px;
}
.srimBarGroup{
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 2px;
    min-width: 0;
    justify-items: center;
    width: 100%;
}
.srimBarPair{
    display: inline-flex;
    justify-content: center;
    gap: 0;
    align-items: end;
    height: 100%;
}
.srimBarWrap{
    display: grid;
    grid-template-rows: auto 1fr auto;
    align-items: end;
    gap: 4px;
    height: 100%;
    text-align: center;
}
.srimBarWrap--grouped{
    grid-template-rows: auto 1fr auto;
    gap: 1px;
    width: 30px;
}
.srimBarMeter{
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-end;
    height: 100%;
    min-height: 120px;
}
.srimBar{
    width: 100%;
    max-width: 56px;
    justify-self: center;
    background: linear-gradient(180deg, #f87171, #dc2626);
    border-radius: 3px 3px 1px 1px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35);
}
.srimBar--annual{
    background: linear-gradient(180deg, #f87171, #dc2626);
}
.srimBar--quarterly{
    background: linear-gradient(180deg, #60a5fa, #2563eb);
}
.srimChart--grouped{
    height: 228px;
    width: 100%;
    margin-left: 0;
}
.srimBar--compact{
    max-width: 24px;
}
.srimBarLabel{
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
    line-height: 1.2;
    text-align: center;
}
.srimBarSeries{
    font-size: 11px;
    color: var(--muted);
    line-height: 1;
}
.srimBarValue{
    font-size: 11px;
    font-weight: 700;
    color: #111827;
    line-height: 1.1;
    white-space: nowrap;
}
.srimBarValue--floating{
    margin-bottom: 4px;
    align-self: center;
}
.srimLine{
    position: absolute;
    left: 12px;
    right: 12px;
    height: 2px;
    background: #111;
    z-index: 1;
}
.srimLine span{
    position: absolute;
    right: 0;
    top: -18px;
    font-size: 11px;
    background: #111;
    color: #fff;
    padding: 2px 6px;
    border-radius: 999px;
}
@media (max-width: 720px){
    .srimChart--grouped{
        height: auto;
        min-height: 260px;
    }
    .srimBars--grouped{
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.alert{
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    background: #f9fafb;
}
.alert--error{ background:#fff1f2; border-color:#fecdd3; }

.card{
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    background: #fff;
}

.finHeader{
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.finToolbar{
    margin-bottom: 12px;
}

.finPeriodSwitch{
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #f8fafc;
}

.finPeriodSwitch__button{
    border: 0;
    border-radius: 999px;
    padding: 8px 14px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.finPeriodSwitch__button.is-active{
    background: var(--text);
    color: #fff;
}

.finSection{
    margin-top: 18px;
}
.finSection:first-of-type{
    margin-top: 0;
}
.finSection__title{
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 800;
}

.finTableWrap{
    overflow:auto;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.finTable{
    width: 100%;
    border-collapse: collapse;
    min-width: 520px;
    background: #fff;
}

.finTable__head,
.finTable__rowHead,
.finTable__cell{
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.finTable__head{
    background: #f9fafb;
    font-weight: 800;
    text-align: right;
    color: var(--text);
}

.finTable__head--sticky{
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 3;
    background: #f9fafb;
}

.finTable__rowHead{
    text-align: left;
    font-weight: 800;
    background: #fafafa;
    color: var(--text);
    white-space: nowrap;

    position: sticky;
    left: 0;
    z-index: 2;
}

.finTable__cell{
    text-align: right;
    color: var(--text);
}

.finTable__unit{
    color: var(--muted);
    font-weight: 400;
    font-size: 12px;
}

.chartCard{
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    background: #fff;
}
.chartHead{
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.chartTitle{
    margin: 0;
    font-size: 16px;
    font-weight: 800;
}
.chartMeta{
    font-size: 12px;
    color: var(--muted);
}
.chartControls{
    display:flex;
    gap: 6px;
    flex-wrap: wrap;
}
.chartToggle{
    display:flex;
    align-items:center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: #374151;
    font-size: 12px;
    font-weight: 700;
}
.chartToggle input{
    margin: 0;
    accent-color: var(--primary);
}
.chartRangeBtn{
    border: 1px solid var(--border);
    background: #fff;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    cursor: pointer;
}
.chartRangeBtn.is-active{
    border-color: var(--primary);
    color: var(--primary);
    background: #eef2ff;
}
.chartCanvasWrap{
    position: relative;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fbfbff;
    padding: 10px;
}
.chartCanvas{
    width: 100%;
    height: 320px;
    display: block;
}
.chartTooltip{
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(-50%, -100%);
    background: #111827;
    color: #fff;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.2);
}
.chartError{
    margin-top: 10px;
}
.chartNote{
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted);
}

.metricChartCard{
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    background: #fff;
    margin-top: 12px;
}
.metricChartTitle{
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 800;
}
.metricLegend{
    display:flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}
.metricLegend__item{
    display:inline-flex;
    align-items:center;
    gap: 6px;
}
.metricLegend__swatch{
    width: 18px;
    height: 3px;
    border-radius: 999px;
}
.metricLegend__swatch--per{
    background: #2563eb;
}
.metricLegend__swatch--pbr{
    background: #dc2626;
}
.metricChartCanvas{
    width: 100%;
    height: 180px;
    display: block;
}

/* 반응형 */
@media (max-width: 640px){
    .logoText{ font-size: 44px; }
    .search__input{ font-size: 16px; padding: 14px 12px; }
    .search__btn{ font-size: 16px; padding: 14px 18px; }
    .popularStocks__head{ display:block; text-align:left; }
    .popularStocks__subtitle{ margin-top: 4px; }
    .hideSm{ display:none; }
}
