:root {
  --ink: #182126;
  --muted: #5b6871;
  --line: #d7dee2;
  --panel: #ffffff;
  --paper: #f5f7f8;
  --rail: #0b5d66;
  --rail-strong: #083f47;
  --signal: #b82e2e;
  --amber: #a06900;
  --leaf: #357348;
  --blue: #245caa;
  --shadow: 0 10px 26px rgba(22, 35, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.45;
}

button,
input {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.masthead {
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(8, 63, 71, 0.96), rgba(11, 93, 102, 0.82)),
    #083f47;
  border-bottom: 4px solid #e0a31a;
}

.masthead__content {
  max-width: 1180px;
  min-height: 230px;
  margin: 0 auto;
  padding: 28px 20px 22px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  align-items: center;
  gap: 28px;
}

.masthead h1,
.compact-header h1 {
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 12px;
  color: #d2edf0;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.lede {
  max-width: 660px;
  margin: 16px 0 0;
  color: #e9f6f7;
  font-size: 1.05rem;
}

.masthead__image {
  width: 100%;
  max-height: 190px;
  object-fit: contain;
}

.compact-header {
  padding: 22px 20px;
  color: #ffffff;
  background: var(--rail-strong);
  border-bottom: 4px solid #e0a31a;
}

.compact-header h1 {
  font-size: 2.2rem;
}

.compact-header p {
  margin: 8px 0 0;
  color: #e9f6f7;
}

.back-link,
.admin-link {
  color: inherit;
  font-weight: 700;
}

.layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 20px 42px;
}

.toolbar,
.summary-band,
.admin-auth {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.admin-login {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--rail);
  border-radius: 8px;
  background: #ffffff;
}

.admin-login label {
  display: grid;
  gap: 6px;
  min-width: min(340px, 100%);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.admin-login input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
}

.admin-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}

.tabs {
  display: inline-flex;
  min-height: 44px;
  padding: 4px;
  background: #e6ecef;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tab {
  min-width: 132px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
}

.tab.is-active {
  color: #ffffff;
  background: var(--rail);
}

.search {
  display: grid;
  gap: 6px;
  min-width: min(360px, 100%);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.search input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #ffffff;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 18px;
}

.filter-chip {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  color: var(--ink);
  background: #ffffff;
  cursor: pointer;
  font-weight: 700;
}

.filter-chip.is-active {
  color: #ffffff;
  border-color: var(--rail);
  background: var(--rail);
}

.summary-band {
  min-height: 66px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--rail);
  border-radius: 8px;
  background: #ffffff;
}

.metric {
  display: inline-block;
  min-width: 44px;
  color: var(--rail-strong);
  font-size: 1.45rem;
  font-weight: 800;
}

.metric-label {
  color: var(--muted);
  font-weight: 700;
}

.article-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 16px;
}

.article-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 330px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.article-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.source {
  color: var(--rail);
}

.score {
  margin-left: auto;
  color: var(--amber);
}

.title {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.title-link {
  color: inherit;
  text-decoration: none;
}

.title-link:hover,
.title-link:focus-visible {
  color: var(--rail);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.summary {
  margin: 0;
  color: var(--ink);
}

.image-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.image-link:focus-visible {
  outline: 3px solid rgba(36, 92, 170, 0.24);
  outline-offset: 3px;
}

.article-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #eef3f4;
}

.article-image.is-loading {
  height: 0;
  aspect-ratio: auto;
  border: 0;
  opacity: 0;
}

.tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  padding: 4px 8px;
  border-radius: 999px;
  color: #1c3540;
  background: #e8eff1;
  font-size: 0.76rem;
  font-weight: 700;
}

.article-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: auto;
}

.button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--ink);
  background: #ffffff;
  cursor: pointer;
  text-decoration: none;
  font-weight: 700;
}

.button--primary {
  color: #ffffff;
  border-color: var(--rail);
  background: var(--rail);
}

.button--danger {
  color: #ffffff;
  border-color: var(--signal);
  background: var(--signal);
}

.status-pill {
  padding: 2px 7px;
  border-radius: 999px;
  color: #1c3540;
  background: #e8eff1;
  text-transform: capitalize;
}

.button:hover,
.button:focus-visible,
.filter-chip:hover,
.filter-chip:focus-visible,
.tab:focus-visible {
  outline: 3px solid rgba(36, 92, 170, 0.24);
  outline-offset: 2px;
}

.feedback-state {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.empty-state,
.notice {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.submit-news {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(320px, 1.2fr);
  gap: 14px;
  align-items: end;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  background: #ffffff;
}

.submit-news h2 {
  margin: 0;
  font-size: 1.1rem;
}

.submit-news p {
  margin: 6px 0 0;
  color: var(--muted);
}

.submit-news__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.submit-news__form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.submit-news__form input {
  min-height: 42px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
}

.submit-news > .feedback-state {
  grid-column: 1 / -1;
}

.empty-state h2 {
  margin-top: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 18px 20px;
  color: var(--muted);
  background: #ffffff;
  text-align: center;
}

.source-add {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.source-add h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.source-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.source-form input,
.source-form select {
  min-height: 42px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: #ffffff;
}

.source-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr));
  gap: 14px;
}

.source-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.source-card h2 {
  margin: 0;
  font-size: 1rem;
}

.source-card__meta {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.source-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-card__links a {
  color: var(--blue);
  font-weight: 700;
}

@media (max-width: 760px) {
  .masthead__content {
    grid-template-columns: 1fr;
  }

  .masthead__image {
    max-height: 130px;
  }

  .tab {
    min-width: auto;
    padding-inline: 10px;
  }

  .tabs,
  .search,
  .toolbar > * {
    width: 100%;
  }

  .article-card {
    min-height: auto;
  }

  .source-form {
    grid-template-columns: 1fr;
  }

  .submit-news,
  .submit-news__form {
    grid-template-columns: 1fr;
  }
}
