:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f0f3f8;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #5b45ff;
  --brand-2: #795cff;
  --hot: #ff4d67;
  --up: #e8384f;
  --down: #4f7cff;
  --shadow: 0 18px 60px rgba(29, 36, 58, 0.08);
}

body.dark {
  --bg: #0d1017;
  --surface: #151a23;
  --surface-2: #1d2430;
  --text: #f4f6fb;
  --muted: #9ca3af;
  --line: #2a3240;
  --shadow: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
button, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.shell {
  width: min(1160px, calc(100% - 36px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: 72px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; width: fit-content; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  color: white; font-weight: 900;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 20px rgba(91, 69, 255, .28);
}
.brand strong { display: block; font-size: 18px; letter-spacing: -0.04em; }
.brand small { display: block; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; }

.top-nav { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 14px; }
.nav-item {
  border: 0; background: transparent; color: var(--muted);
  padding: 9px 16px; border-radius: 10px; font-weight: 800;
}
.nav-item.active { background: var(--surface); color: var(--brand); box-shadow: 0 2px 10px rgba(0,0,0,.06); }

.icon-button {
  justify-self: end;
  width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--text);
}

.hero {
  min-height: 290px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  padding-top: 42px;
  padding-bottom: 30px;
}
.eyebrow {
  margin: 0 0 14px; color: var(--brand); font-size: 13px; font-weight: 900; letter-spacing: .08em;
}
.hero h1 { margin: 0; font-size: clamp(38px, 5vw, 62px); line-height: 1.06; letter-spacing: -0.06em; }
.hero h1 span {
  background: linear-gradient(100deg, var(--brand), #ab55ff 60%, #ff5d8f);
  -webkit-background-clip: text; color: transparent;
}
.hero-copy { margin: 18px 0 0; max-width: 610px; color: var(--muted); font-size: 16px; line-height: 1.75; }

.hero-card {
  min-width: 210px; padding: 26px; border-radius: 24px;
  background: linear-gradient(145deg, #13152b, #211c56);
  color: white; box-shadow: var(--shadow);
}
.hero-card > span { font-size: 11px; font-weight: 900; letter-spacing: .15em; color: #a99dff; }
.hero-card strong { display: block; font-size: 56px; line-height: 1; margin: 10px 0 6px; }
.hero-card small { color: #babbd0; }
.pulse { width: 10px; height: 10px; background: #38e49d; border-radius: 50%; float: right; box-shadow: 0 0 0 8px rgba(56,228,157,.12); }

.controls { margin-bottom: 18px; }
.filter-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip, .select {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 800;
}
.chip.active { border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--surface)); }

.dashboard { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.ranking-panel, .side-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.ranking-panel { padding: 24px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.section-kicker { color: var(--brand); font-size: 12px; font-weight: 900; }
.section-head h2 { margin: 3px 0 0; font-size: 24px; letter-spacing: -.04em; }
.updated { font-size: 12px; color: var(--muted); }

.rank-item {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 18px 4px;
  border-top: 1px solid var(--line);
}
.rank-num { font-size: 24px; font-weight: 950; text-align: center; }
.rank-num.top { color: var(--brand); }
.post-title { font-size: 16px; font-weight: 850; letter-spacing: -.02em; line-height: 1.45; margin-bottom: 8px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 12px; color: var(--muted); font-size: 12px; }
.source { color: var(--text); font-weight: 800; }
.category { color: var(--brand); font-weight: 800; }
.rank-change { min-width: 44px; text-align: right; font-size: 12px; font-weight: 900; }
.rank-change.up { color: var(--up); }
.rank-change.down { color: var(--down); }
.rank-change.new { color: var(--brand); }

.side-panel { display: grid; gap: 18px; }
.side-card { padding: 20px; }
.side-title { display: flex; justify-content: space-between; align-items: start; margin-bottom: 15px; }
.side-title span { color: var(--muted); font-size: 11px; font-weight: 800; }
.side-title h3 { margin: 3px 0 0; font-size: 19px; }
.mini-badge { color: var(--hot)!important; background: color-mix(in srgb, var(--hot) 12%, transparent); padding: 5px 8px; border-radius: 8px; }

.community-list { list-style: none; padding: 0; margin: 0; }
.community-row { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; padding: 11px 0; border-top: 1px solid var(--line); }
.community-rank { color: var(--muted); font-weight: 900; }
.community-name { font-weight: 800; }
.community-score { font-size: 12px; color: var(--muted); }

.topic-card { border-top: 1px solid var(--line); padding: 15px 0 2px; }
.topic-count { color: var(--hot)!important; font-weight: 900!important; }
.topic-card h4 { margin: 7px 0 6px; font-size: 15px; }
.topic-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.topic-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.topic-tags span, .topic-tags a {
  background: var(--surface-2);
  padding: 5px 7px;
  border-radius: 7px;
  font-size: 10px;
  color: var(--text);
  text-decoration: none;
}
.topic-tags a:hover { color: var(--brand); }
.topic-keywords { margin: 8px 0 0!important; color: var(--brand)!important; font-weight: 800; }

.empty { padding: 46px 10px; text-align: center; color: var(--muted); }

footer { border-top: 1px solid var(--line); margin-top: 50px; background: var(--surface); }
.footer-inner { padding: 34px 0; display: flex; justify-content: space-between; gap: 30px; color: var(--muted); font-size: 12px; }
.footer-inner strong { color: var(--text); font-size: 15px; }
.footer-inner p { margin: 6px 0 0; }

@media (max-width: 900px) {
  .header-inner { grid-template-columns: 1fr auto; }
  .top-nav { order: 3; grid-column: 1 / -1; overflow-x: auto; margin-bottom: 8px; }
  .site-header { padding-bottom: 8px; }
  .hero { padding-top: 84px; min-height: 350px; }
  .dashboard { grid-template-columns: 1fr; }
  .side-panel { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .shell { width: min(100% - 24px, 1160px); }
  .hero { align-items: flex-start; flex-direction: column; padding-top: 92px; }
  .hero-card { width: 100%; }
  .filter-row { align-items: stretch; flex-direction: column; }
  .select { width: 100%; }
  .ranking-panel { padding: 15px; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .rank-item { grid-template-columns: 36px minmax(0,1fr) 38px; padding: 16px 0; }
  .rank-num { font-size: 18px; }
  .post-title { font-size: 14px; }
  .side-panel { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }
}
.filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.archive-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.archive-controls[hidden] { display: none; }
.archive-select { min-width: 190px; }
.archive-latest {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--brand);
  border-radius: 12px;
  padding: 10px 13px;
  font-weight: 900;
}
.archive-latest:hover {
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
}
@media (max-width: 760px) {
  .filter-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }
  .archive-controls {
    width: 100%;
  }
  .archive-select {
    flex: 1;
    min-width: 0;
  }
}

.hot-delta {
  color: var(--hot)!important;
  font-weight: 900;
}
.nav-item[data-period="rising"].active {
  color: var(--hot);
}

.active-keyword {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line));
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--brand);
  font-weight: 900;
}
.active-keyword[hidden] { display: none; }
.active-keyword button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.keyword-list {
  display: grid;
  gap: 2px;
}
.keyword-row {
  width: 100%;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 9px 4px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
}
.keyword-row:hover,
.keyword-row.active {
  background: color-mix(in srgb, var(--brand) 7%, transparent);
}
.keyword-rank {
  color: var(--muted);
  font-weight: 900;
  font-size: 12px;
  text-align: center;
}
.keyword-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 850;
  font-size: 13px;
}
.keyword-meta {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.kw-change {
  min-width: 34px;
  text-align: right;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}
.kw-change.up { color: var(--up); }
.kw-change.down { color: var(--down); }
.kw-change.new { color: var(--brand); }

@media (max-width: 640px) {
  .keyword-row {
    grid-template-columns: 22px minmax(0, 1fr) auto;
  }
  .keyword-meta { display: none; }
}

.community-link { text-decoration: none; }
.community-link:hover { color: var(--brand); }

.community-header {
  grid-template-columns: 1fr auto 1fr;
}
.community-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.community-breadcrumb a:hover { color: var(--brand); }

.community-hero {
  padding: 46px 0 26px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}
.community-hero h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 64px);
  letter-spacing: -.06em;
}
.community-hero p:not(.eyebrow) {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}
.community-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
  min-width: 330px;
}
.community-stat-grid > div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}
.community-stat-grid strong {
  display: block;
  font-size: 22px;
  letter-spacing: -.03em;
}
.community-stat-grid span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
.community-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.community-tabs { width: fit-content; }
.back-to-all {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.back-to-all:hover { color: var(--brand); }

.community-dashboard {
  display: grid;
  grid-template-columns: minmax(0,1fr) 310px;
  gap: 22px;
  align-items: start;
}
.source-keyword-list { display: grid; }
.source-keyword {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 10px 2px;
}
.source-keyword:hover,
.source-keyword.active {
  background: color-mix(in srgb, var(--brand) 7%, transparent);
}
.source-keyword span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}
.source-keyword strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.source-keyword small {
  color: var(--muted);
  font-size: 10px;
}
.community-guide p {
  margin: 0;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

@media (max-width: 900px) {
  .community-header { grid-template-columns: 1fr auto; }
  .community-breadcrumb { grid-column: 1 / -1; }
  .community-hero { align-items: stretch; flex-direction: column; padding-top: 80px; }
  .community-stat-grid { min-width: 0; width: 100%; }
  .community-dashboard { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .community-toolbar { align-items: stretch; flex-direction: column; }
  .community-tabs { width: 100%; }
  .community-tabs .nav-item { flex: 1; }
  .community-stat-grid { grid-template-columns: 1fr 1fr; }
}

.header-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}
.global-search {
  display: flex;
  align-items: center;
  height: 40px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.global-search input {
  width: 108px;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 0 2px 0 12px;
  font-size: 12px;
}
.global-search input::placeholder { color: var(--muted); }
.global-search button {
  width: 36px;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  font-weight: 900;
}
.global-search:focus-within {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
}
.global-search:focus-within input { width: 155px; }

.search-header {
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr minmax(280px, 560px) 1fr;
  align-items: center;
  gap: 22px;
}
.global-search-wide {
  width: 100%;
  height: 44px;
}
.global-search-wide input {
  flex: 1;
  width: auto!important;
  padding-left: 14px;
  font-size: 14px;
}
.global-search-wide button {
  width: auto;
  padding: 0 16px;
  background: var(--brand);
  color: white;
  font-size: 12px;
}

.search-hero {
  padding: 54px 0 24px;
}
.search-hero h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 62px);
  letter-spacing: -.06em;
}
.search-hero p:not(.eyebrow) {
  max-width: 650px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.search-controls {
  margin-bottom: 18px;
}
.search-main-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.search-main-form input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 11px 13px;
  font-size: 16px;
}
.search-main-form button {
  border: 0;
  border-radius: 12px;
  background: var(--brand);
  color: white;
  padding: 0 22px;
  font-weight: 900;
}
.search-filter-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.search-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  align-items: start;
}
.search-result-card {
  display: grid;
  grid-template-columns: 42px minmax(0,1fr);
  gap: 13px;
  padding: 18px 4px;
  border-top: 1px solid var(--line);
}
.search-result-rank {
  padding-top: 3px;
  color: var(--muted);
  font-weight: 950;
  text-align: center;
}
.search-result-title {
  display: block;
  margin: 7px 0 9px;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 850;
  letter-spacing: -.02em;
}
.search-result-title:hover { color: var(--brand); }
.search-result-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.search-result-badges span {
  padding: 4px 7px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}
