:root {
  --bg: #f4f6f0;
  --surface: #ffffff;
  --surface-2: #e9efe0;
  --text: #111411;
  --muted: #556051;
  --good: #1b7b44;
  --bad: #b82d1f;
  --accent: #d9ff65;
  --line: #d6dece;
  --shadow: 0 14px 36px rgba(17, 20, 17, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Archivo', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(217, 255, 101, 0.55), transparent 32%),
    radial-gradient(circle at 100% 10%, rgba(57, 118, 0, 0.18), transparent 28%),
    linear-gradient(135deg, #f4f6f0 0%, #f0f7dd 42%, #e8eee1 100%);
}

.layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

.hero {
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: var(--shadow);
  animation: rise 620ms ease-out;
}

.hero h1 {
  font-size: clamp(1.8rem, 2.2vw, 2.8rem);
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.hero p {
  color: var(--muted);
  margin: 0.8rem 0 1.3rem;
  max-width: 70ch;
}

.controls {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: 999px;
  background: var(--text);
  color: white;
  padding: 0.75rem 1.3rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.45;
  cursor: wait;
}

#lastRunMeta {
  color: var(--muted);
  font-size: 0.92rem;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--shadow);
  animation: rise 620ms ease-out;
}

.card h3 {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}

.card strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.25rem;
}

.results {
  margin-top: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 1.4rem;
  box-shadow: var(--shadow);
}

.results h2 {
  margin: 0;
  font-size: 1.15rem;
}

.result-controls {
  display: none;
}

.toggle-button {
  padding: 0.45rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 700;
  background: #eef3ea;
  color: var(--text);
  border: 1px solid var(--line);
}

.toggle-button.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

.withdrawn-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.9rem;
}

.withdrawn-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbf4;
  padding: 0.75rem;
}

.withdrawn-header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.35rem;
}

.withdrawn-meta {
  margin-top: 0.25rem;
  font-size: 0.9rem;
}

.withdrawn-successors {
  margin-top: 0.4rem;
  font-size: 0.9rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

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

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

th {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: #f6f9f2;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody tr:nth-child(odd) {
  background: rgba(233, 239, 224, 0.45);
}

code {
  font-family: 'IBM Plex Mono', monospace;
  background: #eef3ea;
  border-radius: 8px;
  padding: 0.1rem 0.3rem;
}

.status {
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  display: inline-block;
}

.status.pass {
  color: var(--good);
  background: rgba(27, 123, 68, 0.12);
}

.status.fail {
  color: var(--bad);
  background: rgba(184, 45, 31, 0.12);
}

.status-pill {
  display: inline-block;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-weight: 700;
  line-height: 1.2;
}

.status-pill.status-withdrawn {
  color: var(--bad);
  background: rgba(184, 45, 31, 0.15);
}

.status-pill.status-active {
  color: var(--good);
  background: rgba(27, 123, 68, 0.14);
}

.status-pill.status-unknown,
.status-pill.status-na {
  color: var(--muted);
  background: rgba(85, 96, 81, 0.14);
}

.lifecycle-path {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.35;
  margin-bottom: 0.3rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .results {
    padding: 1rem;
  }

  .result-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    margin-top: 0.65rem;
    margin-bottom: 0.4rem;
    color: var(--muted);
    font-size: 0.84rem;
  }

  .summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-wrap {
    border: 0;
    overflow: visible;
  }

  table,
  thead,
  tbody,
  th,
  td,
  tr {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    border-bottom: 1px solid var(--line);
    padding: 0.6rem 0;
  }

  td {
    border: 0;
    padding: 0.35rem 0;
  }

  td::before {
    display: block;
    font-size: 0.76rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.2rem;
  }

  td:nth-child(1)::before { content: 'Szabvány azonosító'; }
  td:nth-child(2)::before { content: 'Típus'; }
  td:nth-child(3)::before { content: 'Állapot'; }
  td:nth-child(4)::before { content: 'MSZT adatlap'; }
  td:nth-child(5)::before { content: 'Utód szabványok'; }
}
