: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;
}

input[type="text"],
input[type="email"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.68rem 0.7rem;
  font-family: 'Space Grotesk', sans-serif;
  background: #fff;
}

input[type="file"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  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;
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
}

button:active {
  transform: scale(0.97);
}

button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  filter: grayscale(0.18);
}

button.is-pressed {
  animation: button-press-pop 180ms ease-out;
}

@keyframes button-press-pop {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  40% {
    transform: scale(0.95);
    filter: brightness(0.96);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

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

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

.status.error {
  color: #b22222;
}

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

.color-legend {
  margin-top: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: #2f3c2b;
  font-size: 0.85rem;
}

.legend-item::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  display: inline-block;
}

.legend-network::before {
  background: #2a69ac;
}

.legend-transport::before {
  background: #2f855a;
}

.legend-app::before {
  background: #b7791f;
}

.legend-other::before {
  background: #6b7280;
}

.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: 0;
  table-layout: fixed;
}

.layer-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.layer-table td:nth-child(2) {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  word-break: break-word;
}

.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;
}

.packet-json-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  background: #fbfdf9;
  margin-top: 0.75rem;
  overflow: hidden;
}

.packet-json-header {
  cursor: pointer;
  list-style: none;
  padding: 0.8rem;
}

.packet-json-header::-webkit-details-marker {
  display: none;
}

.packet-json-header::before {
  content: "▸";
  margin-right: 0.45rem;
  color: #305847;
  display: inline-block;
  transform-origin: center;
  transition: transform 140ms ease;
}

.packet-json-card[open] .packet-json-header::before {
  transform: rotate(90deg);
}