.search-result-badges .live-result {
  background: color-mix(in srgb, var(--hot) 10%, var(--surface));
  color: var(--hot);
}
.search-result-meta { line-height: 1.6; }
.search-empty { padding: 70px 15px; }
.load-more {
  width: 100%;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  padding: 12px;
  font-weight: 850;
}
.search-stats {
  display: grid;
  gap: 0;
}
.search-stats div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.search-stats strong {
  font-size: 20px;
}
.search-stats span {
  color: var(--muted);
  font-size: 11px;
}
.search-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 4px;
}
.search-keywords a {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  border-radius: 9px;
  background: var(--surface-2);
  padding: 7px 9px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 850;
}
.search-keywords a span {
  color: var(--muted);
  font-size: 9px;
}

@media (max-width: 980px) {
  .global-search:not(.global-search-wide) input { display: none; }
  .global-search:not(.global-search-wide) { width: 40px; }
  .global-search:not(.global-search-wide) button { width: 40px; }
  .search-header { grid-template-columns: 1fr minmax(200px, 1fr) auto; }
  .search-layout { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .search-header {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 10px 0;
  }
  .search-header .brand { grid-column: 1; }
  .search-header .global-search-wide {
    order: 3;
    grid-column: 1 / -1;
  }
  .search-hero { padding-top: 28px; }
  .search-filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .search-filter-row .select:last-child { grid-column: 1 / -1; }
  .search-main-form button { padding: 0 16px; }
  .search-result-card { grid-template-columns: 30px minmax(0,1fr); }
  .search-result-title { font-size: 14px; }
}

/* Homepage portal dashboard */
.portal-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
  margin-top: -34px;
  margin-bottom: 22px;
  position: relative;
  z-index: 3;
}
.portal-card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 20px;
}
.portal-today { grid-column: span 7; }
.portal-rising { grid-column: span 5; }
.portal-communities { grid-column: span 5; }
.portal-keywords { grid-column: span 3; }
.portal-topics { grid-column: span 4; }

