:root { --ink: #14213d; --muted: #65708a; --line: #e8ebf1; --surface: #fff; --bg: #f6f8fc; --accent: #A9D9F8; --accent-ink: #315a73; --pink: #FEC4DF; --up: #168760; --down: #d24444; }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.site-header { min-height: 112px; position: sticky; top: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(255,255,255,.95); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); z-index: 100; }
.header-inner { position: relative; display: flex; align-items: center; justify-content: center; width: min(1120px, calc(100% - 40px)); height: 68px; }
.brand-logo { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; height: 100%; }
.header-logo-img { height: 44px; width: auto; max-width: 220px; object-fit: contain; transition: transform 0.2s ease; }
.header-logo-img:hover { transform: scale(1.03); }
.updated-at { position: absolute; right: 0; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; font-weight: 500; margin: 0; white-space: nowrap; }
.page-nav { display: flex; justify-content: center; gap: 6px; height: 44px; }
.page-tab { height: 36px; min-width: 84px; padding: 0 14px; border: none; border-radius: 8px; color: var(--muted); }
.page-tab:hover { color: var(--ink); background: #f0f3fa; }
.page-tab.active { color: var(--accent-ink); background: #edf7fd; }
.page-shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 64px 0 72px; }.hero { margin-bottom: 42px; text-align: center; }.eyebrow { color: var(--accent); font-size: .72rem; font-weight: 800; letter-spacing: .13em; margin: 0 0 10px; }.hero h1, h2, .view-heading h1 { margin: 0; letter-spacing: -.045em; }.hero h1 { font-size: clamp(2rem, 4vw, 3.2rem); }.hero > p:last-child { color: var(--muted); margin: 16px 0 0; }
.page-view[hidden] { display: none; }
.view-heading { margin-bottom: 28px; text-align: center; }
.view-heading h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); }
.detail-placeholder { min-height: 360px; display: grid; place-content: center; gap: 12px; }
.detail-placeholder p { margin: 0; color: var(--muted); }
.overview-chart { margin-bottom: 44px; padding: 26px 28px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.chart-filter-group { display: flex; gap: 4px; background: #f0f3fa; padding: 3px; border-radius: 9px; }
.filter-chip { height: 32px; border: none; background: transparent; padding: 0 12px; font-size: 0.8rem; font-weight: 650; color: var(--muted); border-radius: 7px; transition: all 0.2s ease; cursor: pointer; }
.filter-chip:hover { color: var(--ink); }
.filter-chip.active { background: #fff; color: var(--accent-ink); font-weight: 750; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.overview-graph { min-height: 380px; margin-top: 10px; }
.overview-graph svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: #e8ebf1; stroke-width: 1; stroke-dasharray: 4,4; }
.chart-axis { fill: var(--muted); font-size: 11px; text-anchor: end; }
.val-label { font-size: 11px; font-variant-numeric: tabular-nums; }
.date-title { font-size: 13px; font-weight: 750; fill: var(--ink); text-anchor: middle; }
.item-trend-group { cursor: pointer; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.legend-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 20px; border: 1px solid var(--line); background: #f8fafc; font-size: 0.8rem; color: var(--ink); cursor: pointer; transition: all 0.2s ease; }
.legend-pill:hover, .legend-pill.active { background: #edf2fe; border-color: #b8c7fa; }
.legend-color { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.legend-name { font-weight: 700; }
.legend-val { color: var(--muted); font-variant-numeric: tabular-nums; }
.legend-diff { font-size: 0.75rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.legend-diff.up { color: var(--up); }
.legend-diff.down { color: var(--down); }
.controls { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 18px; }.search-field input, .month-field input, button { height: 44px; border-radius: 9px; font: inherit; }.search-field input, .month-field input { border: 1px solid #d7dce7; background: #fff; padding: 0 14px; color: var(--ink); }.search-field input { width: min(300px, 100%); }.month-field input { min-width: 160px; }.search-field input:focus, .month-field input:focus { outline: 2px solid #b8c7fa; border-color: var(--accent); }button { cursor: pointer; color: var(--ink); background: transparent; border: 1px solid #d7dce7; padding: 0 14px; font-weight: 650; }
.ranking-section { margin-bottom: 44px; }
.ranking-heading { align-items: center; }
.ranking-filter-group { display: flex; gap: 4px; width: fit-content; background: #f0f3fa; padding: 3px; border-radius: 9px; }
.member-section .section-heading { justify-content: center; text-align: center; }
.member-section .section-heading h2 { font-weight: 800; }
.personal-section { padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.personal-stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.personal-stat-card { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcff; }
.personal-stat-card img { width: 92px; aspect-ratio: 1; border-radius: 50%; object-fit: cover; border: 3px solid #e5e9f0; }
.personal-stat-content h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 14px; font-size: 1rem; }
.personal-stat-content h3 strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.personal-ratio-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.personal-ratio-label { color: var(--muted); font-size: .78rem; font-weight: 750; }
.personal-ratio-bar { display: flex; height: 34px; overflow: hidden; border: 1px solid var(--line); border-radius: 999px; }
.personal-ratio-left, .personal-ratio-right { display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden; color: var(--ink); font-size: .72rem; font-weight: 800; }
.personal-ratio-left { background: var(--accent); }
.personal-ratio-right { background: var(--pink); }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 16px; }.section-heading h2 { font-size: 1.55rem; }.result-count { color: var(--muted); font-size: .85rem; }.table-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; }table { border-collapse: collapse; table-layout: fixed; width: 100%; }th, td { padding: 17px clamp(10px, 2vw, 20px); text-align: left; border-bottom: 1px solid var(--line); }thead { background: #fafbfe; }th { color: var(--muted); font-size: .75rem; font-weight: 750; }tbody tr:last-child td { border-bottom: none; }td { font-size: .93rem; }.ranking-section th:nth-child(1), .ranking-section td:nth-child(1) { width: 14%; }.ranking-section th:nth-child(2), .ranking-section td:nth-child(2) { width: 36%; }.ranking-section th:nth-child(3), .ranking-section td:nth-child(3) { width: 25%; }.ranking-section th:nth-child(4), .ranking-section td:nth-child(4) { width: 25%; }.rank { color: var(--accent); font-weight: 800; }.item-name { font-weight: 700; }.value { font-variant-numeric: tabular-nums; font-weight: 650; }.movement { font-variant-numeric: tabular-nums; font-size: .83rem; font-weight: 750; white-space: nowrap; }.movement.up { color: var(--up); }.movement.down { color: var(--down); }.movement.same { color: var(--muted); }.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 14px; }.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0; }footer { color: var(--muted); text-align: center; padding: 24px; font-size: .8rem; border-top: 1px solid var(--line); }
.rank-trend-graph .chart-axis { dominant-baseline: middle; }
.detail-panel { padding: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.detail-panel > h2 { margin: 0 0 24px; text-align: center; font-size: 1.35rem; }
.member-picker-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 18px; max-width: 760px; margin: 0 auto; }
.member-card { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 8px; border: 0; height: auto; border-radius: 14px; color: var(--ink); }
.member-card:hover { background: #f5f7fc; }
.member-card.selected { background: #edfafa; color: #087f8c; }
.member-card img { width: clamp(88px, 12vw, 132px); aspect-ratio: 1; border-radius: 50%; object-fit: cover; border: 3px solid #e1e6ef; transition: border-color .2s, box-shadow .2s; }
.member-card.selected img { border-color: #68c8cf; box-shadow: 0 0 0 5px rgba(104,200,207,.24); }
.member-card span { font-size: .9rem; font-weight: 750; }
.pair-detail { margin-top: 36px; }
.pair-ratio { margin-bottom: 24px; }
.ratio-bar { display: flex; width: 100%; min-height: 52px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #f1f4f8; }
.ratio-segment { display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden; padding: 8px; color: #fff; font-size: .78rem; font-weight: 750; text-align: center; }
.ratio-segment.forward { color: var(--ink); background: var(--accent); }
.ratio-segment.reverse { color: var(--ink); background: #fff; box-shadow: inset 1px 0 var(--line), inset -1px 0 var(--line); }
.ratio-segment.backward { color: var(--ink); background: var(--pink); }
.ratio-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.ratio-summary span { color: var(--muted); font-size: .78rem; text-align: center; }
.detail-table-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.detail-cp-buttons { display: flex; gap: 8px; }
.detail-cp-button.active { color: var(--ink); background: var(--accent); border-color: var(--accent); }
.detail-table-wrap table { min-width: 0; }
.detail-table-wrap th, .detail-table-wrap td { text-align: center; }
.detail-empty { padding: 48px 16px; color: var(--muted); }
@media (max-width: 600px) {
  .site-header { min-height: 98px; }
  .header-inner { width: calc(100% - 24px); height: 56px; }
  .header-logo-img { height: 36px; max-width: 160px; }
  .updated-at { display: none; }
  .page-nav { width: 100%; height: 42px; gap: 2px; }
  .page-tab { height: 34px; min-width: 0; flex: 1; max-width: 120px; padding: 0 8px; font-size: .82rem; }
  .page-shell { width: calc(100% - 24px); padding-top: 38px; }
  .hero { margin-bottom: 30px; }
  .hero h1 { font-size: 1.9rem; }
  .overview-chart { padding: 18px 12px 14px; }
  .overview-graph { min-height: 260px; overflow-x: auto; }
  .overview-graph svg { width: 760px; max-width: none; height: 330px; }
  .controls {
    display: grid;
    grid-template-columns: minmax(0, 38%) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: calc(100% - 10px);
    margin-right: 10px;
  }
  .search-field, .month-field { display: block; width: 100%; min-width: 0; }
  .search-field input, .month-field input {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 44px;
    margin: 0;
  }
  .month-field input { padding: 0 8px; text-align: center; }
  .month-field input::-webkit-date-and-time-value {
    /* iOS Safari renders the month in a separate native value box. */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
  }
  .section-heading { align-items: start; flex-direction: column; gap: 8px; }
  .ranking-heading { flex-direction: row; align-items: center; }
  .filter-chip { padding: 0 9px; font-size: .75rem; }
  th, td { padding: 13px 7px; font-size: .78rem; }
  th { font-size: .68rem; }
  .ranking-section th:nth-child(1), .ranking-section td:nth-child(1) { width: 14%; }
  .ranking-section th:nth-child(2), .ranking-section td:nth-child(2) { width: 30%; }
  .ranking-section th:nth-child(3), .ranking-section td:nth-child(3) { width: 25%; }
  .ranking-section th:nth-child(4), .ranking-section td:nth-child(4) { width: 31%; }
  .movement { font-size: .76rem; }
  .result-count { font-size: .75rem; }
  .member-section .section-heading { align-items: center; }
  .personal-section { padding: 20px 12px; }
  .personal-stats-grid { grid-template-columns: 1fr; gap: 12px; }
  .personal-stat-card { grid-template-columns: 68px 1fr; gap: 12px; padding: 14px 12px; }
  .personal-stat-card img { width: 68px; }
  .personal-stat-content h3 { margin-bottom: 10px; }
  .personal-stat-content h3 strong { font-size: 1.08rem; }
  .personal-ratio-row { gap: 5px; }
  .personal-ratio-bar { height: 30px; }
  .personal-ratio-left, .personal-ratio-right { font-size: .65rem; }
  .detail-panel { padding: 20px 12px; }
  .member-picker-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 4px; }
  .member-card { gap: 6px; padding: 4px 2px; }
  .member-card img { width: clamp(62px, 19vw, 78px); border-width: 2px; }
  .member-card span { font-size: .72rem; }
  .pair-detail { margin-top: 26px; }
  .ratio-bar { min-height: 46px; }
  .ratio-segment { padding: 5px 3px; font-size: .68rem; }
  .ratio-summary span { font-size: .68rem; }
  .detail-table-controls { align-items: stretch; flex-direction: column; }
  .detail-cp-buttons { width: 100%; }
  .detail-cp-button { flex: 1; }
  #detail-sort-button { align-self: flex-end; }
}
