/* ========================================================================
 * scoopframe.css — 스쿱프레임 reset + 레이아웃 + 컴포넌트
 *   - 색상/간격 토큰은 scoopframe-tokens.css 에서 정의
 *   - 프로젝트별 override 는 site-theme.css 에서 (이 파일 직접 편집 X)
 *   - 로드 순서: tokens → scoopframe → site-theme
 *   - SVG 아이콘은 currentColor
 *
 *   반응형 4-tier (mobile-first):
 *     fold     — max-width: 360px   · Z Fold 내측 · 초소형
 *     mobile   — max-width: 640px   · 일반 스마트폰
 *     tablet   — max-width: 960px   · 태블릿 portrait · 좁은 노트북
 *     desktop  — min-width: 961px   · PC · 와이드 노트북
 *   각 컴포넌트는 가능한 위 4 breakpoint 만 사용. 추가 시 같은 값 재사용.
 * ========================================================================
 */

/* ── 1. reset / base ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font-sans);
  font-feature-settings: "tnum";
  overflow-x: clip;
}
img, svg, iframe { max-width: 100%; height: auto; }
a { color: var(--brand-accent); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; text-decoration-color: var(--border-strong); }
a:hover { text-decoration-color: var(--brand-accent); }
/* nav/card/button 형태 a 는 underline 제거 */
.site-header a, .related-link, .item-card, .recent-strip__item, .aside-cat-list a,
.cat-grid-list a, .breadcrumb a, .back-btn, .hero-search a,
.hero-search__suggest-item, .mini-list a, .site-footer a {
  text-decoration: none;
}
.site-header a:hover, .breadcrumb a:hover, .site-footer a:hover { text-decoration: underline; }
code { font-family: var(--font-mono); font-size: 0.92em; background: var(--bg-elevated); padding: 1px 6px; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }

/* ── 2. site header ──────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  max-width: 1480px; margin: 0 auto;
  padding: 0 32px;
  height: 72px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
@media (max-width: 640px) {
  .site-header__inner { height: 60px; gap: 12px; padding: 0 16px; }
}
@media (max-width: 360px) {
  .site-header__inner { padding: 0 12px; gap: 6px; }
  .site-header__brand { font-size: 16px; }
  .site-header__brand-name { font-size: 14px; }
  .site-header__url { font-size: 10px; }
  .header-tools { gap: 4px; }
  .header-tools__btn,
  .header-tools button { width: 32px; height: 32px; }
}
.site-header__brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 18px; color: var(--text) !important;
  letter-spacing: -0.01em; text-decoration: none;
}
.site-header__brand:hover { text-decoration: none; }
.site-header__logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: var(--brand-accent-soft);
  border-radius: 8px;
  color: var(--brand-accent);
  flex-shrink: 0;
}
.site-header__logo svg { width: 18px; height: 18px; }
.site-header__brand-text {
  display: flex; flex-direction: column; line-height: 1.15;
}
.site-header__brand-name { font-size: 16px; font-weight: 700; }
.site-header__url {
  font-size: 11px; color: var(--text-muted); font-weight: 400;
  letter-spacing: 0;
}
.header-tools {
  display: flex; align-items: center; gap: 6px;
}
.header-tools__btn,
.header-tools button {
  background: transparent; border: 1px solid var(--border); color: var(--text);
  width: 36px; height: 36px; border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
}
.header-tools button:hover,
.header-tools__btn:hover { background: var(--brand-accent-soft); }
.header-tools svg { width: 18px; height: 18px; }

/* ── 2b. site nav (상단 메뉴 + 모바일 드롭다운) ─────── */
.site-nav {
  display: none;
  flex: 1;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-right: 8px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.site-nav__link {
  color: var(--text-secondary) !important;
  text-decoration: none !important;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.site-nav__link:hover {
  background: var(--brand-accent-soft);
  color: var(--brand-accent) !important;
}
.site-nav__link--featured { color: var(--brand-accent) !important; font-weight: 700; }
.site-nav__toggle { display: inline-flex; }

.site-nav-mobile {
  display: block;
  border-top: 1px solid var(--border);
  background: var(--bg-panel);
  padding: 8px 16px 12px;
  animation: sf-nav-drop 0.18s ease-out;
}
.site-nav-mobile[hidden] { display: none; }
.site-nav-mobile__link {
  display: block;
  padding: 12px 8px;
  color: var(--text) !important;
  text-decoration: none !important;
  font-size: 15px; font-weight: 500;
  border-bottom: 1px solid var(--border-subtle);
}
.site-nav-mobile__link:last-child { border-bottom: 0; }
.site-nav-mobile__link:hover,
.site-nav-mobile__link:focus { color: var(--brand-accent) !important; }
.site-nav-mobile__link--featured { color: var(--brand-accent) !important; font-weight: 700; }
/* 서브메뉴 그룹 (아코디언) */
.site-nav-mobile__group { border-bottom: 1px solid var(--border-subtle); }
.site-nav-mobile__group:last-child { border-bottom: 0; }
.site-nav-mobile__group .site-nav-mobile__link { border-bottom: 0; }
.site-nav-mobile__toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 12px 8px;
  background: transparent; border: 0; cursor: pointer;
  font-family: inherit; text-align: left;
  color: var(--text); font-size: 15px; font-weight: 500;
}
.site-nav-mobile__toggle:hover { color: var(--brand-accent); }
.site-nav-mobile__chev { width: 16px; height: 16px; opacity: .6; transition: transform .18s; flex-shrink: 0; }
.site-nav-mobile__toggle[aria-expanded="true"] .site-nav-mobile__chev { transform: rotate(180deg); opacity: 1; color: var(--brand-accent); }
.site-nav-mobile__subs {
  padding: 2px 0 8px 12px;
  border-left: 2px solid color-mix(in srgb, var(--brand-accent) 30%, transparent);
  margin: 0 0 8px 8px;
  animation: sf-sub-drop .15s ease-out;
}
.site-nav-mobile__subs[hidden] { display: none; }
.site-nav-mobile__sublink {
  display: block; padding: 9px 12px;
  color: var(--text-secondary) !important; text-decoration: none !important;
  font-size: 13px; font-weight: 500;
  border-radius: 6px;
}
.site-nav-mobile__sublink:hover,
.site-nav-mobile__sublink:focus { background: color-mix(in srgb, var(--brand-accent) 8%, transparent); color: var(--brand-accent) !important; }
/* 현재 페이지 강조 */
.site-nav-mobile__sublink--active { background: color-mix(in srgb, var(--brand-accent) 12%, transparent); color: var(--brand-accent) !important; font-weight: 700; }
.site-nav-mobile__group--active > .site-nav-mobile__toggle { color: var(--brand-accent); font-weight: 700; }
@keyframes sf-sub-drop {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes sf-nav-drop {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ≥ 641px (tablet 이상): 데스크탑 nav 노출, 토글·모바일 드롭다운 숨김 */
@media (min-width: 641px) {
  .site-nav { display: flex; }
  .header-tools .site-nav__toggle { display: none; }
  .site-nav-mobile,
  .site-nav-mobile:not([hidden]) { display: none; }
}

/* ── 3. main container ───────────────────────────── */
main {
  max-width: 720px; margin: 0 auto;
  padding: 24px 16px 64px;
}
main.wide {
  max-width: 1480px;
  padding: 24px 32px 64px;
}
@media (max-width: 640px) {
  main.wide { padding: 16px 16px 48px; }
}

/* ── 4. site footer ──────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 64px;
  padding: 24px 16px;
  text-align: center; color: var(--text-muted); font-size: 13px;
}
.site-footer > div + div { margin-top: 6px; }
.site-footer__links {
  margin-top: 8px;
  display: inline-flex; flex-wrap: wrap; justify-content: center;
  gap: 6px;
  font-size: 12px;
}
.site-footer__links a {
  color: var(--text-secondary); text-decoration: none;
}
.site-footer__links a:hover { color: var(--brand-accent); text-decoration: underline; }
.site-footer__links .site-footer__sep { color: var(--text-muted); user-select: none; }

/* ── 5. breadcrumb ───────────────────────────────── */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand-accent); }
.breadcrumb .sep { margin: 0 8px; color: var(--text-faint); }

.back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  margin-bottom: 8px;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font: inherit; font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}
.back-btn:hover { color: var(--brand-accent); border-color: var(--brand-accent); }
.back-btn svg { width: 14px; height: 14px; }
.back-btn--inline { margin-right: 8px; }