.portal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.portal-head > div > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
}
.portal-head h2 {
  margin: 3px 0 0;
  font-size: 19px;
  letter-spacing: -.035em;
}
.portal-jump {
  border: 0;
  background: transparent;
  color: var(--brand);
  padding: 2px 0;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.portal-jump:hover { text-decoration: underline; }

.portal-feature-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.portal-feature-item {
  min-width: 0;
  min-height: 150px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  padding: 15px;
  display: grid;
  grid-template-columns: 28px minmax(0,1fr);
  gap: 9px;
  align-items: start;
}
.portal-feature-item:first-child {
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
  background: color-mix(in srgb, var(--brand) 6%, var(--surface-2));
}
.portal-feature-rank {
  color: var(--brand);
  font-size: 24px;
  line-height: 1;
  font-weight: 950;
}
.portal-source {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}
.portal-feature-item a {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.5;
}
.portal-feature-item a:hover { color: var(--brand); }
.portal-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 9px;
}

.portal-mini-list { display: grid; }
.portal-mini-item {
  display: grid;
  grid-template-columns: 24px minmax(0,1fr) 34px;
  align-items: center;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding: 9px 0;
}
.portal-mini-item:first-child { border-top: 0; }
.portal-mini-rank {
  color: var(--hot);
  font-size: 15px;
  font-weight: 950;
  text-align: center;
}
.portal-mini-body { min-width: 0; }
.portal-mini-body a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 850;
}
.portal-mini-body a:hover { color: var(--brand); }
.portal-mini-body span {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 9px;
}
.portal-mini-item > strong {
  color: var(--hot);
  font-size: 12px;
  text-align: right;
}

.portal-community-list { margin: 0; padding: 0; }
.portal-community-row {
  grid-template-columns: 22px minmax(0,1fr) auto;
  padding: 9px 0;
}
.community-champion { min-width: 0; }
.community-champion .community-name {
  display: inline-block;
  font-size: 12px;
}
.community-top-title {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 10px;
}
.community-top-title:hover { color: var(--brand); }
.portal-community-row .community-score {
  font-size: 9px;
  white-space: nowrap;
}

.portal-keyword-list,
.portal-topic-list {
  max-height: 320px;
  overflow: auto;
  scrollbar-width: thin;
}
.portal-keyword-list .keyword-row {
  grid-template-columns: 20px minmax(0,1fr) auto;
  padding: 8px 2px;
}
.portal-keyword-list .keyword-meta { display: none; }
.portal-topic-list .topic-card { padding-top: 11px; }
.portal-topic-list .topic-card h4 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 13px;
}
.portal-topic-list .topic-keywords { font-size: 10px!important; }
.portal-topic-list .topic-tags { margin-top: 7px; }
.portal-topic-list .topic-tags a:nth-child(n+4) { display: none; }

