/* Design tokens */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-muted: #fbfcfe;
  --line: #d9dee7;
  --text: #18202d;
  --muted: #667085;
  --accent: #1f6f5b;
  --accent-strong: #15513f;
  --accent-warm: #a66a1f;
  --accent-warm-soft: #fff4df;
  --danger: #ad3434;
  --focus: #2454a6;
  --shadow: 0 10px 24px rgba(16, 24, 40, 0.07);
  --shadow-header: 0 1px 0 rgba(16, 24, 40, 0.02);
  --shadow-subtle: 0 1px 2px rgba(16, 24, 40, 0.04);
  --info-border: #bdd8ce;
  --info-bg: #eef7f4;
  --info-text: #24443a;
  --media-fallback-bg: #f2f6f4;
  --media-fallback-wash: rgba(31, 111, 91, 0.08);
  --media-fallback-warm: rgba(166, 106, 31, 0.1);
  --media-fallback-line: rgba(31, 111, 91, 0.045);
  --media-fallback-text: #31594b;
  --warning-border: #eed3a1;
  --warning-bg: #fff8ea;
  --warning-text: #5e4211;
  --content-max: 1120px;
  --wide-content-max: 1240px;
  --article-max: 880px;
}

/* Base layout */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, "Malgun Gothic", sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

a:hover {
  color: var(--accent-strong);
}

:focus-visible {
  outline: 3px solid rgba(36, 84, 166, 0.38);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header and navigation */
.site-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px clamp(16px, 4vw, 40px) 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: var(--shadow-header);
}

.site-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.site-brand-row {
  display: grid;
  grid-template-columns: max-content minmax(260px, 420px);
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(16px, 4vw, 40px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-header);
}

.admin-surface main {
  width: min(var(--wide-content-max), 100%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(21, 81, 63, 0.12);
}

.site-logo {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.brand-logo {
  display: block;
  width: clamp(168px, 19vw, 224px);
  height: auto;
  max-height: 50px;
  object-fit: contain;
}

.site-header .brand {
  font-size: 1.35rem;
  font-weight: 800;
}

.site-header .brand-mark {
  width: 34px;
  height: 34px;
}

nav {
  display: flex;
  gap: 12px;
}

.section-nav {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

.section-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 14px;
  text-decoration: none;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}

.section-nav a:hover {
  color: var(--accent-strong);
  border-bottom-color: var(--accent);
}

.section-nav a:focus-visible {
  outline-offset: -3px;
}

.admin-header nav a,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  text-decoration: none;
  background: var(--surface);
  color: var(--text);
  line-height: 1.35;
  white-space: nowrap;
}

.site-header .search {
  width: min(420px, 100%);
}

main {
  width: min(var(--content-max), 100%);
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 40px) 48px;
}

/* Shared forms and controls */
.search,
.filters,
.inline-form,
.admin-login form {
  display: flex;
  gap: 8px;
}

.search input {
  min-width: 0;
  flex: 1;
}

input,
select,
button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
}

input,
select {
  background: var(--surface);
  color: var(--text);
}

button,
.button {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
}

button:hover,
.button:hover {
  background: var(--accent-strong);
}

.button.ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

button.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}

button.danger {
  background: var(--danger);
  border-color: var(--danger);
}

button.danger:hover {
  background: #8f2525;
  border-color: #8f2525;
}

/* Shared page layout */
.toolbar-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.news-front {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* News front and dashboard */
.front-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 2px solid var(--text);
  padding-bottom: 12px;
}

.front-hero[hidden] {
  display: none;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 800;
}

.hero-copy {
  margin: 8px 0 0;
  color: var(--muted);
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.hero-points li {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 4px 9px;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.35;
}

.hero-points li:first-child {
  border-color: #ead1a4;
  background: var(--accent-warm-soft);
  color: #6f4c05;
}

.hero-visual {
  width: clamp(140px, 18vw, 220px);
  flex: 0 0 auto;
  align-self: center;
}

.hero-visual img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-subtle);
}

