:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --ink: #1f2937;
  --muted: #5f6d80;
  --brand: #0c6a7b;
  --brand-deep: #0a5361;
  --brand-soft: #e3f4f7;
  --line: #d5ddeb;
  --success: #146c43;
  --warning: #a15f00;
  --shadow: 0 10px 28px rgba(14, 35, 62, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Source Sans 3", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(900px 400px at 100% -10%, #e0f4fa 0%, transparent 60%),
    radial-gradient(700px 500px at -15% 5%, #eef3ff 0%, transparent 58%),
    var(--bg);
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.2rem;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(5px);
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-logo {
  width: clamp(100px, 14vw, 150px);
  height: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.28rem 0.5rem;
}

.brand-copy {
  display: grid;
  gap: 0.1rem;
}

.brand {
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  font-size: clamp(1.04rem, 1.6vw, 1.24rem);
  letter-spacing: 0.2px;
}

.brand-sub {
  color: var(--muted);
  font-size: 0.93rem;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.top-nav a {
  text-decoration: none;
  color: var(--brand-deep);
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.32rem 0.8rem;
  font-weight: 700;
  font-size: 0.92rem;
}

.top-nav a:hover {
  border-color: #b6c4d8;
  background: #f9fbff;
}

.content {
  width: min(1120px, 95vw);
  margin: 1rem auto 2rem;
}

.hero {
  background: linear-gradient(122deg, var(--brand) 0%, #1089a0 70%);
  color: #fff;
  border-radius: 16px;
  padding: 1.3rem 1.4rem;
  box-shadow: var(--shadow);
  animation: lift 0.45s ease-out;
}

.hero.compact {
  padding: 1rem 1.2rem;
}

.hero h1 {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: clamp(1.35rem, 2.8vw, 2.05rem);
}

.hero p {
  margin: 0.55rem 0 0;
  color: #effcff;
  max-width: 72ch;
}

.hero-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.95rem;
}

.meta-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 1rem;
}

.device-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.device-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.55rem;
  box-shadow: 0 5px 16px rgba(14, 35, 62, 0.05);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.device-card:hover,
.device-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(14, 35, 62, 0.12);
}

.device-card img {
  width: 62px;
  height: 62px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid #d6dfec;
  background: #f7f9fc;
  padding: 0.2rem;
  flex: 0 0 62px;
}

.device-card h3 {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 5px 16px rgba(14, 35, 62, 0.05);
}

.card h2 {
  margin: 0 0 0.65rem;
  font-family: "Outfit", sans-serif;
  font-size: 1.15rem;
}

.card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.filter-panel {
  margin-top: 1rem;
}

.upload-panel {
  margin-top: 1rem;
}

.panel-head {
  display: grid;
  gap: 0.25rem;
}

.helper-copy {
  margin: 0;
  color: #4a607c;
  max-width: 90ch;
}

.upload-grid {
  margin-top: 0.8rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 0.7rem;
}

.form-field {
  display: grid;
  gap: 0.28rem;
  font-weight: 600;
  color: #31465f;
}

.file-input-wrap {
  grid-column: span 4;
}

.upload-actions {
  margin-top: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.upload-status {
  margin: 0;
  font-weight: 700;
  color: #4e617b;
}

.upload-status.ok {
  color: var(--success);
}

.upload-status.error {
  color: #9f1a1a;
}

.compulsory-panel {
  margin-top: 1rem;
}

.compulsory-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.compulsory-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem;
  background: #fbfdff;
}

.compulsory-card h3 {
  margin: 0;
  font-family: "Outfit", sans-serif;
}

.compulsory-progress {
  margin: 0.3rem 0 0.55rem;
  color: #4a5e78;
  font-weight: 700;
}

.compulsory-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.3rem;
}

.req-row {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.3rem 0.45rem;
  border-radius: 8px;
}

.req-row.done {
  background: #e8f8ef;
  color: #145c3b;
}

.req-row.missing {
  background: #fff4e8;
  color: #8f5710;
}

.filter-grid {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: 2fr 1fr 1fr 1fr;
}

.filter-grid.single {
  grid-template-columns: 1fr;
}

.filter-grid label {
  display: grid;
  gap: 0.32rem;
  font-weight: 600;
  color: #3a4b61;
}