.quick-panel { display: grid; }
.quick-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 13px 0;
  text-align: left;
  text-decoration: none;
}
.quick-link strong { font-size: 12px; }
.quick-link span {
  color: var(--muted);
  font-size: 9px;
}
.quick-link:hover strong,
.quick-link:hover span { color: var(--brand); }
.quick-button { font: inherit; cursor: pointer; }

.source-shortcuts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.source-shortcuts a {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  padding: 9px 8px;
  text-align: center;
  font-size: 10px;
  font-weight: 850;
}
.source-shortcuts a:hover {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
  color: var(--brand);
}

@media (max-width: 1020px) {
  .portal-grid { grid-template-columns: repeat(2, minmax(0,1fr)); margin-top: -20px; }
  .portal-today,
  .portal-rising,
  .portal-communities,
  .portal-keywords { grid-column: span 1; }
  .portal-topics { grid-column: 1 / -1; }
  .portal-feature-list { grid-template-columns: 1fr; }
  .portal-feature-item { min-height: 0; }
}

@media (max-width: 640px) {
  .portal-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: -10px;
  }
  .portal-today,
  .portal-rising,
  .portal-communities,
  .portal-keywords,
  .portal-topics { grid-column: 1; }
  .portal-card { padding: 15px; border-radius: 17px; }
  .portal-feature-list { grid-template-columns: 1fr; }
  .portal-feature-item {
    min-height: 0;
    grid-template-columns: 26px minmax(0,1fr);
  }
  .portal-keyword-list,
  .portal-topic-list { max-height: 270px; }
}

/* Post detail analysis */
.post-detail-hero {
  padding: 54px 0 24px;
}
.post-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 18px 0 10px;
}
.post-detail-meta span {
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 6px 9px;
  font-size: 10px;
  font-weight: 850;
}
.post-detail-hero h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.2;
  letter-spacing: -.055em;
}
.post-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 12px;
  font-weight: 900;
}
.primary-action {
  background: var(--brand);
  color: #fff;
}
.secondary-action {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}
.primary-action:hover { filter: brightness(.96); }
.secondary-action:hover { color: var(--brand); }

.detail-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.detail-stat {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 17px;
}
.detail-stat span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}
.detail-stat strong {
  display: block;
  margin-top: 5px;
  font-size: 25px;
  letter-spacing: -.04em;
}
.detail-stat small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0,1fr) 300px;
  gap: 22px;
  align-items: start;
}
.detail-main {
  display: grid;
  gap: 18px;
}
.detail-chart-card { min-width: 0; }
.trend-chart {
  min-height: 240px;
  width: 100%;
  overflow-x: auto;
}
.trend-chart svg {
  display: block;
  width: 100%;
  min-width: 560px;
  height: auto;
}
.chart-axis {
  stroke: var(--line);
  stroke-width: 1.2;
}
.chart-grid {
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 4 6;
}
.chart-line {
  stroke: var(--brand);
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart-dot {
  fill: var(--surface);
  stroke: var(--brand);
  stroke-width: 2;
}
.chart-label {
  fill: var(--muted);
  font-size: 10px;
}
.metric-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.metric-tab {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 7px 11px;
  font-size: 10px;
  font-weight: 900;
}
.metric-tab.active {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
  background: color-mix(in srgb, var(--brand) 9%, var(--surface));
  color: var(--brand);
}
.detail-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.detail-keywords a {
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--brand);
  padding: 7px 9px;
  font-size: 11px;
  font-weight: 850;
}
.detail-info-list {
  margin: 0;
}
.detail-info-list > div {
  display: grid;
  grid-template-columns: 78px minmax(0,1fr);
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}
.detail-info-list dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}
.detail-info-list dd {
  margin: 0;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}
.related-rank-item .rank-num {
  font-size: 18px;
}

@media (max-width: 900px) {
  .detail-stat-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .post-detail-hero { padding-top: 34px; }
  .post-detail-hero h1 { font-size: 29px; }
  .detail-stat-grid { grid-template-columns: 1fr 1fr; }
  .detail-stat { padding: 13px; }
  .detail-stat strong { font-size: 21px; }
  .trend-chart { min-height: 205px; }
  .trend-chart svg { min-width: 500px; }
}

/* Cross-community issue analysis */
.issue-hero {
  padding: 54px 0 24px;
}
.issue-hero h1 {
  max-width: 900px;
  margin: 8px 0 0;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.18;
  letter-spacing: -.055em;
}
.issue-hero > p {
  max-width: 780px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}
.issue-hero-keywords { margin-top: 16px; }
.issue-stat-grid { margin-bottom: 20px; }

.topic-title-link {
  color: inherit;
  text-decoration: none;
}
.topic-title-link:hover { color: var(--brand); }

.issue-source-list { display: grid; }
.issue-source-row {
  display: grid;
  grid-template-columns: 24px minmax(0,1fr) auto;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 10px 0;
}
.issue-source-row > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}
.issue-source-row a,
.issue-source-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}
.issue-source-row a:hover { color: var(--brand); }
.issue-source-row small {
  color: var(--muted);
  font-size: 9px;
}

.reaction-table {
  display: grid;
  overflow-x: auto;
}
.reaction-head,
.reaction-row {
  min-width: 600px;
  display: grid;
  grid-template-columns: minmax(150px,1fr) 70px 95px 95px 95px;
  gap: 8px;
  align-items: center;
  padding: 11px 8px;
  border-top: 1px solid var(--line);
  font-size: 11px;
}
.reaction-head {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
}
.reaction-row {
  color: var(--text);
  text-decoration: none;
}
.reaction-row:hover {
  background: color-mix(in srgb, var(--brand) 5%, transparent);
}
.reaction-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reaction-row span {
  color: var(--muted);
  text-align: right;
}
.reaction-head span:not(:first-child) { text-align: right; }

