/* =========================================================
   NEXORA Design System — documentation page + components
   Requires: nexora-tokens.css (tokens) and styles.css (site chrome)
   Components are prefixed .nx- so they never clash with the site.
   ========================================================= */

/* NEXORA tokens, scoped to the documentation content so they don't
   override the portfolio site's own --bg / --radius-sm on this page. */
.ds-scope {
  /* ---------- Colour · Brand (indigo) ---------- */
  --primary-50:  #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-300: #a5b4fc;
  --primary-400: #818cf8;
  --primary-500: #6366f1;
  --primary:     #4f46e5;   /* 600 — default brand / primary action */
  --primary-700: #4338ca;   /* hover / pressed */
  --primary-800: #3730a3;

  /* ---------- Colour · Neutrals ---------- */
  --navy-950: #0b1220;
  --navy-900: #0f172a;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;
  --white:     #ffffff;

  /* ---------- Colour · Semantic (use these in components) ---------- */
  --bg:            #f6f7fb;              /* app background */
  --surface:       var(--white);         /* cards, panels */
  --surface-muted: var(--slate-50);      /* table header, wells */
  --border:        #e6e8ef;              /* default dividers */
  --border-strong: var(--slate-300);     /* hover / emphasis */
  --text:          var(--navy-900);      /* primary text   — 17.1:1 on white */
  --text-2:        var(--slate-600);     /* secondary text —  7.6:1 on white */
  --text-muted:    var(--slate-500);     /* captions       —  4.8:1 on white */

  /* ---------- Colour · Status (text tone + 50 background) ---------- */
  --good-50: #ecfdf5;  --good: #047857;  --good-500: #10b981;
  --warn-50: #fffbeb;  --warn: #b45309;  --warn-500: #f59e0b;
  --bad-50:  #fef2f2;  --bad:  #b91c1c;
  --info-50: #f0f9ff;  --info: #0369a1;

  /* ---------- Colour · Data visualisation (categorical, in order) ---------- */
  --c1: #4f46e5;  /* indigo  */
  --c2: #eb6834;  /* orange  */
  --c3: #1baf7a;  /* green   */
  --c4: #eda100;  /* amber   */
  --c5: #e87ba4;  /* pink    */

  /* ---------- Typography ---------- */
  --font-sans: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-xs:   .75rem;     /* 12 — captions, table meta  */
  --fs-sm:   .8125rem;   /* 13 — labels, secondary     */
  --fs-base: .875rem;    /* 14 — body, table cells     */
  --fs-md:   1rem;       /* 16 — card titles           */
  --fs-lg:   1.125rem;   /* 18 — section titles        */
  --fs-xl:   clamp(1.25rem, 1.1rem + .5vw, 1.5rem);   /* 20–24 — page title */
  --fs-kpi:  clamp(1.5rem, 1rem + .9vw, 1.75rem);     /* 24–28 — KPI values */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --lh-tight: 1.2;
  --lh-base: 1.5;

  /* ---------- Spacing (4px base) ---------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* ---------- Shape ---------- */
  --radius-sm: 6px;     /* badges, small inputs */
  --radius-md: 8px;     /* buttons, inputs      */
  --radius-lg: 12px;    /* menus, popovers      */
  --radius-xl: 16px;    /* cards                */
  --radius-full: 999px; /* pills, avatars       */

  /* ---------- Elevation ---------- */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, .08), 0 2px 4px -2px rgba(15, 23, 42, .05);
  --shadow-lg: 0 16px 40px -8px rgba(15, 23, 42, .18), 0 4px 12px -4px rgba(15, 23, 42, .08);
  --ring: 0 0 0 3px rgba(79, 70, 229, .35);   /* focus-visible */

  /* ---------- Layout ---------- */
  --sidebar-w: 256px;
  --sidebar-w-collapsed: 76px;
  --topbar-h: 72px;
  --container-max: 1600px;
  /* breakpoints (reference — use in media queries): sm 640 · md 768 · lg 1200 · xl 1280 */

  /* ---------- Motion ---------- */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --dur: .18s;
}
@media (prefers-reduced-motion: reduce) { .ds-scope { --dur: 0s; } }

