:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #dde4ee;
  --primary: #002f78;
  --primary-dark: #00245c;
  --accent: #0f9f77;
  --danger: #c03535;
  --warning: #b7791f;
  --radius: 8px;
  --shadow: 0 16px 42px rgba(23, 32, 51, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }
.structured-data-inline {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 5vw, 64px);
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand {
  color: var(--text);
  font-weight: 800;
  font-size: 1.18rem;
}
.main-nav, .site-footer nav, .sidebar nav {
  display: flex;
  align-items: center;
  gap: 16px;
}
.main-nav a, .sidebar a { color: var(--text); font-weight: 650; }
.main-nav a:not(.button) {
  padding: 8px 2px;
}
.menu-toggle { display: none; }
.button, button, input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-weight: 750;
  cursor: pointer;
}
.button-primary, input[type="submit"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.button.button-primary,
a.button.button-primary,
button.button-primary,
a.button.button-primary:visited,
input[type="submit"].button-primary {
  background: #002f78;
  border-color: #002f78;
  color: #fff !important;
}
.button.button-primary:hover,
a.button.button-primary:hover,
button.button-primary:hover,
a.button.button-primary:focus,
button.button-primary:focus {
  background: #00245c;
  border-color: #00245c;
  color: #fff !important;
}
.button-danger { background: var(--danger); border-color: var(--danger); color: #fff; }

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, .98fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding: clamp(42px, 7vw, 82px) clamp(18px, 5vw, 64px) 30px;
  background: #ffffff;
}
.home-hero-copy {
  max-width: 760px;
  min-width: 0;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #e7f7ef;
  color: #06704f;
  font-size: .88rem;
  font-weight: 800;
}
.home-hero h1 {
  margin: 18px 0 16px;
  font-size: clamp(3rem, 7vw, 6.4rem);
  line-height: .96;
  letter-spacing: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.home-hero p {
  max-width: 680px;
  margin: 0 0 24px;
  color: #475467;
  font-size: clamp(1.05rem, 1.6vw, 1.22rem);
}
.home-search {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 260px) auto;
  gap: 12px;
  align-items: end;
  max-width: 840px;
  padding: 14px;
  border: 1px solid #d6e4f5;
  border-radius: var(--radius);
  background: #f8fbff;
  box-shadow: 0 18px 45px rgba(23, 32, 51, .08);
}
.home-search label span {
  color: #344054;
  font-size: .9rem;
}
.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}
.home-hero-visual {
  aspect-ratio: 700 / 482;
  min-height: 360px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #eef5ff;
  box-shadow: 0 24px 60px rgba(23, 32, 51, .12);
}
.home-hero-visual img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
}
.home-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0 clamp(18px, 5vw, 64px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--line);
  box-shadow: 0 14px 32px rgba(23, 32, 51, .06);
}
.home-stats div {
  padding: 18px;
  background: #fff;
}
.home-stats strong {
  display: block;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height: 1;
}
.home-stats span {
  color: var(--muted);
  font-size: .92rem;
}
.home-section .grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.home-category-band {
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.category-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.category-cloud a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 13px;
  border: 1px solid #d6e4f5;
  border-radius: 999px;
  background: #f8fbff;
  color: #243047;
  font-weight: 750;
}
.category-cloud a:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}
.home-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: center;
}
.home-split h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}
.feature-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.feature-list span {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-weight: 750;
}
.home-panel {
  padding: 24px;
  border-radius: var(--radius);
  background: #172033;
  color: #fff;
  box-shadow: 0 22px 50px rgba(23, 32, 51, .18);
}
.home-panel p {
  color: #d8e0eb;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
  gap: 36px;
  align-items: center;
  padding: clamp(42px, 7vw, 86px) clamp(18px, 5vw, 64px) 40px;
  background: linear-gradient(145deg, #ffffff 0%, #eff5ff 55%, #e7f7f1 100%);
}
.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(2.1rem, 4.5vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: 0;
}
.hero p { max-width: 680px; color: var(--muted); font-size: 1.12rem; }
.search-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.search-grid {
  display: grid;
  grid-template-columns: 1fr 220px auto;
  gap: 12px;
}
.section {
  padding: 38px clamp(18px, 5vw, 64px);
}
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 20px;
}
.section h2, .dashboard-content h1 { margin: 0 0 8px; }
.muted { color: var(--muted); }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 10px 24px rgba(23, 32, 51, .05);
}
.entry-card { display: grid; gap: 10px; }
.entry-logo {
  width: 74px;
  height: 74px;
  aspect-ratio: 1 / 1;
  display: block;
  border-radius: var(--radius);
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 8px;
}
.entry-logo-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #eaf4ff, #ecf8f2);
  border: 1px solid #cfe0ef;
  color: var(--primary-dark);
  font-weight: 850;
  font-size: 1.1rem;
  padding: 0;
}
.entry-logo-large {
  width: 90px;
  height: 90px;
  aspect-ratio: 1 / 1;
  font-size: 1.35rem;
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--text);
  font-size: .82rem;
  font-weight: 750;
}
.badge-success { background: #e7f7ef; color: #06704f; }
.badge-warning { background: #fff5da; color: var(--warning); }
.badge-danger { background: #fdecec; color: var(--danger); }
.badge-secondary { background: #eef2f7; color: #4b5565; }

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
}
.detail-section {
  padding-bottom: 28px;
}
.detail-card {
  padding: clamp(20px, 3vw, 34px);
}
.entry-hero-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  margin-bottom: 28px;
}
.entry-hero-row h1 {
  margin: 10px 0 8px;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
}
.entry-summary-box {
  margin: 22px 0 34px;
  padding: 18px 20px;
  border: 1px solid #d6e4f5;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  background: #f8fbff;
}
.entry-summary-box h2,
.entry-long-box h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
}
.entry-summary-box p {
  margin: 0;
  color: #344054;
  font-size: 1.06rem;
}
.entry-long-box {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.article-body, .long-text {
  font-size: 1.04rem;
}
.article-body p, .long-text p { margin: 0 0 1.15em; }
.article-main-image,
.article-body figure {
  margin: 24px 0;
  text-align: center;
}
.article-main-image img,
.article-body figure img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
}
.article-body figcaption {
  margin-top: 10px;
  color: #667085;
  font-size: .92rem;
  line-height: 1.45;
  text-align: center;
}
.long-text h2,
.long-text h3 {
  margin: 1.45em 0 .45em;
}
.contact-card {
  position: sticky;
  top: 92px;
  align-self: start;
}
.internal-links {
  display: grid;
  gap: 9px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.internal-links h3 {
  margin: 0;
  font-size: 1rem;
}
.internal-links a {
  display: block;
}
.related-section {
  padding-top: 22px;
}
.empty-related-card {
  max-width: 680px;
}
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 34px clamp(18px, 5vw, 64px);
  border-top: 1px solid var(--line);
  background: #fff;
}
.cookie-banner {
  position: fixed;
  left: clamp(14px, 4vw, 32px);
  right: clamp(14px, 4vw, 32px);
  bottom: 18px;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 22px 70px rgba(23, 32, 51, .18);
}
.cookie-banner[hidden],
.cookie-modal[hidden] {
  display: none;
}
.cookie-banner p {
  margin: 4px 0 6px;
  color: var(--muted);
}
.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}
.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 32, 51, .42);
}
.cookie-modal-panel {
  width: min(560px, 100%);
  padding: 22px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 28px 80px rgba(23, 32, 51, .24);
}
.cookie-modal-panel h2 {
  margin-top: 0;
}
.cookie-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.cookie-choice input {
  width: auto;
  margin-top: 4px;
}
.cookie-choice small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 500;
}