/* ── 6. page-header ──────────────────────────────── */
.page-header { margin-bottom: 20px; }
.page-header__label {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--brand-accent);
  letter-spacing: 0.18em; text-transform: uppercase;
  margin-bottom: 6px;
}
.page-header__title {
  margin: 0 0 8px; font-size: 25px; line-height: 1.2;
  letter-spacing: -0.02em; font-weight: 700;
}
.page-header__title--hero { font-size: 30px; letter-spacing: -0.025em; }
@media (max-width: 640px) {
  .page-header__title--hero { font-size: 24px; }
}
@media (max-width: 360px) {
  .page-header__title--hero { font-size: 20px; }
  .page-header__title { font-size: 19px; }
  .page-header__desc { font-size: 13px; }
}
.page-header__desc {
  color: var(--text-secondary); font-size: 16px; line-height: 1.55; margin: 0;
}
.page-header__desc strong { color: var(--brand-accent); font-weight: 800; }

/* subnav strip — mobile/tablet category navigation (desktop: sidebar handles it) */
.subnav-strip {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 4px;
  margin-bottom: 12px;
}
.subnav-strip__item {
  display: inline-block;
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.subnav-strip__item:hover { border-color: var(--brand-accent); color: var(--brand-accent); }
.subnav-strip__item--active { background: var(--brand-accent); color: var(--brand-accent-fg); border-color: var(--brand-accent); }
.subnav-strip__item--active:hover { color: var(--brand-accent-fg); }
.subnav-strip__item--featured { color: var(--brand-accent); border-color: var(--brand-accent); }
@media (max-width: 960px) { .subnav-strip { display: flex; } }

.page-header__tldr {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
}
.page-header__tldr strong {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 7px;
  background: var(--brand-accent-soft);
  color: var(--brand-accent);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  vertical-align: 2px;
}

/* ── 7. card / section ───────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-md);
}
.card + .card { margin-top: 16px; }
.card__title { margin: 0 0 12px; font-size: 16px; font-weight: 600; }
.card__desc  { color: var(--text-secondary); font-size: 14px; margin: 0; }

.section {
  padding: 20px 0;
  border-top: 1px dashed var(--border);
}
.section--first { border-top: 0; padding-top: 0; }
.section__title {
  margin: 0 0 12px; font-size: 17px; font-weight: 700;
  letter-spacing: -0.01em;
}
.section__title small {
  font-weight: 400; color: var(--text-muted); font-size: 13px; margin-left: 6px;
}
.section__lead {
  color: var(--text-secondary); font-size: 15px; line-height: 1.7; margin: 0 0 14px;
}

/* ── 8. form ─────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; max-width: 520px; }
.field:last-child { margin-bottom: 0; }
.field__label {
  font-size: 13px; color: var(--text); font-weight: 600;
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
}
.field__label > span { word-break: keep-all; }
.field--inline { flex-direction: row; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: nowrap; }
.field--inline > .field__label {
  flex: 0 1 auto;
  min-width: 96px; max-width: 220px;
  display: flex; flex-direction: column;
  align-items: flex-start; justify-content: center;
  gap: 2px;
}
.field--inline > .field__label > span:first-child { white-space: nowrap; line-height: 1.3; }
.field--inline > .input-row { flex: 1 1 auto; min-width: 0; max-width: none; }
.field__label .field__hint { font-weight: 400; color: var(--text-muted); font-size: 12px; }
.field__hint--block { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.field__hint-inline {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.02em;
  vertical-align: middle;
  margin-left: 6px;
  white-space: nowrap;
}
.field__hint-inline--required { color: var(--danger); background: var(--danger-soft); }
.field__hint-inline--optional { color: var(--text-faint); background: transparent; border: 1px dashed var(--border); }

.input, select, textarea {
  width: 100%; padding: 10px 12px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 15px; font-weight: 500;
  font-feature-settings: 'tnum' on, 'ss01' on;
  letter-spacing: -0.005em; line-height: 1.4;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder, textarea::placeholder { color: var(--text-muted); font-weight: 400; }
.input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px var(--brand-accent-soft);
}
.input--right { text-align: right; font-variant-numeric: tabular-nums; }
.input--mono  { font-family: var(--font-mono); font-weight: 600; }

/* ── filter-bar — 검색+필터 한 줄 레이아웃 ──── */
.filter-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.filter-bar .input, .filter-bar select {
  width: auto; font-size: 13px; padding: 8px 10px; margin: 0;
}
.filter-bar__search {
  flex: 1; min-width: 140px;
  position: relative;
}
.filter-bar__search input {
  width: 100%; font-size: 13px; padding: 8px 28px 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
  font-family: var(--font-sans); font-weight: 500;
  outline: none; box-sizing: border-box;
  transition: border-color 0.15s;
}
.filter-bar__search input:focus { border-color: var(--brand-accent); box-shadow: 0 0 0 3px var(--brand-accent-soft); }
.filter-bar__search input::placeholder { color: var(--text-muted); font-weight: 400; }
.filter-bar__search-icon {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.filter-bar__count {
  font-size: 13px; color: var(--text-muted); margin-left: auto; white-space: nowrap;
}

.input-row {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: nowrap; min-width: 0;
}
.input-row > .input, .input-row > select, .input-row > textarea { flex: 1 1 0; min-width: 60px; }
.input-row__suffix {
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  padding: 0 6px; white-space: nowrap; flex-shrink: 0;
}
.input-row--equal { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }

.preset-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.preset {
  display: inline-flex; align-items: center;
  padding: 4px 10px; min-height: 26px;
  background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: 999px;
  font-size: 12px; color: var(--text-secondary);
  cursor: pointer; transition: all 0.15s;
  font-family: var(--font-mono);
  white-space: nowrap;
}
.preset:hover { border-color: var(--brand-accent); color: var(--brand-accent); }
.preset--active {
  background: var(--brand-accent-soft);
  border-color: var(--brand-accent);
  color: var(--brand-accent); font-weight: 600;
}

.radio-group { display: flex; flex-wrap: wrap; gap: 6px; }
.radio-group input { position: absolute; opacity: 0; pointer-events: none; }
.radio-group label {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 14px; min-height: 38px;
  background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 13px; color: var(--text-secondary);
  cursor: pointer; transition: all 0.15s;
  flex: 1; min-width: 100px;
  white-space: nowrap; word-break: keep-all;
  text-align: center;
}
.radio-group input:checked + label {
  background: var(--brand-accent-soft);
  border-color: var(--brand-accent);
  color: var(--brand-accent); font-weight: 600;
}

/* ── 9. button ───────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; min-height: 40px;
  background: transparent; color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  font: inherit; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
}
.btn:hover { background: var(--brand-accent-soft); }
.btn--primary {
  background: var(--brand-accent); color: var(--brand-accent-fg); border-color: var(--brand-accent);
}
.btn--primary:hover { filter: brightness(1.05); background: var(--brand-accent); }
.btn--block { width: 100%; }
.btn--small { padding: 6px 10px; min-height: 32px; font-size: 13px; }

/* ── 10. result ──────────────────────────────────── */
.result {
  background: var(--brand-accent-soft);
  border: 1px solid var(--brand-accent);
  border-radius: var(--radius);
  padding: 18px;
  margin: 0 0 12px;
}
.result__label {
  font-family: var(--font-mono);
  font-size: 11px; color: var(--brand-accent);
  letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 4px;
}
.result__value {
  font-size: 32px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums; line-height: 1.1;
  letter-spacing: -0.02em;
}
.result__sub {
  font-size: 13px; color: var(--text-secondary); margin-top: 6px;
  line-height: 1.5;
}
.result--neutral { background: var(--bg-elevated); border-color: var(--border); }
.result--success { background: var(--success-soft); border-color: var(--success); }
.result--success .result__label { color: var(--success); }
.result--warn    { background: var(--warn-soft); border-color: var(--warn); }
.result--warn .result__label    { color: var(--warn); }
.result--danger  { background: var(--danger-soft); border-color: var(--danger); }
.result--danger .result__label  { color: var(--danger); }

.breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px;
  margin: 10px 0;
}
.breakdown__cell {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  text-align: center;
}
.breakdown__label {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--text-muted);
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 3px;
}
.breakdown__value {
  font-size: 16px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ── 11. badge / kicker ──────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  background: var(--brand-accent-soft); color: var(--brand-accent);
  border-radius: 999px;
}
.badge--success { background: var(--success-soft); color: var(--success); }
.badge--warn    { background: var(--warn-soft);    color: var(--warn); }
.badge--danger  { background: var(--danger-soft);  color: var(--danger); }
.badge--info    { background: var(--info-soft);    color: var(--info); }