input[type="search"],
select {
  width: 100%;
  border: 1px solid #c5d2e4;
  border-radius: 9px;
  padding: 0.5rem 0.62rem;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

input[type="search"]:focus,
select:focus {
  outline: 2px solid #c6e6ee;
  border-color: #86b9c6;
}

.filter-footer {
  margin-top: 0.82rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.results-copy {
  margin: 0;
  color: #39506f;
}

.device-section {
  margin-top: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem;
}

.section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #f8fbff;
  border: 1px solid #d2dfef;
  border-radius: 10px;
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  font-family: "Outfit", sans-serif;
  font-size: 1.02rem;
  text-align: left;
}

.section-toggle .toggle-icon {
  margin-left: auto;
  font-weight: 700;
}

.section-toggle[aria-expanded="true"] .toggle-icon {
  transform: translateY(-1px);
}

.section-body {
  margin-top: 0.7rem;
}

.section-body.collapsed {
  display: none;
}

.device-section h2 {
  margin: 0 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Outfit", sans-serif;
}

.device-count {
  background: #eef5ff;
  color: #30455f;
  border: 1px solid #d4e2f5;
  border-radius: 999px;
  padding: 0.08rem 0.52rem;
  font-size: 0.86rem;
  font-weight: 700;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  min-width: 700px;
}

th,
td {
  border-top: 1px solid var(--line);
  padding: 0.58rem;
  vertical-align: top;
  text-align: left;
}

th {
  color: #5a6a80;
  font-weight: 700;
  border-top: none;
  background: #f7faff;
}

tbody tr:hover {
  background: #f9fcff;
}

.doc-row {
  cursor: pointer;
}

.doc-row:focus-visible {
  outline: 2px solid #9fd6e3;
  outline-offset: -2px;
}

.empty-device {
  margin: 0.8rem 0 0;
  color: #5a6b80;
  font-weight: 600;
}

.button {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  padding: 0.35rem 0.78rem;
  border-radius: 8px;
  border: none;
  font-size: 0.87rem;
  font-weight: 700;
  cursor: pointer;
}

.button:hover {
  background: var(--brand-deep);
}

.button-light {
  background: #ffffff;
  color: #0a5d6f;
}

.button-light:hover {
  background: #f0fcff;
}

.ghost-button {
  background: #fff;
  color: var(--brand-deep);
  border: 1px solid #b9cedd;
}

.ghost-button:hover {
  background: #f4faff;
}

.status {
  display: inline-block;
  border-radius: 999px;
  padding: 0.12rem 0.56rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-current {
  background: #e6f6ec;
  color: var(--success);
}

.status-pending {
  background: #fff6de;
  color: #8f5900;
}

.status-superseded {
  background: #f1f4f8;
  color: #556375;
}

.text-link {
  text-decoration: none;
  display: inline-block;
  margin-bottom: 0.65rem;
  color: #1f5f8d;
  font-weight: 700;
}

.document-header {
  margin-bottom: 1rem;
}

.document-header h1 {
  margin: 0;
  font-family: "Outfit", sans-serif;
}

.pill-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.65rem 0;
}

.pill {
  background: var(--brand-soft);
  color: #0a4752;
  border: 1px solid #c1e8f0;
  border-radius: 999px;
  padding: 0.22rem 0.63rem;
  font-size: 0.84rem;
  font-weight: 700;
}

.meta-line {
  color: var(--muted);
  margin: 0;
}

.doc-content {
  line-height: 1.5;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
  margin-top: 1.1rem;
  font-family: "Outfit", sans-serif;
}

.markdown-content table {
  margin-top: 0.7rem;
}

.no-results {
  margin-top: 1rem;
  padding: 0.82rem 0.95rem;
  border-radius: 10px;
  border: 1px solid #efd9b3;
  background: #fff7e8;
  color: var(--warning);
  font-weight: 700;
}

.site-footer {
  text-align: center;
  color: #63758c;
  font-size: 0.92rem;
  margin: 1.8rem 0 1.5rem;
}

@keyframes lift {
  from {
    transform: translateY(8px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 980px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-grid {
    grid-template-columns: 1fr 1fr;
  }

  .upload-grid {
    grid-template-columns: repeat(2, minmax(170px, 1fr));
  }

  .file-input-wrap {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .brand-wrap {
    width: 100%;
  }

  .brand-logo {
    width: 118px;
  }

  .top-nav {
    width: 100%;
  }

  .top-nav a {
    font-size: 0.86rem;
  }

  .hero {
    padding: 1.05rem;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .upload-grid {
    grid-template-columns: 1fr;
  }

  .file-input-wrap {
    grid-column: span 1;
  }

  .results-copy {
    font-size: 0.93rem;
  }
}
