/*
 * Type scale: 12 caption · 14 label · 16 body and values · 20 card title · 28 page title and tile number.
 * Spacing scale: 8 · 12 · 16 · 24.
 * Keep new rules on these steps; extra sizes are what made the page look unsorted.
 */
:root {
  /* Neutral grays only. Color is kept for the data: the two chart series. */
  color-scheme: light;
  --plane: #f5f5f4;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --ink-2: #555555;
  --muted: #8a8a8a;
  --grid: #e5e5e3;
  --axis: #c8c8c5;
  --ring: rgba(0, 0, 0, 0.08);
  --chip: #ededeb;
  --accent: #1a1a1a;
  --on-accent: #ffffff;
  /* Chart series, checked with the dataviz palette validator on #ffffff. */
  --s1: #2a78d6;
  --s2: #eb6834;

  --t-caption: 12px;
  --t-label: 14px;
  --t-body: 16px;
  --t-title: 20px;
  --t-display: 28px;
  --radius: 14px;
}
/* Dark: a dark gray rather than black, which read as a blank black screen. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --plane: #1c1c1c;
    --surface: #262626;
    --ink: #ececec;
    --ink-2: #b5b5b5;
    --muted: #8a8a8a;
    --grid: #353535;
    --axis: #4a4a4a;
    --ring: rgba(255, 255, 255, 0.08);
    --chip: #303030;
    --accent: #ececec;
    --on-accent: #1a1a1a;
    /* Checked with the dataviz palette validator on #262626. */
    --s1: #3987e5;
    --s2: #d95926;
  }
}

* { box-sizing: border-box; }
/* Reserve the scrollbar's room on every page, so short pages without a
   scrollbar do not sit a scrollbar's width to the side of long ones. */
html { -webkit-text-size-adjust: 100%; overflow-y: scroll; scrollbar-gutter: stable; }
body {
  margin: 0; background: var(--plane); color: var(--ink);
  font: var(--t-body)/1.6 system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
  word-break: keep-all;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: var(--t-display); }
h2 { font-size: var(--t-title); }
h3 { font-size: var(--t-label); }
p { margin: 0; }
.muted { color: var(--ink-2); }
.small { font-size: var(--t-caption); }

/* Header */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--plane) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--ring); }
/* Fixed height: the home page has no search box in the header and must not be shorter. */
.top-inner { max-width: 880px; height: 56px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); }
.brand:hover { text-decoration: none; }
.mark { width: 16px; height: 16px; border-radius: 4px; background: var(--ink); }

/* Search: one bar holding the icon, the field and, on the home page, the button. */
.search {
  display: flex; align-items: center; width: 260px; height: 40px; padding-left: 12px;
  background: var(--surface); border: 1px solid var(--axis); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--ink-2); box-shadow: 0 0 0 3px var(--ring); }
.search-icon { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.search input {
  flex: 1; min-width: 0; height: 100%; padding: 0 8px; border: 0; outline: 0;
  background: transparent; color: var(--ink); font: inherit; font-size: var(--t-label);
}
.search input::placeholder { color: var(--muted); }
.search button {
  flex: none; height: calc(100% - 16px); margin-right: 8px; padding: 0 16px; border: 0; border-radius: 8px;
  background: var(--accent); color: var(--on-accent); font: inherit; font-size: var(--t-label); font-weight: 600; cursor: pointer;
}
.search.big { width: 100%; height: 56px; padding-left: 16px; }
.search.big .search-icon { width: 20px; height: 20px; }
.search.big input { font-size: var(--t-body); padding: 0 12px; }

main { max-width: 880px; margin: 0 auto; padding: 24px 16px 8px; }
footer { margin-top: 48px; border-top: 1px solid var(--ring); color: var(--muted); font-size: var(--t-caption); }
.footer-inner { max-width: 880px; margin: 0 auto; padding: 24px 16px 40px; display: flex; flex-direction: column; gap: 8px; }
footer nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
footer a { color: var(--ink-2); }
footer b { font-weight: 600; }

/* Cards */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--ring); padding: 24px; margin: 16px 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head + p { margin: 8px 0 16px; }

