:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --soft: #98a2b3;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --accent: #ff5358;
  --accent-deep: #e53b43;
  --accent-soft: #fff4f4;
  --positive: #169c55;
  --negative: #2563d9;
  --content: 1440px;
  --header-height: 68px;
  --radius: 12px;
  --shadow-dialog: 0 24px 80px rgba(16, 24, 40, 0.2);
  font-family: Pretendard, "SUIT Variable", SUIT, "Noto Sans KR", "Apple SD Gothic Neo", Inter, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { color: inherit; }
button, [data-post] { -webkit-tap-highlight-color: transparent; }
svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
img { display: block; max-width: 100%; }

.skip-link { position: fixed; top: 10px; left: 10px; z-index: 1000; transform: translateY(-200%); background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; text-decoration: none; }
.skip-link:focus { transform: translateY(0); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.content-width { width: min(var(--content), calc(100% - 64px)); margin-inline: auto; }

.site-header { height: var(--header-height); border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.96); position: sticky; top: 0; z-index: 50; backdrop-filter: blur(14px); }
.header-inner { height: 100%; width: min(1536px, calc(100% - 48px)); margin-inline: auto; display: flex; align-items: stretch; gap: 56px; }
.brand { border: 0; background: none; color: var(--accent); font-size: 28px; font-weight: 900; letter-spacing: -0.07em; cursor: pointer; padding: 0; }
.desktop-nav { display: flex; align-items: stretch; gap: 40px; }
.desktop-nav button { position: relative; border: 0; background: none; padding: 0 2px; font-size: 15px; font-weight: 700; cursor: pointer; }
.desktop-nav button::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--accent); transform: scaleX(0); transition: transform 180ms ease; }
.desktop-nav button:hover::after, .desktop-nav button.active::after { transform: scaleX(1); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-button, .save-button, .view-toggle button { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 0; background: transparent; border-radius: 9px; cursor: pointer; transition: color 160ms ease, background 160ms ease; }
.icon-button:hover, .save-button:hover { background: #f7f8fa; color: var(--accent); }
.login-button { height: 40px; display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; border-radius: 9px; padding: 0 8px; font-weight: 700; cursor: pointer; }
.login-button:hover { background: #f7f8fa; }
.header-search { margin: auto; width: min(520px, 38vw); height: 42px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 14px; }
.header-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 83, 88, 0.1); }
.header-search input { width: 100%; border: 0; outline: 0; font-size: 15px; color: var(--ink); }

.search-area { padding: 30px 0 18px; border-bottom: 1px solid var(--line); }
.search-box { height: 72px; display: grid; grid-template-columns: auto 1fr auto 84px; align-items: center; border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden; transition: border-color 160ms ease, box-shadow 160ms ease; }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 83, 88, 0.1); }
.search-leading { width: 64px; display: grid; place-items: center; color: var(--muted); }
.search-leading svg { width: 27px; height: 27px; }
.search-box input { min-width: 0; height: 100%; border: 0; outline: 0; font-size: 20px; font-weight: 500; color: var(--ink); }
.search-box input::placeholder { color: #8a93a1; }
.search-example { color: var(--soft); font-size: 14px; padding-right: 24px; white-space: nowrap; }
.clear-search { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: transparent; color: var(--soft); cursor: pointer; }
.search-submit { align-self: stretch; border: 0; color: #fff; background: var(--accent); display: grid; place-items: center; cursor: pointer; transition: background 160ms ease; }
.search-submit:hover { background: var(--accent-deep); }
.search-submit svg { width: 28px; height: 28px; }

.filter-rail { min-height: 62px; display: flex; align-items: center; gap: 28px; overflow-x: auto; scrollbar-width: none; }
.filter-rail::-webkit-scrollbar, .source-tabs::-webkit-scrollbar { display: none; }
.filter-group { display: flex; align-items: center; gap: 8px; flex: none; }
.filter-button { min-height: 38px; border: 1px solid transparent; background: transparent; padding: 0 14px; border-radius: 10px; color: #475467; font-size: 14px; font-weight: 650; white-space: nowrap; cursor: pointer; }
.filter-button:hover { color: var(--ink); background: #f8f9fb; }
.filter-button.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.filter-button.unavailable { color: var(--soft); cursor: help; }
.filter-count { min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 9px; color: var(--muted); background: #f2f4f7; font-size: 10px; font-weight: 750; }
.filter-button.active .filter-count { color: var(--accent); background: #ffe2e3; }
.category-more-button { display: inline-flex; align-items: center; gap: 5px; }
.category-more-button svg { width: 15px; height: 15px; }
.filter-rail.categories-expanded { align-items: flex-start; flex-wrap: wrap; overflow: visible; padding-block: 10px; }
.filter-rail.categories-expanded .category-group { flex: 1 1 70%; flex-wrap: wrap; }
.quick-actions { min-height: 48px; display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.quick-actions::-webkit-scrollbar { display: none; }
.quick-actions button { flex: none; min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: #344054; font-size: 12px; font-weight: 750; cursor: pointer; }
.quick-actions button:hover, .quick-actions button.active { color: var(--accent); border-color: #ffb8bb; background: var(--accent-soft); }
.live-dot { width: 6px; height: 6px; margin-left: 6px; display: inline-block; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(255, 83, 88, 0.12); }
.filter-separator { height: 22px; width: 1px; flex: none; background: var(--line-strong); }

.content-layout, .results-layout { display: grid; grid-template-columns: minmax(0, 1fr) 348px; }
.main-column { min-width: 0; padding-right: 40px; }
.side-column, .results-aside { border-left: 1px solid var(--line); padding: 30px 0 64px 32px; }
.feed-heading { min-height: 86px; display: flex; align-items: center; gap: 32px; border-bottom: 1px solid var(--line); }
.feed-heading h1 { flex: none; margin: 0; font-size: 23px; letter-spacing: -0.035em; }
.data-status { flex: none; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.data-status.live { color: var(--positive); }
.data-status.live i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(22, 156, 85, .1); }
.data-status.loading::before { content: ""; width: 11px; height: 11px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: status-spin .8s linear infinite; }
.data-status.retry { border: 0; background: transparent; color: var(--accent); cursor: pointer; padding: 0; }
.source-tabs { display: flex; align-items: center; gap: 18px; overflow-x: auto; margin-left: 4px; }
.source-tabs button { height: 34px; flex: none; border: 0; background: transparent; padding: 0; color: #475467; font-size: 13px; font-weight: 650; cursor: pointer; }
.source-tabs button.active, .source-tabs button:hover { color: var(--accent); }
.view-toggle { margin-left: auto; display: flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; flex: none; }
.view-toggle button { width: 38px; height: 36px; border-radius: 0; color: var(--muted); }
.view-toggle button + button { border-left: 1px solid var(--line); }
.view-toggle button.active { color: var(--accent); background: var(--accent-soft); }
.saved-count { margin: 18px 0 0; color: var(--muted); font-size: 14px; }
.active-filter-bar { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.active-filter-bar strong { color: var(--ink); }
.active-filter-bar button { border: 0; background: transparent; color: var(--accent); font-size: 12px; font-weight: 750; cursor: pointer; }

.post-row { position: relative; display: grid; grid-template-columns: 38px minmax(0, 1fr) 156px 36px; gap: 16px; align-items: center; min-height: 140px; padding: 18px 0; border-bottom: 1px solid var(--line); cursor: pointer; content-visibility: auto; contain-intrinsic-size: 140px; }
.post-row.no-media { grid-template-columns: 38px minmax(0, 1fr) 36px; }
.post-row::before { content: ""; position: absolute; left: -16px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--accent); opacity: 0; transform: scaleY(.5); transition: opacity 160ms ease, transform 160ms ease; }
.post-row:hover::before, .post-row:focus::before { opacity: 1; transform: scaleY(1); }
.post-row:focus { outline: 0; }
.rank { align-self: start; margin-top: 8px; width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: #f1f3f5; font-size: 13px; font-weight: 800; }
.rank.top { color: #fff; background: var(--accent); }
.post-body { min-width: 0; align-self: center; }
.post-meta { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.post-meta > span:not(:last-child)::after { content: "·"; margin-left: 9px; color: var(--line-strong); }
.source-name { color: var(--ink); font-size: 13px; }
.source-name.youtube { color: #e62929; }
.category-link { margin-left: auto; color: #2563d9; font-weight: 700; }
.post-row h3 { margin: 0; font-size: 16px; line-height: 1.45; letter-spacing: -0.025em; }
.post-row p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-metrics { display: flex; align-items: center; gap: 16px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.post-metrics span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.post-metrics svg { width: 16px; height: 16px; }
.post-media { width: 156px; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 9px; background: #f2f4f7; position: relative; }
.post-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
.post-row:hover .post-media img { transform: scale(1.025); }
.video-media { aspect-ratio: 16 / 9; }
.play-button { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: rgba(16, 24, 40, .78); color: #fff; }
.play-button .play-icon { fill: currentColor; stroke: none; }
.duration { position: absolute; right: 6px; bottom: 5px; padding: 2px 5px; border-radius: 4px; background: rgba(0, 0, 0, .78); color: #fff; font-size: 10px; }
.save-button { align-self: start; margin-top: 2px; color: #475467; }
.save-button.saved { color: var(--accent); }
.save-button .filled { fill: currentColor; stroke: currentColor; }
.channel-name { display: inline-block; margin-top: 7px; color: #475467; font-size: 12px; font-weight: 650; }

.thumbnail-view.feed { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.thumbnail-view .post-row { grid-template-columns: 30px minmax(0, 1fr) 34px; grid-template-rows: auto auto; align-items: start; padding: 22px 0; }
.thumbnail-view .post-body { grid-column: 2 / 3; grid-row: 2; padding-top: 12px; }
.thumbnail-view .post-media { grid-column: 1 / 4; grid-row: 1; width: 100%; aspect-ratio: 16 / 8.5; }
.thumbnail-view .rank { grid-column: 1; grid-row: 2; }
.thumbnail-view .save-button { grid-column: 3; grid-row: 2; }
.thumbnail-view .category-link { display: none; }
.thumbnail-view .ad-slot { grid-column: 1 / -1; }

.ad-slot { min-height: 88px; margin: 10px 0; display: flex; align-items: center; justify-content: center; gap: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--soft); background: #fcfcfd; }
.ad-slot span { padding: 3px 6px; border: 1px solid var(--line-strong); border-radius: 4px; font-size: 9px; }
.ad-slot p { margin: 0; font-size: 11px; }
.feed-skeleton { padding: 4px 0; }
.feed-skeleton > div { min-height: 126px; padding: 20px 0; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; border-bottom: 1px solid var(--line); }
.feed-skeleton i, .feed-skeleton span, .feed-skeleton em { display: block; border-radius: 7px; background: linear-gradient(90deg, #f2f4f7 25%, #fafafa 50%, #f2f4f7 75%); background-size: 200% 100%; animation: skeleton-wave 1.35s infinite linear; }
.feed-skeleton i { width: 32px; height: 32px; border-radius: 50%; }
.feed-skeleton span { height: 18px; margin-top: 3px; }
.feed-skeleton em { grid-column: 2; width: 72%; height: 12px; margin-top: -48px; }

.summary-panel { border-bottom: 1px solid var(--line); padding-bottom: 26px; }
.summary-heading { width: 100%; display: flex; align-items: center; justify-content: space-between; border: 0; background: transparent; padding: 0 0 18px; text-align: left; font-size: 20px; font-weight: 800; letter-spacing: -0.035em; cursor: pointer; }
.summary-heading svg { width: 18px; height: 18px; }
.summary-lead { margin: 0; color: #344054; font-size: 14px; line-height: 1.75; word-break: keep-all; }
.summary-caveat { margin-top: 18px; padding: 12px 14px; border-radius: 9px; color: #475467; background: #f7f8fa; font-size: 12px; line-height: 1.55; }
.sentiment-block { margin-top: 22px; }
.sentiment-labels { display: flex; justify-content: space-between; color: #475467; font-size: 12px; }
.sentiment-labels .positive { color: var(--positive); }
.sentiment-labels .negative { color: var(--negative); }
.sentiment-bar { height: 7px; margin-top: 9px; display: flex; gap: 2px; overflow: hidden; border-radius: 6px; }
.sentiment-bar span { display: block; }
.positive-bar { width: 64%; background: var(--positive); }
.neutral-bar { width: 23%; background: #c7ccd5; }
.negative-bar { width: 13%; background: var(--negative); }
.themes, .source-temperature { margin-top: 25px; }
.themes h3, .source-temperature h3 { margin: 0 0 11px; font-size: 14px; }
.theme-row { width: 100%; min-height: 42px; display: grid; grid-template-columns: 29px 1fr 18px; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; padding: 0 10px; margin-top: 7px; border-radius: 8px; font-size: 12px; font-weight: 700; text-align: left; cursor: pointer; }
.theme-row:hover, .theme-row.active { border-color: var(--accent); background: var(--accent-soft); }
.theme-row svg { width: 16px; height: 16px; justify-self: end; }
.theme-index { color: var(--accent); font-size: 10px; letter-spacing: .04em; }
.temp-row { display: grid; grid-template-columns: 84px minmax(80px, 1fr) 35px; align-items: center; gap: 8px; min-height: 31px; font-size: 11px; }
.temp-track { height: 5px; overflow: hidden; border-radius: 6px; background: #ebeff5; }
.temp-track i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.temp-row:nth-child(5) .temp-track i { background: #6291e9; }
.temp-row em { color: var(--accent); font-style: normal; text-align: right; }
.trending-panel { padding-top: 28px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.panel-title h2 { margin: 0; font-size: 18px; letter-spacing: -0.03em; }
.panel-title > span { display: inline-flex; align-items: center; gap: 5px; color: var(--soft); font-size: 9px; }
.panel-title svg { width: 13px; height: 13px; }
.trending-panel button { width: 100%; min-height: 38px; display: grid; grid-template-columns: 26px 1fr auto; align-items: center; border: 0; background: transparent; padding: 0; text-align: left; cursor: pointer; }
.trending-panel button:hover span { color: var(--accent); }
.trending-panel strong { font-size: 13px; }
.trending-panel span { font-size: 12px; }
.trending-panel em { color: var(--accent); font-style: normal; font-size: 11px; }
.trend-empty { margin: 12px 0 0; color: var(--muted); font-size: 12px; }

.issue-topic-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: -4px 0 22px; }
.issue-topic-list button { min-width: 0; min-height: 48px; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: #fff; text-align: left; cursor: pointer; }
.issue-topic-list button:hover { border-color: #ffb8bb; background: var(--accent-soft); }
.issue-topic-list span { color: var(--accent); font-size: 10px; font-weight: 800; }
.issue-topic-list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.issue-topic-list em { color: var(--muted); font-size: 10px; font-style: normal; }
.issue-topic-list .issue-topic-copy { min-width: 0; display: grid; gap: 2px; color: var(--ink); }
.issue-topic-copy small { color: var(--accent); font-size: 9px; font-weight: 800; }
.issue-topic-copy strong { display: block; color: var(--ink); }

.search-results-page { padding: 28px 0 70px; }
.results-layout { grid-template-columns: minmax(0, 1fr) 460px; align-items: start; }
.results-main { min-width: 0; padding-right: 34px; }
.results-title { padding: 0 0 22px; }
.results-title h1 { margin: 0; font-size: 29px; letter-spacing: -0.045em; }
.results-title p { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.result-controls { height: 54px; display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.result-tabs { align-self: stretch; display: flex; gap: 36px; }
.result-tabs button { position: relative; border: 0; background: transparent; padding: 0; font-size: 14px; font-weight: 750; cursor: pointer; }
.result-tabs button::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--accent); transform: scaleX(0); transition: transform 160ms ease; }
.result-tabs button.active { color: var(--accent); }
.result-tabs button.active::after { transform: scaleX(1); }
.result-tabs span { font-weight: 600; }
.sort-controls { margin-left: auto; display: flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.sort-controls button { height: 34px; border: 0; background: #fff; padding: 0 13px; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.sort-controls button + button { border-left: 1px solid var(--line); }
.sort-controls button.active { color: var(--accent); background: var(--accent-soft); }
.results-main .post-row { grid-template-columns: minmax(0, 1fr) 180px 38px; min-height: 145px; padding: 18px 0; }
.results-main .post-row.no-media { grid-template-columns: minmax(0, 1fr) 38px; }
.results-main .post-media { width: 180px; }
.results-aside { padding-top: 0; padding-left: 30px; position: sticky; top: 96px; }
.results-aside .summary-panel { border: 1px solid var(--line-strong); border-radius: 12px; padding: 24px; }
.results-aside .summary-heading { font-size: 18px; }
.results-aside .summary-lead { font-size: 13px; }
.summary-note { display: flex; gap: 8px; margin: 24px -24px -24px; padding: 16px 24px; border-top: 1px solid var(--line); color: var(--soft); font-size: 10px; line-height: 1.6; }
.summary-note svg { width: 16px; height: 16px; flex: none; }
.load-more { width: 100%; height: 45px; margin-top: 18px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; font-size: 12px; font-weight: 700; cursor: pointer; }
.load-more:hover { border-color: var(--accent); color: var(--accent); }
.load-more svg { width: 14px; height: 14px; vertical-align: middle; margin-left: 4px; }
.mobile-search, .mobile-summary { display: none; }

.empty-state { min-height: 420px; display: grid; place-content: center; justify-items: center; text-align: center; }
.empty-state > span { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.empty-state > span svg { width: 24px; height: 24px; }
.empty-state h2 { margin: 18px 0 0; font-size: 19px; }
.empty-state p { margin: 8px 0 20px; color: var(--muted); font-size: 13px; }
.empty-state button { height: 40px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; padding: 0 17px; font-size: 13px; font-weight: 750; cursor: pointer; }

.bottom-nav { display: none; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 200; transform: translate(-50%, 18px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 9px; box-shadow: 0 10px 28px rgba(16, 24, 40, .2); font-size: 13px; transition: opacity 180ms ease, transform 180ms ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.dialog-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; background: rgba(16, 24, 40, .48); animation: fade-in 150ms ease; }
body.dialog-open { overflow: hidden; }
.detail-dialog { position: relative; width: min(560px, 100%); max-height: min(760px, calc(100vh - 48px)); overflow-y: auto; border-radius: 16px; background: #fff; padding: 28px; box-shadow: var(--shadow-dialog); }
.dialog-close { position: absolute; right: 18px; top: 18px; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: #f5f6f8; cursor: pointer; }
.dialog-source { color: var(--accent); font-size: 12px; font-weight: 750; }
.detail-dialog h2 { margin: 10px 42px 18px 0; font-size: 23px; line-height: 1.4; letter-spacing: -0.035em; }
.detail-dialog > img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; }
.detail-dialog > p { color: #475467; font-size: 14px; line-height: 1.75; }
.dialog-actions { display: flex; gap: 9px; margin-top: 22px; }
.dialog-actions button, .dialog-actions a { flex: 1; min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; border-radius: 9px; font-weight: 750; cursor: pointer; text-decoration: none; }
.dialog-actions .secondary { border: 1px solid var(--line-strong); background: #fff; }
.dialog-actions .primary { border: 0; background: var(--accent); color: #fff; }
.dialog-actions .primary.disabled { opacity: .55; cursor: not-allowed; }
.dialog-actions svg { width: 15px; height: 15px; vertical-align: middle; }
.detail-dialog small { display: block; margin-top: 15px; color: var(--soft); line-height: 1.6; }

.reader-shell { position: fixed; inset: 0; z-index: 300; display: grid; grid-template-rows: 58px minmax(0, 1fr); background: #fff; animation: fade-in 120ms ease; }
body.reader-open { overflow: hidden; padding-bottom: 0; }
.reader-toolbar { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-width: 0; padding: 0 16px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .98); box-shadow: 0 2px 10px rgba(16, 24, 40, .06); }
.reader-back { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 9px; background: #f5f6f8; color: var(--ink); cursor: pointer; }
.reader-back svg { width: 18px; height: 18px; transform: rotate(180deg); }
.reader-title { min-width: 0; display: grid; gap: 2px; }
.reader-title strong { color: var(--accent); font-size: 11px; line-height: 1.2; }
.reader-title span { overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.reader-direct { min-height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.reader-frame-wrap { position: relative; min-height: 0; background: #f7f8fa; }
.reader-frame { position: relative; z-index: 2; width: 100%; height: 100%; display: block; border: 0; background: #fff; }
.reader-loading { position: absolute; inset: 0; z-index: 1; display: grid; place-content: center; justify-items: center; gap: 9px; color: var(--muted); text-align: center; }
.reader-loading i { width: 24px; height: 24px; border: 3px solid #eceef2; border-top-color: var(--accent); border-radius: 50%; animation: status-spin .8s linear infinite; }
.reader-loading strong { color: var(--ink); font-size: 14px; }
.reader-loading span { padding: 0 24px; font-size: 11px; }
.reader-frame-wrap.loaded .reader-loading { display: none; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes status-spin { to { transform: rotate(360deg); } }
@keyframes skeleton-wave { to { background-position: -200% 0; } }

@media (max-width: 1180px) {
  :root { --content: 1080px; }
  .content-layout { grid-template-columns: minmax(0, 1fr) 310px; }
  .results-layout { grid-template-columns: minmax(0, 1fr) 360px; }
  .header-inner { gap: 34px; }
  .desktop-nav { gap: 26px; }
  .source-tabs { gap: 18px; }
  .post-row { grid-template-columns: 34px minmax(0, 1fr) 140px 34px; }
  .post-media { width: 140px; }
}

@media (max-width: 900px) {
  :root { --header-height: 50px; }
  body { padding-bottom: 54px; }
  .content-width, .header-inner { width: min(100% - 34px, 720px); }
  .site-header { position: relative; }
  .header-inner { justify-content: space-between; }
  .brand { font-size: 21px; }
  .desktop-nav, .login-button span, .header-search { display: none; }
  .header-actions { margin-left: 0; }
  .header-actions .login-button { display: none; }
  .icon-button { width: 34px; height: 34px; }
  .icon-button svg { width: 19px; height: 19px; }
  .search-area { padding: 12px 0 0; }
  .search-box { height: 48px; grid-template-columns: auto 1fr auto 48px; }
  .search-leading { width: 42px; }
  .search-leading svg { width: 19px; height: 19px; }
  .search-box input { font-size: 14px; }
  .search-example { display: none; }
  .filter-rail { display: block; min-height: 78px; margin-right: 0; padding-right: 0; overflow: visible; }
  .filter-separator { display: none; }
  .filter-group { width: 100%; min-height: 39px; gap: 2px; overflow-x: auto; scrollbar-width: none; }
  .filter-group::-webkit-scrollbar { display: none; }
  .category-group { border-top: 1px solid var(--line); border-left: 0; padding-left: 0; }
  .filter-rail.categories-expanded { margin-right: 0; padding-right: 0; }
  .filter-rail.categories-expanded .category-group { padding-block: 10px; overflow: visible; }
  .filter-button { min-height: 29px; padding: 0 8px; border-radius: 8px; font-size: 11px; }
  .filter-count { min-width: 16px; height: 16px; margin-left: 4px; padding-inline: 4px; font-size: 9px; }
  .quick-actions { min-height: 40px; margin-right: -17px; padding-right: 17px; gap: 6px; }
  .quick-actions button { min-height: 28px; padding: 0 10px; border-radius: 14px; font-size: 11px; }
  .content-layout, .results-layout { display: block; }
  .main-column, .results-main { padding-right: 0; }
  .side-column, .results-aside { display: none; }
  .feed-heading { min-height: auto; padding: 20px 0 0; display: grid; grid-template-columns: 1fr auto; gap: 12px; }
  .feed-heading h1 { font-size: 21px; }
  .feed-heading .data-status { grid-column: 1; grid-row: 2; justify-self: start; }
  .source-tabs { grid-column: 1 / -1; grid-row: 3; margin: 0 -17px; padding: 0 17px; gap: 14px; border-top: 1px solid var(--line); height: 42px; }
  .source-tabs button { height: 32px; font-size: 11.5px; }
  .view-toggle { grid-column: 2; grid-row: 1 / span 2; align-self: start; }
  .post-row { grid-template-columns: 34px minmax(0, 1fr) 132px 34px; min-height: 132px; gap: 12px; }
  .post-row.no-media { grid-template-columns: 34px minmax(0, 1fr) 34px; }
  .post-media { width: 132px; }
  .bottom-nav { position: fixed; inset: auto 0 0; z-index: 60; height: 54px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); background: rgba(255, 255, 255, .97); backdrop-filter: blur(14px); }
  .bottom-nav button { display: grid; place-content: center; justify-items: center; gap: 1px; border: 0; background: transparent; color: #344054; font-size: 9px; font-weight: 750; cursor: pointer; }
  .bottom-nav button.active { color: var(--accent); }
  .bottom-nav svg { width: 18px; height: 18px; }
  .toast { bottom: 66px; }
  .search-results-page { padding: 14px 0 40px; }
  .mobile-search { display: block; }
  .search-box.compact { height: 46px; margin-bottom: 16px; }
  .results-title h1 { font-size: 25px; }
  .results-title p { font-size: 13px; }
  .result-controls { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .97); }
  .result-tabs { width: 100%; justify-content: space-between; gap: 0; }
  .sort-controls { display: none; }
  .mobile-summary { display: block; }
  .mobile-summary .summary-panel { margin: 0 -17px; padding: 26px 17px; border-bottom: 1px solid var(--line); background: #fff; }
  .mobile-summary .summary-heading { font-size: 19px; }
  .mobile-summary .themes, .mobile-summary .source-temperature, .mobile-summary .summary-note { display: none; }
  .mobile-summary .sentiment-block { max-width: 100%; }
  .results-main .post-row { grid-template-columns: minmax(0, 1fr) 144px 34px; }
  .results-main .post-media { width: 144px; }
  .issue-topic-list { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
}

@media (max-width: 620px) {
  .content-width, .header-inner { width: calc(100% - 32px); }
  .header-inner { width: calc(100% - 32px); }
  .icon-button { width: 32px; }
  .search-area { border-bottom: 0; }
  .search-box { border-radius: 11px; }
  .search-submit { display: none; }
  .search-box { grid-template-columns: auto 1fr auto; }
  .filter-rail { margin-inline: -16px; padding-inline: 0; border-bottom: 1px solid var(--line); }
  .filter-rail .filter-group { padding-inline: 16px; }
  .quick-actions { margin-inline: -16px; padding-inline: 16px; }
  .source-tabs, .mobile-summary .summary-panel { margin-inline: -16px; }
  .issue-topic-list { grid-template-columns: 1fr 1fr; gap: 6px; }
  .issue-topic-list button { min-height: 42px; grid-template-columns: 20px minmax(0, 1fr); padding: 0 9px; }
  .issue-topic-list em { display: none; }
  .feed-heading { padding-top: 18px; }
  .active-filter-bar { min-height: 40px; }
  .feed-heading h1 { font-size: 20px; }
  .view-toggle button { width: 36px; }
  .post-row { grid-template-columns: minmax(0, 1fr) 112px 28px; gap: 10px; padding: 18px 0; min-height: 130px; }
  .post-row.no-media { grid-template-columns: minmax(0, 1fr) 28px; }
  .post-row .rank { display: none; }
  .post-row::before { left: -9px; }
  .post-media { width: 112px; }
  .post-meta { margin-bottom: 7px; }
  .category-link { display: none; }
  .post-row h3 { font-size: 15px; line-height: 1.45; }
  .post-row p { font-size: 12px; -webkit-line-clamp: 2; }
  .post-metrics { gap: 11px; margin-top: 9px; font-size: 11px; }
  .post-metrics svg { width: 14px; height: 14px; }
  .save-button { width: 28px; height: 34px; }
  .thumbnail-view.feed { grid-template-columns: 1fr; }
  .thumbnail-view .post-row { grid-template-columns: minmax(0, 1fr) 34px; }
  .thumbnail-view .post-media { grid-column: 1 / 3; }
  .thumbnail-view .post-body { grid-column: 1; }
  .thumbnail-view .save-button { grid-column: 2; }
  .ad-slot { min-height: 72px; }
  .results-title { padding-bottom: 13px; }
  .results-title h1 { font-size: 24px; line-height: 1.35; }
  .result-controls { margin-inline: -16px; padding-inline: 16px; }
  .result-tabs button { font-size: 13px; }
  .mobile-summary .summary-lead { font-size: 13px; line-height: 1.7; }
  .results-main .post-row { grid-template-columns: minmax(0, 1fr) 112px 28px; }
  .results-main .post-row.no-media { grid-template-columns: minmax(0, 1fr) 28px; }
  .results-main .post-media { width: 112px; }
  .results-main .post-row.video-row { grid-template-columns: minmax(0, 1fr) 130px 28px; }
  .results-main .video-row .post-media { width: 130px; }
  .results-main .post-metrics span:first-child { display: none; }
  .summary-labels { font-size: 11px; }
  .detail-dialog { padding: 22px; }
  .detail-dialog h2 { font-size: 20px; }
  .dialog-backdrop { padding: 12px; align-items: end; }
  .detail-dialog { width: 100%; max-height: 88vh; border-radius: 16px 16px 8px 8px; }
  .reader-shell { grid-template-rows: 50px minmax(0, 1fr); }
  .reader-toolbar { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 7px; padding: 0 10px; }
  .reader-back { width: 32px; height: 32px; }
  .reader-title strong { font-size: 10px; }
  .reader-title span { font-size: 12px; }
  .reader-direct { min-height: 30px; padding-inline: 9px; font-size: 10px; }
}

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