/* ---------- Page layout: sticky contents + content ---------- */
.ds-hero { padding-top: 16px; }
.ds-hero__card {
  border-radius: var(--radius);
  padding: 56px;
  background:
    radial-gradient(50% 60% at 95% 10%, rgba(129,140,248,.55) 0%, transparent 70%),
    radial-gradient(45% 55% at 0% 100%, rgba(235,104,52,.18) 0%, transparent 70%),
    linear-gradient(160deg, #0f172a 0%, #1e1b4b 100%);
  color: #fff;
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: end;
}
.ds-hero__eyebrow { font-size: 13px; color: #c7d2fe; letter-spacing: .04em; }
.ds-hero__title { margin-top: 18px; font: 700 clamp(48px, 6vw, 92px)/.92 var(--font-display); letter-spacing: -0.055em; }
.ds-hero__lead { margin-top: 22px; max-width: 520px; font-size: 16px; line-height: 1.6; color: #cbd5e1; }
.ds-hero__actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px; }
.ds-hero__stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.ds-hero__stats div { padding: 18px 20px; border-radius: 16px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); }
.ds-hero__stats strong { display: block; font: 700 34px/1 var(--font-display); letter-spacing: -0.04em; }
.ds-hero__stats span { display: block; margin-top: 6px; font-size: 13px; color: #cbd5e1; }

.ds-principles { margin-top: 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.ds-principles article { padding: 22px 24px; border-radius: 18px; background: #f5f4fa; }
.ds-principles b { display: block; font: 600 18px/1.2 var(--font-display); letter-spacing: -0.02em; }
.ds-principles p { margin-top: 6px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }

.ds-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; align-items: start; padding-top: 72px; }
.ds-toc { position: sticky; top: 104px; font-size: 14px; }
.ds-toc p { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 22px 0 8px; }
.ds-toc p:first-child { margin-top: 0; }
.ds-toc a { display: block; padding: 5px 0 5px 12px; border-left: 2px solid var(--line); color: var(--ink-2); }
.ds-toc a:hover { color: var(--ink); border-color: var(--ink); }

.ds-group + .ds-group { margin-top: 96px; }
.ds-group__label { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.ds-group__title { margin-top: 8px; font: 700 clamp(40px, 4.4vw, 64px)/.95 var(--font-display); letter-spacing: -0.05em; }
.ds-group__intro { margin-top: 14px; max-width: 640px; font-size: 15px; line-height: 1.65; color: var(--ink-2); }

.ds-sec { margin-top: 56px; scroll-margin-top: 100px; }
.ds-sec h3 { font-size: 26px; letter-spacing: -0.035em; }
.ds-sec > p { margin-top: 8px; max-width: 680px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.ds-panel {
  margin-top: 20px; padding: 28px; border-radius: 20px;
  background: var(--bg); border: 1px solid var(--border);
  font-family: var(--font-sans); color: var(--text);
}
.ds-panel--white { background: var(--surface); }
.ds-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ds-row + .ds-row { margin-top: 16px; }
.ds-cap { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
code, .ds-code { font: 500 12px/1.5 ui-monospace, "Cascadia Code", Consolas, monospace; }
code { padding: 2px 6px; border-radius: 6px; background: #eef2ff; color: #3730a3; }
.ds-pre {
  margin: 16px 0 0; padding: 18px 20px; border-radius: 14px; overflow-x: auto;
  background: #0f172a; color: #e2e8f0; font: 500 12.5px/1.7 ui-monospace, Consolas, monospace;
}
.ds-pre .k { color: #a5b4fc; } .ds-pre .v { color: #fbbf24; } .ds-pre .c { color: #64748b; }

/* ---------- Token visuals ---------- */
.ds-ramp { display: grid; grid-template-columns: repeat(9, 1fr); border-radius: 14px; overflow: hidden; }
.ds-ramp div { height: 84px; padding: 10px; display: flex; flex-direction: column; justify-content: flex-end; font: 600 11px/1.3 var(--font-sans); }
.ds-ramp div span { font-weight: 500; opacity: .85; }
.ds-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ds-sw { border-radius: 14px; background: var(--surface); border: 1px solid var(--border); overflow: hidden; font-family: var(--font-sans); }
.ds-sw i { display: block; height: 64px; border-bottom: 1px solid var(--border); }
.ds-sw div { padding: 10px 12px; }
.ds-sw b { display: block; font-size: 13px; }
.ds-sw span { display: block; margin-top: 2px; font-size: 11px; color: var(--text-muted); }

.ds-type { width: 100%; border-collapse: collapse; }
.ds-type td { padding: 14px 0; border-bottom: 1px solid var(--border); vertical-align: baseline; }
.ds-type td:first-child { width: 150px; font-size: 12px; color: var(--text-muted); }
.ds-type td:last-child { text-align: right; font-size: 12px; color: var(--text-muted); white-space: nowrap; }

.ds-space { display: flex; flex-direction: column; gap: 10px; }
.ds-space div { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 12px; font-size: 12px; color: var(--text-2); }
.ds-space i { display: block; height: 14px; border-radius: 4px; background: var(--primary-300); }

.ds-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
.ds-tile { height: 96px; background: var(--surface); border: 1px solid var(--border); display: grid; place-items: center; text-align: center; font-size: 12px; color: var(--text-2); }
.ds-tile b { display: block; font-size: 13px; color: var(--text); }

/* ---------- Components (.nx-) ---------- */
.nx-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-md); border: 1px solid transparent;
  font: var(--fw-semibold) var(--fs-base)/1 var(--font-sans); cursor: pointer; white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.nx-btn svg { width: 16px; height: 16px; }
.nx-btn--primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-xs); }
.nx-btn--primary:hover, .nx-btn--primary.is-hover { background: var(--primary-700); }
.nx-btn--secondary { background: var(--surface); border-color: var(--border); color: var(--text); box-shadow: var(--shadow-xs); }
.nx-btn--secondary:hover, .nx-btn--secondary.is-hover { border-color: var(--border-strong); background: var(--surface-muted); }
.nx-btn--ghost { background: transparent; color: var(--text-2); }
.nx-btn--ghost:hover { background: var(--slate-100); color: var(--text); }
.nx-btn--danger { background: var(--bad); color: #fff; }
.nx-btn--sm { height: 32px; padding: 0 12px; font-size: var(--fs-sm); }
.nx-btn--icon { width: 40px; padding: 0; }
.nx-btn:focus-visible, .nx-btn.is-focus { outline: none; box-shadow: var(--ring); }
.nx-btn:disabled, .nx-btn.is-disabled { opacity: .45; cursor: not-allowed; }

.nx-field { display: flex; flex-direction: column; gap: 6px; min-width: 220px; flex: 1; }
.nx-label { font: var(--fw-medium) var(--fs-sm)/1.2 var(--font-sans); color: var(--text); }
.nx-input {
  height: 40px; padding: 0 12px; border-radius: var(--radius-md); border: 1px solid var(--border);
  background: var(--surface); font: var(--fw-regular) var(--fs-base)/1 var(--font-sans); color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.nx-input::placeholder, .nx-input .ph { color: var(--slate-400); }
.nx-input:focus, .nx-input.is-focus { outline: none; border-color: var(--primary-400); box-shadow: var(--ring); }
.nx-input.is-error { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(185,28,28,.15); }
.nx-help { font: var(--fs-xs)/1.4 var(--font-sans); color: var(--text-muted); }
.nx-help.is-error { color: var(--bad); }
.nx-input svg { width: 16px; height: 16px; color: var(--slate-400); flex-shrink: 0; }
.nx-kbd { margin-left: auto; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border); font-size: 11px; color: var(--text-muted); }

.nx-badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: var(--radius-full); font: var(--fw-semibold) var(--fs-xs)/1 var(--font-sans); }
.nx-badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.nx-badge--good { background: var(--good-50); color: var(--good); }
.nx-badge--warn { background: var(--warn-50); color: var(--warn); }
.nx-badge--bad  { background: var(--bad-50);  color: var(--bad); }
.nx-badge--info { background: var(--info-50); color: var(--info); }
.nx-badge--brand { background: var(--primary-50); color: var(--primary-700); }
.nx-badge--neutral { background: var(--slate-100); color: var(--slate-600); }
.nx-delta { display: inline-flex; align-items: center; gap: 3px; font: var(--fw-semibold) var(--fs-xs)/1 var(--font-sans); padding: 4px 7px; border-radius: 6px; }
.nx-delta--up { color: var(--good); background: var(--good-50); }
.nx-delta--down { color: var(--bad); background: var(--bad-50); }

.nx-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px;
  border-radius: var(--radius-full); border: 1px solid var(--border); background: var(--surface);
  font: var(--fw-medium) var(--fs-sm)/1 var(--font-sans); color: var(--text-2);
}
.nx-chip em { font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 99px; background: var(--slate-100); color: var(--text-muted); }
.nx-chip.is-on { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.nx-chip.is-on em { background: rgba(255,255,255,.16); color: #fff; }

.nx-seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--slate-100); border: 1px solid var(--border); border-radius: 10px; }
.nx-seg span { padding: 7px 14px; border-radius: 8px; font: var(--fw-semibold) var(--fs-sm)/1 var(--font-sans); color: var(--text-2); }
.nx-seg span.is-on { background: var(--surface); color: var(--primary-700); box-shadow: var(--shadow-sm); }

.nx-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--border); }
.nx-tabs span { padding: 10px 0; font: var(--fw-semibold) var(--fs-sm)/1 var(--font-sans); color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.nx-tabs span.is-on { color: var(--primary-700); border-color: var(--primary); }

.nx-avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 700 12px/1 var(--font-sans); color: #fff; background: var(--slate-500); }
.nx-avatar--brand { background: linear-gradient(135deg, var(--primary-500), var(--primary-800)); }
.nx-avatar--lg { width: 44px; height: 44px; font-size: 14px; }
.nx-avatars { display: flex; }
.nx-avatars .nx-avatar { box-shadow: 0 0 0 2px var(--surface); margin-left: -8px; }
.nx-avatars .nx-avatar:first-child { margin-left: 0; }

.nx-progress { width: 220px; height: 6px; border-radius: 99px; background: var(--primary-100); overflow: hidden; }
.nx-progress span { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.nx-progress--good { background: #d1fae5; } .nx-progress--good span { background: var(--good-500); }

.nx-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: var(--space-6); box-shadow: var(--shadow-xs); font-family: var(--font-sans); }
.nx-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.nx-card__title { font-size: var(--fs-md); font-weight: var(--fw-semibold); letter-spacing: -.01em; }
.nx-card__sub { margin-top: 2px; font-size: var(--fs-sm); color: var(--text-muted); }

.nx-kpi { position: relative; overflow: hidden; --tone: var(--primary); --tone-50: var(--primary-50); }
.nx-kpi::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--tone); }
.nx-kpi--green { --tone: #059669; --tone-50: #d1fae5; }
.nx-kpi--amber { --tone: #d97706; --tone-50: #fef3c7; }
.nx-kpi--sky { --tone: #0284c7; --tone-50: #e0f2fe; }
.nx-kpi__top { display: flex; align-items: center; gap: 12px; }
.nx-kpi__icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--tone-50); color: var(--tone); }
.nx-kpi__icon svg { width: 18px; height: 18px; }
.nx-kpi__label { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-2); }
.nx-kpi__body { margin-top: 14px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.nx-kpi__value { font-size: var(--fs-kpi); font-weight: var(--fw-bold); letter-spacing: -.025em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.nx-kpi__spark { width: 96px; height: 36px; color: var(--tone); }
.nx-kpi__foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--slate-100); display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--text-muted); }

.nx-table { width: 100%; border-collapse: collapse; font: var(--fs-base)/1.4 var(--font-sans); }
.nx-table th { text-align: left; padding: 10px 14px; background: var(--surface-muted); border-bottom: 1px solid var(--border); font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.nx-table td { padding: 12px 14px; border-bottom: 1px solid var(--slate-100); white-space: nowrap; }
.nx-table tr:hover td { background: var(--slate-50); }
.nx-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.nx-who { display: flex; align-items: center; gap: 10px; }
.nx-who small { display: block; font-size: var(--fs-xs); color: var(--text-muted); }
.nx-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface); }

