/* AI Trend Research — 디자인 토큰은 docs/01_product/ui_design.md 참고 */
:root {
  /* 글자 위계: --heading(제목) > --text(본문) > --muted(보조) */
  --bg: #fbfbf9; --surface: #ffffff; --surface-2: #f4f4f1;
  --heading: #111110; --text: #2e2e2b; --muted: #6b6b66;
  --line: #e4e4e0; --accent: #1f5fbf;
  --p0: #b42318; --p1: #b54708; --p2: #475467; --p3: #98a2b3;
  --official: #027a48; --secondary: #6941c6; --community: #667085;
  --ok-bg: #ecfdf3; --ok: #027a48;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413; --surface: #1c1c1a; --surface-2: #252523;
    --heading: #f7f7f2; --text: #c9c9c1; --muted: #8e8e86;
    --line: #2e2e2b; --accent: #7aa7ec;
    --p0: #f97066; --p1: #fdb022; --p2: #98a2b3; --p3: #667085;
    --official: #32d583; --secondary: #b692f6; --community: #98a2b3;
    --ok-bg: #0b2a1c; --ok: #32d583;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.7 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Malgun Gothic", sans-serif;
  word-break: keep-all; overflow-wrap: anywhere;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 6px 10px; z-index: 10; }

/* 레이아웃 */
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.wrap.wide { max-width: 1120px; }
.layout { display: block; }
/* 사이드바 없는 페이지: 헤더와 같은 시작선, 본문 폭은 읽기 좋은 760px */
main.wide > :not(.layout):not(.region-cols) { max-width: 760px; }
.primary { min-width: 0; }
@media (min-width: 1024px) {
  .layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; align-items: start; }
  .sidebar { position: sticky; top: 72px; max-height: calc(100vh - 88px); overflow-y: auto; padding-bottom: 16px; }
}