.kicker-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700;
  color: var(--brand-accent);
  letter-spacing: -0.005em;
  white-space: nowrap;
  flex-shrink: 0;
}
.kicker-badge__icon {
  width: 14px; height: 14px; flex-shrink: 0;
  stroke: currentColor; stroke-width: 1.8; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
}
.kicker-badge--update { color: var(--accent-warm); }

/* ── 12. help / formula / table ──────────────────── */
.formula {
  display: inline-block;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  margin: 8px 0;
  font-family: var(--font-mono); font-size: 14px;
  color: var(--brand-accent);
}
.formula--block { display: block; }
.help-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0; }
.help-table th, .help-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.help-table th {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 600;
  background: var(--bg-elevated);
}
.help-table td.num { font-family: var(--font-mono); text-align: right; font-variant-numeric: tabular-nums; }
.help-table tr:last-child td { border-bottom: 0; }

/* ── 13. hero-search ─────────────────────────────── */
.hero-search {
  position: relative;
  z-index: 100;
  display: flex; align-items: center; gap: 8px;
  background: var(--card-bg);
  border: 2px solid var(--brand-accent);
  border-radius: 12px;
  padding: 6px 6px 6px 16px;
  margin: 16px 0 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.hero-search:focus-within {
  z-index: 1000;
  box-shadow: 0 0 0 4px var(--brand-accent-soft), 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}
.hero-search__icon { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.hero-search__input {
  flex: 1 1 auto; min-width: 0;
  background: transparent; border: 0;
  padding: 12px 4px;
  font: inherit; font-size: 15px; color: var(--text);
}
.hero-search__input:focus { outline: none; }
.hero-search__input::placeholder { color: var(--text-faint); }
.hero-search__count {
  font-family: var(--font-mono); font-size: 12px; color: var(--text-muted);
  white-space: nowrap; margin-right: 4px;
}
.hero-search__count b { color: var(--brand-accent); font-weight: 700; }
.hero-search__count small { margin-left: 2px; font-size: 10px; letter-spacing: 0.04em; }
.hero-search__btn {
  flex-shrink: 0;
  padding: 9px 18px;
  background: var(--brand-accent); color: var(--brand-accent-fg);
  border: 0; border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em;
  cursor: pointer;
  transition: filter 0.15s;
}
.hero-search__btn:hover { filter: brightness(1.06); }

.hero-search__suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background-color: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.05);
  z-index: 1000;
  max-height: 360px; overflow-y: auto;
  padding: 4px;
  isolation: isolate;
}
[data-theme="dark"] .hero-search__suggest { box-shadow: 0 8px 28px rgba(0,0,0,0.45); }
.hero-search__suggest-item {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) 40px;
  align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 6px;
  text-decoration: none; color: var(--text);
  background-color: var(--card-bg);
  transition: background 0.12s;
}
.hero-search__suggest-item:hover,
.hero-search__suggest-item.is-active {
  background-color: var(--bg-elevated);
  text-decoration: none;
}
.hero-search__suggest-cat {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--brand-accent); font-weight: 700;
}
.hero-search__suggest-title {
  font-size: 14px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hero-search__suggest-title mark {
  background: var(--brand-accent-soft); color: var(--brand-accent);
  font-weight: 700; padding: 0 2px; border-radius: 2px;
}
.hero-search__suggest-status {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.08em;
  color: var(--text-muted);
  justify-self: end;
}
.hero-search__suggest-status--done {
  color: var(--brand-accent); font-weight: 700;
}
.hero-search__suggest-empty {
  padding: 12px 14px; color: var(--text-muted); font-size: 13px;
}
@media (max-width: 640px) {
  .hero-search { padding: 4px 4px 4px 12px; gap: 6px; }
  .hero-search__input { padding: 10px 4px; font-size: 14px; }
  .hero-search__btn { padding: 8px 14px; font-size: 12px; }
  .hero-search__icon { width: 16px; height: 16px; }
  .hero-search__suggest-item { grid-template-columns: 60px minmax(0, 1fr) 36px; gap: 6px; padding: 7px 10px; }
  .hero-search__suggest-cat { font-size: 9px; }
  .hero-search__suggest-title { font-size: 13px; }
}

/* ── 14. 2-col layout ────────────────────────────── */
.layout-2col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 40px;
  align-items: start;
}
.layout-2col__main { min-width: 0; }
.layout-2col__aside { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 960px) {
  .layout-2col { grid-template-columns: 1fr; gap: 24px; }
}