.front-status .live-status {
  margin-top: -8px;
}

.live-status {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) repeat(2, max-content) minmax(260px, 1.15fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--info-border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--info-bg);
  color: var(--info-text);
}

.live-status div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.live-status .status-main {
  min-width: 0;
}

.live-status .status-metric {
  min-width: 68px;
}

.live-status strong {
  color: var(--accent-strong);
}

.live-status span,
.live-status p {
  margin: 0;
  font-size: 0.92rem;
}

.scope-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar-section + .scope-tabs {
  margin-bottom: 12px;
}

.scope-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
  background: var(--surface);
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
}

.scope-tab.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.metric-card,
.region-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  box-shadow: var(--shadow-subtle);
}

.metric-card span,
.region-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.metric-card strong,
.region-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.55rem;
  line-height: 1.15;
}

.news-lead {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.8fr);
  gap: 20px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}

.lead-story {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.list-image {
  aspect-ratio: 5 / 3;
}

.lead-image {
  aspect-ratio: 2.25 / 1;
}

.lead-image.is-broken {
  aspect-ratio: 3 / 1;
}

.card-image {
  aspect-ratio: 16 / 9;
}

.image-link,
.lead-image-link,
.list-thumb {
  display: block;
  min-width: 0;
  text-decoration: none;
}

/* Article media */
.article-media {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--media-fallback-bg);
  color: var(--media-fallback-text);
  isolation: isolate;
}

.article-media[data-media-theme="election"] {
  --media-fallback-wash: rgba(217, 159, 45, 0.13);
  --media-fallback-warm: rgba(31, 111, 91, 0.08);
  --media-fallback-line: rgba(166, 106, 31, 0.06);
}

.article-media[data-media-theme="candidate"] {
  --media-fallback-wash: rgba(45, 84, 116, 0.1);
  --media-fallback-warm: rgba(31, 111, 91, 0.08);
  --media-fallback-line: rgba(45, 84, 116, 0.055);
}

.article-media[data-media-theme="policy"] {
  --media-fallback-wash: rgba(31, 111, 91, 0.09);
  --media-fallback-warm: rgba(166, 106, 31, 0.09);
  --media-fallback-line: rgba(31, 111, 91, 0.055);
}

.article-media[data-media-theme="local"] {
  --media-fallback-wash: rgba(42, 91, 67, 0.1);
  --media-fallback-warm: rgba(112, 130, 92, 0.08);
  --media-fallback-line: rgba(42, 91, 67, 0.055);
}

.article-media[data-media-theme="civic"] {
  --media-fallback-wash: rgba(77, 91, 124, 0.08);
  --media-fallback-warm: rgba(166, 106, 31, 0.08);
  --media-fallback-line: rgba(77, 91, 124, 0.05);
}