@media (max-width: 640px) {
  .issue-hero { padding-top: 34px; }
  .issue-hero h1 { font-size: 30px; }
  .issue-stat-grid { grid-template-columns: 1fr 1fr; }
}

/* Issue ranking archive */
.nav-anchor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 8px 11px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}
.nav-anchor:hover {
  background: var(--surface-2);
  color: var(--brand);
}

.issue-rank-hero {
  padding: 56px 0 26px;
}
.issue-rank-hero h1 {
  margin: 0;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.08;
  letter-spacing: -.065em;
}
.issue-rank-hero h1 span { color: var(--brand); }
.issue-rank-hero > p:not(.eyebrow) {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.issue-rank-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.issue-rank-tabs { width: fit-content; }

.issue-rank-layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) 300px;
  gap: 22px;
  align-items: start;
}

.issue-top-cards {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 10px;
  margin: 4px 0 16px;
}
.issue-rank-feature {
  position: relative;
  min-width: 0;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
  color: var(--text);
  padding: 16px;
  text-decoration: none;
  overflow: hidden;
}
.issue-rank-feature.rank-1 {
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
  background:
    radial-gradient(circle at 85% 15%, color-mix(in srgb, var(--brand) 15%, transparent), transparent 42%),
    var(--surface-2);
}
.issue-rank-feature:hover {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  transform: translateY(-1px);
}
.issue-rank-number {
  color: var(--brand);
  font-size: 34px;
  line-height: 1;
  font-weight: 950;
}
.issue-rank-feature-body > span {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
}
.issue-rank-feature-body > strong {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 7px;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  font-size: 15px;
  line-height: 1.45;
}
.issue-card-keywords,
.issue-row-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}
.issue-card-keywords em,
.issue-row-keywords span {
  border-radius: 7px;
  background: var(--surface);
  color: var(--brand);
  padding: 4px 6px;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}
.issue-score-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--hot) 10%, var(--surface));
  color: var(--hot);
  padding: 6px 8px;
  font-size: 10px;
  font-weight: 950;
}

.issue-ranking-list { display: grid; }
.issue-rank-row {
  display: grid;
  grid-template-columns: 48px minmax(0,1fr) auto;
  gap: 13px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 17px 4px;
}
.issue-rank-row-body { min-width: 0; }
.issue-rank-row .post-title {
  display: block;
  margin-bottom: 7px;
}
.issue-row-keywords { margin-top: 8px; }
.issue-row-keywords span { background: var(--surface-2); }

.issue-home-link {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--text);
  text-decoration: none;
}
.issue-home-link strong { font-size: 14px; }
.issue-home-link span {
  color: var(--muted);
  font-size: 10px;
}
.issue-home-link:hover strong,
.issue-home-link:hover span { color: var(--brand); }

@media (max-width: 900px) {
  .issue-rank-layout { grid-template-columns: 1fr; }
  .issue-top-cards { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 720px) {
  .issue-rank-controls {
    align-items: stretch;
    flex-direction: column;
  }
  .issue-rank-tabs { width: 100%; }
  .issue-rank-tabs .nav-item { flex: 1; }
  .issue-rank-controls .archive-controls { width: 100%; }
}

@media (max-width: 640px) {
  .issue-rank-hero { padding-top: 34px; }
  .issue-rank-hero h1 { font-size: 38px; }
  .issue-top-cards { grid-template-columns: 1fr; }
  .issue-rank-feature { min-height: 0; }
  .issue-rank-row { grid-template-columns: 34px minmax(0,1fr) auto; }
}

.nav-link-item {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.issue-rank-hero {
  padding: 54px 0 24px;
}
.issue-rank-hero h1 {
  margin: 0;
  font-size: clamp(38px,6vw,64px);
  letter-spacing: -.06em;
  line-height: 1.05;
}
.issue-rank-hero h1 span { color: var(--brand); }
.issue-rank-hero > p:not(.eyebrow) {
  max-width: 700px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}
.issue-rank-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.issue-rank-tabs { width: fit-content; }
.issue-rank-layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) 300px;
  gap: 22px;
  align-items: start;
}
.issue-top-cards {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.issue-rank-feature {
  position: relative;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--text);
  padding: 16px;
  text-decoration: none;
}
.issue-rank-feature.rank-1 {
  border-color: color-mix(in srgb,var(--brand) 35%,var(--line));
  background: color-mix(in srgb,var(--brand) 7%,var(--surface-2));
}
.issue-rank-number {
  color: var(--brand);
  font-size: 28px;
  font-weight: 950;
}
.issue-rank-feature-body > span {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}
.issue-rank-feature-body strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  margin-top: 7px;
  font-size: 14px;
  line-height: 1.5;
}
.issue-card-keywords,
.issue-row-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}
.issue-card-keywords em,
.issue-row-keywords span {
  font-style: normal;
  border-radius: 7px;
  background: var(--surface);
  color: var(--brand);
  padding: 4px 6px;
  font-size: 9px;
  font-weight: 850;
}
.issue-score-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  min-width: 34px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  padding: 5px 8px;
  text-align: center;
  font-size: 10px;
  font-weight: 900;
}
.issue-ranking-list { display: grid; }
.issue-rank-row {
  display: grid;
  grid-template-columns: 50px minmax(0,1fr) auto;
  gap: 14px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 18px 4px;
}
.issue-rank-row-body { min-width: 0; }
.issue-rank-row .post-title { display: block; }
.issue-home-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}
.issue-home-link span {
  color: var(--muted);
  font-size: 10px;
}
.issue-home-link:hover { color: var(--brand); }

