/* ============================================================
   외교의 언어 — 연설 아카이브 & 스타일 랩
   Mobile-first. Light "paper archive" theme (deliberate single look).
   ============================================================ */
:root {
  color-scheme: light;
  /* paper & ink — 차분한 문서 사이트 톤 (회사에서 눈에 띄지 않게) */
  --bg: #f7f7f8;            /* page plane — neutral light gray */
  --surface: #ffffff;       /* cards */
  --surface-2: #f1f1f3;     /* recessed */
  --ink: #1e1f22;
  --ink-2: #55565a;
  --ink-3: #8b8c91;
  --line: #e4e4e7;
  --line-strong: #cfcfd4;
  /* brand */
  --navy: #1f3a5f;
  --navy-deep: #14273f;
  --accent: #2a78d6;        /* series-1 blue (이재명) */
  --accent-2: #eb6834;      /* series-2 orange (조현) */
  --accent-2-deep: #b44618;
  --gold: #b08d3e;
  --hl: #fdf3d7;            /* highlight wash for notable expressions */
  /* chart chrome (dataviz roles, light) */
  --chart-surface: #fcfcfb;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --seq-400: #3987e5;
  --seq-300: #6da7ec;
  --seq-200: #9ec5f4;
  --seq-100: #cde2fb;
  --seq-550: #1c5cab;
  --radius: 14px;
  --radius-sm: 9px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --serif: "Noto Serif KR", "Nanum Myeongjo", "Apple SD Gothic Neo", Georgia, serif;
  --topbar-h: 56px;
  --tabbar-h: calc(58px + env(safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--navy); text-decoration: none; }
button { font-family: inherit; }

/* ---------- topbar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(247,247,248,.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding-left: 16px; padding-right: 12px;
}
.brand { display: flex; align-items: baseline; gap: 8px; cursor: pointer; }
.brand-mark {
  font-family: var(--serif); font-weight: 900; font-size: 19px;
  color: var(--navy-deep); letter-spacing: -.2px;
}
.brand-sub { font-size: 10.5px; color: var(--ink-3); letter-spacing: .6px; font-weight: 600; }
@media (max-width: 600px) { .brand-sub { display: none; } }
.btn-report {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--navy-deep); font-weight: 700; font-size: 12.5px;
  padding: 7px 13px; border-radius: 100px; cursor: pointer;
  box-shadow: 0 1px 3px rgba(20,39,63,.06);
}
.btn-report:active { transform: scale(.97); }

/* ---------- layout ---------- */
.page {
  max-width: 820px; margin: 0 auto;
  padding: calc(var(--topbar-h) + env(safe-area-inset-top, 0px) + 14px) 16px calc(var(--tabbar-h) + 28px);
}
@media (min-width: 900px) {
  .page { max-width: 1120px; padding: calc(var(--topbar-h) + 22px) 24px 60px; }
}

/* ---------- bottom tab bar (mobile) / top-attached nav (desktop) ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  height: var(--tabbar-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr);
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--ink-3); font-size: 10.5px; font-weight: 600;
  background: none; border: none; cursor: pointer; padding: 6px 0 8px;
}
.tab svg { width: 22px; height: 22px; stroke: currentColor; }
.tab.active { color: var(--navy-deep); }
.tab.active svg { stroke: var(--navy-deep); }
@media (min-width: 900px) {
  .tabbar {
    top: 0; bottom: auto; left: auto; right: 220px;
    height: var(--topbar-h); width: auto; border: none; background: none;
    backdrop-filter: none; -webkit-backdrop-filter: none;
    display: flex; gap: 4px; align-items: center; padding: 0;
  }
  .tab { flex-direction: row; gap: 7px; font-size: 13.5px; padding: 8px 14px; border-radius: 100px; }
  .tab svg { width: 17px; height: 17px; }
  .tab.active { background: var(--surface-2); }
}

/* ---------- common blocks ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 16px;
  box-shadow: none;
}
.section { margin-top: 26px; }
.section-title {
  font-family: var(--serif); font-size: 17px; font-weight: 800;
  color: var(--navy-deep); margin: 0 0 4px; letter-spacing: -.2px;
  display: flex; align-items: baseline; gap: 8px;
}
.section-desc { font-size: 12.5px; color: var(--ink-3); margin: 0 0 12px; }
.chip {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600; color: var(--ink-2);
  background: var(--surface-2); border-radius: 100px; padding: 3px 10px;
}
.badge-speaker {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 800; border-radius: 100px; padding: 3px 10px;
}
.badge-speaker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-speaker.lee { color: #1c5cab; background: #e8f1fc; }
.badge-speaker.cho { color: var(--accent-2-deep); background: #fdeee6; }
.badge-speaker.trump { color: #0d7a52; background: #e4f6ee; }
.badge-cat {
  font-size: 10.5px; font-weight: 700; color: var(--ink-2);
  border: 1px solid var(--line-strong); border-radius: 5px; padding: 1.5px 7px;
}
.badge-text {
  font-size: 10.5px; font-weight: 700; border-radius: 5px; padding: 2px 7px;
}
.badge-text.has { color: #315c4d; background: #edf5f1; }
.badge-text.missing { color: #8a5b35; background: #f7eee6; }

/* ---------- home ---------- */
.home-hero { padding: 20px 0 26px; border-bottom: 1px solid var(--line-strong); }
.home-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.home-eyebrow { margin: 0; color: var(--ink-3); font-size: 11px; font-weight: 800; letter-spacing: 1.5px; }
.home-update { border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--ink-2); padding: 6px 9px; font-size: 10.5px; font-weight: 800; cursor: pointer; }
.home-update span { color: var(--navy); margin-right: 3px; }
.home-hero h1 { margin: 0; color: var(--ink); font-size: clamp(26px, 4vw, 38px); line-height: 1.25; letter-spacing: -.8px; }
.home-hero-top + h1 { margin-top: 6px; }
.home-search {
  display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 8px;
  max-width: 680px; margin-top: 20px; padding: 5px 5px 5px 13px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px;
}
.home-search:focus-within { border-color: #8da6c4; box-shadow: 0 0 0 3px rgba(31,58,95,.08); }
.home-search svg { width: 18px; height: 18px; stroke: var(--ink-3); }
.home-search input { min-width: 0; border: 0; outline: 0; background: transparent; padding: 7px 2px; font: inherit; font-size: 14px; color: var(--ink); }
.home-search button { border: 0; border-radius: 6px; background: var(--navy-deep); color: white; padding: 8px 15px; font-size: 12.5px; font-weight: 800; cursor: pointer; }
.home-data-line { margin-top: 8px; color: var(--ink-3); font-size: 11.5px; }
.home-data-line b { color: var(--ink-2); }
.home-block { margin-top: 26px; }
.block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.block-head h2 { margin: 0; font-size: 15px; color: var(--ink); }
.block-head a { font-size: 11.5px; color: var(--ink-3); }
.home-people { display: grid; grid-template-columns: repeat(2, 1fr); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface); }
.home-person {
  position: relative; display: grid; grid-template-columns: 1fr auto auto; align-items: baseline; gap: 3px;
  border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: var(--surface); text-align: left; padding: 13px 14px; color: var(--ink); cursor: pointer;
}
.home-person:nth-child(2n) { border-right: 0; }
.home-person:nth-child(n+3) { border-bottom: 0; }
.home-person:hover { background: #fafafb; }
.home-person::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--accent); }
.home-person.cho::before { background: var(--accent-2); }
.home-person.trump::before { background: #1baf7a; }
.home-person-name { font-size: 13px; font-weight: 800; }
.home-person b { font-size: 17px; color: var(--navy-deep); }
.home-person small { color: var(--ink-3); font-size: 10px; }
.dataset-status { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 8px 10px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; background: #fafafb; }
.dataset-status span { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-3); font-size: 9.5px; }
.dataset-status i { width: 6px; height: 6px; border-radius: 50%; background: #4a8b70; }
.dataset-status .planned { color: #a0a0a5; }
.dataset-status .planned b { padding: 1px 4px; border-radius: 3px; background: #ececef; color: #929298; font-size: 8.5px; }
.home-analysis-links { display: grid; grid-template-columns: 1fr; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.home-analysis-links a { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 11px 13px; background: var(--surface); border-bottom: 1px solid var(--line); }
.home-analysis-links a:last-child { border-bottom: 0; }
.home-analysis-links a:hover { background: #fafafb; }
.home-analysis-links b { color: var(--ink); font-size: 12.5px; }
.home-analysis-links span { color: var(--ink-3); font-size: 11.5px; }
@media (min-width: 720px) {
  .home-hero h1 br { display: none; }
  .home-people { grid-template-columns: repeat(4, 1fr); }
  .home-person { border-bottom: 0; }
  .home-person:nth-child(2n) { border-right: 1px solid var(--line); }
  .home-person:last-child { border-right: 0; }
}

/* ---------- archive ---------- */
.archive-head { display: flex; align-items: baseline; gap: 12px; margin: 2px 2px 10px; }
.archive-head h1 {
  margin: 0; font-size: 20px; color: var(--ink);
}
.archive-head span { font-size: 11.5px; color: var(--ink-3); }
.archive-bar {
  position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  z-index: 30; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px;
  background: rgba(247,247,248,.96); padding: 6px 0; margin: -6px 0 4px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.search-input-wrap { position: relative; }
.search-input-wrap svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; stroke: var(--ink-3);
}
#search-input {
  width: 100%; height: 40px; padding: 9px 36px 9px 38px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface); font-size: 13px; color: var(--ink);
  font-family: inherit; outline: none;
}
#search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(42,120,214,.12); }
.search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: none; background: var(--surface-2); color: var(--ink-2);
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-size: 13px; line-height: 1;
  display: none;
}
.filter-toggle {
  min-width: 76px; height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink-2);
  font-size: 12px; font-weight: 800; cursor: pointer;
}
.filter-toggle b { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--navy-deep); color: white; font-size: 10px; }
.filter-toggle span { color: var(--ink-3); font-size: 11px; }
.filter-panel {
  position: relative; display: grid; grid-template-columns: 1fr; gap: 9px;
  padding: 13px 14px; margin: 4px 0 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
}
.filter-panel[hidden] { display: none; }
.filter-group { min-width: 0; }
.filter-label { color: var(--ink-3); font-size: 10px; font-weight: 800; letter-spacing: .7px; }
.filter-row { display: flex; gap: 5px; overflow-x: auto; padding: 5px 0 0; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-sep { flex: 0 0 1px; background: var(--line); margin: 2px 3px; }
.fchip {
  flex: 0 0 auto; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink-2); font-size: 11px; font-weight: 650;
  padding: 5px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.fchip.on { background: var(--navy-deep); color: #fff; border-color: var(--navy-deep); }
.fchip.planned-chip { border-style: dashed; background: #f3f3f4; color: #a1a1a6; cursor: not-allowed; }
.filter-reset { justify-self: end; border: 0; background: none; color: var(--ink-3); font-size: 11px; text-decoration: underline; cursor: pointer; padding: 0; }
.arch-count { font-size: 11.5px; color: var(--ink-3); margin: 7px 2px; }
.arch-count b { color: var(--ink); }
.arch-count span { color: var(--ink-3); }
.arch-tools {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 2px;
}
.sort-btn {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
  border-radius: 7px; padding: 5px 9px; font: inherit; font-size: 11.5px;
  font-weight: 700; cursor: pointer; white-space: nowrap;
}
.archive-list { border-top: 1px solid var(--line-strong); }
.archive-table-head, .arch-item {
  display: grid; grid-template-columns: 96px minmax(260px, 1.35fr) minmax(190px, .8fr) 16px;
  align-items: center; gap: 14px;
}
.archive-table-head { padding: 6px 9px; color: var(--ink-3); font-size: 10px; font-weight: 800; border-bottom: 1px solid var(--line); }
.arch-item { min-height: 48px; padding: 9px; border-bottom: 1px solid var(--line); cursor: pointer; background: transparent; }
.arch-item:hover { background: rgba(255,255,255,.7); }
.item-date { color: var(--ink-3); font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.item-topic { min-width: 0; color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.38; }
.item-place { min-width: 0; color: var(--ink-3); font-size: 11.5px; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.item-arrow { color: var(--line-strong); font-size: 20px; text-align: right; }
.compact-list .arch-item { grid-template-columns: 96px minmax(250px, 1.35fr) minmax(180px, .8fr) 16px; }
@media (min-width: 760px) {
  .filter-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-reset { position: absolute; right: 14px; top: 12px; }
}
@media (max-width: 650px) {
  .archive-table-head { display: none; }
  .arch-item, .compact-list .arch-item { grid-template-columns: 78px minmax(0, 1fr) 12px; gap: 5px 9px; min-height: 58px; padding: 9px 2px; }
  .item-date { grid-column: 1; grid-row: 1 / span 2; align-self: start; padding-top: 2px; font-size: 10.5px; }
  .item-topic { grid-column: 2; grid-row: 1; font-size: 12.5px; }
  .item-place { grid-column: 2; grid-row: 2; font-size: 10.5px; -webkit-line-clamp: 1; }
  .item-arrow { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
  .home-analysis-links a { grid-template-columns: 94px 1fr; gap: 8px; }
}
mark { background: var(--hl); color: inherit; padding: 0 1px; border-radius: 2px; }
.ft-note { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; }
.ft-note button { border: none; background: none; color: var(--accent); font-weight: 700; cursor: pointer; font-size: 11.5px; padding: 0; }

/* ---------- speech detail ---------- */
.sp-back {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 700; color: var(--ink-2);
  background: none; border: none; cursor: pointer; padding: 4px 0; margin-bottom: 6px;
}
.sp-header { padding: 4px 2px 14px; border-bottom: 2px solid var(--navy-deep); }
.sp-title {
  font-family: var(--serif); font-size: 21px; font-weight: 900; line-height: 1.45;
  color: var(--ink); margin: 8px 0 8px; letter-spacing: -.3px;
}
.sp-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 12px; color: var(--ink-2); }
.sp-summary-card { margin-top: 16px; background: var(--surface-2); border-color: var(--line); }
.bilingual-summary { margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.bilingual-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.bilingual-head > b { color: var(--ink); font-size: 11.5px; }
.bilingual-head nav { display: flex; gap: 9px; }
.bilingual-head a { color: var(--ink-3); font-size: 9.5px; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; }
.summary-grid article { min-width: 0; padding: 13px 14px; }
.summary-grid article + article { border-left: 1px solid var(--line); }
.summary-label { color: var(--ink); font-size: 10.5px; font-weight: 850; letter-spacing: .3px; }
.summary-label small { margin-left: 4px; color: var(--ink-3); font-size: 9px; font-weight: 500; }
.summary-grid p { margin: 6px 0 0; color: var(--ink-2); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.summary-grid article[lang="en"] p { line-height: 1.6; }
.summary-grid ul { margin: 7px 0 0; padding-left: 16px; color: var(--ink-2); font-size: 11.5px; }
.source-record {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 9px 14px;
  margin-top: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
.source-record-main { display: flex; align-items: center; min-width: 0; gap: 9px; }
.source-record-main > div { min-width: 0; }
.source-record-main b { display: block; color: var(--ink); font-size: 12.5px; }
.source-record-main small { display: block; color: var(--ink-3); font-size: 10px; }
.source-kind { flex: 0 0 auto; padding: 3px 6px; border-radius: 5px; background: #e9f3ee; color: #27634d; font-size: 9.5px; font-weight: 800; }
.source-record.archive .source-kind { background: #eaf0f8; color: #315a88; }
.source-record.media .source-kind { background: #f1f1f3; color: var(--ink-2); }
.source-record.missing .source-kind { background: #f8ece5; color: #8a4d2c; }
.source-link { border: 1px solid var(--line-strong); border-radius: 6px; padding: 6px 9px; color: var(--navy-deep); font-size: 11px; font-weight: 800; white-space: nowrap; }
.source-link span { color: var(--ink-3); }
.source-alt { grid-column: 1 / -1; display: flex; align-items: center; gap: 5px; padding-top: 7px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 9.5px; }
.source-alt a { display: inline-grid; place-items: center; width: 19px; height: 19px; border-radius: 4px; background: var(--surface-2); font-size: 10px; }
.source-unavailable { color: var(--ink-3); font-size: 11px; }
.sp-label { font-size: 10.5px; font-weight: 800; letter-spacing: 1.8px; color: var(--ink-3); margin-bottom: 7px; }
.sp-summary { font-size: 13.5px; line-height: 1.75; color: var(--ink); margin: 0; }
.sp-points { margin: 8px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.8; color: var(--ink-2); }
.sp-expr { display: flex; flex-wrap: wrap; gap: 6px; }
.expr-tag {
  font-size: 12px; background: var(--hl); border: 1px solid #ecd9a0;
  border-radius: 7px; padding: 4px 9px; color: #6b5518; font-weight: 600; cursor: pointer;
}
.sp-body { margin-top: 20px; }
.sp-body p {
  font-family: var(--serif); font-size: 15.5px; line-height: 1.95;
  color: #26241f; margin: 0 0 1.15em; word-break: keep-all;
}
.sp-body[lang="en"] p { font-family: Georgia, "Times New Roman", serif; font-size: 15px; line-height: 1.85; }
.translation-section { max-width: 800px; margin: 34px auto 0; padding-top: 16px; border-top: 2px solid var(--ink); }
.translation-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.translation-head > div { display: flex; flex-direction: column; }
.translation-head span { color: var(--ink); font-size: 15px; font-weight: 850; }
.translation-head small { margin-top: 2px; color: var(--ink-3); font-size: 10.5px; }
.translation-head > b { padding: 3px 7px; border-radius: 5px; background: #e7f3ed; color: #27634d; font-size: 9.5px; }
.translation-head > b.pending { background: var(--surface-2); color: var(--ink-3); }
.translation-body { margin-top: 14px; }
.translation-body p { font-family: var(--serif); }
.translation-pending { margin-top: 12px; padding: 15px; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--surface-2); }
.translation-pending p { margin: 0; color: var(--ink-2); font-size: 12px; line-height: 1.65; }
.translation-pending button { margin-top: 9px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); padding: 6px 9px; color: var(--ink-2); font-size: 10.5px; font-weight: 750; cursor: pointer; }
.sp-src { margin-top: 18px; font-size: 12px; color: var(--ink-3); }
.sp-src a { text-decoration: underline; }
.sp-nav { display: flex; gap: 10px; margin-top: 22px; }
.sp-nav a {
  flex: 1; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 12px; color: var(--ink-2); background: var(--surface);
  overflow: hidden;
}
.sp-nav a b { display: block; color: var(--ink); font-size: 12.5px; margin-top: 2px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.sp-nav a.next { text-align: right; }
.sp-tone { font-size: 13px; color: var(--ink-2); line-height: 1.7; margin: 0; }
@media (min-width: 900px) {
  .sp-back, .sp-header, .source-record, .bilingual-summary, .sp-summary-card, .sp-body, .sp-src, .sp-nav { max-width: 800px; margin-left: auto; margin-right: auto; }
  .source-record { margin-top: 12px; }
  .sp-summary-card { margin-top: 16px; }
}
@media (max-width: 650px) {
  .summary-grid { grid-template-columns: 1fr; }
  .summary-grid article + article { border-left: 0; border-top: 1px solid var(--line); }
  .bilingual-head nav { display: none; }
  .source-record { grid-template-columns: minmax(0, 1fr) auto; }
  .source-kind { display: none; }
}

/* ---------- insights ---------- */
.insights-head { display: flex; align-items: baseline; gap: 12px; margin: 2px 0 12px; }
.insights-head h1 { margin: 0; font-size: 20px; color: var(--ink); }
.insights-head span { color: var(--ink-3); font-size: 11.5px; }
.seg {
  display: flex; flex-wrap: nowrap; gap: 2px; overflow-x: auto; scrollbar-width: none;
  background: var(--surface-2); border-radius: 8px; padding: 3px; margin-bottom: 14px;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: 1 0 auto; min-width: 72px;
  border: none; background: none; padding: 7px 9px; border-radius: 6px;
  font-size: 11.5px; font-weight: 700; color: var(--ink-3); cursor: pointer; white-space: nowrap;
}
.seg button.on { background: var(--surface); color: var(--navy-deep); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.ins-kpis { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.ins-kpis div { padding: 12px 13px; border-right: 1px solid var(--line); }
.ins-kpis div:last-child { border-right: 0; }
.ins-kpis b { display: block; color: var(--ink); font-size: 20px; line-height: 1.2; }
.ins-kpis span { display: block; margin-top: 3px; color: var(--ink-3); font-size: 10.5px; }
.ins-quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.ins-quick a { min-width: 0; overflow: hidden; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.ins-quick b { display: block; margin-bottom: 3px; color: var(--ink); font-size: 12.5px; }
.ins-quick span { color: var(--ink-3); font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; word-break: keep-all; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ins-quick a, .speaker-summary, .ins-fold-body, .insight-prose, #ins-body { max-width: 100%; min-width: 0; }
.speaker-summary p, .ins-fold-body { overflow-wrap: anywhere; }
.ins-folds { margin-top: 12px; }
.ins-fold { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); margin-bottom: 7px; overflow: hidden; }
.ins-fold > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px;
  padding: 9px 12px; list-style: none; cursor: pointer; color: var(--ink); font-size: 12.5px; font-weight: 800;
}
.ins-fold > summary::-webkit-details-marker, .country-card > summary::-webkit-details-marker { display: none; }
.ins-fold > summary::after { content: "+"; margin-left: auto; color: var(--ink-3); font-size: 16px; font-weight: 400; }
.ins-fold[open] > summary::after { content: "−"; }
.ins-fold > summary small { order: 1; margin-left: auto; color: var(--ink-3); font-size: 10.5px; font-weight: 500; }
.ins-fold > summary::after { order: 2; }
.ins-fold-body { padding: 12px 14px 14px; border-top: 1px solid var(--line); }
.compare-common { margin-bottom: 14px; color: var(--ink-2); font-size: 12.5px; }
.compare-common ul { margin: 6px 0 0; padding-left: 18px; }
.country-intro { display: flex; align-items: baseline; gap: 10px; padding: 3px 2px 11px; }
.country-intro b { font-size: 14px; color: var(--ink); }
.country-intro span { color: var(--ink-3); font-size: 11px; }
.country-groups { margin-bottom: 12px; }
.country-section > summary i { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; }
.country-grid { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 8px; border-top: 1px solid var(--line); background: var(--bg); }
.country-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 7px; overflow: hidden;
}
.country-card > summary { display: grid; grid-template-columns: 100px 1fr auto; align-items: center; gap: 10px; padding: 10px 11px; list-style: none; cursor: pointer; }
.country-name { color: var(--ink); font-size: 13px; font-weight: 800; }
.country-focus { min-width: 0; color: var(--ink-2); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.country-count { color: var(--ink-3); font-size: 10.5px; white-space: nowrap; }
.country-body { padding: 0 11px 11px; border-top: 1px solid var(--line); }
.country-card p { margin: 9px 0 0; font-size: 12px; line-height: 1.7; color: var(--ink-2); }
.country-sources { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); }
.country-sources b {
  display: block; margin-bottom: 3px; font-size: 10px; letter-spacing: 1px; color: var(--ink-3);
}
.country-sources a {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11.5px; color: var(--navy); padding: 2px 0;
}
@media (min-width: 720px) {
  .country-grid { grid-template-columns: 1fr 1fr; }
}
.speaker-summary { padding: 14px 15px; border: 1px solid var(--line); border-left: 3px solid var(--speaker-color); border-radius: 8px; background: var(--surface); }
.speaker-summary-head { display: flex; align-items: center; justify-content: space-between; }
.speaker-summary-head span { color: var(--ink); font-size: 14px; font-weight: 850; }
.speaker-summary-head a { color: var(--ink-3); font-size: 10.5px; }
.speaker-summary p { margin: 7px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.65; }
.speaker-wordline { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.speaker-wordline span { padding: 3px 8px; border-radius: 5px; background: var(--surface-2); color: var(--ink-2); font-size: 10.5px; }
.compact-stats { margin-top: 9px; }
.viz-root { background: var(--chart-surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.viz-root.flat { border: 0; padding: 0; }
.viz-title { font-size: 13.5px; font-weight: 800; color: var(--ink); margin: 0 0 2px; font-family: var(--sans); }
.viz-sub { font-size: 11.5px; color: var(--ink-3); margin: 0 0 12px; }
.bar-row { display: grid; grid-template-columns: 84px 1fr 40px; align-items: center; gap: 8px; margin: 7px 0; }
.bar-label { font-size: 12px; color: var(--ink); text-align: right; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 16px; position: relative; }
.bar-fill { height: 16px; border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-val { font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.stat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .stat-tiles { grid-template-columns: repeat(4, 1fr); } }
.stat-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 10px 11px; }
.stat-tile .v { font-size: 18px; font-weight: 800; color: var(--navy-deep); line-height: 1.2; }
.stat-tile .v small { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.stat-tile .k { font-size: 11px; color: var(--ink-3); margin-top: 3px; font-weight: 600; }
.timeline { position: relative; margin-top: 6px; }
.tl-item { position: relative; padding: 0 0 20px 22px; }
.tl-item::before {
  content: ""; position: absolute; left: 5px; top: 8px; bottom: -2px;
  width: 2px; background: var(--line-strong);
}
.tl-item:last-child::before { display: none; }
.tl-dot {
  position: absolute; left: 0; top: 5px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--navy); border: 2.5px solid var(--bg);
}
.tl-period { font-size: 11px; font-weight: 800; color: var(--gold); letter-spacing: .5px; }
.tl-title { font-size: 14.5px; font-weight: 800; color: var(--ink); margin: 2px 0 4px; }
.tl-desc { font-size: 13px; color: var(--ink-2); line-height: 1.7; }
.tl-desc b { color: var(--ink); }
.insight-prose { font-size: 13.5px; line-height: 1.8; color: var(--ink); }
.insight-prose p { margin: 0 0 10px; }
.insight-prose b { color: var(--navy-deep); }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.compare-col h4 { font-size: 13px; margin: 0 0 8px; display: flex; align-items: center; gap: 6px; }
.compare-col ul { margin: 0; padding-left: 16px; font-size: 12.5px; color: var(--ink-2); line-height: 1.75; }
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--ink-2); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.methodology { margin-top: 26px; padding-top: 12px; border-top: 1px solid var(--line-strong); }
.method-body ol { margin: 0; padding: 0; list-style: none; counter-reset: method; }
.method-body li { counter-increment: method; display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.method-body li:last-child { border-bottom: 0; }
.method-body li b { color: var(--ink); font-size: 11.5px; }
.method-body li b::before { content: counter(method) ". "; color: var(--ink-3); }
.method-body li span { color: var(--ink-2); font-size: 11.5px; line-height: 1.65; }
.method-limit { margin: 10px 0 0; padding: 9px 10px; background: var(--surface-2); color: var(--ink-2); font-size: 11px; line-height: 1.6; }
.evidence-list a { display: grid; grid-template-columns: 88px 1fr auto; align-items: center; gap: 10px; padding: 8px 1px; border-bottom: 1px solid var(--line); }
.evidence-list a:last-child { border-bottom: 0; }
.evidence-list time { color: var(--ink-3); font-size: 10.5px; }
.evidence-list span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: 11.5px; }
.evidence-list b { color: var(--ink-3); font-size: 9.5px; }
.evidence-note { margin: 9px 0 0; color: var(--ink-3); font-size: 10px; }
@media (max-width: 650px) {
  .insights-head span { display: none; }
  .ins-kpis { grid-template-columns: repeat(2, 1fr); }
  .ins-kpis div:nth-child(2) { border-right: 0; }
  .ins-kpis div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .ins-quick { grid-template-columns: 1fr; gap: 6px; }
  .country-card > summary { grid-template-columns: 78px 1fr; gap: 4px 8px; }
  .country-count { grid-column: 2; }
  .compare-grid { grid-template-columns: 1fr; }
  .method-body li { grid-template-columns: 1fr; gap: 3px; }
}

/* ---------- writer / phrases ---------- */
.wr-intro { font-size: 13px; color: var(--ink-2); line-height: 1.7; }
.writer-context { margin: 10px 2px 2px; padding: 8px 10px; border-left: 2px solid var(--line-strong); color: var(--ink-3); font-size: 11.5px; line-height: 1.55; }
.phrase-group { margin-top: 14px; }
.phrase-stage {
  font-size: 11px; font-weight: 800; letter-spacing: 1.5px; color: var(--gold);
  margin: 14px 2px 6px;
}
.phrase {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 13px; margin-bottom: 8px; position: relative;
}
.phrase-text { font-family: var(--serif); font-size: 14px; line-height: 1.75; color: var(--ink); word-break: keep-all; padding-right: 30px; }
.phrase-src { font-size: 11px; color: var(--ink-3); margin-top: 6px; }
.phrase-src a { color: var(--accent); }
.phrase-copy {
  position: absolute; right: 8px; top: 8px; border: none; background: var(--surface-2);
  width: 28px; height: 28px; border-radius: 7px; cursor: pointer; color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
}
.phrase-copy svg { width: 14px; height: 14px; stroke: currentColor; }
.phrase-copy.done { background: #e7f6ec; color: #1c6b3a; }
.checklist { margin: 0; padding-left: 18px; }
.checklist li { margin-bottom: 7px; font-size: 13px; color: var(--ink-2); line-height: 1.65; }
.checklist li b { color: var(--ink); }

/* ---------- feedback modal ---------- */
.fb-overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(20,25,35,.45);
  display: flex; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
@media (min-width: 640px) { .fb-overlay { align-items: center; } }
.fb-modal {
  background: var(--surface); width: 100%; max-width: 480px;
  border-radius: 18px 18px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  max-height: 88vh; overflow-y: auto;
}
@media (min-width: 640px) { .fb-modal { border-radius: 18px; } }
.fb-h { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.fb-title { font-size: 16px; font-weight: 800; margin: 0; color: var(--ink); }
.fb-sub { font-size: 12px; color: var(--ink-3); margin: 3px 0 0; }
.fb-close {
  margin-left: auto; border: none; background: var(--surface-2); border-radius: 50%;
  width: 30px; height: 30px; font-size: 16px; cursor: pointer; color: var(--ink-2); line-height: 1;
}
.fb-field { margin-bottom: 12px; }
.fb-label { display: block; font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 5px; }
.fb-input, .fb-textarea, .fb-select {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 11px 12px; font-size: 14px; font-family: inherit; background: var(--surface);
  color: var(--ink); outline: none;
}
.fb-input:focus, .fb-textarea:focus, .fb-select:focus { border-color: var(--accent); }
.fb-textarea { resize: vertical; min-height: 110px; }
.fb-actions { display: flex; gap: 8px; margin-top: 6px; }
.fb-btn {
  flex: 1; padding: 12px; border-radius: 11px; font-size: 14px; font-weight: 800; cursor: pointer;
}
.fb-btn.primary { background: var(--navy-deep); color: #fff; border: none; }
.fb-btn.primary:disabled { opacity: .5; }
.fb-btn.ghost { background: none; border: 1px solid var(--line-strong); color: var(--ink-2); }
.fb-ok { text-align: center; padding: 26px 10px; }
.fb-ok .ic { font-size: 34px; }
.fb-ok .t1 { font-size: 16px; font-weight: 800; margin-top: 8px; }
.fb-ok .t2 { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.fb-err { font-size: 12.5px; color: #b3261e; background: #fdeceb; border-radius: 8px; padding: 9px 11px; margin-bottom: 10px; }

/* ---------- update panel ---------- */
.update-modal { width: 100%; max-width: 600px; max-height: 88vh; overflow-y: auto; padding: 18px; border-radius: 14px 14px 0 0; background: var(--surface); }
@media (min-width: 640px) { .update-modal { border-radius: 12px; } }
.update-head { display: flex; align-items: flex-start; justify-content: space-between; }
.update-kicker { color: var(--ink-3); font-size: 9px; font-weight: 800; letter-spacing: 1.3px; }
.update-head h2 { margin: 1px 0 0; font-size: 18px; }
.update-version { display: flex; flex-direction: column; margin-top: 13px; padding: 10px 11px; border-left: 2px solid var(--navy); background: var(--surface-2); }
.update-version b { color: var(--ink); font-size: 12px; }
.update-version span { margin-top: 2px; color: var(--ink-3); font-size: 10.5px; }
.update-counts { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 10px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.update-counts div { padding: 9px 8px; border-right: 1px solid var(--line); }
.update-counts div:last-child { border-right: 0; }
.update-counts b { display: block; color: var(--ink); font-size: 16px; }
.update-counts span { color: var(--ink-3); font-size: 9.5px; }
.update-section-head { display: flex; justify-content: space-between; margin-top: 16px; padding-bottom: 6px; border-bottom: 1px solid var(--line-strong); }
.update-section-head b { font-size: 12px; }
.update-section-head span { color: var(--ink-3); font-size: 10px; }
.update-list a { display: grid; grid-template-columns: 78px 1fr; gap: 9px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.update-list time { color: var(--ink-3); font-size: 10px; }
.update-list span { color: var(--ink); font-size: 11.5px; font-weight: 650; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.update-analysis { display: flex; gap: 6px; margin-top: 12px; overflow-x: auto; }
.update-analysis a { flex: 0 0 auto; padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink-2); font-size: 10.5px; }
.update-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; }
.update-actions button, .update-actions > a { border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); padding: 8px 10px; color: var(--ink-2); font-size: 11px; font-weight: 750; cursor: pointer; }
.update-actions > a { background: var(--navy-deep); color: white; border-color: var(--navy-deep); }
.update-actions button:disabled { opacity: .55; }

/* ---------- misc ---------- */
.loading { text-align: center; color: var(--ink-3); font-size: 13px; padding: 60px 0; }
.spinner {
  width: 22px; height: 22px; border: 2.5px solid var(--line-strong); border-top-color: var(--navy);
  border-radius: 50%; margin: 0 auto 10px; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; color: var(--ink-3); font-size: 13px; padding: 40px 0; }
.footer-note { text-align: center; font-size: 10.5px; color: var(--ink-3); margin-top: 34px; letter-spacing: .5px; line-height: 1.8; }
.toast {
  position: fixed; bottom: calc(var(--tabbar-h) + 12px); left: 50%; transform: translateX(-50%);
  background: var(--navy-deep); color: #fff; font-size: 12.5px; font-weight: 600;
  padding: 9px 18px; border-radius: 100px; z-index: 120; box-shadow: 0 4px 14px rgba(0,0,0,.25);
  opacity: 0; transition: opacity .25s; pointer-events: none; white-space: nowrap;
}
.toast.show { opacity: 1; }