/* Home */
.hero { padding: 48px 0 24px; }
.hero h1 { margin-bottom: 24px; }
.coverage { color: var(--ink-2); font-size: var(--t-label); margin-top: 12px; }
.examples { color: var(--muted); font-size: var(--t-label); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.examples a { background: var(--surface); box-shadow: 0 0 0 1px var(--ring); padding: 4px 12px; border-radius: 999px; color: var(--ink-2); }

/* Search results: one card holding a list, ten rows per card */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.result-count-line { color: var(--ink-2); font-size: var(--t-label); }
.results { list-style: none; padding: 0; overflow: hidden; }
.results li + li { border-top: 1px solid var(--grid); }
.result { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 24px; color: var(--ink); }
.result:hover { text-decoration: none; background: var(--plane); }
.result-main { display: flex; flex-direction: column; min-width: 0; }
.result-main strong { font-size: var(--t-body); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-main span { color: var(--ink-2); font-size: var(--t-label); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-count { flex: none; color: var(--ink-2); font-size: var(--t-label); }
.result-count b { color: var(--ink); font-size: var(--t-body); font-weight: 600; margin-left: 4px; }
.empty p + p { margin-top: 8px; }
.badge { font-style: normal; font-size: var(--t-caption); font-weight: 600; color: var(--ink-2); background: var(--chip); border-radius: 4px; padding: 1px 6px; margin-right: 8px; white-space: nowrap; }
.sites { margin-top: 24px; }
.sites summary { display: block; cursor: pointer; color: var(--ink-2); font-size: var(--t-label); list-style: none; }
.sites summary::-webkit-details-marker { display: none; }
.sites summary::after { content: " 보기 ›"; color: var(--ink); font-weight: 600; }
.sites[open] summary::after { content: " 접기"; }
.sites > p { margin: 8px 0 0; }

/* Workplace: header */
.company-head { padding-bottom: 8px; }
.company-head h1 { margin-bottom: 12px; }
.company-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.compare-link { flex: none; margin-top: 4px; background: var(--surface); box-shadow: 0 0 0 1px var(--ring); padding: 4px 12px; border-radius: 999px; color: var(--ink-2); font-size: var(--t-label); }
.compare-link:hover { text-decoration: none; color: var(--ink); }

/* Comparison of two companies */
.compare-head { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: start; padding-bottom: 8px; }
.compare-company { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.compare-company a { color: var(--ink); font-size: var(--t-title); }
.compare-company .key { margin-bottom: 4px; }
.compare-vs { color: var(--muted); font-size: var(--t-label); padding-top: 24px; }
.compare-change { display: inline-block; margin-top: 8px; color: var(--ink-2); font-size: var(--t-label); text-decoration: underline; text-underline-offset: 3px; }
.compare-search { margin-top: 16px; }
.compare-hint { margin-top: 16px; font-size: var(--t-label); }
table.compare { white-space: normal; table-layout: fixed; }
table.compare th[scope="row"] { color: var(--ink-2); font-size: var(--t-label); font-weight: 400; width: 128px; vertical-align: top; }
table.compare thead th { text-align: left; color: var(--ink); font-size: var(--t-label); font-weight: 600; }
table.compare td { text-align: left; vertical-align: top; }
table.compare td strong { font-size: var(--t-body); font-weight: 600; display: block; }
table.compare .gauge { margin: 4px 0; max-width: 240px; }
.compare-note { display: block; color: var(--muted); font-size: var(--t-caption); }
table.compare tbody tr:last-child th { border-bottom: 0; }
.compare-peers { margin-top: 12px; }
.compare-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.compare-charts .chart.narrow { display: block; }
.compare-chart-name { display: flex; align-items: center; gap: 8px; font-size: var(--t-label); color: var(--ink-2); }
.status { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 0; margin-bottom: 8px; font-size: var(--t-label); color: var(--ink-2); }
.meta { color: var(--ink-2); font-size: var(--t-label); margin-top: 4px; }
.disclosed { margin-top: 8px; cursor: help; }
.disclosed b { color: var(--ink); font-weight: 600; }
.disclosed span { white-space: nowrap; }
.disclosed-label { font-size: var(--t-caption); color: var(--ink-2); background: var(--chip); border-radius: 4px; padding: 1px 6px; margin-right: 8px; }

/* Workplace: tiles */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; }
.tile { background: var(--surface); border-radius: var(--radius); box-shadow: 0 0 0 1px var(--ring); padding: 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile-label { color: var(--ink-2); font-size: var(--t-label); }
.tile strong { font-size: var(--t-display); line-height: 1.2; letter-spacing: -0.02em; }
.tile strong small { font-size: var(--t-body); font-weight: 500; color: var(--ink-2); margin-left: 2px; }
.tile-sub { color: var(--muted); font-size: var(--t-caption); min-height: 19px; }
.tile-warn { color: var(--ink-2); min-height: 0; cursor: help; }

/* Workplace: key points */
.ins-row { display: grid; grid-template-columns: 112px 200px 1fr; gap: 24px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--grid); }
.insights .card-head { margin-bottom: 8px; }
.ins-row:last-child { border-bottom: 0; }
.ins-label { color: var(--ink-2); font-size: var(--t-label); }
.ins-value { font-size: var(--t-body); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ins-value strong { font-weight: 600; }
.ins-note { color: var(--ink-2); font-size: var(--t-label); }
.gauge { display: flex; align-items: center; gap: 8px; font-size: var(--t-caption); color: var(--muted); }
.gauge-bar { position: relative; flex: 1; margin: 0 8px; height: 4px; border-radius: 2px; background: var(--chip); }
.gauge-bar::after { content: ""; position: absolute; left: 50%; top: -4px; width: 1px; height: 12px; background: var(--axis); }
.gauge-bar i { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--surface); z-index: 1; }

/* Charts */
.legend { display: flex; gap: 16px; font-size: var(--t-label); color: var(--ink-2); }
.legend span { display: flex; align-items: center; gap: 8px; }
.key { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.key.s1 { background: var(--s1); }
.key.s2 { background: var(--s2); }
/* The peer line is a reference, not a series: gray and dashed, no color. */
.key.ref { height: 0; border-radius: 0; border-top: 2px dashed var(--muted); }
.chart { position: relative; }
.chart.narrow { display: none; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.s1 { stroke: var(--s1); }
.chart .line.s2 { stroke: var(--s2); }
.chart .line.ref { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .dot.s1, .chart .focus { fill: var(--s1); stroke: var(--surface); stroke-width: 2; }
.chart .dot.s2 { fill: var(--s2); stroke: var(--surface); stroke-width: 2; }
.chart .bar.s1 { fill: var(--s1); }
.chart .bar.s2 { fill: var(--s2); }
.chart .event { fill: var(--ink); }
.chart .event-label { fill: var(--ink); font-size: 12px; font-weight: 600; }

/* Chart periods: every period is in the page, the chosen one is shown. */
.range-pane { display: none; }
.charts[data-range="1y"] .range-pane[data-range="1y"],
.charts[data-range="3y"] .range-pane[data-range="3y"],
.charts[data-range="all"] .range-pane[data-range="all"] { display: block; }
.range-bar { display: flex; justify-content: flex-end; gap: 4px; margin: 24px 0 -4px; }
.range-bar button {
  border: 0; background: transparent; color: var(--ink-2); font: inherit; font-size: var(--t-label);
  padding: 4px 12px; border-radius: 8px; cursor: pointer;
}
.range-bar button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--ring); }
.chart-caption { margin: 8px 0 16px; }
.chart .event-guide { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0.4; }
.changes { margin: 16px 0 8px; }
.changes td { color: var(--ink-2); cursor: default; }
.changes tr:hover td { color: var(--ink); }
.changes .change-key { color: var(--ink); font-weight: 600; }
.change-mark { display: inline-block; width: 1.5em; font-size: 10px; color: var(--ink); }
.chart .crosshair { stroke: var(--axis); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: crosshair; }
.tooltip {
  position: absolute; top: -8px; transform: translateY(-100%); pointer-events: none;
  background: var(--surface); box-shadow: 0 0 0 1px var(--ring), 0 8px 24px rgba(0,0,0,.12);
  border-radius: 8px; padding: 8px 12px; font-size: var(--t-label); display: flex; flex-direction: column; white-space: nowrap;
}
.tooltip[hidden] { display: none; }
.tooltip strong { font-size: var(--t-caption); color: var(--ink-2); font-weight: 600; }

/* Tables */
.scroll { overflow-x: auto; margin-top: 12px; }
table { border-collapse: collapse; width: 100%; font-size: var(--t-label); white-space: nowrap; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--grid); text-align: right; }
th:first-child, td:first-child { text-align: left; padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
th { color: var(--muted); font-weight: 500; font-size: var(--t-caption); }
tbody tr:last-child td { border-bottom: 0; }
details summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "펼치기"; color: var(--ink-2); font-size: var(--t-label); }
details[open] summary::after { content: "접기"; }

.notes ul { margin: 12px 0 0; padding-left: 16px; color: var(--ink-2); font-size: var(--t-label); }
.notes li { margin: 4px 0; }


/* Documents: about, terms, privacy, contact */
.doc { padding: 40px; }
.doc h1 { margin-bottom: 24px; }
.doc h2 { font-size: var(--t-body); margin: 32px 0 8px; }
.doc p, .doc li, .doc dd { color: var(--ink-2); font-size: var(--t-body); line-height: 1.75; }
.doc p + p { margin-top: 12px; }
.doc ul { margin: 8px 0 0; padding-left: 20px; }
.doc li { margin: 4px 0; }
.doc a { text-decoration: underline; text-underline-offset: 3px; }
.doc-defs { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 8px 0 0; }
.doc-defs dt { font-weight: 600; font-size: var(--t-body); }
.doc-defs dd { margin: 0; }
.doc-contact { font-size: var(--t-title) !important; color: var(--ink) !important; font-weight: 600; margin: 16px 0 !important; }

/* Home page lists */
.home-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.home-lists .card { margin: 0; }
.home-lists + .card { margin-top: 16px; }
.rank { margin-top: 12px; }
.rank td { padding-top: 10px; padding-bottom: 10px; color: var(--ink-2); }
/* The name takes the room left over and is cut with an ellipsis when long. */
.rank-name { width: 100%; max-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rank-name a { color: var(--ink); }
.rank .rank-key { color: var(--ink); font-weight: 600; }

@media (max-width: 720px) {
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .home-lists { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  :root { --t-display: 24px; }
  .chart.wide { display: none; }
  .chart.narrow { display: block; }
  .top-inner .search { width: 170px; }
  .card { padding: 16px; }
  .doc { padding: 24px 16px; }
  .doc-defs { grid-template-columns: 1fr; gap: 0; }
  .doc-defs dd { margin-bottom: 12px; }
  .tiles { gap: 8px; }
  .tile { padding: 12px; }
  .result { padding: 12px 16px; }
  .ins-row { grid-template-columns: 1fr 1fr; gap: 4px 12px; }
  .ins-value { text-align: right; }
  .ins-note { grid-column: 1 / -1; font-size: var(--t-caption); }
  .compare-head { grid-template-columns: 1fr; gap: 8px; }
  .compare-vs { padding-top: 0; }
  .compare-charts { grid-template-columns: 1fr; }
  table.compare th[scope="row"] { width: 88px; }
  table.compare .gauge-end { display: none; }
  table.compare .gauge-bar { margin: 0; }
}
