:root {
  /* Brand */
  --teal-base:  #008e8f;
  --teal-light: #68dccf;
  --teal-dark:  #125c5c;
  --purple:     #56008f;
  --gray:       #939393;
  --off-white:  #f4fafa;
  --black:      #0a0a0a;
  --text-dark:  #1a2e2e;

  /* Escala neutral */
  --neutral-50:  #f0f7f7;
  --neutral-100: #d4eaea;
  --neutral-200: #a8d0d0;
  --neutral-300: #78b0b0;
  --neutral-400: #486a6a;
  --neutral-500: #2e4e4e;
  --neutral-600: #1a2e2e;

  /* Semánticos */
  --color-success:      #008e8f;
  --color-success-bg:   rgba(0, 142, 143, 0.07);
  --color-success-text: #125c5c;
  --color-info:         #2563eb;
  --color-info-bg:      rgba(37, 99, 235, 0.07);
  --color-info-text:    #1a3a7a;
  --color-warning:      #d97706;
  --color-warning-bg:   rgba(217, 119, 6, 0.07);
  --color-warning-text: #7c3d00;
  --color-error:        #cc0033;
  --color-error-bg:     rgba(204, 0, 51, 0.07);
  --color-error-text:   #7a001f;

  /* Bordes */
  --border-subtle:  rgba(0, 142, 143, 0.08);
  --border-default: rgba(0, 142, 143, 0.15);
  --border-strong:  rgba(0, 142, 143, 0.3);

  /* Transiciones */
  --ease-fast:   0.15s ease;
  --ease-base:   0.2s ease;
  --ease-slow:   0.35s ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--off-white);
  color: var(--text-dark);
  font-family: "Noto Sans", sans-serif;
  overflow-x: hidden;
}

::selection {
  background: rgba(104, 220, 207, 0.45);
}

.brand-nav {
  background: rgba(0, 142, 143, 0.96);
  backdrop-filter: blur(14px);
}

.nav-link {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: #fff;
}

.theme-toggle {
  align-items: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 800;
  gap: 0.4rem;
  min-height: 2.25rem;
  padding: 0.45rem 0.75rem;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.34);
}

.theme-toggle__icon {
  font-size: 0.95rem;
  line-height: 1;
}

.hero-surface {
  background:
    radial-gradient(ellipse 70% 50% at 50% 36%, rgba(104, 220, 207, 0.18), transparent 70%),
    linear-gradient(135deg, var(--teal-dark) 0%, var(--teal-base) 52%, #007a7b 100%);
}

.hero-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 40px 40px;
}

.brand-logo-img {
  display: block;
  height: auto;
  object-fit: contain;
  width: min(100%, 22rem);
}

.brand-logo-img--nav {
  height: 2.4rem;
  width: auto;
}

.brand-logo-img--footer {
  margin-inline: auto;
  max-width: min(86vw, 22rem);
}

.brand-footer {
  background: var(--teal-dark);
  color: #fff;
}

.brand-footer__text {
  color: rgba(255, 255, 255, 0.72);
}

.brand-footer__link {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.8125rem;
  font-weight: 800;
  text-decoration: none;
}

.brand-footer__link:hover {
  color: #fff;
  text-decoration: underline;
}

.brand-footer__meta {
  color: rgba(255, 255, 255, 0.5);
}

.brand-iso-img {
  display: block;
  height: auto;
  object-fit: contain;
  width: 3rem;
}

.brand-iso-img--hero {
  width: clamp(5rem, 12vw, 8rem);
}

.brand-iso-img--small {
  width: 2.5rem;
}

.section-label {
  color: var(--teal-base);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.section-title {
  color: var(--text-dark);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
}

.section-desc {
  color: #5a7a7a;
  font-family: "Noto Serif", serif;
  font-size: 1.05rem;
  line-height: 1.75;
}

.brand-card {
  background: #fff;
  border: 1px solid rgba(0, 142, 143, 0.12);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(18, 92, 92, 0.08);
}

.logo-variant {
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  min-height: 18rem;
  overflow: hidden;
}

.logo-variant__preview {
  align-items: center;
  display: flex;
  flex: 1;
  justify-content: center;
  min-height: 13rem;
  padding: 2.5rem;
}

.logo-variant__meta {
  border-top: 1px solid rgba(0, 142, 143, 0.12);
  padding: 1rem 1.25rem;
}

.logo-variant--dark .logo-variant__meta {
  border-top-color: rgba(255, 255, 255, 0.16);
}

.swatch {
  min-height: 13rem;
  position: relative;
}

.swatch::after {
  background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.14));
  content: "";
  inset: 0;
  position: absolute;
}

