/* 정책 히스토리만의 시간축. 색은 정책 수단의 방향이며 위험 점수가 아니다. */
.history-view .policy-hero, .history-view #data-status { display: none; }
.history-view #policy-tabs { margin-top: 24px; margin-bottom: 0; }
.history-intro { padding: 38px 0 28px; }
.history-intro h3 { font-size: clamp(26px, 3vw, 36px); letter-spacing: -.035em; line-height: 1.35; margin: 10px 0 13px; }
.history-intro-copy { font-size: 15px; color: var(--ink-soft); max-width: 74ch; }
.history-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 18px; font-size: 11px; color: var(--ink-soft); }
.history-meta span:first-child { font-weight: 650; color: var(--brand); }
.history-overview { border: 1px solid var(--line); background: var(--card-bg); border-radius: 14px; padding: 23px; }
.history-overview-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 14px; margin-bottom: 18px; }
.history-overview-heading h4 { font-size: 16px; }
.history-overview-heading p { color: var(--ink-soft); font-size: 12px; }
.history-era-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.history-era { position: relative; font: inherit; text-align: left; border: 1px solid var(--line); border-top: 3px solid var(--line-strong); border-radius: 8px; background: var(--bg); color: var(--ink); padding: 17px 14px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 9px; transition: border-color .15s, background-color .15s; min-width: 0; }
.history-era:hover { border-color: var(--brand); }
.history-era[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.history-era-period { font-family: var(--mono); color: var(--brand); font-size: 12px; font-weight: 600; }
.history-era strong { font-size: 16px; line-height: 1.5; letter-spacing: -.02em; }
.history-era-summary { font-size: 12px; line-height: 1.7; color: var(--ink-soft); }
.history-era-focus { display: flex; flex-wrap: wrap; gap: 5px; padding-top: 8px; margin-top: auto; }
.history-era-focus span { color: var(--ink-soft); border: 1px solid var(--line-strong); background: var(--card-bg); padding: 1px 5px; border-radius: 4px; font-size: 10px; }
.history-era-caption { font-size: 11px; color: var(--ink-soft); margin-top: 16px; }
.history-filters { padding: 30px 0 20px; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--history-header-height, 108px) + 10px); }
.history-filter-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 15px; gap: 12px; }
.history-filter-top h4 { font-size: 19px; letter-spacing: -.02em; }
.history-filter-top > span { font-size: 12px; color: var(--ink-soft); }
.history-topic-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.history-topic { border: 1px solid var(--line); border-radius: 999px; background: var(--card-bg); padding: 7px 14px; font: inherit; font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.history-topic[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.history-topic:hover { border-color: var(--brand); }
.history-search-row { display: flex; gap: 12px; align-items: end; margin-top: 17px; max-width: 650px; }
.history-search-row .search-field { display: grid; gap: 5px; font-size: 11px; color: var(--ink-soft); }
.history-search-row input { color: var(--ink); background: var(--input-bg); border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 13px; font: inherit; font-size: 13px; width: 100%; min-height: 43px; }
.history-search-row .qual-btn { min-height: 43px; white-space: nowrap; }
.history-results-head { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; padding: 16px 0 22px; font-size: 11px; color: var(--ink-soft); }
.history-results-head .result-count { margin: 0; }
.history-layout { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 35px; align-items: start; margin-bottom: 36px; }
.history-year-rail { position: sticky; top: calc(var(--history-header-height, 108px) + 24px); padding: 5px 0; }
.history-year-rail > p { font-size: 10px; margin: 0 12px 10px; }
.history-year-nav { display: grid; gap: 2px; }
.history-year-button { display: block; font-family: var(--mono); font-size: 12px; color: var(--ink-soft); text-align: left; border: 0; border-left: 2px solid transparent; background: transparent; padding: 8px 12px; cursor: pointer; }
.history-year-button[aria-current="location"] { border-left-color: var(--brand); color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.history-year-button:hover { color: var(--brand); }
.history-phase + .history-phase { margin-top: 34px; }
.history-phase-head { padding: 19px 23px; background: var(--brand-soft); border-radius: 10px; }
.history-phase-head .eyebrow { font-size: 10px; }
.history-phase-head h4 { font-size: 19px; margin: 6px 0; letter-spacing: -.02em; }
.history-phase-head > p:last-child { color: var(--ink-soft); font-size: 13px; max-width: 90ch; }
.history-year-heading { color: var(--ink); font-family: var(--mono); font-size: 22px; font-weight: 500; margin: 25px 0 15px; scroll-margin-top: calc(var(--history-header-height, 108px) + 78px); }
.history-spine { border-left: 2px solid var(--line-strong); margin-left: 8px; padding-left: 28px; display: grid; gap: 14px; }
.history-event { position: relative; border: 1px solid var(--line); border-radius: 10px; background: var(--card-bg); }
.history-event::before { content: ""; width: 10px; height: 10px; border: 2px solid var(--brand); background: var(--bg); border-radius: 50%; position: absolute; top: 30px; left: -37px; }
.history-event[open]::before { background: var(--brand); }
.history-event[open] { border-color: var(--line-strong); }
.history-event-summary { padding: 21px 24px; cursor: pointer; list-style: none; }
.history-event-summary::-webkit-details-marker { display: none; }
.history-event-summary:hover .history-event-title h5 { color: var(--brand); }
.history-event-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.history-date { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); margin-right: 6px; }
.history-date-kind { font-size: 10px; color: var(--ink-soft); margin-right: 5px; }
.history-badge { font-size: 10px; border-radius: 4px; padding: 2px 7px; background: var(--chip-bg); color: var(--ink-soft); }
.history-tighten { color: #98600b; background: #fff2d9; }
.history-ease { color: #2867a1; background: #eaf2fd; }
.history-supply { color: #216b58; background: #e5f3ec; }
.history-protect { color: #795b9c; background: #f1eafa; }
.history-stabilize { color: #665e53; background: #f2eee7; }
:root[data-theme="dark"] .history-tighten { color: #edc987; background: #382c19; }
:root[data-theme="dark"] .history-ease { color: #9ac4ef; background: #1a2c40; }
:root[data-theme="dark"] .history-supply { color: #94d3bb; background: #16332b; }
:root[data-theme="dark"] .history-protect { color: #cdb1eb; background: #2c2338; }
:root[data-theme="dark"] .history-stabilize { color: #d1c3ae; background: #302c24; }
.history-event-title { display: flex; justify-content: space-between; gap: 15px; align-items: baseline; margin: 9px 0 6px; }
.history-event-title h5 { font-size: 17px; line-height: 1.5; font-weight: 700; letter-spacing: -.015em; }
.history-expand { color: var(--brand); font-size: 20px; font-weight: 400; line-height: 1; }
.history-event[open] .history-expand { font-size: 0; }
.history-event[open] .history-expand::after { content: "−"; font-size: 20px; }
.history-change { color: var(--ink-soft); font-size: 13px; line-height: 1.8; max-width: 90ch; }
.history-event-content { padding: 23px 24px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 22px 30px; font-size: 13px; }
.history-event-content h6 { font-size: 12px; color: var(--brand); margin-bottom: 9px; }
.history-event-content p { line-height: 1.85; }
.history-full-title { font-weight: 600; margin-bottom: 8px; }
.history-event-content ul { padding-left: 18px; margin-top: 12px; color: var(--ink-soft); }
.history-event-content li + li { margin-top: 7px; }
.history-context h6:not(:first-child) { margin-top: 22px; }
.history-context p { color: var(--ink-soft); }
.history-timing { grid-column: 1 / -1; border-radius: 8px; background: var(--bg); padding: 12px 15px; color: var(--ink-soft); font-size: 12px; }
.history-timing strong { color: var(--ink); font-weight: 600; }
.history-event-sources { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 7px 15px; font-size: 11px; }
.history-event-sources > span { color: var(--ink-soft); }
.history-event-sources a { overflow-wrap: anywhere; }
.history-empty { padding: 40px 25px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--ink-soft); text-align: center; }
.history-empty strong { display: block; font-size: 16px; color: var(--ink); }
.history-empty p { margin: 12px 0 20px; font-size: 13px; }
.history-method-note { padding: 23px 26px; border: 1px solid var(--line); border-radius: 10px; margin: 30px 0; color: var(--ink-soft); }
.history-method-note h4 { font-size: 13px; color: var(--ink); margin-bottom: 9px; }
.history-method-note > p { font-size: 12px; margin-top: 8px; }
.history-data-status { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 15px; font-size: 11px; color: var(--ink-soft); margin: 15px 0 0; }
.history-retry { border: 0; background: transparent; color: var(--brand); padding: 0; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
@media (max-width: 1050px) {
  .history-era-grid { display: flex; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 8px; }
  .history-era { flex: 0 0 210px; scroll-snap-align: start; }
  .history-layout { grid-template-columns: 85px minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 700px) {
  .history-view #policy-tabs { margin-top: 12px; }
  .history-intro { padding: 28px 0 23px; }
  .history-intro h3 { font-size: 27px; }
  .history-intro-copy { font-size: 13px; }
  .history-meta { gap: 5px 12px; font-size: 10px; margin-top: 14px; }
  .history-overview { padding: 17px; margin: 0; }
  .history-overview-heading { margin-bottom: 14px; }
  .history-overview-heading h4 { font-size: 15px; }
  .history-overview-heading p { font-size: 11px; }
  .history-era { flex-basis: 205px; }
  .history-era-caption { font-size: 10px; }
  .history-filters { padding-top: 25px; }
  .history-filter-top h4 { font-size: 18px; }
  .history-filter-top > span { font-size: 10px; }
  .history-topic-chips { gap: 6px; }
  .history-topic { font-size: 11px; padding: 7px 10px; }
  .history-search-row { gap: 8px; }
  .history-search-row .search-field { min-width: 0; }
  .history-search-row input { font-size: 12px; }
  .history-search-row .qual-btn { font-size: 11px; padding: 7px 9px; }
  .history-results-head { padding-bottom: 14px; }
  .history-layout { display: block; }
  .history-year-rail { top: var(--history-header-height, 108px); z-index: 5; padding: 7px 0; margin: 0 0 18px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .history-year-rail > p { display: none; }
  .history-year-nav { display: flex; overflow-x: auto; gap: 2px; }
  .history-year-button { border-left: 0; border-bottom: 2px solid transparent; font-size: 11px; padding: 8px 11px; flex: none; }
  .history-year-button[aria-current="location"] { border-bottom-color: var(--brand); }
  .history-phase-head { padding: 16px 18px; }
  .history-phase-head h4 { font-size: 17px; }
  .history-phase-head > p:last-child { font-size: 12px; }
  .history-year-heading { font-size: 21px; }
  .history-spine { margin-left: 5px; padding-left: 19px; }
  .history-event::before { left: -28px; width: 9px; height: 9px; top: 25px; }
  .history-event-summary { padding: 17px 15px; }
  .history-event-title h5 { font-size: 15px; }
  .history-event-meta { gap: 5px; }
  .history-date { font-size: 10px; }
  .history-badge { font-size: 9px; padding: 2px 5px; }
  .history-change { font-size: 12px; }
  .history-event-content { grid-template-columns: 1fr; padding: 18px 15px; gap: 20px; font-size: 12px; }
  .history-timing { padding: 11px; font-size: 11px; }
  .history-method-note { padding: 18px; }
}