.article-media img {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-media img[hidden] {
  display: none;
}

.media-fallback {
  position: absolute;
  inset: 0;
  display: block;
  padding: 14px;
  background:
    linear-gradient(135deg, var(--media-fallback-wash), var(--media-fallback-warm) 62%, rgba(255, 255, 255, 0) 100%),
    repeating-linear-gradient(135deg, var(--media-fallback-line) 0, var(--media-fallback-line) 1px, transparent 1px, transparent 18px),
    var(--media-fallback-bg);
  opacity: 0;
  transition: opacity 120ms ease;
}

.article-media.is-broken .media-fallback {
  opacity: 1;
}

.media-fallback span,
.media-fallback strong {
  display: block;
  max-width: 85%;
}

.media-fallback span {
  color: var(--media-fallback-text);
  font-size: 0.78rem;
  font-weight: 700;
}

.media-fallback strong {
  position: absolute;
  left: 14px;
  bottom: 12px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.25;
}

.lead-image .media-fallback,
.detail-image .media-fallback {
  padding: 16px;
}

.detail-image .media-fallback strong {
  font-size: 1.05rem;
}

.list-image .media-fallback {
  padding: 10px;
}

.list-image .media-fallback span {
  font-size: 0.72rem;
}

.list-image .media-fallback strong {
  left: 10px;
  bottom: 9px;
  font-size: 0.82rem;
}

.lead-copy h2,
.article-list-item h3 {
  margin: 6px 0 8px;
  line-height: 1.28;
}

.article-list-item h2 {
  margin: 6px 0 8px;
  font-size: 1.15rem;
  line-height: 1.35;
}

.lead-copy h2 {
  max-width: 92%;
  font-size: 1.95rem;
}

.lead-copy a,
.article-list-item a {
  text-decoration: none;
}

.lead-copy p,
.article-list-item p,
.lead-copy .article-summary,
.article-list-item .article-summary {
  margin: 0;
  color: #344054;
}

.article-summary p {
  margin: 0;
}

.article-summary p + p::before {
  content: "\A";
  white-space: pre;
}

.lead-copy .article-summary,
.card .article-summary {
  color: #344054;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.lead-copy .article-summary {
  max-width: 72ch;
  line-height: 1.6;
}

.archive-list {
  border-top: 2px solid var(--text);
}

.archive-item h2 a {
  text-decoration: none;
}

.news-lead.front-main-rank {
  display: block;
  border-bottom: 0;
  padding-bottom: 0;
}

.front-main-rank .lead-story {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  border-bottom: 2px solid var(--text);
  padding-bottom: 10px;
}

.front-main-rank .lead-image {
  aspect-ratio: 2.25 / 1;
}

.secondary-rank-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.secondary-rank-item {
  min-width: 0;
  border-top: 2px solid var(--text);
  padding-top: 10px;
}

.secondary-rank-image {
  aspect-ratio: 16 / 9;
}

.secondary-rank-item h3,
.third-rank-item h3 {
  margin: 8px 0 0;
  line-height: 1.32;
}

.secondary-rank-item h3 a,
.third-rank-item h3 a {
  display: -webkit-box;
  overflow: hidden;
  text-decoration: none;
  -webkit-box-orient: vertical;
}

.secondary-rank-item h3 a {
  -webkit-line-clamp: 2;
}

.third-rank-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
  border-top: 2px solid var(--text);
}

