:root {
  --eds-ground: #f4f5f6;
  --eds-surface: #ffffff;
  --eds-surface-muted: #eceef0;
  --eds-ink: #202327;
  --eds-muted: #626970;
  --eds-line: #d7dade;
  --eds-strong-line: #aeb4ba;
  --eds-focus: #384049;
  --eds-radius: 8px;
  --eds-space-1: 0.5rem;
  --eds-space-2: 0.75rem;
  --eds-space-3: 1rem;
  --eds-space-4: 1.5rem;
  --eds-space-5: 2rem;
  --eds-space-6: 3rem;
  --eds-container: 1180px;
}

.electrika-design-system-page .entry-title,
.electrika-design-system-page .wp-block-post-title {
  display: none;
}

.electrika-design-system-page .entry-content,
.electrika-design-system-page .wp-block-post-content {
  max-width: none;
}

.electrika-design-system-page .eds-shell {
  width: 100vw;
  max-width: none;
  margin-left: calc(50% - 50vw);
  color: var(--eds-ink);
  background: var(--eds-ground);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

.eds-shell *,
.eds-shell *::before,
.eds-shell *::after {
  box-sizing: border-box;
}

.eds-shell :focus-visible {
  outline: 3px solid var(--eds-focus);
  outline-offset: 3px;
}

.eds-container {
  width: min(calc(100% - 2rem), var(--eds-container));
  margin-inline: auto;
}

.eds-hero {
  padding: clamp(3.5rem, 8vw, 7rem) 0 clamp(2.5rem, 5vw, 4.5rem);
  background: var(--eds-surface);
  border-bottom: 1px solid var(--eds-line);
}

.eds-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--eds-space-2) var(--eds-space-4);
  margin-bottom: var(--eds-space-5);
  color: var(--eds-muted);
  font-size: 0.875rem;
  font-weight: 650;
}

.eds-hero h1 {
  max-width: 900px;
  margin: 0 0 var(--eds-space-6);
  color: var(--eds-ink);
  font-size: clamp(2.75rem, 7vw, 6rem);
  font-weight: 720;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.eds-counters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-block: 1px solid var(--eds-line);
}

.eds-counter {
  min-height: 122px;
  padding: var(--eds-space-4);
  border-right: 1px solid var(--eds-line);
}

.eds-counter:last-child {
  border-right: 0;
}

.eds-counter strong,
.eds-counter span {
  display: block;
}

.eds-counter strong {
  margin-bottom: var(--eds-space-3);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
}

.eds-counter span {
  color: var(--eds-muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.3;
  text-transform: uppercase;
}

.eds-evidence {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--eds-space-4);
  margin-top: var(--eds-space-5);
}

.eds-evidence p {
  margin: 0;
  padding-left: var(--eds-space-3);
  border-left: 2px solid var(--eds-strong-line);
  color: var(--eds-muted);
  font-size: 0.95rem;
}

.eds-evidence strong {
  color: var(--eds-ink);
}

.eds-section-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--eds-line);
  background: rgba(255, 255, 255, 0.97);
}

.admin-bar .eds-section-nav {
  top: 32px;
}

.eds-section-nav__inner {
  position: relative;
}