@media (max-width: 900px) {
  .issue-rank-layout { grid-template-columns: 1fr; }
  .issue-top-cards { grid-template-columns: 1fr; }
  .issue-rank-feature { min-height: 0; }
}
@media (max-width: 640px) {
  .issue-rank-hero { padding-top: 34px; }
  .issue-rank-controls { align-items: stretch; flex-direction: column; }
  .issue-rank-tabs { width: 100%; }
  .issue-rank-tabs .nav-item { flex: 1; }
  .issue-rank-row { grid-template-columns: 36px minmax(0,1fr) auto; }
}

/* Daily internet briefing */
.briefing-hero {
  padding: 54px 0 26px;
}
.briefing-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
}
.briefing-title-row h1 {
  margin: 0;
  font-size: clamp(38px,6vw,64px);
  letter-spacing: -.06em;
  line-height: 1.05;
}
.briefing-title-row p {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}
.briefing-stats {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 10px;
  margin-top: 22px;
}
.briefing-stats > div {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 14px 16px;
}
.briefing-stats strong {
  display: block;
  font-size: 24px;
}
.briefing-stats span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}
.briefing-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 18px;
}
.briefing-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 20px;
}
.briefing-highlights {
  grid-column: 1 / -1;
}
.briefing-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}
.briefing-card-head > div > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
}
.briefing-card-head h2 {
  margin: 3px 0 0;
  font-size: 20px;
  letter-spacing: -.04em;
}
.briefing-card-head > a {
  color: var(--brand);
  font-size: 10px;
  font-weight: 900;
}
.brief-highlight-list {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 10px;
}
.brief-highlight {
  display: grid;
  grid-template-columns: 28px minmax(0,1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-2);
  color: var(--text);
  padding: 14px;
}
.brief-highlight > span {
  color: var(--brand);
  font-size: 22px;
  font-weight: 950;
}
.brief-highlight strong {
  display: block;
  font-size: 13px;
  line-height: 1.45;
}
.brief-highlight p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}
.brief-highlight:hover strong { color: var(--brand); }

.brief-list-row {
  display: grid;
  grid-template-columns: 28px minmax(0,1fr);
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 10px 2px;
}
.brief-rank {
  color: var(--muted);
  font-weight: 950;
  text-align: center;
}
.brief-rank.hot { color: var(--hot); }
.brief-list-row a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}
.brief-list-row a:hover { color: var(--brand); }
.brief-list-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}
.briefing-keywords {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 7px;
}
.briefing-keywords a {
  display: grid;
  grid-template-columns: 22px minmax(0,1fr) auto;
  gap: 7px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  padding: 9px;
}
.briefing-keywords a > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}
.briefing-keywords strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--brand);
  font-size: 11px;
}
.briefing-keywords small {
  color: var(--muted);
  font-size: 9px;
}

@media (max-width: 900px) {
  .briefing-grid { grid-template-columns: 1fr; }
  .briefing-highlights { grid-column: 1; }
  .brief-highlight-list { grid-template-columns: 1fr; }
  .briefing-title-row { align-items: stretch; flex-direction: column; }
}
@media (max-width: 640px) {
  .briefing-hero { padding-top: 34px; }
  .briefing-stats { grid-template-columns: 1fr 1fr; }
  .briefing-keywords { grid-template-columns: 1fr; }
}

/* Accessibility and resilient navigation */
button,
[role="button"] { cursor: pointer; }

.top-nav {
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.top-nav::-webkit-scrollbar { display: none; }
.nav-item {
  flex: 0 0 auto;
  white-space: nowrap;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent);
  outline-offset: 2px;
}

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