.third-rank-item {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.third-rank-image {
  aspect-ratio: 4 / 3;
}

.third-rank-item h3 {
  font-size: 1rem;
}

.third-rank-item h3 a {
  -webkit-line-clamp: 2;
}

.third-rank-copy {
  min-width: 0;
}

.third-rank-copy .compact-tags {
  gap: 4px;
  margin-top: 7px;
}

.third-rank-copy .tag {
  min-height: 24px;
  padding: 2px 7px;
  font-size: 0.78rem;
}

.one-line-summary {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 6px;
  color: #344054;
  font-size: 0.9rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.one-line-summary p:nth-child(n + 2) {
  display: none;
}

.front-bottom-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 24px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
}

.front-bottom-row .front-section {
  border-bottom: 0;
  padding-bottom: 0;
}

/* News front sections */
.front-section {
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
}

.issue-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.issue-link {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 2px solid var(--text);
  padding: 10px 0;
  text-decoration: none;
}

.issue-link span {
  font-weight: 800;
}

.article-list {
  display: grid;
  gap: 0;
}

.article-list-item {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

.article-list-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.list-image {
  aspect-ratio: 5 / 3;
}

.dashboard-section {
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.2rem;
}

.section-heading a {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.issue-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.issue-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface);
  text-decoration: none;
}

.issue-chip span {
  font-weight: 800;
}

.issue-chip strong {
  color: var(--accent-strong);
}

.timeline-list {
  display: grid;
  gap: 8px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
}

.timeline-item:first-child {
  padding-top: 0;
}

.timeline-item time,
.timeline-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.timeline-item a,
.region-card a {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.timeline-item a {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 12px;
}

.region-card a {
  display: block;
  margin-top: 8px;
  line-height: 1.35;
}

/* Shared text states */
h1 {
  margin: 0;
  font-size: 1.625rem;
  line-height: 1.22;
}

.count,
.meta-line,
.notice,
footer,
.empty {
  color: var(--muted);
}

/* Archive and admin filters */
.filters {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) repeat(3, minmax(130px, 0.8fr)) minmax(132px, 0.7fr);
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.filters.has-reset {
  grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(124px, 0.75fr)) minmax(124px, 0.65fr) minmax(104px, 0.5fr);
}

.filters input,
.filters select,
.filters button,
.filters .button {
  width: 100%;
  min-width: 0;
}

.filter-reset {
  text-align: center;
}

.admin-filters {
  grid-template-columns:
    minmax(240px, 1.5fr)
    repeat(6, minmax(112px, 0.7fr))
    minmax(92px, 0.5fr);
}

.admin-filters.has-reset {
  grid-template-columns:
    minmax(220px, 1.4fr)
    repeat(6, minmax(104px, 0.65fr))
    minmax(90px, 0.5fr)
    minmax(94px, 0.5fr);
}

/* Card and archive lists */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  min-width: 0;
  box-shadow: var(--shadow-subtle);
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.card:hover {
  border-color: #b8c1cf;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.card-body {
  padding: 16px;
}

.card h2 {
  font-size: 1.075rem;
  margin: 8px 0;
  line-height: 1.35;
}

.card h2 a {
  text-decoration: none;
}

.card p,
.card .article-summary {
  margin: 0 0 12px;
  color: #344054;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.lead-copy .article-summary p,
.article-list-item .article-summary p,
.card .article-summary p {
  display: inline;
  margin: 0;
  color: inherit;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: #edf3f0;
  color: #235844;
  padding: 4px 9px;
  font-size: 0.85rem;
  text-decoration: none;
}

/* Article detail */
.detail {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(18px, 4vw, 34px);
  max-width: var(--article-max);
  margin: 0 auto;
  box-shadow: var(--shadow-subtle);
}

.public-detail {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

.detail h1 {
  margin: 8px 0 18px;
}

.detail-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.detail-image.is-broken {
  aspect-ratio: 2.7 / 1;
}

.body-image-secondary {
  margin-top: 12px;
}

.summary {
  font-size: 1.08rem;
  font-weight: 700;
  margin: 18px 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.summary p {
  margin: 0;
}

.summary p + p {
  margin-top: 10px;
}

.public-detail .summary {
  font-size: 1.12rem;
  line-height: 1.65;
  margin: 18px 0;
}

.body p {
  margin: 0 0 14px;
}

.public-detail .body {
  font-size: 1.02rem;
  padding-bottom: 2px;
}

.public-detail .body p {
  margin-bottom: 16px;
}

.candidate-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 16px;
  padding: 0;
}

.candidate-meta-item {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f4f7f5;
  color: #24443a;
  padding: 5px 9px;
  line-height: 1.3;
}

.candidate-meta-item:first-child {
  border-color: #d4dfda;
  background: #edf5f1;
  color: var(--accent-strong);
}

.candidate-meta dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.candidate-meta dd {
  margin: 0;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.candidate-meta.compact {
  gap: 5px;
  margin: 6px 0 8px;
}

.candidate-meta.compact .candidate-meta-item {
  min-height: 26px;
  padding: 3px 8px;
}

.candidate-meta.compact dt,
.candidate-meta.compact dd {
  font-size: 0.8rem;
}

.public-detail .tag-row {
  margin-top: 8px;
}

.sources {
  margin-top: 24px;
  padding: 16px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.public-detail .sources {
  background: transparent;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  margin-top: 20px;
  padding: 16px 0;
}

.sources h2,
.admin-actions h2 {
  font-size: 1.1rem;
  margin-top: 0;
}

.sources ul {
  margin: 10px 0 0;
  padding-left: 20px;
}

.sources a {
  color: var(--accent-strong);
}

.notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--info-border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--info-bg);
  margin-top: 24px;
  padding: 14px 16px;
  color: var(--info-text);
}

.notice strong {
  flex: 0 0 auto;
  color: var(--accent-strong);
}

.notice span {
  min-width: 0;
}

/* Admin */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-subtle);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  font-size: 0.9rem;
  color: var(--muted);
  background: var(--surface-muted);
}

thead th:nth-child(1) {
  width: 47%;
}

thead th:nth-child(2),
thead th:nth-child(3),
thead th:nth-child(4),
thead th:nth-child(5) {
  width: 9%;
}

thead th:nth-child(6) {
  width: 10%;
}

thead th:nth-child(7) {
  width: 7%;
}

.admin-title-cell a {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.admin-title-cell a:hover {
  color: var(--accent-strong);
}

.admin-title-cell a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

td[data-label="관리"] .inline-form {
  gap: 0;
}

td[data-label="관리"] button {
  min-width: 76px;
  padding-left: 10px;
  padding-right: 10px;
  white-space: nowrap;
}

td[data-label="등록일"] {
  white-space: nowrap;
}

tbody tr:hover {
  background: #f9fbfa;
}

tbody tr.needs-review {
  background: #fffaf0;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.admin-summary-card {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
  text-decoration: none;
}

.admin-summary-card span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.admin-summary-card strong {
  color: var(--text);
  font-size: 1.15rem;
}

.admin-conflict-links {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-conflict-links a,
.admin-flags span {
  display: inline-flex;
  border-radius: 999px;
  background: #fff3d6;
  color: #6f4c05;
  padding: 3px 8px;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.admin-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.page-link,
.page-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  font-weight: 800;
  text-decoration: none;
}

.page-link.disabled {
  color: var(--muted);
  background: var(--surface-muted);
}

.page-current {
  color: var(--accent-strong);
}

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.85rem;
  background: #eef1f5;
}

.status.published {
  color: var(--accent-strong);
  background: #e6f2ee;
}

.status.hidden {
  color: var(--danger);
  background: #f8eaea;
}

.placement-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.85rem;
  font-weight: 800;
  background: #eef1f5;
  color: var(--muted);
}

.placement-badge.placed {
  background: #edf6fb;
  color: #1d5f7a;
}

.placement-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.85rem;
}