.nx-alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-lg); font: var(--fs-sm)/1.5 var(--font-sans); border: 1px solid; }
.nx-alert b { display: block; font-weight: var(--fw-semibold); }
.nx-alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.nx-alert--info { background: var(--info-50); border-color: #bae6fd; color: var(--info); }
.nx-alert--warn { background: var(--warn-50); border-color: #fde68a; color: var(--warn); }
.nx-alert--bad { background: var(--bad-50); border-color: #fecaca; color: var(--bad); }
.nx-toast { display: inline-flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; border-radius: var(--radius-lg); background: var(--navy-900); color: #fff; box-shadow: var(--shadow-lg); font: var(--fs-sm)/1.4 var(--font-sans); }
.nx-toast i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--good-500); font-style: normal; font-size: 12px; }
.nx-toast a { color: #a5b4fc; font-weight: var(--fw-semibold); }

.nx-nav { width: 240px; padding: 12px; border-radius: var(--radius-xl); background: var(--navy-950); font: var(--fw-medium) var(--fs-base)/1 var(--font-sans); }
.nx-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: #94a3b8; }
.nx-nav a svg { width: 18px; height: 18px; }
.nx-nav a.is-on { background: rgba(99,102,241,.18); color: #fff; box-shadow: inset 3px 0 0 var(--primary-400); }
.nx-nav a:hover { color: #fff; }
.nx-nav em { margin-left: auto; font-style: normal; font-size: 11px; padding: 2px 7px; border-radius: 99px; background: var(--primary); color: #fff; }

.nx-empty { text-align: center; padding: 36px 24px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-xl); background: var(--surface); font-family: var(--font-sans); }
.nx-empty__icon { width: 48px; height: 48px; margin: 0 auto; border-radius: 14px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.nx-empty b { display: block; margin-top: 14px; font-size: var(--fs-md); }
.nx-empty p { margin-top: 6px; font-size: var(--fs-sm); color: var(--text-muted); }
.nx-skel { border-radius: 8px; background: linear-gradient(90deg, var(--slate-100) 0%, var(--slate-200) 50%, var(--slate-100) 100%); background-size: 200% 100%; animation: nx-shimmer 1.4s var(--ease) infinite; }
@keyframes nx-shimmer { to { background-position: -200% 0; } }

/* chart helpers */
.nx-chart { width: 100%; height: auto; display: block; }
.nx-legend { display: flex; flex-wrap: wrap; gap: 14px; font: var(--fs-xs)/1 var(--font-sans); color: var(--text-2); }
.nx-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Patterns ---------- */
.ds-wire { display: grid; grid-template-columns: 120px 1fr; gap: 10px; height: 300px; font: 600 11px/1.2 var(--font-sans); color: var(--primary-700); }
.ds-wire > div, .ds-wire__main > div { border-radius: 10px; background: var(--primary-50); border: 1.5px dashed var(--primary-300); display: grid; place-items: center; text-align: center; padding: 6px; }
.ds-wire__main { display: grid; grid-template-rows: 44px 34px 70px 1fr 64px; gap: 10px; }
.ds-wire__main .k4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; background: none; border: 0; padding: 0; }
.ds-wire__main .k4 > div, .ds-wire__main .c2 > div { border-radius: 10px; background: var(--primary-50); border: 1.5px dashed var(--primary-300); display: grid; place-items: center; }
.ds-wire__main .c2 { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; background: none; border: 0; padding: 0; }
.ds-states { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.ds-flow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font: var(--fs-sm)/1.3 var(--font-sans); }
.ds-flow span { padding: 10px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.ds-flow b { color: var(--primary); }

/* ---------- Guidelines ---------- */
.ds-do { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ds-do article { border-radius: 16px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-top: 4px solid; font-family: var(--font-sans); }
.ds-do .is-do { border-top-color: var(--good-500); }
.ds-do .is-dont { border-top-color: var(--bad); }
.ds-do h4 { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.ds-do .is-do h4 { color: var(--good); } .ds-do .is-dont h4 { color: var(--bad); }
.ds-do ul { margin: 12px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.6; color: var(--text-2); display: grid; gap: 6px; }
.ds-rules { width: 100%; border-collapse: collapse; font: var(--fs-sm)/1.5 var(--font-sans); background: var(--surface); border-radius: 14px; overflow: hidden; }
.ds-rules th { text-align: left; padding: 11px 14px; background: var(--surface-muted); font-size: 12px; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.ds-rules td { padding: 11px 14px; border-bottom: 1px solid var(--slate-100); vertical-align: top; }
.ds-rules td:first-child { font-weight: 600; white-space: nowrap; }
.ds-rules .ok { color: var(--good); font-variant-numeric: tabular-nums; }
.ds-rules .no { color: var(--bad); text-decoration: line-through; }
.ds-checks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.ds-checks div { display: flex; gap: 12px; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); font: var(--fs-sm)/1.5 var(--font-sans); color: var(--text-2); }
.ds-checks b { display: block; color: var(--text); }
.ds-checks i { flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; background: var(--good-50); color: var(--good); }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .ds-layout { grid-template-columns: 1fr; gap: 0; padding-top: 56px; }
  .ds-toc { display: none; }
  .ds-principles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .ds-hero__card { grid-template-columns: 1fr; padding: 36px; }
  .ds-ramp { grid-template-columns: repeat(3, 1fr); }
  .ds-states, .ds-do, .ds-checks { grid-template-columns: 1fr; }
  .ds-wire { grid-template-columns: 70px 1fr; }
}
@media (max-width: 640px) {
  .ds-hero__card { padding: 26px 22px; }
  .ds-principles { grid-template-columns: 1fr; }
  .ds-panel { padding: 18px; }
  .ds-group + .ds-group { margin-top: 72px; }
  .ds-type td:last-child { display: none; }
  .ds-wire__main .k4 { grid-template-columns: repeat(2, 1fr); }
  .ds-wire__main { grid-template-rows: 40px 30px 110px 1fr 50px; }
  .nx-nav { width: 100%; }
}
