.hf-hero { margin-bottom: 1.5rem; }
.hf-hero h1 { margin: 0 0 0.35rem; font-size: 1.75rem; }
.hf-toolbar {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center;
  margin-bottom: 1.25rem; padding: 1rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
}
.hf-toolbar label { display: flex; gap: 0.4rem; align-items: center; font-size: 0.9rem; }
.hf-toolbar select, .hf-toolbar input {
  padding: 0.4rem 0.6rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 0.9rem;
}
.hf-toolbar select:focus, .hf-toolbar input:focus { outline: none; border-color: var(--accent); }
.hf-btn {
  padding: 0.45rem 0.9rem; border: none; border-radius: 8px;
  background: #ef4444; color: #fff; cursor: pointer; font-size: 0.9rem;
}
.hf-btn:hover { filter: brightness(1.08); }
.hf-btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
#filter-seoul.active { background: var(--accent, #ef4444); border-color: var(--accent, #ef4444); color: #fff; }
.hf-card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem;
}
.hf-card {
  padding: 1.25rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; text-decoration: none; color: inherit;
  transition: border-color 0.2s, transform 0.15s;
}
.hf-card:hover { border-color: #ef4444; transform: translateY(-2px); }
.hf-card h3 { margin: 0 0 0.25rem; font-size: 1rem; }
.hf-region { font-size: 0.85rem; color: var(--muted); margin: 0.5rem 0 0; }
.hf-hira-stats { font-size: 0.85rem; color: var(--muted); margin: 0.3rem 0 0; }
.hf-hira-source { font-size: 0.75rem; opacity: 0.7; margin-left: 0.25rem; }
.hf-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.hf-hero-top h1 { margin: 0; }
.hf-btn-sm { padding: 0.3rem 0.7rem; font-size: 0.78rem; flex-shrink: 0; }
.hf-btn-xs { padding: 0.15rem 0.5rem; font-size: 0.75rem; border-radius: 6px; }
.hf-hira-branches { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0.5rem 0 0; }
.hf-hira-branch { font-size: 0.85rem; color: var(--muted); }
.hf-hira-branch b { color: var(--text); font-weight: 600; }
.hf-manual-badge {
  font-size: 0.68rem; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px;
  padding: 0 0.4rem; margin-left: 0.25rem;
}
.hf-staff-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.hf-staff-form label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; color: var(--muted); }
.hf-staff-form input, .hf-staff-form select {
  padding: 0.4rem 0.6rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 0.9rem; width: 8rem;
}
.hf-badge {
  font-size: 0.72rem; font-weight: 500; color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px; padding: 0.05rem 0.5rem;
}
.hf-sibling-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }
.hf-sibling-nav a {
  font-size: 0.85rem; color: var(--text); text-decoration: none; font-weight: 600;
  border: 1px solid var(--border); border-radius: 999px; padding: 0.15rem 0.7rem;
  background: var(--surface); cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.hf-sibling-nav a:hover { color: #ef4444; border-color: #ef4444; background: rgba(239, 68, 68, 0.08); }
.hf-kpi-grid { margin-bottom: 1.5rem; }
.hf-kpi-table-full { width: 100%; border-collapse: collapse; font-size: 0.85rem; table-layout: fixed; }
.hf-kpi-table-full th, .hf-kpi-table-full td {
  padding: 0.5rem 0.5rem; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap;
}
.hf-kpi-table-full thead th:first-child, .hf-kpi-table-full tbody th {
  text-align: left; color: var(--text); font-weight: 700; width: 4.5rem;
}
/* 지표명이 길면 한 줄일 때 열이 과하게 넓어지므로, 헤더 제목만 두 줄로 접히게 하고
   나머지 9개 열은 table-layout:fixed로 같은 폭으로 균등 분배한다(숫자 셀은 nowrap 유지). */
.hf-kpi-table-full thead th {
  white-space: normal; overflow-wrap: anywhere; word-break: keep-all;
  vertical-align: bottom; line-height: 1.3;
}
.hf-kpi-label {
  background: none; border: none; padding: 0; font: inherit; color: var(--muted); cursor: pointer;
  border-bottom: 1px dashed var(--border);
}
.hf-kpi-label:hover { color: var(--text); }
.hf-info-icon { font-size: 0.75rem; opacity: 0.7; }
.hf-kpi-table-full td.negative { color: #f87171; }
.hf-kpi-table-full td.positive { color: #34d399; }
.hf-kpi-table-full td.muted { color: var(--muted); }
.hf-kpi-table-full tr.hf-kpi-row-primary { font-size: 1.1rem; background: var(--bg); }
.hf-kpi-table-full tr.hf-kpi-row-primary th,
.hf-kpi-table-full tr.hf-kpi-row-primary td { padding-top: 0.7rem; padding-bottom: 0.7rem; font-weight: 700; }
.hf-modal-sm { width: min(480px, 100%); }
.hf-kpi-formula {
  font-family: ui-monospace, SFMono-Regular, monospace; font-size: 0.9rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 0.8rem;
}
.hf-tabs { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.hf-tab {
  padding: 0.4rem 0.9rem; border-radius: 8px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); cursor: pointer; font-size: 0.88rem;
}
.hf-tab.active { background: var(--surface); color: var(--text); border-color: #ef4444; }
.hf-statement-scroll { max-height: 70vh; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.hf-statement-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.hf-statement-table thead th { position: sticky; top: 0; background: var(--surface); }
.hf-statement-table th, .hf-statement-table td { padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--border); text-align: right; }
.hf-statement-table th:first-child, .hf-statement-table td:first-child { text-align: left; }
.hf-statement-table tr.indent-1 td:first-child { padding-left: 1.4rem; color: var(--muted); }
.hf-statement-table tr.indent-2 td:first-child { padding-left: 2.4rem; color: var(--muted); font-size: 0.82rem; }
.hf-symbol-table tr.indent-1 td:first-child { padding-left: 1.4rem; }
.hf-symbol-table tr.indent-2 td:first-child { padding-left: 2.4rem; font-size: 0.82rem; }
/* 손익·재무상태표·준비금 세 요약표의 열 폭을 고정해, 제목·연도·구분선이 세로로 정렬되게 한다. */
.hf-symbol-table { table-layout: fixed; }
.hf-symbol-table th:first-child, .hf-symbol-table td:first-child { width: 34%; }
.hf-symbol-table td { overflow: hidden; text-overflow: ellipsis; }
.hf-symbol-inline { font-size: 0.72rem; color: var(--muted); margin-left: 0.35rem; }
.hf-row-highlight td { background: rgba(239, 68, 68, 0.12); }
.hf-row-bold td, .hf-row-bold td:first-child { font-weight: 700; color: var(--text); }
.hf-section-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 0.75rem; }
.hf-table-title {
  margin: 0; font-size: 1rem; font-weight: 600; display: inline-block;
  padding: 0.4rem 0.85rem; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
}
.hf-statement-table tr.hf-section-row td {
  background: var(--bg); color: var(--muted); font-size: 0.78rem; font-weight: 600;
  text-align: left; padding-top: 0.6rem;
}
.hf-modal-overlay {
  display: none;
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(2px);
  align-items: center; justify-content: center; z-index: 100; padding: 1.5rem;
}
/* [hidden]의 기본 display:none은 UA(브라우저) 스타일이라 위 author 규칙에 항상 밀린다.
   :not([hidden])로 author 규칙끼리 특정성 싸움을 붙여야 hidden 토글이 실제로 먹힌다. */
.hf-modal-overlay:not([hidden]) { display: flex; }
.hf-modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 1.25rem; width: min(900px, 100%); max-height: 85vh; display: flex; flex-direction: column; gap: 0.75rem;
}
.hf-modal.hf-modal-lg { width: min(1200px, 100%); }
.hf-modal.hf-modal-lg:has(#analysis-chart-mix) { overflow-y: auto; }
.hf-analysis-chart-title { margin-top: 0.5rem; }
.hf-analysis-chart-title:first-of-type { margin-top: 0; }
.hf-analysis-chart-wrap {
  position: relative; height: 260px; flex-shrink: 0; cursor: zoom-in; transition: height 0.25s ease;
}
.hf-analysis-chart-wrap.is-expanded { height: 520px; cursor: zoom-out; }
.hf-modal-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.hf-modal-head h3 { margin: 0; }
.hf-modal-actions { display: flex; gap: 0.75rem; align-items: center; font-size: 0.9rem; }
.hf-modal-actions select { padding: 0.3rem; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.hf-table-wrap { overflow-x: auto; }
.hf-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.hf-table th, .hf-table td { padding: 0.55rem 0.65rem; border-bottom: 1px solid var(--border); text-align: right; }
.hf-table th:first-child, .hf-table td:first-child { text-align: left; }
.hf-table th { cursor: pointer; color: var(--muted); user-select: none; }
.hf-table th:hover { color: var(--text); }
.hf-compare-pick { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; margin-bottom: 1rem; font-size: 0.9rem; }
.hf-note { font-size: 0.82rem; color: var(--muted); margin-top: 0.75rem; }
#insights-panel { margin: 1.25rem 0; }
#insights-panel .hf-table-title { margin-bottom: 0.85rem; }
.hf-insights { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.hf-insight {
  padding: 0; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); font-size: 0.8rem; overflow: hidden;
}
.hf-insight-high { border-color: #f59e0b; background: rgba(245, 158, 11, 0.08); }
.hf-insight-toggle {
  width: 100%; display: flex; align-items: baseline; gap: 0.5rem;
  background: none; border: none; color: var(--text); cursor: pointer;
  padding: 0.35rem 0.75rem; text-align: left; font: inherit; font-size: 0.8rem;
}
.hf-insight-year { color: #fbbf24; font-weight: 700; font-size: 0.78rem; flex: none; }
.hf-insight-title { font-weight: 600; flex: 1; }
.hf-insight-caret { color: var(--muted); flex: none; transition: transform 0.2s ease; }
.hf-insight-toggle[aria-expanded="true"] .hf-insight-caret { transform: rotate(180deg); }
.hf-insight-body {
  max-height: 0; overflow: hidden; padding: 0 0.75rem;
  transition: max-height 0.25s ease, padding 0.25s ease;
}
.hf-insight.is-open .hf-insight-body { max-height: 400px; padding: 0 0.75rem 0.5rem; }
.hf-insight-body p { margin: 0.2rem 0 0; line-height: 1.45; }
.hf-insight-evidence { font-size: 0.76rem; color: var(--muted); margin-top: 0.4rem !important; }
.muted { color: var(--muted); }
.page { max-width: 1200px; }