.admin-login,
.message,
.admin-actions {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  max-width: 880px;
  margin: 20px auto 0;
}

.admin-toolbar {
  border-bottom: 2px solid var(--text);
  padding-bottom: 12px;
}

.admin-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: start;
}

.admin-preview {
  min-width: 0;
}

.admin-preview .detail {
  max-width: none;
  margin: 0;
}

.admin-detail-layout .admin-side-panels {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 16px;
}

.admin-detail-layout .admin-actions {
  margin: 0;
}

.admin-detail-layout .danger-zone {
  border-color: #e1b3b3;
  background: #fffafa;
}

.placement-form {
  display: grid;
  gap: 10px;
}

.placement-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.placement-form input,
.placement-form select,
.placement-form button,
.placement-clear button {
  width: 100%;
}

.placement-clear {
  margin-top: 8px;
}

.stacked-form {
  margin-top: 14px;
}

.admin-note,
.admin-success,
.admin-warning {
  margin: 12px 0 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.admin-note {
  color: var(--muted);
}

.admin-success {
  border: 1px solid var(--info-border);
  border-radius: 8px;
  background: var(--info-bg);
  color: var(--info-text);
  padding: 10px 12px;
}

.admin-warning {
  border: 1px solid var(--warning-border);
  border-radius: 8px;
  background: var(--warning-bg);
  color: var(--warning-text);
  padding: 10px 12px;
}

.admin-warning ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.admin-login form {
  align-items: end;
  margin-top: 12px;
  flex-wrap: wrap;
}

.admin-login label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 20px clamp(16px, 4vw, 40px);
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.92rem;
}