.swatch--teal-base {
  background: var(--teal-base);
}

.swatch--teal-light {
  background: var(--teal-light);
}

.swatch--teal-dark {
  background: var(--teal-dark);
}

.swatch--purple {
  background: var(--purple);
}

.swatch--gray {
  background: var(--gray);
}

.swatch--gradient {
  background: linear-gradient(135deg, var(--teal-base), var(--teal-light));
}

.color-chip {
  border-radius: 999px;
  display: inline-flex;
  height: 2.75rem;
  width: 2.75rem;
}

.color-chip--teal-base {
  background: var(--teal-base);
}

.color-chip--teal-light {
  background: var(--teal-light);
}

.color-chip--teal-dark {
  background: var(--teal-dark);
}

.color-chip--purple {
  background: var(--purple);
}

.color-chip--gray {
  background: var(--gray);
}

.palette-band {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 0.8fr 0.8fr;
  min-height: 6rem;
  overflow: hidden;
}

.palette-band > span {
  display: block;
}

.badge {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.7rem;
  font-weight: 900;
  gap: 0.35rem;
  letter-spacing: 0.08em;
  padding: 0.32rem 0.72rem;
  text-transform: uppercase;
}

.badge-primary {
  background: rgba(0, 142, 143, 0.12);
  color: var(--teal-base);
}

.badge-dark {
  background: var(--teal-dark);
  color: #fff;
}

.badge-purple {
  background: rgba(86, 0, 143, 0.12);
  color: var(--purple);
}

.btn-brand {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  padding: 0.75rem 1.1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-brand:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--teal-base);
  color: #fff;
}

.btn-primary:hover {
  background: var(--teal-dark);
  box-shadow: 0 14px 32px rgba(0, 142, 143, 0.28);
}

.btn-secondary {
  border: 2px solid var(--teal-base);
  color: var(--teal-base);
}

.btn-secondary:hover {
  background: rgba(0, 142, 143, 0.08);
}

.tone-example {
  border-left: 3px solid var(--teal-base);
  color: #466;
  font-size: 0.94rem;
  line-height: 1.65;
  padding-left: 1rem;
}