.packet-json-card h3 {
  margin-bottom: 0.3rem;
  display: inline;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.packet-json-meta {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 1rem;
  font-family: 'Space Grotesk', sans-serif;
}

.packet-json-body {
  border-top: 1px solid var(--line);
  padding: 0.8rem;
}

.security-findings {
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e2d7b4;
  border-radius: 10px;
  background: #fff9ea;
}

.security-findings h4 {
  margin-bottom: 0.35rem;
}

.security-findings ul {
  margin: 0;
  padding-left: 1rem;
}

.finding-row {
  margin: 0.22rem 0;
  padding: 0.28rem 0.4rem 0.28rem 0.45rem;
  border-radius: 8px;
  border-left: 4px solid #d1d5db;
}

.finding-row-warning {
  background: #fff8e8;
  border-left-color: #b7791f;
  color: #6a3e00;
}

.finding-row-error {
  background: #fff1f1;
  border-left-color: #b22222;
  color: #8f1515;
}

.finding-row-threat {
  background: #fff0f8;
  border-left-color: #b83280;
  color: #7d124f;
}

.finding-severity {
  display: inline-block;
  font-size: 0.73rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.08rem 0.42rem;
}

.finding-warning {
  background: #f8d7a4;
  color: #6a3e00;
}

.finding-info {
  background: #d8e8fa;
  color: #12416f;
}

.finding-error {
  background: #ffd5d5;
  color: #8f1515;
}

.finding-threat {
  background: #ffc8e5;
  color: #7d124f;
}

.packet-risk-summary {
  margin-left: 0.65rem;
  display: inline-flex;
  gap: 0.32rem;
  flex-wrap: wrap;
  vertical-align: middle;
}

.packet-risk-chip {
  display: inline-block;
  border-radius: 999px;
  padding: 0.15rem 0.48rem;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.packet-risk-chip-warning {
  background: #f6dfb5;
  border-color: #e8c078;
  color: #6a3e00;
}

.packet-risk-chip-error {
  background: #ffd5d5;
  border-color: #f0b0b0;
  color: #8f1515;
}

.packet-risk-chip-threat {
  background: #ffc8e5;
  border-color: #eea9d3;
  color: #7d124f;
}

.security-summary-chips {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.protocol-tone-network {
  border-left: 6px solid #2a69ac;
  background: linear-gradient(90deg, rgba(42, 105, 172, 0.08), #fbfdf9 22%);
}

.protocol-tone-transport {
  border-left: 6px solid #2f855a;
  background: linear-gradient(90deg, rgba(47, 133, 90, 0.08), #fbfdf9 22%);
}

.protocol-tone-app {
  border-left: 6px solid #b7791f;
  background: linear-gradient(90deg, rgba(183, 121, 31, 0.08), #fbfdf9 22%);
}

.protocol-tone-other {
  border-left: 6px solid #6b7280;
  background: linear-gradient(90deg, rgba(107, 114, 128, 0.08), #fbfdf9 22%);
}

.json-node {
  margin: 0.2rem 0 0.2rem 0.35rem;
}

.json-node > summary {
  cursor: pointer;
  line-height: 1.45;
}

.json-children {
  margin-left: 1rem;
  border-left: 1px dashed #c7d5c0;
  padding-left: 0.7rem;
}

.json-key {
  color: #1a3f34;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
}

.json-meta {
  color: #4f5f4d;
  font-size: 0.9rem;
  margin-left: 0.15rem;
}

.json-value {
  color: #2a2f29;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.json-value-null {
  color: #7b4d22;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1rem;
}

.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;
  }
}

/* Layout compatibility + homepage sections */
.container {
  width: min(1180px, calc(100% - 2rem));
}

.site-header .header-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1d7a5f, #133e34);
  color: #fff;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}

.brand-text {
  font-weight: 800;
  letter-spacing: 0.01em;
}

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

.nav a {
  text-decoration: none;
  color: var(--brand-2);
  font-weight: 600;
  padding: 0.4rem 0.6rem;
  border-radius: 999px;
}

.nav a:hover {
  background: #deefe6;
  color: var(--brand);
}

.main {
  padding-top: 0;
  padding-bottom: 0;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1.1rem;
  align-items: start;
}

.content-grid.full-width {
  grid-template-columns: minmax(0, 1fr);
}

.content-main {
  min-width: 0;
  overflow: hidden;
}

.content-sidebar {
  display: grid;
  gap: 0.9rem;
}

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

.section-head {
  margin-bottom: 0.75rem;
}

.section-head p {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

.list {
  display: grid;
  gap: 0.6rem;
}

.list a {
  text-decoration: none;
}

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

.list-item:hover {
  border-color: #b6c9b7;
  background: #f7fbf5;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.7rem;
}

.tool-card {
  text-decoration: none;
}

.tool-card h3 {
  margin-bottom: 0.45rem;
  font-size: 1rem;
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: #e7efe2;
  color: var(--brand-2);
}

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

.widget h3 {
  margin: 0 0 0.7rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #ebf1e6;
}

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

.widget li {
  margin: 0;
}

.widget form {
  display: flex;
  gap: 0.45rem;
}

.widget input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.widget button {
  border: 0;
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  padding: 0.5rem 0.8rem;
  font-weight: 700;
}

.post-content {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-wrap: anywhere;
}

.post-content img {
  display: block;
  max-width: 100% !important;
  width: 100% !important;
  height: auto !important;
}

.post-content figure {
  max-width: 100% !important;
  width: 100% !important;
  margin-left: 0;
  margin-right: 0;
}

.post-content .wp-caption,
.post-content .wp-block-image,
.post-content [class*="wp-image-"] {
  max-width: 100% !important;
}

.post-content .alignleft,
.post-content .alignright,
.post-content .aligncenter {
  float: none !important;
  margin: 0.75rem auto !important;
  display: block !important;
}

.post-content p > img.alignleft,
.post-content p > img.alignright,
.post-content p > img.aligncenter {
  margin-left: auto !important;
  margin-right: auto !important;
}

.post-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.post-content iframe,
.post-content video,
.post-content canvas,
.post-content svg {
  max-width: 100%;
}

.post-content pre {
  overflow: auto;
  border-radius: 12px;
  padding: 0.8rem;
  background: #0c1628;
  color: #eaf2ff;
}

.post-content blockquote {
  border-left: 4px solid #bdd5f8;
  margin-left: 0;
  padding-left: 1rem;
  color: #41516a;
}

.post-content p,
.post-content li {
  line-height: 1.75;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: linear-gradient(90deg, #0d2619, #132f1f);
  color: #d6dfd5;
  font-size: 0.92rem;
  padding: 1rem 0 0.5rem;
}

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

.footer-col h4 {
  margin: 0 0 0.45rem;
  font-family: 'Merriweather', serif;
  font-size: 0.95rem;
  color: #f3f7f2;
}

.footer-col ul {
  margin: 0;
  padding-left: 1rem;
}

.footer-col a {
  color: #d9e8db;
}

.footer-note {
  margin-top: 0.8rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(214, 223, 213, 0.25);
  font-size: 0.82rem;
}

.home-section {
  margin-bottom: 1rem;
}

.home-three-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.home-blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
  gap: 0.9rem;
}

.home-blog-main {
  display: grid;
  gap: 0.7rem;
}

.blog-preview-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem;
  background: #fffefb;
  text-decoration: none;
}

.blog-preview-card:hover {
  border-color: #b6c9b7;
  background: #f7fbf5;
}

.blog-preview-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #dbe6d5;
  background: #edf4e8;
}

.blog-preview-card h3 {
  margin: 0 0 0.35rem;
}

.blog-preview-card p {
  margin: 0;
}

.blog-sidebar {
  display: grid;
  gap: 0.7rem;
  align-content: start;
}

.blog-sidebar .widget {
  box-shadow: none;
}

.home-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #d4ddcf;
}

.page-link {
  display: inline-block;
  padding: 0.45rem 0.8rem;
  border: 1px solid #d4ddcf;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  font-weight: 600;
}

.page-link.disabled {
  opacity: 0.55;
  pointer-events: none;
}

@media (max-width: 980px) {
  .content-grid,
  .home-blog-layout {
    grid-template-columns: 1fr;
  }

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

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

  .home-three-grid,
  .blog-preview-card {
    grid-template-columns: 1fr;
  }
}