/* 헤더·푸터 */
.site-header { position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(8px); }
.site-header .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: var(--heading); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 18px; height: 18px; border-radius: 5px; background: url(/static/favicon.svg) center / cover; }
.menu { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.menu::-webkit-scrollbar { display: none; }
.menu a { color: var(--muted); font-size: 14px; padding: 6px 10px; border-radius: 6px; white-space: nowrap; }
.menu a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.menu a[aria-current="page"] { color: var(--heading); font-weight: 700; background: var(--surface-2); }
.site-footer { border-top: 1px solid var(--line); margin-top: 64px; padding: 24px 0 32px; color: var(--muted); font-size: 13px; }
.site-footer p { margin: 4px 0; }
.site-footer a { color: var(--muted); text-decoration: underline; }

/* 타이포 */
h1, h2, h3 { color: var(--heading); }
h1 { font-size: 30px; line-height: 1.25; margin: 8px 0 6px; letter-spacing: -0.015em; font-weight: 800; }
h2 { font-size: 19px; margin: 40px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--heading); display: flex; align-items: baseline; gap: 8px; font-weight: 800; }
h3 { font-size: 18.5px; line-height: 1.45; margin: 8px 0 10px; font-weight: 750; letter-spacing: -0.01em; }
h2 .count, .count { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 1px 7px; }
main > h1:first-child { margin-top: 32px; }
.kicker { margin: 32px 0 0; color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.crumb { margin: 24px 0 0; font-size: 14px; }
.crumb + .kicker { margin-top: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.coverage { font-size: 13px; margin: 0; }
.empty { color: var(--muted); padding: 32px 0; }

/* 오늘의 숫자 */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 20px 0 0; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.stats dt { font-size: 12px; color: var(--muted); }
.stats dd { margin: 2px 0 0; font-size: 24px; font-weight: 800; color: var(--heading); font-variant-numeric: tabular-nums; line-height: 1.2; }
.stats dd small { font-size: 14px; font-weight: 600; margin-left: 1px; }

/* 배지·기업 */
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.badge { display: inline-block; font-size: 12px; line-height: 1; padding: 4px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
a.badge:hover { text-decoration: none; border-color: var(--muted); }
.badge.p-p0 { color: #fff; background: var(--p0); border-color: var(--p0); }
.badge.p-p1 { color: var(--p1); border-color: var(--p1); }
.badge.p-p2 { color: var(--p2); }
.badge.p-p3 { color: var(--p3); }
.badge.a-ga, .badge.a-api, .badge.a-open_weights { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.badge.field { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.badge.industry { color: var(--secondary); border-color: color-mix(in srgb, var(--secondary) 35%, transparent); }
.badge.region-kr { color: #fff; background: #3b5bdb; border-color: #3b5bdb; }
.companies { display: inline-flex; flex-wrap: wrap; gap: 4px; }
a.entity { color: var(--heading); font-weight: 600; }
a.entity.related { font-weight: 400; color: var(--muted); }
a.entity.related::before { content: "· "; }

/* 핵심 카드 */
.event.lead { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 12px; }
.event p, .detail p { margin: 0 0 10px; }
.fact { font-size: 15.5px; line-height: 1.8; }
.why { font-size: 15.5px; line-height: 1.8; }
.why b, .claim b { color: var(--heading); }
.claim { color: var(--muted); font-size: 14.5px; line-height: 1.75; border-left: 2px solid var(--line); padding-left: 10px; }
.claim b, .why b { font-weight: 700; margin-right: 4px; }
.sources { list-style: none; padding: 0; margin: 10px 0 0; font-size: 14px; border-top: 1px dashed var(--line); padding-top: 8px; }
.sources li { margin: 3px 0; }
.stype { display: inline-block; min-width: 46px; font-size: 11px; font-weight: 700; }
.stype.official { color: var(--official); }
.stype.secondary { color: var(--secondary); }
.stype.community { color: var(--community); }

/* 접이식 목록 */
.event-list { border-top: 1px solid var(--line); }
.event-item { border-bottom: 1px solid var(--line); }
.event-item summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto 120px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 12px 4px; }
.event-item summary::-webkit-details-marker { display: none; }
.event-item summary:hover { background: var(--surface-2); }
.event-item .who { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-item .what { font-weight: 700; color: var(--heading); }
.event-item .state { font-size: 12px; color: var(--muted); white-space: nowrap; }
.event-item summary::after { content: "＋"; color: var(--muted); font-size: 13px; grid-column: 5; }
.event-item[open] summary::after { content: "－"; }
.event-item .detail { padding: 0 4px 16px 4px; }
.event-item .detail .meta { margin-bottom: 8px; }
@media (max-width: 640px) {
  .event-item summary { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "p who sign" "what what what"; row-gap: 4px; }
  .event-item summary .badge { grid-area: p; }
  .event-item .who { grid-area: who; }
  .event-item .what { grid-area: what; }
  .event-item .state { display: none; }
  .event-item summary::after { grid-area: sign; }
}

/* 사이드바 */
.sidebar { font-size: 14px; }
.side-block { margin-top: 32px; }
.side-block h2 { font-size: 14px; margin: 0 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.side-sector { margin-bottom: 12px; }
.side-sector h3 { font-size: 12px; color: var(--muted); font-weight: 600; margin: 0 0 4px; }
.side-sector ul, .side-topics, .side-recent { list-style: none; padding: 0; margin: 0; }
.side-sector ul { display: flex; flex-wrap: wrap; gap: 6px; }
.side-sector li a { display: inline-block; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 13px; }
.side-sector li .count { margin-left: 2px; }
.side-topics li { display: flex; justify-content: space-between; padding: 4px 0; }
.side-recent li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }
.side-recent li a { font-variant-numeric: tabular-nums; font-weight: 600; }
.side-recent li span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1023px) { .sidebar { border-top: 2px solid var(--heading); margin-top: 48px; } }

/* 목록 페이지 */
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li a { font-variant-numeric: tabular-nums; margin-right: 10px; }
h2.day { font-size: 15px; border-bottom-width: 1px; margin-top: 28px; }
.event-row .title { display: block; color: var(--heading); font-weight: 700; margin-top: 6px; font-size: 16.5px; }
.event-row .date { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); margin-right: 2px; }
.row-summary { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.watch li { margin-bottom: 6px; }
.pager { display: flex; justify-content: space-between; margin-top: 32px; }
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); }
.chips .count { margin-left: 4px; }

/* 기업 */
.sector-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.sector-nav a { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 14px; }
.company-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.company-grid li { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; }
.company-grid li a { color: var(--heading); font-weight: 700; }
.company-grid li.idle a { color: var(--muted); font-weight: 400; }

/* 검색 */
.search { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 8px; }
.search input { flex-basis: 100%; }
.search input, .search select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.search input { flex: 1; min-width: 0; }

/* 표 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }

@media (max-width: 640px) {
  h1 { font-size: 25px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .event.lead { padding: 14px; }
  .site-header .wrap { flex-direction: column; align-items: flex-start; gap: 0; padding-top: 10px; }
  .menu { width: 100%; padding-bottom: 6px; }
  .search { flex-direction: column; }
}

/* 분야·산업 */
.field-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.field-grid li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.field-grid li a { color: var(--heading); font-weight: 700; }
.field-grid li p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.field-grid li.idle a { color: var(--muted); font-weight: 600; }
.region-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 640px) { .region-cols { grid-template-columns: 1fr; } }
.empty-note { color: var(--muted); font-size: 14px; padding: 8px 0; }

/* 접는 카드(북마크형) — 기본은 접힘, 오른쪽 위 버튼으로 펼침 상태를 바로 알 수 있게 */
:root { --card-shadow: 0 1px 2px rgba(16,16,15,.06), 0 4px 14px rgba(16,16,15,.07); --card-shadow-hover: 0 2px 4px rgba(16,16,15,.08), 0 10px 24px rgba(16,16,15,.12); --card-body: #fafaf7; }
@media (prefers-color-scheme: dark) {
  :root { --card-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 6px 18px rgba(0,0,0,.45); --card-shadow-hover: 0 1px 0 rgba(255,255,255,.06) inset, 0 12px 28px rgba(0,0,0,.6); --card-body: #181816; --surface: #1f1f1d; }
}
/* "모두 펼치기"는 바로 아래 첫 섹션 제목(h2) 줄의 오른쪽 끝에 맞춘다 */
.card-tools { position: relative; height: 0; margin: 0; z-index: 2; }
.card-tools .expand-all { position: absolute; right: 0; top: 34px; }
.expand-all { font: inherit; font-size: 13px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; cursor: pointer; box-shadow: var(--card-shadow); }
.expand-all:hover { color: var(--heading); border-color: var(--muted); }
.card-list { display: flex; flex-direction: column; gap: 14px; }
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--p3);
  border-radius: 12px; box-shadow: var(--card-shadow); transition: box-shadow .18s, transform .18s, border-color .18s; overflow: hidden; }
.card.pr-p0 { border-left-color: var(--p0); }
.card.pr-p1 { border-left-color: var(--p1); }
.card.pr-p2 { border-left-color: var(--p2); }
.card:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-1px); }
.card[open] { box-shadow: var(--card-shadow-hover); }
.card > summary { list-style: none; cursor: pointer; padding: 16px 18px 14px; padding-right: 104px; display: block; }
.card > summary::-webkit-details-marker { display: none; }
.card > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.card .card-title { margin: 8px 0 6px; font-size: 17px; }
.card.lead .card-title { font-size: 19px; }
.card-teaser { margin: 0; color: var(--text); font-size: 14.5px; line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card.lead .card-teaser { -webkit-line-clamp: 3; }
.card[open] .card-teaser { display: none; }
.card-foot { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.src-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.src-label { font-size: 11.5px; color: var(--muted); margin-right: 2px; }
.src-chip { font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.src-chip.official { color: var(--official); }
.src-chip.secondary { color: var(--secondary); }
/* 펼치기 버튼: 오른쪽 위 고정, 화살표 회전 */
.fold-btn { position: absolute; top: 14px; right: 14px; display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 999px; padding: 4px 10px 4px 12px; }
.card:hover .fold-btn { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.fold-btn .chev { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform .18s; }
.card[open] .fold-btn .chev { transform: translateY(2px) rotate(-135deg); }
.fold-btn .close-label, .card[open] .fold-btn .open-label { display: none; }
.card[open] .fold-btn .close-label { display: inline; }
.card-body { padding: 14px 18px 18px; border-top: 1px solid var(--line); background: var(--card-body); }
.card-body .sources { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 12px; }
@media (max-width: 640px) {
  .card > summary { padding: 14px 14px 12px; padding-top: 48px; }
  .fold-btn { top: 12px; right: 12px; }
}

/* 당일 업데이트 */
.updated { color: var(--accent); font-weight: 600; }
.update-group { margin-bottom: 18px; }
.update-time { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--accent); }
.update-time .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.badge.upd { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

/* 묶음 카드 설명 */
.company-grid li .desc { margin-top: 4px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* 연구·용어집·스터디 */
a.paper-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px;
  box-shadow: var(--card-shadow); color: var(--text); transition: box-shadow .18s, transform .18s; }
a.paper-card:hover { text-decoration: none; box-shadow: var(--card-shadow-hover); transform: translateY(-1px); }
a.paper-card .card-teaser { -webkit-line-clamp: 2; }
.paper-orig { margin: 0 0 6px; color: var(--muted); font-size: 13.5px; font-style: italic; }
.lede { font-size: 17px; line-height: 1.75; color: var(--heading); margin: 16px 0; }
.h1-sub { font-size: 20px; font-weight: 600; }
.paper-sec h2 { font-size: 16px; border-bottom-width: 1px; margin-top: 28px; }
.paper-sec p, .paper-sec li { line-height: 1.85; }
.terms dt { font-weight: 700; color: var(--heading); margin-top: 10px; }
.terms dd { margin: 2px 0 0; color: var(--text); }
.callout { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 12px 16px; margin: 16px 0; }
.callout b { color: var(--heading); margin-right: 6px; }
.glossary-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.glossary-grid li[hidden], section[hidden] { display: none; }
a.term-card { display: flex; flex-direction: column; gap: 4px; height: 100%; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px; box-shadow: var(--card-shadow); color: var(--text); transition: box-shadow .18s, transform .18s; }
a.term-card:hover { text-decoration: none; box-shadow: var(--card-shadow-hover); transform: translateY(-1px); }
.term-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.term-head b { color: var(--heading); font-size: 16.5px; }
.term-ko { font-size: 12.5px; color: var(--muted); }
.term-short { font-size: 13.5px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; }
.badge.lv-입문 { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.badge.lv-기초 { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.badge.lv-심화 { color: var(--p1); border-color: var(--p1); }
.level-filter { display: flex; gap: 6px; margin: 12px 0 0; }
.level-filter button { font: inherit; font-size: 13px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.level-filter button[aria-pressed="true"] { background: var(--heading); color: var(--bg); border-color: var(--heading); font-weight: 700; }

/* 광고 슬롯 */
.ad-slot { margin: 28px 0; min-height: 90px; position: relative; }
.ad-slot.side { margin: 24px 0 0; min-height: 250px; }
.ad-slot .ad-label { position: absolute; top: -18px; left: 0; font-size: 11px; color: var(--muted); }
.ad-slot.preview { display: flex; align-items: center; justify-content: center; border: 2px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: 13px; background: repeating-linear-gradient(45deg, transparent, transparent 8px, var(--surface-2) 8px, var(--surface-2) 9px); }

/* 구간 페이징 */
.pager-mini { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0 0; }
.pager-mini button { font: inherit; font-size: 13px; min-width: 34px; padding: 5px 10px; border-radius: 8px; cursor: pointer;
  color: var(--text); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--card-shadow); }
.pager-mini button:hover:not(:disabled) { border-color: var(--muted); color: var(--heading); }
.pager-mini button[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.pager-mini button:disabled { opacity: .4; cursor: default; }
.pager-info { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.card[hidden] { display: none; }
.stat-note { margin: 4px 0 0; font-size: 11px; color: var(--muted); line-height: 1.4; }

/* 커뮤니티 화제 */
.buzz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.buzz { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; box-shadow: var(--card-shadow); }
.buzz p { margin: 6px 0 0; font-size: 14px; line-height: 1.65; }
.buzz-kw { display: inline-block; font-weight: 800; color: var(--accent); font-size: 15px; }

/* 트렌드 키워드 */
.badge.st-confirmed { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.badge.st-emerging { color: var(--p1); border-color: color-mix(in srgb, var(--p1) 45%, transparent); }
.badge.st-unverified { color: var(--muted); border-style: dashed; }
.trend-card h4 { margin: 14px 0 6px; font-size: 14px; color: var(--muted); }
.trend-card .sources { margin: 0; padding-left: 0; list-style: none; }
.trend-card .sources li { margin: 6px 0; }

/* 주간 분야별 주목 논문 */
.weekly-box { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px 18px 14px; margin: 18px 0 28px; }
.weekly-box > summary { list-style: none; cursor: pointer; }
.weekly-box > summary::-webkit-details-marker { display: none; }
.weekly-box > summary h2 { border: 0; margin: 10px 0; }
.wk-group { margin-top: 18px; }
.wk-head { font-size: 15px; color: var(--accent); margin: 0 0 6px; }
.wk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.wk-item { padding: 10px 0; border-top: 1px solid var(--line); }
.wk-title { font-weight: 700; color: var(--heading, var(--text)); }
.wk-orig { margin: 2px 0; font-size: 13px; color: var(--muted); }
.wk-line { margin: 4px 0; }

/* 트렌드 트리맵 */
:root { --tm-confirmed: #12b76a; --tm-emerging: #f79009; --tm-unverified: #98a2b3; }
.treemap { position: relative; width: 100%; height: 440px; margin: 12px 0 6px; border-radius: 14px; overflow: hidden; background: var(--line); }
.treemap.compact { height: 270px; }
.tile { position: absolute; box-sizing: border-box; border: 2px solid var(--bg); border-radius: 10px; overflow: hidden;
  color: #fff; text-decoration: none; transition: filter .15s, transform .15s; }
.tile:hover, .tile:focus-visible { filter: brightness(1.12); z-index: 2; text-decoration: none; outline: none; box-shadow: inset 0 0 0 2px rgba(255,255,255,.75); }
.tile { --c: #475467; background: linear-gradient(140deg, color-mix(in srgb, var(--c) 95%, #000), color-mix(in srgb, var(--c) 60%, #000)); }
.kd-model { --c: #2e6be6; } .kd-product { --c: #7a5af8; } .kd-technique, .kd-concept { --c: #0e9384; }
.kd-event { --c: #e04f16; } .kd-company { --c: #667085; }
.tile.st-unverified { filter: saturate(.35) brightness(.85); }
.tile.st-unverified:hover { filter: saturate(.6); }
.st-pill { align-self: flex-start; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.22); }
.tile.st-emerging .st-pill { background: #fdb022; color: #3a2400; }
.st-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: #6ce9a6; box-shadow: 0 0 0 2px rgba(0,0,0,.2); }
.tile .st-dot.st-emerging, .tile.st-emerging .st-dot { background: #fdb022; }
.tile.st-unverified .st-dot, .st-dot.st-unverified { background: #d0d5dd; }
.treemap-legend .st-dot { position: static; display: inline-block; margin: 0 3px 0 6px; vertical-align: 0; }
.treemap-legend .st-dot.st-confirmed { background: #12b76a; } .treemap-legend .st-dot.st-emerging { background: #f79009; }
.treemap.tall { display: none; }
.tile-in { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; height: 100%; box-sizing: border-box; }
.tile-kw { font-weight: 800; line-height: 1.15; word-break: keep-all; overflow-wrap: break-word; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.tile-ko, .tile-meta { font-size: 12px; opacity: .9; }
.tile-why { font-size: 13px; line-height: 1.45; opacity: .92; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: auto; }
.sz-xl .tile-kw { font-size: clamp(20px, 2.6vw, 32px); }
.sz-lg .tile-kw { font-size: clamp(16px, 1.8vw, 22px); }
.sz-md .tile-kw { font-size: 14px; }
.sz-sm .tile-kw { font-size: 12px; }
.sz-sm .tile-in { padding: 5px 6px; }
.sz-xs .tile-kw { display: none; }
.treemap-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.treemap-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.sw { background: var(--c); }
.viz-tabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.viz-tabs input { position: absolute; opacity: 0; pointer-events: none; }
.viz-tabs label { cursor: pointer; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--muted); background: var(--surface); }
.viz-tabs input:checked + label { color: var(--text); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.viz-tabs input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.viz-pane { display: none; flex-basis: 100%; }
#tv-today:checked ~ .pane-today, #tv-week:checked ~ .pane-week { display: block; }
.home-trends { margin: 8px 0 22px; }
.home-trends h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.home-trends .more { font-weight: 500; }
.trend-card.st-confirmed { border-left-color: var(--tm-confirmed); }
.trend-card.st-emerging { border-left-color: var(--tm-emerging); }
.trend-card:target { box-shadow: 0 0 0 2px var(--accent); }
@media (max-width: 640px) {
  .treemap.wide { display: none; } .treemap.tall { display: block; height: 560px; }
  .treemap.tall.compact { height: 460px; }
  .tile-why { display: none; }
  .sz-sm .tile-kw { font-size: 11px; }
}

/* 스터디 노트 */
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; margin: 18px 0; }
.toc ol { margin: 6px 0 0; padding-left: 20px; } .toc li { margin: 3px 0; }
.study-sec p { line-height: 1.85; }
.study-sec a[href*="arxiv.org"] { font-size: .9em; white-space: nowrap; }
.chips-inline .badge { margin: 0 4px 6px 0; }

/* 관리 화면 */
.admin section { margin: 28px 0; }
.admin h2 { font-size: 18px; }
.admin h3 { font-size: 14px; color: var(--muted); margin: 8px 0; }
.adm-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.adm-kpis .kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.adm-kpis .kpi span { font-size: 12px; color: var(--muted); } .adm-kpis .kpi b { font-size: 22px; } .adm-kpis .kpi small { font-size: 12px; color: var(--muted); }
.adm-chart svg { width: 100%; height: auto; display: block; }
.adm-chart .ax { font-size: 11px; fill: var(--muted); }
.adm-chart .s1, .adm-legend .sw.s1 { fill: var(--accent); background: var(--accent); }
.adm-chart .s2, .adm-legend .sw.s2 { fill: #12b76a; background: #12b76a; }
.adm-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 4px 0 10px; }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.adm-rank { list-style: none; margin: 0; padding: 0; }
.adm-rank li { position: relative; display: flex; justify-content: space-between; gap: 8px; padding: 4px 6px; font-size: 13px; }
.adm-rank .k { position: relative; z-index: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-rank b { position: relative; z-index: 1; }
.adm-rank .bar { position: absolute; left: 0; top: 2px; bottom: 2px; background: color-mix(in srgb, var(--accent) 16%, transparent); border-radius: 4px; }
.adm-table { width: 100%; font-size: 13px; border-collapse: collapse; }
.adm-table th, .adm-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.adm-table tr.fail td { color: var(--p0); }
.adm-pre { font-size: 12px; white-space: pre-wrap; background: var(--surface); padding: 10px; border-radius: 8px; max-height: 320px; overflow: auto; }
.api-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.api-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.api-card.paused { border-color: var(--p1); }
.api-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.api-head button { margin-left: auto; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; }
.meter { display: grid; grid-template-columns: 56px 1fr auto; gap: 8px; align-items: center; font-size: 13px; margin: 4px 0; }
.meter .track { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.meter .track span { display: block; height: 100%; background: var(--accent); }
.adm-list { padding-left: 18px; } .adm-list li { margin: 4px 0; }

/* 약관·정책 */
.legal { max-width: 760px; }
.legal h2 { font-size: 18px; margin-top: 28px; }
.legal table { font-size: 14px; }
.legal-links { font-size: 13px; }
/* 쿠키 동의(광고 사용 시에만) */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 720px; margin: 0 auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.consent p { margin: 0 0 10px; font-size: 14px; }
.consent-btns { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.consent button { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); cursor: pointer; }
.consent button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.menu .lang-switch { margin-left: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 13px; }

/* 기업 주가 */
.stock-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 14px 0 20px; max-width: 520px; }
.stock-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.stock-sym { font-weight: 700; } .stock-last { font-size: 22px; } .stock-last small { font-size: 12px; color: var(--muted); }
.chg { font-weight: 700; font-size: 14px; } .chg.up { color: #d92d20; } .chg.down { color: #1570ef; }
.spark { width: 100%; height: 56px; margin: 8px 0 4px; }
.spark polyline { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.spark.up polyline { stroke: #d92d20; } .spark.down polyline { stroke: #1570ef; }
.ko-tag { font-size: 11px; color: var(--muted); font-weight: 400; }

.status-guide { display: grid; gap: 6px; margin: 10px 0 18px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; font-size: 13px; }
.status-guide div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; }
.status-guide dt, .status-guide dd { margin: 0; } .status-guide dd { color: var(--muted); }
@media (max-width: 640px) { .status-guide div { grid-template-columns: 1fr; gap: 2px; } }
.consent-opts { display: flex; gap: 14px; margin: 0 0 10px; font-size: 14px; }
.consent-opts input { margin-right: 4px; }

/* 브리핑 탭 */
.tab-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 32px 0 6px; padding-bottom: 10px; border-bottom: 2px solid var(--heading);
  position: sticky; top: 0; z-index: 3; background: var(--bg); padding-top: 8px; }
.tab-bar [role="tab"] { font: inherit; font-size: 14px; font-weight: 700; color: var(--muted); background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.tab-bar [role="tab"][aria-selected="true"] { color: var(--bg); background: var(--heading); border-color: var(--heading); }
.tab-bar [role="tab"] .count { margin-left: 2px; }
.tab-bar [role="tab"][aria-selected="true"] .count { background: color-mix(in srgb, var(--bg) 25%, transparent); color: var(--bg); }
.tab-bar .expand-all { position: static; margin-left: auto; }
.tabs-on > .tab-panel > h2 { display: none; }
.tab-desc { color: var(--muted); font-size: 14px; margin: 10px 0 14px; }
.tabs-on > .ad-slot { display: none; }
@media (max-width: 640px) {
  .tab-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tab-bar [role="tab"] { white-space: nowrap; }
}

.recent-split { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
@media (max-width: 900px) { .recent-split { grid-template-columns: 1fr; } }
.chips-caption { margin: 4px 0 6px; }

.cat-filter a[aria-pressed="true"], .level-filter button[aria-pressed="true"] { color: var(--bg); background: var(--heading); border-color: var(--heading); }
.cat-filter a[aria-pressed="true"] .count { background: color-mix(in srgb, var(--bg) 25%, transparent); color: var(--bg); }

/* 공유·복사·PDF */
.share-fab { position: fixed; right: 18px; bottom: 18px; z-index: 40; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.share-toggle { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 14px; font-weight: 700; color: var(--bg); background: var(--heading);
  border: 0; border-radius: 999px; padding: 10px 16px; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.share-toggle svg { width: 16px; height: 16px; fill: currentColor; }
.share-menu { order: -1; display: grid; min-width: 180px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: 0 12px 32px rgba(0,0,0,.28); }
.share-menu[hidden] { display: none; }
.share-menu button { font: inherit; font-size: 14px; text-align: left; color: var(--text); background: none; border: 0; border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.share-menu button:hover, .share-menu button:focus-visible { background: var(--surface-2); outline: none; }
.share-menu button[data-a="pdf"] { border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; padding-top: 10px; }
.toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); z-index: 60; background: var(--heading); color: var(--bg);
  padding: 9px 16px; border-radius: 999px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.ev-copy { font: inherit; font-size: 13px; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; margin-top: 8px; cursor: pointer; }
.ev-copy:hover { color: var(--heading); }
@media print {
  .site-header, .site-footer, .no-print, .tab-bar, .card-tools, .pager-mini, .ad-slot, .skip, .lang-switch, .consent, .viz-tabs input, .fold-btn { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .card, .stock-card, .weekly-box, .status-guide { box-shadow: none !important; border-color: #ccc !important; break-inside: avoid; background: #fff !important; }
  .tabs-on > .tab-panel > h2 { display: flex !important; }
  .layout { display: block !important; } .sidebar { display: none !important; }
  a { color: #000 !important; text-decoration: underline; }
  .treemap { break-inside: avoid; }
}

/* 한 줄 푸터 */
.footer-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 13px; color: var(--muted); padding-top: 18px; padding-bottom: 72px; }
.footer-line a { color: var(--muted); }
.footer-line a:hover { color: var(--heading); }

/* 용어 구조도(src/atr/diagram.py): 노드 종류별 색은 사이트 토큰을 섞어 쓴다 */
:root { --dg-model: #6941c6; --dg-store: #b54708; --dg-out: #027a48; }
@media (prefers-color-scheme: dark) { :root { --dg-model: #b692f6; --dg-store: #fdb022; --dg-out: #32d583; } }
.diagram { margin: 18px 0 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 10px; }
.dg-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; contain: inline-size; width: 100%; }  /* 넓은 그림이 본문 폭을 밀어내지 않고 이 안에서만 가로 스크롤 */
.dg { display: block; width: 100%; height: auto; min-width: var(--dg-min); margin: 0 auto; font-family: inherit; }
.diagram figcaption { font-size: 13px; line-height: 1.65; color: var(--muted); margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.diagram figcaption b { color: var(--heading); margin-right: 6px; }
.dg-node { --c: var(--accent); }
.dg-node .dg-shape { fill: color-mix(in srgb, var(--c) 9%, var(--surface)); stroke: var(--c); stroke-width: 1.4; }
.dg-node .dg-rim { fill: none; stroke: var(--c); stroke-width: 1.2; }
.dg-node.k-input, .dg-node.k-note { --c: var(--muted); }
.dg-node.k-model { --c: var(--dg-model); }
.dg-node.k-model .dg-shape { stroke-width: 2; }
.dg-node.k-store { --c: var(--dg-store); }
.dg-node.k-output { --c: var(--dg-out); }
.dg-node.k-concept { --c: var(--accent); }
.dg-node.k-note .dg-shape { stroke-dasharray: 4 3; fill: var(--surface-2); }
.dg-label { font-size: 13.5px; font-weight: 600; fill: var(--heading); text-anchor: middle; }
.dg-sub { font-size: 11.5px; fill: var(--muted); text-anchor: middle; }
.dg-edge { fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-linejoin: round; }
.dg-edge.dashed { stroke-dasharray: 5 4; }
.dg-arrow path { fill: var(--muted); }
.dg-elabel { font-size: 11.5px; fill: var(--text); paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; }
.dg-group rect { fill: var(--surface-2); stroke: var(--line); stroke-width: 1; }
.dg-group text { font-size: 11.5px; font-weight: 600; fill: var(--muted); letter-spacing: .02em; }
@media print { .diagram { break-inside: avoid; } }

/* 소식 상세 */
.event-page h1 { font-size: 28px; line-height: 1.35; margin: 12px 0 8px; }
.ev-sec h2 { font-size: 16px; margin-top: 26px; }
.ev-sec p { line-height: 1.8; }
.ev-thread { padding-left: 20px; } .ev-thread li { margin: 6px 0; } .ev-thread li.here { font-weight: 700; }
.ev-more { margin: 10px 0 0; font-size: 14px; }

.co-profile { margin: 10px 0 6px; } .co-profile p { margin: 6px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sector-recent { list-style: none; padding: 0; margin: 4px 0 14px; font-size: 14px; }
.sector-recent li { margin: 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
