:root {
  --bg: #f4f6f0;
  --card: #fffef9;
  --ink: #1f2a1c;
  --muted: #4f5f4d;
  --brand: #0e5a43;
  --brand-2: #164037;
  --line: #d4ddcf;
  --accent: #f3b73c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at top left, #eaf2d9, #f4f6f0 45%) fixed;
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1.6;
}

h1,
h2,
h3 {
  font-family: 'Merriweather', serif;
  line-height: 1.25;
  margin-top: 0;
}

a {
  color: var(--brand);
}

.container {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 2rem;
}

.site-header {
  padding: 0.5rem 0;
}

.site-header.compact {
  margin-bottom: 0.55rem;
}

.brand {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--brand-2);
  text-decoration: none;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.58rem;
}

.brand-logo {
  width: auto;
  height: 96px;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

.site-header.compact .brand-logo {
  height: 64px;
}

.tagline {
  margin: 0.15rem 0 0;
  color: var(--muted);
}

.content-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem;
  margin-top: 1rem;
  box-shadow: 0 9px 20px rgba(35, 56, 30, 0.05);
}

.hero {
  background: linear-gradient(135deg, #fffdf4, #ecf4e4);
}

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

.tool-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem;
  background: #fff;
}

.primary-link {
  display: inline-block;
  margin-top: 0.4rem;
  font-weight: 700;
}

.ad-strip {
  border-style: dashed;
}

.ad-label {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.protocol-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 0.6rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 0.5rem;
}

.form-label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  padding: 0.75rem;
  resize: vertical;
}

select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.68rem 0.7rem;
  font-family: 'Space Grotesk', sans-serif;
  background: #fff;
}

.decoder-options {
  margin-top: 0.8rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbf6;
}

.form-step {
  margin: 0 0 0.35rem;
  font-weight: 700;
}

.decoder-options .form-label {
  margin-top: 0.1rem;
}

.action-row {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.6rem;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 1.05rem;
  font-weight: 700;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
}

button.secondary {
  background: #d9e3d3;
  color: #243923;
}

.status {
  margin: 0.8rem 0 0;
  color: var(--muted);
}

.status.error {
  color: #b22222;
}

.status.success {
  color: #0a6644;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

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

th {
  background: #eef4e8;
}

code {
  background: #f0f5eb;
  border: 1px solid #dbe4d6;
  border-radius: 6px;
  padding: 0.15rem 0.3rem;
  word-break: break-all;
}

.simple-list {
  margin: 0;
  padding-left: 1rem;
}

.sidebar-category + .sidebar-category {
  margin-top: 0.7rem;
}

.sidebar-category h4 {
  margin: 0.15rem 0 0.3rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #375848;
}

.seo-details h3 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

.seo-list {
  margin: 0;
  padding-left: 1.1rem;
}

.seo-list li + li {
  margin-top: 0.35rem;
}

.layer-block + .layer-block {
  margin-top: 1rem;
}

.layer-block h3 {
  margin-bottom: 0.45rem;
}

.layer-table {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
}

.protocol-stack-banner {
  margin: 0.85rem 0 0.95rem;
  padding: 0.75rem 0.95rem 0.85rem;
  border: 1px solid #a8c8b1;
  border-left: 7px solid var(--brand);
  border-radius: 10px;
  background: linear-gradient(92deg, #e3f1e6 0%, #f7fbf5 65%);
  color: #12362a;
}

.stack-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #2a5f4b;
}

.stack-value {
  display: block;
  margin-top: 0.28rem;
  font-size: 1.03rem;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  word-break: break-word;
}

.packet-insights-wrap {
  margin-bottom: 0.85rem;
}

.raw-decode-box {
  min-height: 260px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.42;
  white-space: pre;
  overflow: auto;
  background: #f8fbf6;
}

.site-footer {
  margin-top: 2rem;
  background: #1d2a1d;
  color: #f0f5ec;
  padding: 2rem 1rem;
}

.footer-grid {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.site-footer h3 {
  margin-bottom: 0.4rem;
  color: #fff;
}

.site-footer p,
.site-footer li,
.site-footer a {
  color: #d8e6d2;
}

.footer-note {
  width: min(1180px, calc(100% - 2rem));
  margin: 1rem auto 0;
  color: #c9d5c4;
}

.consent-banner {
  display: none;
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: min(540px, calc(100% - 2rem));
  background: #fffef9;
  border: 1px solid #b5c7b0;
  border-radius: 12px;
  box-shadow: 0 14px 28px rgba(21, 38, 19, 0.18);
  padding: 0.95rem;
  z-index: 1000;
}

.consent-banner h3 {
  margin-bottom: 0.4rem;
}

.consent-banner p {
  margin: 0.35rem 0;
  color: #2b3b2a;
  font-size: 0.93rem;
}

.consent-note {
  font-size: 0.82rem;
  color: #4f5f4d;
}

.consent-actions {
  margin-top: 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.consent-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.46rem 0.84rem;
  font-weight: 700;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
}

.consent-btn.secondary {
  background: #d9e3d3;
  color: #243923;
}

.consent-modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 26, 16, 0.48);
  z-index: 1001;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.consent-modal[hidden] {
  display: none;
}

.consent-modal-card {
  width: min(560px, 100%);
  background: #fffef9;
  border: 1px solid #b5c7b0;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 16px 28px rgba(21, 38, 19, 0.2);
}

.consent-modal-card h3 {
  margin-bottom: 0.45rem;
}

.consent-modal-card p {
  margin: 0.3rem 0 0.6rem;
}

.consent-check {
  display: block;
  margin: 0.38rem 0;
}

.consent-check input {
  margin-right: 0.4rem;
}

@media (max-width: 960px) {
  .protocol-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  table {
    min-width: 620px;
  }

  .brand-logo {
    width: auto;
    height: 78px;
  }

  .site-header.compact .brand-logo {
    height: 56px;
  }

  .consent-banner {
    right: 0.6rem;
    left: 0.6rem;
    width: auto;
    bottom: 0.6rem;
  }
}