.eds-section-nav__toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
  border: 0;
  color: var(--eds-ink);
  background: transparent;
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.eds-section-nav__links {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.eds-section-nav__links a {
  flex: 0 0 auto;
  padding: 1rem 1.1rem;
  border-left: 1px solid var(--eds-line);
  color: var(--eds-muted);
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
}

.eds-section-nav__links a:last-child {
  border-right: 1px solid var(--eds-line);
}

.eds-section-nav__links a span {
  margin-right: 0.45rem;
  color: var(--eds-ink);
}

.eds-section-nav__links a:hover,
.eds-section-nav__links a[aria-current="true"] {
  color: var(--eds-ink);
  background: var(--eds-surface-muted);
}

.eds-content {
  padding-block: clamp(2.5rem, 6vw, 6rem);
}

.eds-section {
  scroll-margin-top: 90px;
  padding: clamp(2rem, 5vw, 4.5rem) 0;
  border-top: 1px solid var(--eds-line);
}

.eds-section:first-child {
  border-top: 0;
}

.eds-section__header {
  display: grid;
  grid-template-columns: 64px minmax(0, 780px);
  gap: var(--eds-space-4);
  align-items: start;
}

.eds-section__number {
  padding-top: 0.25rem;
  color: var(--eds-muted);
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.eds-section h2,
.eds-section h3,
.eds-section p {
  color: inherit;
}

.eds-section h2 {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.eds-section__header p {
  max-width: 64ch;
  margin: var(--eds-space-3) 0 0;
  color: var(--eds-muted);
}

.eds-empty-state {
  display: flex;
  min-height: 170px;
  align-items: center;
  justify-content: center;
  margin: var(--eds-space-5) 0 0 88px;
  border: 1px dashed var(--eds-strong-line);
  border-radius: var(--eds-radius);
  color: var(--eds-muted);
  background: rgba(255, 255, 255, 0.45);
  text-align: center;
}

.eds-component-preview,
.eds-changelog {
  margin: var(--eds-space-5) 0 0 88px;
}

.eds-component-preview > h3,
.eds-changelog > h3 {
  margin: 0;
  font-size: 1.1rem;
}

.eds-component-preview > p {
  margin: var(--eds-space-1) 0 var(--eds-space-4);
  color: var(--eds-muted);
}

.eds-decision-card {
  overflow: hidden;
  border: 1px solid var(--eds-line);
  border-radius: var(--eds-radius);
  background: var(--eds-surface);
}

.eds-decision-card__header {
  display: flex;
  gap: var(--eds-space-4);
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--eds-space-4);
  border-bottom: 1px solid var(--eds-line);
}

.eds-decision-card__id {
  margin: 0 0 0.25rem;
  color: var(--eds-muted) !important;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.eds-decision-card__header h3 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.eds-status-chip {
  flex: 0 0 auto;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--eds-strong-line);
  border-radius: 999px;
  color: var(--eds-ink);
  background: var(--eds-surface-muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.05em;
}

.eds-decision-card__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.eds-decision-card__fields > div {
  min-width: 0;
  padding: var(--eds-space-4);
  border-right: 1px solid var(--eds-line);
  border-bottom: 1px solid var(--eds-line);
}

.eds-decision-card__fields > div:nth-child(2n) {
  border-right: 0;
}

.eds-decision-card__fields dt {
  margin-bottom: var(--eds-space-1);
  color: var(--eds-muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.eds-decision-card__fields dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.eds-table-wrap {
  margin-top: var(--eds-space-4);
  overflow-x: auto;
  border: 1px solid var(--eds-line);
  border-radius: var(--eds-radius);
  background: var(--eds-surface);
}

.eds-changelog table {
  width: 100%;
  min-width: 960px;
  border: 0;
  border-collapse: collapse;
}

.eds-changelog th,
.eds-changelog td {
  padding: 0.85rem 1rem;
  border: 0;
  border-right: 1px solid var(--eds-line);
  border-bottom: 1px solid var(--eds-line);
  text-align: left;
  vertical-align: top;
}

.eds-changelog th:last-child,
.eds-changelog td:last-child {
  border-right: 0;
}

.eds-changelog th {
  color: var(--eds-muted);
  background: var(--eds-surface-muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.eds-changelog td {
  color: var(--eds-muted);
}

@media (max-width: 800px) {
  .admin-bar .eds-section-nav {
    top: 46px;
  }

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

  .eds-counter {
    min-height: 108px;
    border-bottom: 1px solid var(--eds-line);
  }

  .eds-counter:nth-child(2n) {
    border-right: 0;
  }

  .eds-evidence {
    grid-template-columns: 1fr;
  }

  .eds-section-nav__toggle {
    display: flex;
  }

  .eds-section-nav__links {
    display: none;
    max-height: min(70vh, 520px);
    padding-bottom: var(--eds-space-3);
    overflow-y: auto;
  }

  .eds-section-nav.is-open .eds-section-nav__links {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .eds-section-nav__links a,
  .eds-section-nav__links a:last-child {
    padding: 0.75rem;
    border: 0;
    border-top: 1px solid var(--eds-line);
    white-space: normal;
  }

  .eds-section__header {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .eds-empty-state,
  .eds-component-preview,
  .eds-changelog {
    margin-left: 66px;
  }
}

@media (max-width: 560px) {
  .eds-hero h1 {
    font-size: clamp(2.5rem, 15vw, 4rem);
  }

  .eds-counters,
  .eds-decision-card__fields {
    grid-template-columns: 1fr;
  }

  .eds-counter,
  .eds-counter:nth-child(2n),
  .eds-decision-card__fields > div,
  .eds-decision-card__fields > div:nth-child(2n) {
    border-right: 0;
  }

  .eds-section-nav.is-open .eds-section-nav__links {
    grid-template-columns: 1fr;
  }

  .eds-section__header {
    grid-template-columns: 1fr;
    gap: var(--eds-space-2);
  }

  .eds-empty-state,
  .eds-component-preview,
  .eds-changelog {
    margin-left: 0;
  }

  .eds-decision-card__header {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .eds-shell {
    scroll-behavior: auto;
  }
}