/* Mobile responsive overrides */
@media (max-width: 760px) {
  main {
    padding-top: 18px;
  }

  .news-front {
    gap: 10px;
  }

  .site-header {
    gap: 6px;
    padding-top: 10px;
  }

  .site-meta {
    align-items: center;
    flex-direction: row;
    gap: 8px;
    justify-content: space-between;
    font-size: 0.78rem;
  }

  .site-brand-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .site-header .brand {
    font-size: 1.25rem;
  }

  .brand-logo {
    width: clamp(156px, 48vw, 214px);
    max-height: 48px;
  }

  .site-header .brand-mark {
    width: 30px;
    height: 30px;
  }

  .section-nav {
    margin-left: calc(-1 * clamp(16px, 4vw, 40px));
    margin-right: calc(-1 * clamp(16px, 4vw, 40px));
    padding-left: clamp(16px, 4vw, 40px);
    padding-right: clamp(16px, 4vw, 40px);
    box-shadow: inset -18px 0 18px -18px rgba(24, 32, 45, 0.45);
  }

  .section-nav a {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 0.95rem;
  }

  .site-header .search {
    width: 100%;
  }

  .admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .search {
    width: 100%;
  }

  .search input {
    flex: 1;
    min-width: 0;
  }

  .toolbar-section {
    align-items: flex-start;
    flex-direction: column;
  }

  .front-hero {
    align-items: flex-start;
    flex-direction: column;
    padding-bottom: 10px;
  }

  .hero-visual {
    display: none;
  }

  .front-hero .button {
    display: none;
  }

  .live-status {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 8px 9px;
  }

  .live-status .status-main {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 1px 7px;
  }

  .live-status .status-metric {
    gap: 1px;
    min-width: 0;
    border: 1px solid rgba(31, 111, 91, 0.16);
    border-radius: 6px;
    padding: 4px 7px;
    background: rgba(255, 255, 255, 0.55);
    line-height: 1.15;
  }

  .live-status .status-metric span {
    font-size: 0.78rem;
  }

  .live-status p {
    grid-column: 1 / -1;
    line-height: 1.35;
  }

  .live-status span,
  .live-status p {
    font-size: 0.88rem;
  }

  .scope-tabs {
    flex-wrap: nowrap;
  }

  .scope-tab {
    flex: 1;
    padding-left: 8px;
    padding-right: 8px;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .admin-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 8px;
  }

  .admin-summary-card {
    padding: 8px 9px;
  }

  .admin-summary-card span {
    font-size: 0.75rem;
  }

  .admin-summary-card strong {
    font-size: 1rem;
  }

  .admin-detail-layout {
    grid-template-columns: 1fr;
  }

  .admin-detail-layout .admin-side-panels {
    position: static;
  }

  .news-lead,
  .lead-story {
    grid-template-columns: 1fr;
  }

  .news-lead {
    gap: 18px;
    padding-bottom: 18px;
  }

  .lead-story {
    gap: 10px;
  }

  .lead-image {
    aspect-ratio: 2 / 1;
  }

  .lead-image.is-broken {
    aspect-ratio: 2.45 / 1;
  }

  .lead-copy h2 {
    max-width: none;
    font-size: 1.68rem;
    line-height: 1.24;
  }

  .lead-copy .article-summary {
    line-height: 1.55;
    -webkit-line-clamp: 2;
  }

  .front-main-rank .lead-story {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-bottom: 10px;
  }

  .front-main-rank .lead-image {
    aspect-ratio: 2 / 1;
  }

  .secondary-rank-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 12px;
  }

  .secondary-rank-item {
    padding-top: 8px;
  }

  .secondary-rank-item h3 {
    margin-top: 6px;
    font-size: 0.95rem;
  }

  .third-rank-list {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .third-rank-item {
    grid-template-columns: minmax(88px, 104px) minmax(0, 1fr);
    gap: 10px;
    padding: 10px 0;
  }

  .third-rank-item h3 {
    margin-top: 0;
    font-size: 0.96rem;
    line-height: 1.3;
  }

  .third-rank-copy .compact-tags {
    margin-top: 5px;
  }

  .one-line-summary {
    margin-top: 5px;
    font-size: 0.86rem;
  }

  .front-bottom-row {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-bottom: 18px;
  }

  .article-list-item {
    grid-template-columns: minmax(88px, 100px) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 12px 0;
  }

  .article-list-item .meta-line {
    font-size: 0.84rem;
    line-height: 1.35;
  }

  .article-list-item h2,
  .article-list-item h3 {
    margin: 3px 0 5px;
    font-size: 0.96rem;
    line-height: 1.3;
  }

  .article-list-item p,
  .article-list-item .article-summary {
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.88rem;
    line-height: 1.4;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .article-list-item .list-image {
    aspect-ratio: 4 / 3;
  }

  .article-list-item .tag-row {
    gap: 4px;
    margin-top: 6px;
  }

  .article-list-item .candidate-meta.compact {
    display: none;
  }

  .article-list-item .tag {
    min-height: 24px;
    padding: 2px 7px;
    font-size: 0.78rem;
  }

  .article-list-item .tag:nth-child(n + 3) {
    display: none;
  }

  .issue-strip .issue-link {
    align-items: center;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    background: var(--surface);
  }

  .issue-strip .issue-link:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .issue-list {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 8px;
    margin-bottom: 8px;
    padding: 8px 10px;
  }

  .filters.has-reset {
    grid-template-columns: 1fr 1fr;
  }

  .admin-filters,
  .admin-filters.has-reset {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .table-wrap {
    overflow-x: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .table-wrap table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
    width: 100%;
  }

  .table-wrap tr.admin-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    padding: 10px 12px;
    box-shadow: var(--shadow-subtle);
  }

  .table-wrap tbody tr:hover {
    background: var(--surface);
  }

  .table-wrap tr.needs-review {
    background: #fffaf0;
  }

  .table-wrap td {
    border-bottom: 0;
    padding: 0;
  }

  .table-wrap td[data-label] {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.35;
  }

  .table-wrap td[data-label]::before {
    display: none;
  }

  .table-wrap td.admin-title-cell {
    grid-column: 1 / -1;
    font-weight: 800;
  }

  .table-wrap td.admin-title-cell a {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .table-wrap td[data-label="상태"] {
    justify-content: flex-start;
  }

  .table-wrap td[data-label="배치"] {
    flex-wrap: wrap;
  }

  .table-wrap td[data-label="관리"] {
    justify-content: flex-end;
  }

  .table-wrap td[data-label="관리"] .inline-form {
    display: block;
  }

  .table-wrap td[data-label="관리"] button {
    width: auto;
    min-width: 120px;
    min-height: 40px;
    padding: 6px 9px;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .table-wrap .status,
  .table-wrap .placement-badge {
    padding: 3px 8px;
    font-size: 0.8rem;
  }

  .table-wrap .placement-meta {
    display: inline-flex;
    margin-top: 0;
    font-size: 0.78rem;
  }

  .filters .filter-query,
  .filters .filter-reset {
    grid-column: 1 / -1;
  }

  .filters input,
  .filters select,
  .filters button,
  .filters .button {
    width: 100%;
  }

  .pagination {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .detail h1 {
    font-size: 1.45rem;
    line-height: 1.18;
    margin-bottom: 14px;
  }

  .detail-image.is-broken {
    aspect-ratio: 2.35 / 1;
  }

  .notice {
    flex-direction: column;
    gap: 4px;
  }
}

/* Desktop responsive overrides */
@media (min-width: 761px) {
  h1 {
    font-size: 2rem;
  }
}