/* ── tab navigation ────────────────────────────── */
.tab-nav { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tab-nav::-webkit-scrollbar { display: none; }
.tab-nav__item { padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -2px; cursor: pointer; white-space: nowrap; background: none; border-top: none; border-left: none; border-right: none; transition: color 0.15s, border-color 0.15s; }
.tab-nav__item:hover { color: var(--text); }
.tab-nav__item--active { color: var(--brand-accent); border-bottom-color: var(--brand-accent); }
.tab-panel { display: none; }
.tab-panel--active { display: block; }

/* ── data-table — 분석 페이지 반응형 테이블 ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 8px 4px; font-size: 12px; font-weight: 700; color: var(--text-muted); border-bottom: 2px solid var(--border); }
.data-table td { padding: 6px 4px; border-bottom: 1px solid var(--border-soft); }
.data-table__name { max-width: 200px; }
.data-table__name a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); text-decoration: none; font-weight: 600; }
.data-table__name a:hover { color: var(--brand-accent); }
.data-table__num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table__accent { color: var(--brand-accent); font-weight: 700; }
.data-table__muted { color: var(--text-muted); }
@media (max-width: 640px) {
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 5px 3px; }
  .data-table__name { max-width: 110px; }
  .data-table .bar { display: none; }
}

.aside-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-md);
}
.aside-card--sticky { position: sticky; top: 84px; }
.aside-card__title {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 10px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 6px;
}
.aside-card__title small { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); font-weight: 400; letter-spacing: 0.08em; }
.aside-cat-list { list-style: none; margin: 0; padding: 0; }
.aside-cat-group { list-style: none; margin-bottom: 12px; }
.aside-cat-group:last-child { margin-bottom: 0; }
.aside-cat-group__title {
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  letter-spacing: 0.03em; padding: 6px 0 2px;
  margin-bottom: 2px;
}
.aside-cat-group__items { list-style: none; margin: 0; padding: 0; }
.aside-cat-group__items a {
  display: block; padding: 5px 0 5px 10px;
  font-size: 13px; line-height: 1.4;
  color: var(--text) !important; text-decoration: none;
  border-left: 2px solid transparent; transition: border-color 0.15s, color 0.15s;
}
.aside-cat-group__items a:hover { color: var(--brand-accent) !important; border-left-color: var(--brand-accent); }
.aside-cat-group__items a.aside-active {
  color: var(--brand-accent) !important; font-weight: 700;
  border-left-color: var(--brand-accent);
}
@media (max-width: 960px) {
  .aside-card { display: none; }
}

/* ── 15. ad slot ─────────────────────────────────── */
.ad-slot {
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px 12px;
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
}
.ad-slot--tall { min-height: 250px; display: flex; align-items: center; justify-content: center; }
.ad-slot--in-article {
  margin: 0 auto 16px;
  min-height: 100px;
  display: flex; align-items: center; justify-content: center;
}

/* ── 16. recent strip ────────────────────────────── */
.recent-strip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  font-size: 13px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.recent-strip__label {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
}
.recent-strip__list { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.recent-strip__item {
  padding: 4px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: 999px;
  color: var(--text) !important;
  font-size: 12px;
  white-space: nowrap;
}
.recent-strip__item:hover { border-color: var(--brand-accent); color: var(--brand-accent) !important; }
.recent-strip__empty { color: var(--text-faint); font-size: 12px; }

/* ── 17. cat-section (카테고리 그리드) ───────────── */
.cat-section { margin-top: 32px; }
.cat-section__title {
  margin: 0 0 12px; font-size: 18px; font-weight: 700;
  display: flex; align-items: baseline; gap: 8px;
}
.cat-section__title small { color: var(--text-muted); font-size: 13px; font-weight: 400; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.cat-grid-block {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.cat-grid-block__head {
  display: flex; align-items: baseline; gap: 10px;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}
.cat-grid-block__num {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--brand-accent);
  letter-spacing: 0.16em;
}
.cat-grid-block__title { font-size: 15px; font-weight: 700; margin: 0; }
.cat-grid-block__count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px; color: var(--text-muted);
  letter-spacing: 0.04em;
}
.cat-grid-block__count b { color: var(--text); font-weight: 700; }
.cat-grid-list {
  list-style: none; margin: 0; padding: 8px 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 2px;
}
.cat-grid-list li { min-width: 0; }
.cat-grid-list a {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px;
  font-size: 13px; color: var(--text) !important;
  border-radius: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cat-grid-list a:hover { background: var(--brand-accent-soft); color: var(--brand-accent) !important; }
.cat-grid-list a.is-pending { color: var(--text-muted) !important; pointer-events: none; }

.item-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
  color: var(--text) !important;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
.item-card:hover { border-color: var(--brand-accent); transform: translateY(-1px); }
.item-card__cat {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--text-muted);
  letter-spacing: 0.08em; text-transform: uppercase;
}
.item-card__title { font-weight: 600; font-size: 15px; }
.item-card__desc  { color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
.item-card--pending {
  opacity: 0.55; pointer-events: none; cursor: not-allowed;
  background: var(--card-bg-muted, var(--card-bg));
}
.item-card--pending:hover { transform: none; border-color: var(--border); }

/* ── 18. related-grid ────────────────────────────── */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.related-link {
  display: block; padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text) !important; text-decoration: none;
  font-size: 13px; line-height: 1.4;
  transition: border-color 0.15s, color 0.15s;
}
.related-link:hover { border-color: var(--brand-accent); color: var(--brand-accent) !important; }
.related-link__cat {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--text-muted);
  letter-spacing: 0.1em; text-transform: uppercase;
  display: block; margin-bottom: 2px;
}

/* ── 19. live panel (옵션) ───────────────────────── */
.live-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.live-panel__head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.live-panel__title {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600;
}
.live-pulse {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-warm);
}
.live-pulse::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 currentColor;
  animation: sf-pulse 1.6s infinite;
}
@keyframes sf-pulse {
  0%   { box-shadow: 0 0 0 0   currentColor; opacity: 1; }
  70%  { box-shadow: 0 0 0 7px transparent;  opacity: 0.7; }
  100% { box-shadow: 0 0 0 0   transparent;  opacity: 1; }
}

/* ── 20. utilities ───────────────────────────────── */
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row--right { justify-content: flex-end; }
.spacer { flex: 1; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.mono  { font-family: var(--font-mono); }
[hidden] { display: none !important; }

/* ── 21. Above-the-fold 컴팩트화 (모바일 ≤ 667px) ──
 *   모바일에서 입력 → 결과가 1 스크롤 안에 들어오도록 vertical rhythm 압축.
 */
@media (max-width: 640px) {
  main, main.wide { padding-top: 12px; padding-bottom: 32px; }
  .page-header { margin-bottom: 12px; }
  .page-header__title { font-size: 22px; }
  .page-header__desc { font-size: 14px; }
  .card { padding: 14px; }
  .section { padding: 14px 0; }
  .section__title { font-size: 16px; }
  .field { margin-bottom: 8px; }
  .result { padding: 14px; }
  .result__value { font-size: 26px; }
}

/* ── 22. print ───────────────────────────────────── */
@media print {
  .site-header, .site-footer, .header-tools, .hero-search,
  .layout-2col__aside, .ad-slot { display: none !important; }
  .layout-2col { grid-template-columns: 1fr; gap: 0; }
  body { background: #fff; color: #000; }
}