/* Operations dashboard */
.admin-header-title {
  justify-self: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
}
.admin-hero {
  padding: 48px 0 24px;
}
.admin-hero h1 {
  margin: 0;
  font-size: clamp(36px,5vw,58px);
  letter-spacing: -.055em;
}
.admin-hero > p:not(.eyebrow) {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}
.admin-status-grid {
  display: grid;
  grid-template-columns: repeat(6,minmax(0,1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.admin-stat {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 14px;
}
.admin-stat span,
.admin-stat small {
  display: block;
  color: var(--muted);
  font-size: 9px;
}
.admin-stat strong {
  display: block;
  margin: 5px 0 3px;
  font-size: 22px;
  letter-spacing: -.04em;
}
.admin-layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) 320px;
  gap: 22px;
  align-items: start;
}
.admin-main {
  display: grid;
  gap: 18px;
}
.admin-table {
  overflow-x: auto;
}
.admin-table-head,
.admin-table-row {
  min-width: 640px;
  display: grid;
  grid-template-columns: minmax(160px,1fr) minmax(220px,1.3fr) 90px 100px;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 11px 6px;
}
.admin-table-head {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
}
.admin-table-row {
  font-size: 11px;
}
.admin-table-row strong {
  font-size: 12px;
}
.admin-table-row small {
  display: block;
  max-width: 240px;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 9px;
}
.admin-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 9px;
  font-weight: 900;
}
.admin-pill.ok {
  background: color-mix(in srgb, #23b26d 12%, var(--surface));
  color: #1c9a5d;
}
.admin-pill.cache {
  background: color-mix(in srgb, #e59a16 13%, var(--surface));
  color: #bd7b0c;
}
.admin-pill.warn {
  background: color-mix(in srgb, #e34d59 12%, var(--surface));
  color: #cc3443;
}
.diagnostic-list {
  display: grid;
}
.diagnostic-row {
  display: grid;
  grid-template-columns: 30px minmax(0,1fr);
  gap: 10px;
  align-items: start;
  border-top: 1px solid var(--line);
  padding: 11px 4px;
}
.diagnostic-row > span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
}
.diagnostic-row.ok > span {
  background: color-mix(in srgb, #23b26d 12%, var(--surface));
  color: #1c9a5d;
}
.diagnostic-row.warn > span {
  background: color-mix(in srgb, #e34d59 12%, var(--surface));
  color: #cc3443;
}
.diagnostic-row strong {
  font-size: 12px;
}
.diagnostic-row p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}
.admin-volume-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 9px;
}
.admin-volume-grid > div {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  padding: 12px;
}
.admin-volume-grid span {
  display: block;
  color: var(--muted);
  font-size: 9px;
}
.admin-volume-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 19px;
}
.workflow-list {
  display: grid;
}
.workflow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 10px 0;
  color: var(--text);
}
.workflow-row strong {
  display: block;
  font-size: 11px;
}
.workflow-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}
.analytics-connection strong {
  display: block;
  color: var(--muted);
  font-size: 18px;
}
.analytics-connection p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}
@media (max-width: 1080px) {
  .admin-status-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-volume-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .admin-hero { padding-top: 34px; }
  .admin-status-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .admin-header-title { display: none; }
}

.analytics-setup-list {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.75;
}
.analytics-setup-list code {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9px;
}
.analytics-action {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, var(--brand) 7%, var(--surface));
  color: var(--brand);
  padding: 10px;
  text-align: center;
  font-size: 10px;
  font-weight: 900;
}
.analytics-action:hover {
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
}
.analytics-on {
  color: #1c9a5d!important;
}

/* My Commurank */
.my-hero {
  padding: 54px 0 24px;
}
.my-hero h1 {
  margin: 0;
  font-size: clamp(38px,6vw,62px);
  letter-spacing: -.06em;
}
.my-hero > p:not(.eyebrow) {
  max-width: 760px;
  margin: 13px 0 0;
  color: var(--muted);
  line-height: 1.7;
}
.my-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.my-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 18px;
}
.my-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.my-card-head > div > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
}
.my-card-head h2 {
  margin: 3px 0 0;
  font-size: 18px;
}
.my-text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 3px;
  font-size: 10px;
  font-weight: 850;
}
.my-text-button:hover { color: var(--brand); }

.my-keyword-form {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 7px;
}
.my-keyword-form input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--text);
  outline: 0;
  padding: 10px 11px;
}
.my-keyword-form button {
  border: 0;
  border-radius: 11px;
  background: var(--brand);
  color: #fff;
  padding: 0 15px;
  font-weight: 900;
}
.my-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}
.my-chip {
  border: 1px solid color-mix(in srgb,var(--brand) 22%,var(--line));
  border-radius: 999px;
  background: color-mix(in srgb,var(--brand) 7%,var(--surface));
  color: var(--brand);
  padding: 7px 10px;
  font-size: 10px;
  font-weight: 850;
}
.my-chip span { color: var(--muted); }

.my-source-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 7px;
}
.my-source-choice {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  padding: 10px;
  text-align: left;
}
.my-source-choice strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
.my-source-choice span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}
.my-source-choice.active {
  border-color: color-mix(in srgb,var(--brand) 38%,var(--line));
  background: color-mix(in srgb,var(--brand) 8%,var(--surface));
}
.my-source-choice.active strong,
.my-source-choice.active span { color: var(--brand); }

.my-summary-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 9px;
  margin-bottom: 18px;
}
.my-summary-grid article {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 13px;
}
.my-summary-grid strong {
  display: block;
  font-size: 22px;
}
.my-summary-grid span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.my-layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) 300px;
  gap: 22px;
  align-items: start;
}
.my-main {
  display: grid;
  gap: 18px;
}
.my-match {
  color: var(--brand)!important;
  font-weight: 900;
}
.my-empty {
  padding: 56px 10px;
}
.my-recent-list {
  display: grid;
}
.my-recent-row {
  display: block;
  border-top: 1px solid var(--line);
  padding: 10px 0;
  color: var(--text);
}
.my-recent-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
.my-recent-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}
.my-recent-row:hover strong { color: var(--brand); }