.dont {
  border-left-color: #cc0033;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

.copy-button.copied {
  background: var(--teal-dark);
  color: #fff;
}

@media (max-width: 860px) {
  .nav-menu {
    background: rgba(0, 142, 143, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    display: none;
    left: 0;
    padding: 1rem 1.5rem 1.25rem;
    position: absolute;
    right: 0;
    top: 4rem;
  }

  .nav-menu.is-open {
    display: grid;
    gap: 0.85rem;
  }
}

/* ── Index cards ─────────────────────────────────────── */
.index-card {
  color: inherit;
  display: block;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.index-card:hover {
  box-shadow: 0 24px 72px rgba(18, 92, 92, 0.14);
  transform: translateY(-3px);
}

.index-card__num {
  color: var(--teal-base);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* ── Badge gray ──────────────────────────────────────── */
.badge-gray {
  background: rgba(147, 147, 147, 0.14);
  color: #6b6b6b;
}

.badge-success {
  background: var(--color-success-bg);
  color: var(--color-success-text);
}

.badge-info {
  background: var(--color-info-bg);
  color: var(--color-info-text);
}

.badge-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
}

.badge-error {
  background: var(--color-error-bg);
  color: var(--color-error-text);
}

/* ── Additional button variants ──────────────────────── */
.btn-ghost {
  color: var(--teal-base);
}

.btn-ghost:hover {
  background: rgba(0, 142, 143, 0.08);
  box-shadow: none;
  transform: translateY(-2px);
}

.btn-destructive {
  background: rgba(204, 0, 51, 0.08);
  color: #cc0033;
}

.btn-destructive:hover {
  background: #cc0033;
  box-shadow: 0 14px 32px rgba(204, 0, 51, 0.2);
  color: #fff;
}

.btn-brand:disabled,
.btn-brand.is-disabled {
  cursor: not-allowed;
  opacity: 0.38;
  pointer-events: none;
  transform: none !important;
}

.btn-loading-spinner {
  animation: ds-spin 0.8s linear infinite;
  border: 2.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  height: 0.875rem;
  width: 0.875rem;
}

@keyframes ds-spin {
  to { transform: rotate(360deg); }
}

/* ── Form elements ───────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  color: var(--text-dark);
  font-size: 0.875rem;
  font-weight: 700;
}

.form-input {
  appearance: none;
  background: #fff;
  border: 2px solid rgba(0, 142, 143, 0.2);
  border-radius: 8px;
  color: var(--text-dark);
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 0.6875rem 0.875rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  width: 100%;
}

.form-input::placeholder {
  color: var(--gray);
  opacity: 0.75;
}

.form-input:focus {
  border-color: var(--teal-base);
  box-shadow: 0 0 0 3px rgba(0, 142, 143, 0.14);
  outline: none;
}

.form-input.is-error {
  border-color: #cc0033;
}

.form-input.is-error:focus {
  box-shadow: 0 0 0 3px rgba(204, 0, 51, 0.11);
}

.form-input:disabled {
  background: var(--off-white);
  color: var(--gray);
  cursor: not-allowed;
}

.form-helper {
  color: var(--gray);
  font-size: 0.8125rem;
  line-height: 1.55;
}

.form-error-msg {
  color: #cc0033;
  font-size: 0.8125rem;
  line-height: 1.55;
}

.form-combobox {
  position: relative;
}

.form-combobox-input {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.form-combobox-list {
  background: #fff;
  border: 2px solid rgba(0, 142, 143, 0.2);
  border-radius: 0 0 8px 8px;
  border-top: 0;
  max-height: 11rem;
  overflow-y: auto;
}

.form-combobox-option {
  color: var(--text-dark);
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0.65rem 0.875rem;
}

.form-combobox-option + .form-combobox-option {
  border-top: 1px solid rgba(0, 142, 143, 0.08);
}

.form-combobox-option:hover,
.form-combobox-option.is-active {
  background: rgba(0, 142, 143, 0.08);
  color: var(--teal-dark);
  font-weight: 800;
}

/* ── Alerts ──────────────────────────────────────────── */
.alert {
  border-left: 4px solid;
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
}

.alert-title {
  font-size: 0.875rem;
  font-weight: 700;
}

.alert-body {
  font-size: 0.875rem;
  line-height: 1.6;
  margin-top: 0.2rem;
  opacity: 0.85;
}

.alert-success {
  background: rgba(0, 142, 143, 0.07);
  border-left-color: var(--teal-base);
  color: var(--teal-dark);
}

.alert-info {
  background: rgba(37, 99, 235, 0.07);
  border-left-color: #2563eb;
  color: #1a3a7a;
}

.alert-warning {
  background: rgba(217, 119, 6, 0.07);
  border-left-color: #d97706;
  color: #7c3d00;
}

.alert-error {
  background: rgba(204, 0, 51, 0.07);
  border-left-color: #cc0033;
  color: #7a001f;
}

/* ── Design system subnav ────────────────────────────── */
.ds-subnav {
  background: #fff;
  border-bottom: 1px solid rgba(0, 142, 143, 0.1);
  display: flex;
  left: 0;
  margin-top: 4rem;
  overflow-x: auto;
  padding: 0 1.5rem;
  position: sticky;
  right: 0;
  scrollbar-width: none;
  top: 4rem;
  z-index: 40;
}

.ds-subnav::-webkit-scrollbar {
  display: none;
}

.ds-subnav-link {
  border-bottom: 2px solid transparent;
  color: #5a7a7a;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.85rem 1rem;
  text-decoration: none;
  transition: color 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}

.ds-subnav-link:hover,
.ds-subnav-link.is-active {
  border-bottom-color: var(--teal-base);
  color: var(--teal-base);
}

/* ── Token rows ──────────────────────────────────────── */
.token-row {
  align-items: center;
  border-bottom: 1px solid rgba(0, 142, 143, 0.08);
  display: grid;
  gap: 1rem;
  grid-template-columns: 2.75rem 1fr 6rem 2fr;
  padding: 0.75rem 0;
}

.token-row:last-child {
  border-bottom: none;
}

.token-swatch {
  border-radius: 6px;
  display: block;
  height: 2.75rem;
  width: 2.75rem;
}

.token-name {
  color: var(--text-dark);
  font-size: 0.8125rem;
  font-weight: 700;
}

.token-var {
  color: var(--gray);
  font-family: monospace;
  font-size: 0.78rem;
}

.token-hex {
  color: #5a7a7a;
  font-family: monospace;
  font-size: 0.8rem;
  font-weight: 600;
}

.token-use {
  color: #5a7a7a;
  font-size: 0.8rem;
  line-height: 1.5;
}

/* ── Spacing rows ────────────────────────────────────── */
.space-row {
  align-items: center;
  border-bottom: 1px solid rgba(0, 142, 143, 0.08);
  display: grid;
  gap: 1rem;
  grid-template-columns: 4rem 1fr 3.5rem;
  padding: 0.5rem 0;
}

.space-row:last-child {
  border-bottom: none;
}

.space-bar {
  background: var(--teal-base);
  border-radius: 3px;
  height: 1.25rem;
  opacity: 0.45;
}

/* ── Shadow demos ─────────────────────────────────────── */
.shadow-demo {
  align-items: center;
  background: #fff;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  height: 5.5rem;
  justify-content: center;
}

.shadow-sm-demo { box-shadow: 0 1px 3px rgba(18,92,92,0.08), 0 1px 2px rgba(18,92,92,0.04); }
.shadow-md-demo { box-shadow: 0 4px 12px rgba(18,92,92,0.1), 0 2px 4px rgba(18,92,92,0.06); }
.shadow-lg-demo { box-shadow: 0 18px 60px rgba(18,92,92,0.08); }
.shadow-xl-demo { box-shadow: 0 32px 80px rgba(18,92,92,0.16), 0 12px 32px rgba(18,92,92,0.08); }

/* ── Card metric variant ─────────────────────────────── */
.card-metric {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal-base));
  border: none;
  color: #fff;
}

.card-metric .metric-value {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1;
}

.card-metric .metric-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-top: 0.25rem;
  opacity: 0.72;
  text-transform: uppercase;
}

