:root {
  --ink: #0b1b3d;
  --muted: #61708b;
  --primary: #2457f5;
  --primary-dark: #173fca;
  --primary-soft: #edf3ff;
  --canvas: #f5f7fb;
  --surface: #ffffff;
  --line: #dbe3ef;
  --mint: #ddf6ee;
  --mint-ink: #08775f;
  --amber: #fff0cb;
  --amber-ink: #a45a00;
  --danger: #be123c;
  --shadow: 0 14px 40px rgba(20, 45, 90, .08);
  --radius: 16px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--canvas); font-family: "Noto Sans KR", Pretendard, "Malgun Gothic", sans-serif; line-height: 1.55; word-break: keep-all; overflow-wrap: break-word; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #f5a623; outline-offset: 3px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 10px 14px; background: var(--ink); color: white; transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.topbar { height: 72px; padding: 0 28px; display: flex; align-items: center; gap: 32px; position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 800; letter-spacing: .04em; white-space: nowrap; }
.brand svg { width: 34px; fill: none; stroke: currentColor; stroke-width: 3; }
.brand b { font-size: 15px; }
.topnav { display: flex; align-self: stretch; gap: 24px; }
.topnav a { display: flex; align-items: center; border-bottom: 3px solid transparent; color: #42516f; font-weight: 600; }
.topnav a[aria-current="page"] { color: var(--primary); border-bottom-color: var(--primary); }
.icon-button { margin-left: auto; min-height: 44px; border: 0; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); padding: 8px 14px; display: flex; align-items: center; gap: 8px; font-weight: 700; }
.icon-button strong { min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--primary); color: white; font-size: 12px; }
.mobile-menu { display: none; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: white; padding: 0 14px; }

