/* Company Atlas 공통 스타일 — 디자인 A(단정한 신뢰형) */
:root {
  --ink: #14213D;
  --muted: #52607A;
  --line: #D8DEE9;
  --line-strong: #8A92A3;
  --accent: #1D4ED8;
  --hero: #F3F6FC;
  --icon-bg: #E4ECFB;
  --navy: #14213D;
  --s1: #1E3A8A;
  --s2: #3B82F6;
  --s3: #D97706;
  --s4: #F5C26B;
  --s5: #0F766E;
  --s6: #8A92A3;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #FFFFFF;
  color: var(--ink);
  font-family: 'Noto Sans KR', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px; width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* 상단 메뉴 */
.site-header { border-bottom: 1px solid var(--line); background: #FFFFFF; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.logo { font-size: 20px; font-weight: 700; color: var(--accent); }
.site-nav { display: flex; gap: 24px; font-size: 15px; }
.menu-btn { display: none; width: 44px; height: 44px; border: 0; background: none; align-items: center; justify-content: center; cursor: pointer; }

/* 버튼·입력 */
.input, .select {
  height: 52px; padding: 0 16px; font-size: 16px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #FFFFFF; min-width: 0;
}
.select { padding: 0 12px; font-size: 15px; }
.btn {
  height: 52px; padding: 0 28px; font-size: 16px; border: 0; border-radius: var(--radius);
  background: var(--accent); color: #FFFFFF; cursor: pointer;
}
.btn:hover { background: #1E40AF; }
.chip {
  display: inline-block; padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #FFFFFF; font-size: 15px;
}
.chip.more { color: var(--muted); border-style: dashed; border-color: var(--line-strong); }
.tabs { display: inline-flex; }
.tab {
  height: 44px; padding: 0 20px; font-size: 15px; border: 1px solid var(--line); background: #FFFFFF;
  color: var(--muted); cursor: pointer;
}
.tab:first-child { border-radius: 8px 0 0 8px; }
.tab:last-child { border-radius: 0 8px 8px 0; border-left: 0; }
.tab[aria-pressed="true"] { background: var(--navy); color: #FFFFFF; border-color: var(--navy); }

/* 홈 */
.hero { background: var(--hero); border-bottom: 1px solid var(--line); }
.hero .wrap { padding-top: 72px; padding-bottom: 72px; display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.hero h1 { font-size: 44px; line-height: 1.25; }
.hero p { font-size: 17px; color: var(--muted); }
.search-box {
  display: flex; flex-wrap: wrap; gap: 8px; width: 100%; max-width: 880px;
  background: #FFFFFF; border: 1px solid var(--line); border-radius: 12px; padding: 10px;
}
.search-box .input { flex: 2 1 220px; }
.search-box .select { flex: 1 1 130px; height: 52px; }
.home-sections { padding-top: 48px; padding-bottom: 56px; display: flex; flex-direction: column; gap: 40px; }
.home-sections h2, .sec h2 { font-size: 22px; }
.sec { display: flex; flex-direction: column; gap: 16px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.cat {
  display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; font-size: 15px; font-weight: 700;
}
.cat .count { font-weight: 400; font-size: 13px; color: var(--muted); }
.ico { width: 44px; height: 44px; border-radius: 10px; background: var(--icon-bg); display: flex; align-items: center; justify-content: center; flex: none; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 8px; }

/* 목록 화면 */
.page { padding-top: 32px; padding-bottom: 56px; display: flex; flex-direction: column; gap: 24px; }
.result-head { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between; }
.result-head h1 { font-size: 20px; }
.result-list { display: flex; flex-direction: column; gap: 12px; }
.result {
  display: flex; gap: 16px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px;
}
.result .info { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.result .name { font-size: 18px; font-weight: 700; }
.result .go { font-size: 14px; color: var(--accent); white-space: nowrap; }
.logo-box {
  width: 128px; height: 56px; flex: none; border-radius: 12px; background: var(--icon-bg); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px;
}
.logo-box.has-logo { background: #FFFFFF; border: 1px solid var(--line); padding: 8px 12px; }
.logo-box img { width: 100%; height: 100%; object-fit: contain; display: block; }
.logo-box.small-logo img { width: 32px; height: 32px; margin: auto; }
/* 로고 상자는 모두 같은 가로로 긴 모양이고, 로고는 가운데에 놓여요 */
.empty { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 32px; text-align: center; color: var(--muted); }
.grid-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.grid-item { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; }

/* 기업 페이지 */
.crumb { font-size: 14px; color: var(--muted); }
.co-head { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.co-head .logo-box { width: 200px; height: 80px; font-size: 30px; border-radius: 14px; }
.co-head .logo-box.has-logo { padding: 12px 18px; }
.co-head h1 { font-size: 32px; }
.co-head .en { font-size: 18px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.co-head .meta { font-size: 15px; color: var(--muted); }
.co-head .tagline { font-size: 16px; }
.in-nav {
  display: flex; gap: 24px; overflow-x: auto; white-space: nowrap;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 15px;
  position: sticky; top: 0; background: #FFFFFF; z-index: 5;
}
.in-nav a { padding: 12px 0; }
.co-body { display: flex; flex-direction: column; gap: 44px; }
.co-body .sec { scroll-margin-top: 60px; }
.about { font-size: 17px; line-height: 1.75; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.cell { background: var(--hero); border-radius: var(--radius); padding: 16px; }
.cell .lbl { font-size: 13px; color: var(--muted); }
.cell .val { font-size: 16px; margin-top: 4px; }
.cell .val .role { font-size: 12px; color: var(--muted); margin-right: 2px; }
.cell .val .line2 { display: block; margin-top: 4px; }
.cell .big { font-size: 32px; font-weight: 700; line-height: 1.2; }
.cell .krw { font-size: 17px; font-weight: 700; color: var(--accent); margin-top: 2px; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.card .lbl { font-size: 13px; color: var(--muted); }
.note { font-size: 14px; color: var(--muted); line-height: 1.6; }

.share-bar { display: flex; height: 28px; border-radius: 6px; overflow: hidden; gap: 2px; }
.share-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px 32px; }
.share-legend div { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.share-legend span.n { flex: 1; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; }

.chart-controls { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 14px; align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .unit { margin-left: auto; color: var(--muted); font-size: 13px; }
.chart-scroll { overflow-x: auto; }
.chart { display: flex; align-items: flex-end; gap: 8px; height: 300px; border-bottom: 1px solid var(--line-strong); padding-top: 8px; }
.chart .group { flex: 1 1 0; min-width: 84px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 100%; }
.chart .bar-col { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 30px; }
.chart .bar-col span { font-size: 11px; white-space: nowrap; }
.chart .bar { width: 26px; border-radius: 4px 4px 0 0; }
/* 0 선 위는 이익, 아래는 손실 */
.chart { position: relative; align-items: flex-start; }
.chart.has-loss { border-bottom: none; }
.chart .group { align-items: flex-start; height: auto; cursor: pointer; border-radius: 8px 8px 0 0; outline: none; }
.chart .group:hover, .chart .group.active, .chart .group:focus-visible { background: var(--hero); }
.chart .group:focus-visible { box-shadow: 0 0 0 2px var(--accent) inset; }
.chart .bar-col .up { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; }
.chart .bar-col .down { display: flex; flex-direction: column; justify-content: flex-start; align-items: center; gap: 2px; }
.chart .bar.neg { border-radius: 0 0 4px 4px; }
.chart .zero { position: absolute; left: 0; right: 0; height: 1px; background: var(--line-strong); pointer-events: none; }
.chart-labels div { cursor: pointer; }
.chart .group, .chart-labels div { -webkit-tap-highlight-color: transparent; }
.chart-labels div.active { color: var(--ink); font-weight: 700; }
/* 기간을 고르면 나오는 정확한 금액 */
.chart-detail { border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; background: #FFFFFF; }
.chart-detail .cd-head { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.chart-detail .cd-tag { font-size: 12px; color: var(--accent); background: var(--hero); border-radius: 999px; padding: 2px 8px; }
.chart-detail .cd-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 24px; }
.chart-detail .cd-rows div { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.chart-detail .cd-rows .n { color: var(--muted); min-width: 56px; }
.chart-detail .cd-loss { font-size: 12px; color: #B42318; background: #FEF3F2; border-radius: 999px; padding: 1px 7px; }
.chart-detail .cd-rows div { flex-wrap: wrap; }
.chart-detail .cd-chg { font-size: 13px; color: var(--muted); }
.chart-detail .cd-chg.up { color: #D92D20; }
.chart-detail .cd-chg.down { color: #1D4ED8; }
.chart-detail .cd-hint { font-size: 13px; color: var(--muted); }
.chart-labels { display: flex; gap: 8px; margin-top: 6px; }
.chart-labels div { flex: 1 1 0; min-width: 84px; text-align: center; font-size: 14px; color: var(--muted); }
.fin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
/* 숫자 표는 화면에는 보이지 않고, 화면 읽기 프로그램(시각장애인용)에만 읽혀요. 숫자는 그래프를 눌러 확인해요 */
.fin-table { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fin-table th { text-align: right; padding: 8px 0; color: var(--muted); font-weight: 400; border-bottom: 1px solid var(--line); }
.fin-table th:first-child, .fin-table td:first-child { text-align: left; }
.fin-table td { text-align: right; padding: 8px 0; border-bottom: 1px solid #EEF1F6; }
.chart-note { font-size: 15px; line-height: 1.6; }

.timeline { display: flex; flex-direction: column; gap: 12px; border-left: 2px solid var(--line); padding-left: 20px; margin-left: 6px; }
.timeline span { color: var(--muted); font-size: 15px; margin-left: 6px; }
.timeline > div { position: relative; display: flex; gap: 10px; align-items: baseline; }
.timeline > div::before { content: ''; position: absolute; left: -28px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: #FFFFFF; border: 2px solid var(--accent); }
.timeline > div:last-child::before { background: var(--accent); }
.timeline strong { min-width: 40px; color: var(--accent); }
.timeline > div span { margin-left: 0; color: var(--ink); }
.rivals { display: flex; flex-direction: column; gap: 12px; }
.rival-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; }
.rival-row strong { min-width: 160px; }
.rival-chip { padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 15px; }
.rival-chip.linked { border-color: var(--accent); }
.rival-chip.linked strong { color: var(--accent); }
.rival-chip .c { color: var(--muted); font-size: 13px; margin-left: 4px; }
.sources { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; line-height: 1.6; }

.site-footer { border-top: 1px solid var(--line); padding: 24px 32px; text-align: center; font-size: 13px; color: var(--muted); margin-top: auto; }
.site-footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { color: var(--accent); }
.site-footer br + a { display: inline-block; margin-top: 6px; }
.page-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* 휴대폰 화면 */
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .site-nav { display: none; }
  .site-nav.open { display: flex; flex-direction: column; gap: 0; position: absolute; top: 60px; right: 16px; background: #FFFFFF; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 0; z-index: 10; }
  .site-nav.open a { padding: 12px 20px; }
  .menu-btn { display: flex; }
  .site-header .wrap { position: relative; padding-top: 8px; padding-bottom: 8px; }
  .hero .wrap { padding-top: 40px; padding-bottom: 32px; gap: 14px; }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 15px; }
  .search-box { flex-direction: column; }
  .search-box .input, .search-box .btn { flex: none; width: 100%; height: 48px; }
  .search-box .selects { display: flex; gap: 8px; }
  .search-box .select { flex: 1; height: 48px; }
  .home-sections { padding-top: 28px; gap: 32px; }
  .home-sections h2, .sec h2 { font-size: 19px; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cat { flex-direction: row; align-items: center; padding: 12px; font-size: 14px; }
  .cat .ico { width: 40px; height: 40px; }
  .cat .count { display: none; }
  .cat.more { grid-column: 1 / -1; justify-content: center; }
  .result { align-items: flex-start; padding: 14px; }
  .result .go { display: none; }
  .logo-box { width: 96px; height: 48px; font-size: 17px; }
  .logo-box.has-logo { padding: 6px 10px; }
  .grid-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .co-head .logo-box { width: 150px; height: 60px; font-size: 24px; }
  .co-head .logo-box.has-logo { padding: 8px 14px; }
  .co-head h1 { font-size: 26px; }
  .co-body { gap: 32px; }
  .about { font-size: 16px; }
  .cards.info { display: flex; flex-direction: column; gap: 0; }
  .cards.info .cell { background: none; border-radius: 0; padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
  .cards.info .cell .val { margin-top: 0; text-align: right; font-size: 15px; }
  .cards.nums { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cards.nums .cell:last-child { grid-column: 1 / -1; }
  .cell .big { font-size: 22px; }
  .tabs { display: flex; width: 100%; }
  .tab { flex: 1; padding: 0 8px; }
  .chart-controls { flex-direction: column; align-items: stretch; }
  .chart { height: 180px; gap: 6px; }
  .chart .group { min-width: 52px; gap: 2px; }
  .chart .bar-col { width: auto; }
  .chart .bar-col span { display: none; }
  .chart .bar { width: 13px; border-radius: 3px 3px 0 0; }
  .chart .bar.neg { border-radius: 0 0 3px 3px; }
  .chart-detail { padding: 12px 14px; }
  .chart-detail .cd-rows { grid-template-columns: 1fr; gap: 6px; }
  .chart-detail .cd-chg { flex-basis: 100%; padding-left: 20px; }
  .chart-labels { gap: 6px; }
  .chart-labels div { min-width: 52px; font-size: 12px; }
  .rival-row { flex-direction: column; align-items: flex-start; padding: 14px; }
  .rival-row strong { min-width: 0; }
  .site-footer { padding: 20px 16px; }
}

/* 무엇을 하는 기업인가요? — 칸에 마우스를 올리거나 누르면 자세한 설명이 떠요 */
.biz-hint { margin-top: -8px; }
.biz-card { position: relative; cursor: pointer; outline: none; transition: border-color .15s; }
.biz-card:hover, .biz-card:focus-visible, .biz-card.open { border-color: var(--accent); }
.biz-card .more { font-size: 13px; color: var(--accent); margin-top: auto; padding-top: 4px; }
.biz-pop { display: none; position: absolute; top: 100%; left: 0; padding-top: 8px; width: 380px; max-width: calc(100vw - 32px); z-index: 30; cursor: auto; }
.biz-pop.pop-right { left: auto; right: 0; }
.biz-pop-in { background: #FFFFFF; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(20, 33, 61, .18); overflow: hidden; }
.biz-pop figure { margin: 0; }
.biz-pop img { width: 100%; height: 200px; object-fit: cover; display: block; background: var(--hero); }
.biz-pop figcaption { font-size: 11px; color: var(--muted); padding: 6px 14px 0; line-height: 1.4; }
.biz-pop figcaption a { color: var(--muted); text-decoration: underline; }
.biz-text { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.biz-text strong { font-size: 16px; }
.biz-text p { font-size: 15px; line-height: 1.65; color: var(--ink); font-weight: 400; }
.biz-text .ex { font-size: 14px; color: var(--muted); }
.biz-text .ex span { display: inline-block; font-size: 12px; color: var(--accent); background: var(--hero); border-radius: 999px; padding: 1px 8px; margin-right: 6px; }
@media (hover: hover) and (min-width: 641px) {
  .biz-card:hover .biz-pop, .biz-card:focus-within .biz-pop { display: block; }
}
@media (min-width: 641px) {
  .biz-card.open .biz-pop { display: block; }
}
@media (max-width: 640px) {
  /* 휴대폰: 누르면 칸이 한 줄 전체로 넓어지며 아래로 펼쳐져요 */
  .biz-card.open { grid-column: 1 / -1; }
  .biz-card.open .biz-pop { display: block; position: static; width: auto; max-width: none; padding-top: 10px; }
  .biz-card.open .biz-pop-in { box-shadow: none; }
  .biz-card.open .more { display: none; }
  .biz-pop img { height: 180px; }
}

/* 숫자로 보기: 시가총액은 시세 페이지로 연결 */
.cell.cap-link { display: flex; flex-direction: column; justify-content: center; gap: 6px; border: 1px dashed var(--accent); background: #FFFFFF; text-decoration: none; color: inherit; }
.cell.cap-link:hover { background: var(--hero); }
.cell.cap-link .go { font-size: 18px; font-weight: 700; color: var(--accent); }

/* 첫 화면: 기업 둘러보기 */
.sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.co-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.co-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #FFFFFF; text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.co-card:hover { border-color: var(--accent); box-shadow: 0 6px 18px rgba(20, 33, 61, .08); }
.co-card .logo-box { width: 100%; height: 56px; margin-bottom: 4px; }
.co-card strong { font-size: 15px; }
.co-card span { font-size: 12px; color: var(--muted); }
.co-more { display: flex; justify-content: center; }
.btn-ghost { font: inherit; font-size: 14px; color: var(--accent); background: #FFFFFF; border: 1px solid var(--line); border-radius: 999px; padding: 8px 20px; cursor: pointer; }
.btn-ghost:hover { border-color: var(--accent); }
@media (max-width: 640px) {
  .co-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .co-card { padding: 10px; }
  .co-card .logo-box { height: 48px; }
}