form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-weight: 700; }
.field-help {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 500;
}
.honeypot-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
input, select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font: inherit;
}
textarea { min-height: 130px; resize: vertical; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  padding: 22px;
  background: #fff;
  border-right: 1px solid var(--line);
}
.sidebar nav {
  align-items: stretch;
  flex-direction: column;
  margin-top: 28px;
}
.sidebar nav a {
  padding: 10px 12px;
  border-radius: var(--radius);
}
.sidebar nav a:hover { background: #eef5ff; }
.dashboard-main { min-width: 0; }
.dashboard-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 68px;
  padding: 14px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
}
.dashboard-content { padding: 24px; }
.admin-entry-editor {
  max-width: 1120px;
}
.admin-entry-form {
  gap: 18px;
}
.admin-entry-form h2 {
  margin: 8px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 1.05rem;
}
.seo-preview {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
}
.seo-preview code {
  display: block;
  margin-top: 6px;
  white-space: normal;
}
.social-preview-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
  border: 1px solid #d6e4f5;
  border-radius: var(--radius);
  background: #fff;
}
.social-preview-card img {
  width: 180px;
  height: 95px;
  object-fit: cover;
  background: #eef2f7;
}
.social-preview-card div {
  min-width: 0;
  padding: 10px 12px 10px 0;
}
.social-preview-card strong,
.social-preview-card p,
.social-preview-card span {
  display: block;
}
.social-preview-card strong {
  overflow-wrap: anywhere;
}
.social-preview-card p {
  margin: 4px 0;
  color: var(--muted);
  font-size: .9rem;
}
.social-preview-card span {
  color: #98a2b3;
  font-size: .82rem;
}
.html-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
}
.html-editor-toolbar button {
  min-height: 34px;
  padding: 7px 10px;
}
.html-code-editor {
  min-height: 420px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: .94rem;
}
.insert-code-box,
.content-image-upload {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #d6e4f5;
  border-radius: var(--radius);
  background: #f8fbff;
}
.content-image-upload h2 {
  margin: 0;
  font-size: 1.05rem;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.stat {
  padding: 18px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
}
.stat strong { display: block; font-size: 1.8rem; }
.table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th { color: var(--muted); font-size: .88rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.flash {
  margin: 16px clamp(18px, 5vw, 64px);
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #eef5ff;
  border: 1px solid var(--line);
}
.flash-success { background: #e7f7ef; }
.flash-error { background: #fdecec; }
.backlink-code {
  margin-bottom: 14px;
}
.backlink-code textarea {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  min-height: 70px;
}

@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; }
  .main-nav {
    display: none;
    position: absolute;
    left: 18px;
    right: 18px;
    top: 68px;
    flex-direction: column;
    align-items: stretch;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }
  .main-nav.is-open { display: flex; }
  .home-hero,
  .home-search,
  .home-split,
  .hero, .detail-layout, .dashboard-shell, .form-grid, .search-grid {
    grid-template-columns: 1fr;
  }
  .home-hero {
    padding-top: 34px;
  }
  .home-hero h1 {
    font-size: clamp(2.25rem, 10.5vw, 3rem);
    line-height: 1.05;
  }
  .home-hero-visual,
  .home-hero-visual img {
    min-height: 250px;
  }
  .home-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .entry-hero-row {
    grid-template-columns: 1fr;
  }
  .contact-card {
    position: static;
  }
  .cookie-banner {
    grid-template-columns: 1fr;
  }
  .cookie-actions {
    justify-content: stretch;
  }
  .cookie-actions button,
  .cookie-actions .button {
    flex: 1 1 160px;
  }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .site-footer, .section-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .home-hero {
    padding-top: 28px;
  }
  .home-hero h1 {
    font-size: clamp(2rem, 10vw, 2.55rem);
  }
  .home-hero p {
    font-size: 1.02rem;
  }
}