@media (max-width: 900px) {
  .my-settings-grid { grid-template-columns: 1fr; }
  .my-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .my-hero { padding-top: 34px; }
  .my-source-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .my-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

.my-hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.my-notification-status {
  color: var(--muted);
  font-size: 10px;
}
.my-summary-grid {
  grid-template-columns: repeat(5,minmax(0,1fr));
}
.my-new-stat {
  border-color: color-mix(in srgb,var(--hot) 28%,var(--line))!important;
}
.my-new-stat strong {
  color: var(--hot);
}
.my-new-badge {
  display: inline-flex!important;
  align-items: center;
  border-radius: 999px;
  background: color-mix(in srgb,var(--hot) 12%,var(--surface));
  color: var(--hot)!important;
  padding: 2px 6px;
  font-size: 8px!important;
  font-weight: 950!important;
}
[data-pwa-install][hidden] {
  display: none!important;
}
@media (max-width: 900px) {
  .my-summary-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .my-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .my-hero-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .my-hero-actions .primary-action,
  .my-hero-actions .secondary-action {
    width: 100%;
  }
}


/* 2026-09 launch polish */
.analysis-link {
  color: var(--brand);
  font-weight: 850;
  text-decoration: none;
}
.analysis-link:hover { text-decoration: underline; }

@media (min-width: 901px) and (max-width: 1180px) {
  .header-inner {
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    gap: 12px;
  }
  .top-nav {
    min-width: 0;
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
  }
  .top-nav::-webkit-scrollbar { display: none; }
  .nav-item {
    flex: 0 0 auto;
    padding: 9px 10px;
    font-size: 14px;
    white-space: nowrap;
  }
  .header-actions { gap: 6px; }
  .global-search:not(.global-search-wide) {
    width: 40px;
    flex: 0 0 40px;
  }
  .global-search:not(.global-search-wide) input { display: none; }
  .global-search:not(.global-search-wide) button { width: 40px; }
}


/* Ranking navigation and live source health */
.source-link:hover { color: var(--brand); }
.outbound-link {
  color: var(--muted);
  font-weight: 850;
}
.outbound-link:hover { color: var(--brand); text-decoration: underline; }
.updated strong.stale {
  color: var(--hot);
}
.source-shortcuts a.source-unavailable,
.source-shortcuts a.source-cached {
  position: relative;
  padding-right: 34px;
}
.source-shortcuts a.source-unavailable::after,
.source-shortcuts a.source-cached::after {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  padding: 2px 5px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 950;
  line-height: 1.3;
}
.source-shortcuts a.source-unavailable::after {
  content: "점검";
  color: var(--hot);
  background: color-mix(in srgb, var(--hot) 10%, var(--surface));
}
.source-shortcuts a.source-cached::after {
  content: "캐시";
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
}
.source-shortcuts a.source-unavailable {
  color: var(--muted);
}


/* Trust and policy pages */
.info-hero { padding: 58px 0 24px; }
.info-hero h1 { margin: 0; font-size: clamp(36px, 6vw, 58px); letter-spacing: -.055em; line-height: 1.12; }
.info-hero p:not(.eyebrow) { max-width: 760px; margin: 14px 0 0; color: var(--muted); line-height: 1.75; }
.info-layout { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 22px; align-items: start; padding-bottom: 36px; }
.info-main { display: grid; gap: 14px; }
.info-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 24px; }
.info-card h2 { margin: 0 0 12px; font-size: 21px; letter-spacing: -.035em; }
.info-card h3 { margin: 22px 0 8px; font-size: 16px; }
.info-card p, .info-card li { color: var(--muted); font-size: 14px; line-height: 1.8; }
.info-card p { margin: 9px 0; }
.info-card ul, .info-card ol { margin: 8px 0 0; padding-left: 22px; }
.info-note { border-left: 3px solid var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--surface)); padding: 13px 15px; border-radius: 10px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.info-side { position: sticky; top: 92px; }
.info-nav { display: grid; gap: 8px; }
.info-nav a { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 11px 12px; font-size: 12px; font-weight: 850; }
.info-nav a:hover, .info-nav a.active { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.footer-policy-links { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-left: auto; }
.footer-policy-links a { color: var(--muted); font-size: 11px; font-weight: 800; }
.footer-policy-links a:hover { color: var(--brand); }
.error-page { min-height: calc(100vh - 170px); display: grid; place-items: center; padding: 50px 0; }
.error-card { width: min(680px, 100%); border: 1px solid var(--line); border-radius: 26px; background: var(--surface); box-shadow: var(--shadow); padding: 42px; text-align: center; }
.error-code { color: var(--brand); font-size: clamp(68px, 13vw, 120px); font-weight: 950; line-height: .9; letter-spacing: -.07em; }
.error-card h1 { margin: 18px 0 8px; font-size: 28px; }
.error-card p { color: var(--muted); line-height: 1.7; }
.error-actions { margin-top: 22px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
@media (max-width: 800px) {
  .info-layout { grid-template-columns: 1fr; }
  .info-side { position: static; order: -1; }
  .info-nav { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .info-hero { padding-top: 34px; }
  .info-card { padding: 18px; border-radius: 16px; }
  .footer-policy-links { margin-left: 0; }
  .error-card { padding: 28px 18px; }
}


/* SEO ranking archive pages */
.ranking-archive-hero h1 span { color: var(--brand); }
.archive-page-nav { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 18px; }
.archive-page-nav a { color: var(--brand); font-size: 12px; font-weight: 900; }
.ranking-seo-layout { padding-bottom: 38px; }
.archive-index-list { display: grid; }
.archive-index-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding: 14px 2px; }
.archive-index-row:first-child { border-top: 0; }
.archive-index-row strong { font-size: 14px; }
.archive-index-row span { color: var(--brand); font-size: 11px; font-weight: 850; }
.archive-index-row:hover strong { color: var(--brand); }
.archive-period-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.archive-period-grid a { display: grid; gap: 5px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); padding: 18px; }
.archive-period-grid strong { font-size: 20px; color: var(--text); }
.archive-period-grid span { color: var(--muted); font-size: 11px; }
.archive-period-grid a:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.archive-period-grid a:hover strong { color: var(--brand); }
@media (max-width: 640px) {
  .archive-period-grid { grid-template-columns: 1fr; }
  .ranking-seo-layout .ranking-panel { padding: 14px; }
}