.app-shell { max-width: 1600px; min-height: calc(100vh - 72px); margin: auto; display: grid; grid-template-columns: 230px 1fr; }
.sidebar { padding: 28px 16px; background: #f8faff; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.sidebar nav { display: grid; gap: 7px; }
.sidebar nav a { min-height: 48px; padding: 11px 14px; display: flex; align-items: center; gap: 12px; border-radius: 11px; color: #384865; font-weight: 600; }
.sidebar nav a span { width: 24px; text-align: center; color: #64748b; }
.sidebar nav a[aria-current="page"] { background: #e9f0ff; color: var(--primary); box-shadow: inset 3px 0 var(--primary); }
.sidebar-summary { margin-top: auto; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: white; display: grid; gap: 4px; }
.sidebar-summary strong { font-size: 18px; }
.sidebar-summary span { color: var(--muted); font-size: 13px; }

main { width: 100%; min-width: 0; padding: 38px clamp(20px, 4vw, 64px) 64px; }
.page { max-width: 1240px; margin: auto; }
.page-head { margin-bottom: 28px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.page-head h1 { margin: 5px 0 8px; font-size: clamp(30px, 4vw, 46px); line-height: 1.18; letter-spacing: -.035em; }
.page-head p { margin: 0; color: var(--muted); font-size: 17px; }
.page-head > :last-child:not(:first-child) { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.eyebrow { margin: 0; color: var(--primary); font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.meta-note { color: var(--muted); font-size: 13px; }
.data-source { display: inline-flex; align-items: center; width: fit-content; padding: 6px 10px; border-radius: 999px; background: var(--amber); color: var(--amber-ink); font-size: 12px; font-weight: 800; }
.data-source.is-live { background: var(--mint); color: var(--mint-ink); }

.hero { padding: clamp(26px, 4vw, 48px); margin-bottom: 24px; border: 1px solid #d4e2ff; border-radius: 22px; background: linear-gradient(130deg, #f8fbff 20%, #e8f2ff); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr); gap: 42px; align-items: center; overflow: hidden; }
.hero h1 { margin: 8px 0 18px; font-size: clamp(36px, 4.1vw, 58px); line-height: 1.16; letter-spacing: -.05em; }
.hero .lead { max-width: 600px; margin: 0 0 26px; color: #53637e; font-size: clamp(17px, 2vw, 21px); }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.primary, .secondary, .ghost, .danger-button { min-height: 46px; padding: 10px 17px; border-radius: 11px; border: 1px solid transparent; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.primary { background: var(--primary); color: white; }
.primary:hover { background: var(--primary-dark); }
.secondary { background: white; color: var(--primary-dark); border-color: #9bb3ed; }
.secondary:hover { background: var(--primary-soft); }
.ghost { background: transparent; color: #3c4b66; border-color: var(--line); }
.danger-button { background: #fff1f2; color: var(--danger); border-color: #fecdd3; }
.full { width: 100%; }

.snapshot { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.92); box-shadow: var(--shadow); }
.snapshot-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.snapshot-head h2 { margin: 0; font-size: 20px; }
.policy-mini { width: 100%; padding: 14px 0; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; color: inherit; }
.policy-mini:first-of-type { border-top: 0; }
.policy-mini b { font-size: 15px; }
.policy-mini small { color: var(--muted); }
.policy-mini .status-pill { grid-row: 1 / 3; grid-column: 2; align-self: center; }

.stats { margin: 0 0 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.stat span { display: block; color: var(--muted); font-size: 13px; }
.stat strong { display: block; margin-top: 3px; font-size: 26px; }

.toolbar { margin-bottom: 18px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search { flex: 1 1 300px; min-height: 48px; padding: 0 15px; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--ink); }
.filter { min-height: 48px; padding: 0 38px 0 13px; border: 1px solid var(--line); border-radius: 11px; background: white; color: var(--ink); }
.policy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.policy-card { position: relative; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: 0 4px 16px rgba(20,45,90,.04); display: flex; flex-direction: column; gap: 14px; }
.policy-card:hover { border-color: #9eb7ef; transform: translateY(-1px); }
.policy-card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.topic-label { display: inline-flex; align-items: center; gap: 7px; color: var(--topic-color, var(--primary)); font-size: 13px; font-weight: 800; }
.topic-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-pill { display: inline-flex; align-items: center; width: fit-content; padding: 5px 10px; border-radius: 999px; background: var(--amber); color: var(--amber-ink); font-size: 12px; font-weight: 800; white-space: nowrap; }
.policy-card h2 { margin: 0; font-size: 21px; line-height: 1.35; }
.policy-card p { margin: 0; color: var(--muted); }
.change-box { padding: 13px 14px; border-radius: 10px; background: var(--primary-soft); color: #314463; font-size: 14px; }
.card-actions { margin-top: auto; display: flex; gap: 8px; }
.card-actions button { flex: 1; }
.follow-button[data-following="true"] { background: var(--mint); color: var(--mint-ink); border-color: #99dbc9; }
.empty { padding: 54px 24px; border: 1px dashed #aab8ca; border-radius: var(--radius); text-align: center; background: rgba(255,255,255,.65); }
.empty h2 { margin: 0 0 8px; }
.empty p { margin: 0 0 20px; color: var(--muted); }

.interest-layout { display: grid; grid-template-columns: 1fr 310px; gap: 20px; align-items: start; }
.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.topic-card { min-height: 205px; padding: 20px; border: 2px solid transparent; border-radius: var(--radius); background: white; text-align: left; color: inherit; position: relative; }
.topic-card:hover { border-color: #a9bce7; }
.topic-card[aria-pressed="true"] { border-color: var(--primary); background: #f9fbff; }
.topic-card .check { position: absolute; top: 16px; right: 16px; width: 26px; height: 26px; border: 2px solid #acb8cb; border-radius: 50%; display: grid; place-items: center; color: transparent; }
.topic-card[aria-pressed="true"] .check { border-color: var(--primary); background: var(--primary); color: white; }
.topic-card h2 { margin: 16px 0 6px; font-size: 20px; }
.topic-card p { margin: 0 0 15px; color: var(--muted); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 9px; border-radius: 999px; background: #edf1f7; color: #536078; font-size: 12px; }
.selection-panel { position: sticky; top: 96px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.selection-panel h2 { margin: 0; font-size: 20px; }
.selection-count { width: 30px; height: 30px; float: right; border-radius: 50%; background: var(--primary); color: white; display: grid; place-items: center; font-weight: 800; }
.selected-list { min-height: 120px; margin: 18px 0; display: grid; gap: 8px; align-content: start; }
.selected-item { padding: 10px 12px; border-radius: 9px; background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.selected-item button { border: 0; background: transparent; color: inherit; }
.field { margin: 18px 0; }
.field label, .field legend { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 700; }
.field select { width: 100%; min-height: 44px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.field .search { width: 100%; }
.check-row { min-height: 44px; display: flex; align-items: center; gap: 10px; }
.check-row input { width: 19px; height: 19px; accent-color: var(--primary); }

.tracking-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 20px; }
.tracking-main, .brief-card, .settings-card { padding: clamp(20px, 3vw, 32px); border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.tracking-head { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.tracking-head h2 { margin: 8px 0; font-size: 27px; }
.stage { margin: 28px 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.stage-item { position: relative; text-align: center; color: var(--muted); font-size: 13px; }
.stage-item::before { content: ""; position: absolute; top: 16px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.stage-item:first-child::before { display: none; }
.stage-dot { position: relative; z-index: 1; width: 34px; height: 34px; margin: 0 auto 7px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--line); background: white; font-weight: 800; }
.stage-item.done { color: var(--primary); font-weight: 700; }
.stage-item.done::before { background: var(--primary); }
.stage-item.done .stage-dot { border-color: var(--primary); background: var(--primary); color: white; }
.timeline { margin: 25px 0 0; padding: 0; list-style: none; }
.timeline li { margin-left: 8px; padding: 0 0 24px 25px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); }
.timeline li:last-child { border-left-color: transparent; }
.timeline time { display: block; color: var(--primary); font-size: 12px; font-weight: 800; }
.timeline h3 { margin: 2px 0 3px; font-size: 16px; }
.timeline p { margin: 0; color: var(--muted); font-size: 14px; }
.important-box { padding: 18px; border-radius: 12px; background: linear-gradient(120deg, #eff7ff, #eaf4ff); }
.important-box b { display: block; margin-bottom: 4px; }
.tracking-list { display: grid; gap: 10px; }
.tracking-list button { padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: white; text-align: left; color: inherit; }
.tracking-list button[aria-current="true"] { border-color: var(--primary); background: var(--primary-soft); }
.tracking-list b { display: block; margin-bottom: 4px; }
.tracking-list span { color: var(--muted); font-size: 12px; }

.briefing-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 20px; }
.brief-index { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: white; align-self: start; }
.brief-index h2 { margin: 0 0 14px; font-size: 18px; }
.brief-index a { display: block; padding: 10px 0; border-top: 1px solid var(--line); color: #40506b; font-size: 14px; }
.brief-index a:first-of-type { border-top: 0; }
.brief-card { max-width: 820px; }
.brief-brand { margin-bottom: 22px; display: flex; justify-content: space-between; color: var(--primary); font-weight: 800; }
.brief-card h1 { margin: 0 0 14px; font-size: clamp(30px, 4vw, 48px); line-height: 1.2; letter-spacing: -.04em; }
.brief-section { margin: 20px 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; }
.brief-section h2 { margin: 0 0 8px; font-size: 17px; }
.brief-section p, .brief-section ul { margin: 0; color: #43526d; }
.compare-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; }
.compare-grid > div { min-height: 120px; padding: 16px; border-radius: 10px; background: #f1f4f9; }
.compare-grid > div:last-child { background: #eaf2ff; }

.settings-stack { display: grid; gap: 16px; max-width: 800px; }
.settings-card h2 { margin-top: 0; }
.settings-card p { color: var(--muted); }
.settings-card .button-row { margin-top: 18px; }
.account-page { min-height: 100vh; padding: 28px 16px; display: grid; place-items: center; background: var(--canvas); }
.account-card { width: min(560px, 100%); padding: clamp(24px, 5vw, 44px); border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: var(--shadow); text-align: center; }
.account-card .brand { justify-content: center; margin-bottom: 24px; }
.account-card h1 { margin: 0 0 10px; font-size: clamp(28px, 5vw, 40px); }
.account-card p { color: var(--muted); }
.account-card .button-row { justify-content: center; margin-top: 24px; }

dialog { width: min(760px, calc(100% - 28px)); max-height: 90vh; padding: 0; border: 0; border-radius: 18px; color: var(--ink); box-shadow: 0 28px 80px rgba(10,28,70,.28); overflow: auto; }
dialog::backdrop { background: rgba(8, 20, 45, .55); backdrop-filter: blur(4px); }
.dialog-head { position: sticky; top: 0; z-index: 2; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); background: white; display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.dialog-head h2 { margin: 4px 0 0; font-size: 24px; }
.close-button { width: 44px; height: 44px; flex: 0 0 auto; border: 0; border-radius: 50%; background: #edf1f7; color: #34425b; font-size: 25px; }
#policyDialogBody, #notificationList { padding: 22px 24px 26px; }
.dialog-summary { margin: 0 0 18px; color: #40506b; }
.notification-dialog { width: min(520px, calc(100% - 28px)); }
.notification-dialog .full { margin: 0 24px 24px; width: calc(100% - 48px); }
.notification-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.notification-item:last-child { border-bottom: 0; }
.notification-item b { display: block; }
.notification-item span { color: var(--muted); font-size: 13px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; max-width: 360px; padding: 13px 17px; border-radius: 11px; background: var(--ink); color: white; box-shadow: var(--shadow); }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .hero { grid-template-columns: 1fr; }
  .interest-layout, .tracking-layout { grid-template-columns: 1fr; }
  .selection-panel { position: static; }
  .selected-list { min-height: 0; }
}

@media (max-width: 768px) {
  .topbar { height: 64px; padding: 0 16px; gap: 12px; }
  .brand { font-size: 18px; }
  .brand svg { width: 29px; }
  .mobile-menu { display: block; margin-left: auto; }
  .topnav { position: fixed; inset: 64px 0 auto 0; padding: 12px 16px 18px; display: none; flex-direction: column; gap: 3px; background: white; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .topnav[data-open="true"] { display: flex; }
  .topnav a { min-height: 46px; padding: 0 10px; border: 0; border-radius: 9px; }
  .topnav a[aria-current="page"] { background: var(--primary-soft); }
  .icon-button { margin-left: 0; padding: 8px 10px; }
  .icon-button span { display: none; }
  main { padding: 26px 16px 48px; }
  .page-head { align-items: start; flex-direction: column; }
  .hero { padding: 25px 20px; border-radius: 16px; gap: 25px; }
  .hero h1 { font-size: 39px; }
  .stats { grid-template-columns: 1fr; }
  .policy-grid, .topic-grid { grid-template-columns: 1fr; }
  .briefing-layout { grid-template-columns: 1fr; }
  .brief-index { display: none; }
  .compare-grid { grid-template-columns: 1fr; }
  .compare-grid > span { text-align: center; transform: rotate(90deg); }
  .stage-item { font-size: 11px; }
  .stage-dot { width: 30px; height: 30px; }
  .tracking-head { flex-direction: column; }
}

@media (max-width: 375px) {
  .brand b { display: none; }
  .hero h1 { font-size: 34px; }
  .button-row > * { width: 100%; }
  .card-actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media print {
  .topbar, .sidebar, .brief-index, .button-row, .toast { display: none !important; }
  .app-shell { display: block; }
  main { padding: 0; }
  .brief-card { border: 0; max-width: none; }
}