.card-metric .metric-delta {
  font-size: 0.875rem;
  font-weight: 700;
  margin-top: 1rem;
  opacity: 0.85;
}

/* ── Contrast table ──────────────────────────────────── */
.contrast-pass { color: #00694a; font-weight: 700; }
.contrast-fail { color: #cc0033; font-weight: 700; }

.contrast-row {
  align-items: center;
  border-bottom: 1px solid rgba(0, 142, 143, 0.08);
  display: grid;
  gap: 1rem;
  grid-template-columns: 2.75rem 2.75rem 1fr 4rem 4rem 5rem;
  padding: 0.75rem 0;
}

.contrast-row:last-child { border-bottom: none; }

.contrast-swatch {
  border-radius: 4px;
  height: 2.75rem;
  width: 2.75rem;
}

/* ── Ghost-white button (hero oscuro) ────────────────── */
.btn-ghost-white {
  border: 2px solid rgba(255, 255, 255, 0.5);
  color: #fff;
}
.btn-ghost-white:hover {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

/* ── Screen reader only ──────────────────────────────── */
.sr-only {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

/* ── Form: Select ────────────────────────────────────── */
.form-select {
  appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='%23939393' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M4 6l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
  background-size: 1rem;
  border: 2px solid rgba(0, 142, 143, 0.2);
  border-radius: 8px;
  color: var(--text-dark);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 0.6875rem 2.5rem 0.6875rem 0.875rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  width: 100%;
}
.form-select:focus {
  border-color: var(--teal-base);
  box-shadow: 0 0 0 3px rgba(0, 142, 143, 0.14);
  outline: none;
}
.form-select:disabled {
  background-color: var(--off-white);
  color: var(--gray);
  cursor: not-allowed;
}

/* ── Form: Checkbox & Radio ──────────────────────────── */
.form-check {
  align-items: flex-start;
  cursor: pointer;
  display: flex;
  gap: 0.6rem;
}
.form-check-input {
  appearance: none;
  background: #fff;
  border: 2px solid rgba(0, 142, 143, 0.3);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  height: 1.125rem;
  margin-top: 0.1rem;
  position: relative;
  transition: border-color 0.18s, background 0.18s;
  width: 1.125rem;
}
.form-check-input:checked {
  background: var(--teal-base);
  border-color: var(--teal-base);
}
.form-check-input:checked::after {
  border: 2.5px solid #fff;
  border-right: 0;
  border-top: 0;
  content: "";
  height: 0.38rem;
  left: 50%;
  position: absolute;
  top: 40%;
  transform: translate(-50%, -50%) rotate(-45deg);
  width: 0.58rem;
}
.form-check-input[type="radio"] {
  border-radius: 50%;
}
.form-check-input[type="radio"]:checked::after {
  background: #fff;
  border: 0;
  border-radius: 50%;
  content: "";
  height: 0.45rem;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 0.45rem;
}
.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(0, 142, 143, 0.14);
  outline: none;
}
.form-check-input:disabled {
  background: var(--off-white);
  border-color: rgba(0, 142, 143, 0.12);
  cursor: not-allowed;
}
.form-check-label {
  color: var(--text-dark);
  font-size: 0.9375rem;
  line-height: 1.45;
}
.form-check-label.is-disabled {
  color: var(--gray);
}

/* ── Form: Toggle / Switch ────────────────────────────── */
.form-toggle {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 0.75rem;
  user-select: none;
}
.form-toggle-input {
  height: 0;
  opacity: 0;
  position: absolute;
  width: 0;
}
.form-toggle-track {
  background: rgba(0, 142, 143, 0.18);
  border-radius: 9999px;
  flex-shrink: 0;
  height: 1.375rem;
  position: relative;
  transition: background 0.22s ease;
  width: 2.5rem;
}
.form-toggle-thumb {
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  height: 1rem;
  left: 0.19rem;
  position: absolute;
  top: 0.19rem;
  transition: transform 0.22s ease;
  width: 1rem;
}
.form-toggle-input:checked ~ .form-toggle-track {
  background: var(--teal-base);
}
.form-toggle-input:checked ~ .form-toggle-track .form-toggle-thumb {
  transform: translateX(1.125rem);
}
.form-toggle-input:focus ~ .form-toggle-track {
  box-shadow: 0 0 0 3px rgba(0, 142, 143, 0.14);
}
.form-toggle-label {
  color: var(--text-dark);
  font-size: 0.9375rem;
}

/* ── Tabla ────────────────────────────────────────────── */
.ds-table {
  border-collapse: collapse;
  font-size: 0.875rem;
  width: 100%;
}
.ds-table thead th {
  background: var(--off-white);
  border-bottom: 2px solid rgba(0, 142, 143, 0.12);
  color: var(--text-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  padding: 0.75rem 1rem;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.ds-table tbody td {
  border-bottom: 1px solid rgba(0, 142, 143, 0.06);
  color: #486a6a;
  padding: 0.875rem 1rem;
  vertical-align: middle;
}
.ds-table tbody tr:last-child td { border-bottom: none; }
.ds-table tbody tr:hover td { background: rgba(0, 142, 143, 0.03); }

/* ── Tabs ─────────────────────────────────────────────── */
.ds-tabs {
  border-bottom: 2px solid rgba(0, 142, 143, 0.1);
  display: flex;
  gap: 0;
}
.ds-tab {
  border-bottom: 2px solid transparent;
  color: #5a7a7a;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: -2px;
  padding: 0.875rem 1.25rem;
  text-decoration: none;
  transition: color 0.18s, border-color 0.18s;
  white-space: nowrap;
}
.ds-tab:hover { color: var(--teal-base); }
.ds-tab.is-active {
  border-bottom-color: var(--teal-base);
  color: var(--teal-base);
}
.ds-tab-panel { display: none; }
.ds-tab-panel.is-active { display: block; }

/* ── Progress bar ─────────────────────────────────────── */
.ds-progress {
  background: rgba(0, 142, 143, 0.1);
  border-radius: 9999px;
  height: 0.5rem;
  overflow: hidden;
  width: 100%;
}
.ds-progress-fill {
  background: var(--teal-base);
  border-radius: 9999px;
  height: 100%;
  transition: width 0.6s ease;
}
.ds-progress--sm  { height: 0.3rem; }
.ds-progress--lg  { height: 0.875rem; }
.ds-progress--purple { background-color: var(--purple); }
.ds-progress--warning { background-color: var(--color-warning); }
.ds-progress--error   { background-color: var(--color-error); }
.ds-progress--table {
  flex: 0 0 6rem;
  height: 0.5rem;
  width: 6rem;
}
.ds-progress-value {
  color: var(--teal-dark);
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  text-align: right;
  width: 2.6rem;
}

/* ── Spinner ──────────────────────────────────────────── */
.ds-spinner {
  animation: ds-spin 0.8s linear infinite;
  border: 3px solid rgba(0, 142, 143, 0.15);
  border-radius: 50%;
  border-top-color: var(--teal-base);
  display: inline-block;
  flex-shrink: 0;
  height: 2rem;
  width: 2rem;
}
.ds-spinner--sm { border-width: 2px; height: 1.25rem; width: 1.25rem; }
.ds-spinner--lg { border-width: 4px; height: 3rem; width: 3rem; }

/* ── Skeleton loader ──────────────────────────────────── */
.skeleton {
  animation: skeleton-wave 1.6s ease-in-out 0.3s infinite;
  background: linear-gradient(
    90deg,
    rgba(0, 142, 143, 0.08) 0%,
    rgba(0, 142, 143, 0.04) 40%,
    rgba(0, 142, 143, 0.08) 80%
  );
  background-size: 400% 100%;
  border-radius: 4px;
}

.layout-preview {
  background: var(--off-white);
  color: var(--text-dark);
}

.layout-preview-hero {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal-base));
  color: #fff;
}

.ds-mini-cta {
  align-items: center;
  background: var(--teal-base);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-size: 0.75rem;
  font-weight: 800;
  height: 2rem;
  padding-inline: 1rem;
}
@keyframes skeleton-wave {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Empty state ──────────────────────────────────────── */
.empty-state {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 3rem 1.5rem;
  text-align: center;
}
.empty-state-icon {
  align-items: center;
  background: rgba(0, 142, 143, 0.08);
  border-radius: 50%;
  color: var(--teal-base);
  display: flex;
  font-size: 1.5rem;
  height: 4rem;
  justify-content: center;
  width: 4rem;
}
.empty-state-title {
  color: var(--text-dark);
  font-size: 1rem;
  font-weight: 700;
  margin-top: 0.25rem;
}
.empty-state-desc {
  color: #5a7a7a;
  font-size: 0.875rem;
  line-height: 1.65;
  max-width: 26rem;
}

/* ── Breadcrumb ───────────────────────────────────────── */
.ds-breadcrumb {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.ds-breadcrumb-item {
  align-items: center;
  color: var(--gray);
  display: flex;
  font-size: 0.8125rem;
  gap: 0.15rem;
}
.ds-breadcrumb-item a {
  color: var(--teal-base);
  text-decoration: none;
  transition: color 0.18s;
}
.ds-breadcrumb-item a:hover { color: var(--teal-dark); text-decoration: underline; }
.ds-breadcrumb-item.is-current { color: var(--text-dark); font-weight: 700; }
.ds-breadcrumb-sep { color: var(--gray); margin: 0 0.1rem; opacity: 0.5; }

/* ── Do / Don't ───────────────────────────────────────── */
.do-block,
.dont-block {
  border-radius: 8px;
  border-top: 4px solid;
  padding: 1.25rem;
}
.do-block {
  background: rgba(0, 142, 143, 0.05);
  border-top-color: var(--teal-base);
}
.do-label,
.do-block .do-label {
  color: var(--teal-base);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.dont-block {
  background: rgba(204, 0, 51, 0.05);
  border-top-color: #cc0033;
}
.dont-label,
.dont-block .dont-label {
  color: #cc0033;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.do-dont-content {
  color: #486a6a;
  font-size: 0.875rem;
  line-height: 1.65;
  margin-top: 0.75rem;
}
.do-dont-example {
  border-radius: 6px;
  font-weight: 700;
  margin-top: 0.75rem;
  padding: 0.6rem 0.875rem;
}
.do-block .do-dont-example {
  background: rgba(0, 142, 143, 0.08);
  color: var(--teal-dark);
}
.dont-block .do-dont-example {
  background: rgba(204, 0, 51, 0.07);
  color: #7a001f;
}

.microcopy-example--good {
  background: rgba(0, 142, 143, 0.08);
  color: var(--teal-dark);
}

.microcopy-example--bad {
  background: rgba(204, 0, 51, 0.07);
  color: #7a001f;
}

/* ── Code / Token snippet ─────────────────────────────── */
.ds-code {
  background: #0f1f1f;
  border-radius: 8px;
  color: var(--teal-light);
  font-family: monospace;
  font-size: 0.8125rem;
  line-height: 1.7;
  overflow-x: auto;
  padding: 1rem 1.25rem;
}
.ds-code span.ds-code-comment { color: rgba(104, 220, 207, 0.4); }
.ds-code span.ds-code-key     { color: var(--teal-light); }
.ds-code span.ds-code-val     { color: #fff; }

/* ── Divider ──────────────────────────────────────────── */
.ds-divider-label {
  align-items: center;
  color: var(--gray);
  display: flex;
  font-size: 0.72rem;
  font-weight: 700;
  gap: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ds-divider-label::before,
.ds-divider-label::after {
  background: rgba(0, 142, 143, 0.1);
  content: "";
  flex: 1;
  height: 1px;
}

/* ── Tag / Chip ───────────────────────────────────────── */
.ds-tag {
  align-items: center;
  background: rgba(0, 142, 143, 0.1);
  border-radius: 9999px;
  color: var(--teal-dark);
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 700;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
}
.ds-tag-close {
  align-items: center;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.65rem;
  height: 1rem;
  justify-content: center;
  transition: background 0.18s;
  width: 1rem;
}
.ds-tag-close:hover { background: rgba(0, 0, 0, 0.22); }

/* ── Stat / KPI card ──────────────────────────────────── */
.stat-card {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 1.5rem;
}
.stat-value {
  color: var(--text-dark);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}
.stat-label {
  color: var(--gray);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-top: 0.25rem;
  text-transform: uppercase;
}
.stat-delta {
  font-size: 0.8125rem;
  font-weight: 700;
  margin-top: 0.75rem;
}
.stat-delta-up   { color: var(--color-success); }
.stat-delta-down { color: var(--color-error); }

/* ── Transition tokens demo ───────────────────────────── */
.transition-demo {
  align-items: center;
  background: rgba(0, 142, 143, 0.08);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  height: 3rem;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.transition-demo::after {
  background: var(--teal-base);
  border-radius: inherit;
  bottom: 0;
  content: "";
  left: 0;
  position: absolute;
  top: 0;
  width: 0;
}
.transition-demo:hover::after { width: 100%; }
.transition-demo-fast::after   { transition: width 0.15s ease; }
.transition-demo-base::after   { transition: width 0.22s ease; }
.transition-demo-slow::after   { transition: width 0.38s ease; }
.transition-demo-bounce::after { transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ── Tooltip ──────────────────────────────────────────── */
.tooltip-wrap {
  display: inline-flex;
  position: relative;
}
.tooltip-wrap .tooltip {
  background: var(--text-dark);
  border-radius: 6px;
  bottom: calc(100% + 6px);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  left: 50%;
  opacity: 0;
  padding: 0.4rem 0.75rem;
  pointer-events: none;
  position: absolute;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 0.18s, transform 0.18s;
  white-space: nowrap;
  z-index: 100;
}
.tooltip-wrap:hover .tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Dark theme ───────────────────────────────────────── */
html[data-theme="dark"] body {
  background: #071f20;
  color: #e7fbf8;
}

html[data-theme="dark"] .brand-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .bg-white {
  background-color: #0f2b2c !important;
  border-color: rgba(104, 220, 207, 0.18);
  color: #e7fbf8;
}

html[data-theme="dark"] .brand-footer {
  background: #041819;
  color: #fff;
}

html[data-theme="dark"] .brand-footer__text {
  color: rgba(231, 251, 248, 0.72);
}

html[data-theme="dark"] .brand-footer__link {
  color: rgba(231, 251, 248, 0.86);
}

html[data-theme="dark"] .brand-footer__link:hover {
  color: #fff;
}

html[data-theme="dark"] .brand-footer__meta {
  color: rgba(231, 251, 248, 0.52);
}

html[data-theme="dark"] .bg-offWhite,
html[data-theme="dark"] .layout-preview,
html[data-theme="dark"] .form-input,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .form-combobox-list {
  background-color: #0a2526 !important;
  color: #e7fbf8;
}

html[data-theme="dark"] .section-title,
html[data-theme="dark"] .empty-state-title,
html[data-theme="dark"] .form-label,
html[data-theme="dark"] .form-check-label,
html[data-theme="dark"] .form-toggle-label,
html[data-theme="dark"] .stat-value,
html[data-theme="dark"] .ds-progress-value,
html[data-theme="dark"] .text-textDark,
html[data-theme="dark"] .text-tealDark {
  color: #e7fbf8 !important;
}

html[data-theme="dark"] .section-desc,
html[data-theme="dark"] .form-helper,
html[data-theme="dark"] .empty-state-desc,
html[data-theme="dark"] .do-dont-content,
html[data-theme="dark"] .text-brandGray,
html[data-theme="dark"] .text-\[\#5a7a7a\] {
  color: rgba(231, 251, 248, 0.7) !important;
}

html[data-theme="dark"] .ds-table thead th,
html[data-theme="dark"] .ds-table tbody td {
  background: transparent;
  border-color: rgba(104, 220, 207, 0.12);
  color: rgba(231, 251, 248, 0.76);
}

html[data-theme="dark"] .ds-table tbody tr:hover td {
  background: rgba(104, 220, 207, 0.06);
}

html[data-theme="dark"] .form-input,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .form-combobox-list {
  border-color: rgba(104, 220, 207, 0.28);
}

html[data-theme="dark"] .form-combobox-option {
  color: #e7fbf8;
}

html[data-theme="dark"] .form-combobox-option:hover,
html[data-theme="dark"] .form-combobox-option.is-active {
  background: rgba(104, 220, 207, 0.12);
  color: #fff;
}

html[data-theme="dark"] .brand-mark-on-light {
  filter: invert(1);
}

html[data-theme="dark"] .alert-success {
  background: rgba(104, 220, 207, 0.14);
  border-left-color: var(--teal-light);
  color: #d6fffa;
}

html[data-theme="dark"] .alert-info {
  background: rgba(96, 165, 250, 0.16);
  border-left-color: #60a5fa;
  color: #dbeafe;
}

html[data-theme="dark"] .alert-warning {
  background: rgba(251, 191, 36, 0.17);
  border-left-color: #fbbf24;
  color: #ffefc2;
}

html[data-theme="dark"] .alert-error {
  background: rgba(248, 113, 113, 0.16);
  border-left-color: #f87171;
  color: #ffe1e1;
}

html[data-theme="dark"] .do-block {
  background: rgba(104, 220, 207, 0.1);
  border-top-color: var(--teal-light);
}

html[data-theme="dark"] .dont-block {
  background: rgba(248, 113, 113, 0.1);
  border-top-color: #f87171;
}

html[data-theme="dark"] .do-block .do-dont-example,
html[data-theme="dark"] .microcopy-example--good {
  background: rgba(104, 220, 207, 0.16) !important;
  color: #d6fffa !important;
}

html[data-theme="dark"] .dont-block .do-dont-example,
html[data-theme="dark"] .microcopy-example--bad {
  background: rgba(248, 113, 113, 0.16) !important;
  color: #ffe1e1 !important;
}

html[data-theme="dark"] .do-label,
html[data-theme="dark"] .do-block .do-label {
  color: var(--teal-light);
}

html[data-theme="dark"] .dont-label,
html[data-theme="dark"] .dont-block .dont-label {
  color: #fca5a5;
}

html[data-theme="dark"] .badge-primary,
html[data-theme="dark"] .badge-success,
html[data-theme="dark"] .badge[style*="--color-success-bg"] {
  background: rgba(104, 220, 207, 0.16) !important;
  color: #d6fffa !important;
}

html[data-theme="dark"] .badge-info,
html[data-theme="dark"] .badge[style*="--color-info-bg"] {
  background: rgba(96, 165, 250, 0.18) !important;
  color: #dbeafe !important;
}

html[data-theme="dark"] .badge-warning,
html[data-theme="dark"] .badge[style*="--color-warning-bg"] {
  background: rgba(251, 191, 36, 0.2) !important;
  color: #ffefc2 !important;
}

html[data-theme="dark"] .badge-error,
html[data-theme="dark"] .badge[style*="--color-error-bg"] {
  background: rgba(248, 113, 113, 0.18) !important;
  color: #ffe1e1 !important;
}

html[data-theme="dark"] .badge-dark {
  background: rgba(104, 220, 207, 0.22);
  color: #fff;
}

html[data-theme="dark"] .badge-purple,
html[data-theme="dark"] .ds-tag[style*="--purple"] {
  background: rgba(196, 181, 253, 0.18) !important;
  color: #ede9fe !important;
}

html[data-theme="dark"] .badge-gray {
  background: rgba(231, 251, 248, 0.12);
  color: rgba(231, 251, 248, 0.78);
}

html[data-theme="dark"] .ds-breadcrumb-item {
  color: rgba(231, 251, 248, 0.7);
}

html[data-theme="dark"] .ds-breadcrumb-item a {
  color: var(--teal-light);
}

html[data-theme="dark"] .ds-breadcrumb-item a:hover {
  color: #fff;
}

html[data-theme="dark"] .ds-breadcrumb-item.is-current {
  color: #fff;
}

html[data-theme="dark"] .ds-breadcrumb-sep {
  color: rgba(231, 251, 248, 0.45);
}
