/**
 * Noribel Design System page — studio + brand specimens.
 * This sheet is only for /design-system.html.
 */

.nds-page {
  --nds-bar: 4rem;
  --nds-max: 76rem;
  min-height: 100vh;
  background: var(--bg-subtle, #f0f5fb);
  color: var(--text, #0f1222);
  font-family: var(--font, "Outfit", system-ui, sans-serif);
}

.nds-content {
  padding-top: var(--nds-bar);
}

/* ── App top bar (same contract as organiser chrome) ── */
.nds-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--nds-bar);
  padding: 0 1.1rem 0 1.35rem;
  background: var(--noribel-marine, #1c6c9e);
  color: #fff;
}

.nds-top__brand {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  flex: none;
}

.nds-top__brand img,
.nds-logo--invert {
  display: block;
  width: 9.25rem;
  height: auto;
  filter: brightness(0) invert(1);
}

.nds-top__crumb {
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  opacity: 0.92;
}

.nds-top__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.nds-top-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: transparent;
  color: #fff;
  font: 600 0.8rem/1 Outfit, system-ui, sans-serif;
  padding: 0.35rem 0.7rem;
  border-radius: 10px;
  cursor: pointer;
}

.nds-top-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.nds-top-btn--solid {
  background: #fff;
  color: var(--noribel-marine, #1c6c9e);
  border-color: #fff;
}

.nds-top-btn--solid:hover {
  background: var(--noribel-sky, #8ec7ed);
  border-color: var(--noribel-sky, #8ec7ed);
  color: var(--noribel-night, #0b2233);
}

.nds-live-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  white-space: nowrap;
}

.nds-avatar {
  width: 2rem;
  height: 2rem;
  margin-left: 0.25rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.16);
}

.nds-status {
  max-width: var(--nds-max);
  margin: 0 auto;
  padding: 0.65rem 1.25rem 0;
  min-height: 1.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted, #5c6178);
}

.nds-status[data-kind='ok'] { color: #047857; }
.nds-status[data-kind='err'] { color: var(--danger, #e11d48); }

.nds-shell {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr) 23rem;
  gap: 1rem;
  max-width: 92rem;
  margin: 0 auto;
  padding: 0.5rem 1.25rem 4rem;
}

.nds-side {
  position: sticky;
  top: calc(var(--nds-bar) + 0.75rem);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.45rem;
  background: #fff;
  border: 1px solid var(--border, rgba(11, 34, 51, 0.09));
  border-radius: 16px;
  max-height: calc(100vh - var(--nds-bar) - 1.5rem);
  overflow: auto;
}

.nds-side a {
  color: var(--text-muted, #5c6178);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 650;
  padding: 0.38rem 0.6rem;
  border-radius: 8px;
}

.nds-side a:hover {
  color: var(--noribel-marine, #1c6c9e);
  background: rgba(142, 199, 237, 0.22);
}

.nds-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.nds-hero {
  padding: 1.6rem 1.5rem;
  border-radius: 22px;
  background: var(--noribel-marine, #1c6c9e);
  color: #fff;
}

.nds-hero__eyebrow {
  margin: 0 0 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}

.nds-hero h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.6rem, 2.2vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.nds-hero p {
  margin: 0;
  max-width: 40rem;
  line-height: 1.5;
  opacity: 0.95;
}

.nds-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 1rem;
}

.nds-chip {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.nds-section {
  background: #fff;
  border: 1px solid var(--border, rgba(11, 34, 51, 0.09));
  border-radius: 16px;
  padding: 1.2rem 1.3rem 1.35rem;
}

.nds-section > h2 {
  margin: 0 0 0.3rem;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--noribel-night, #0b2233);
}

.nds-lede, .nds-foot {
  margin: 0 0 1rem;
  color: var(--text-muted, #5c6178);
  font-size: 0.92rem;
  line-height: 1.5;
}

.nds-foot { margin: 0.75rem 0 0; font-size: 0.82rem; }

.nds-subh {
  margin: 1.1rem 0 0.45rem;
  font-size: 0.92rem;
  font-weight: 800;
}

.nds-grid { display: grid; gap: 0.7rem; }
.nds-grid--2 { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.nds-grid--swatches {
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  margin-top: 1rem;
}

.nds-swatch {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.nds-swatch__chip { height: 3.6rem; }
.nds-swatch__body { padding: 0.55rem 0.65rem 0.7rem; }
.nds-swatch__name { display: block; font-size: 0.82rem; font-weight: 700; }
.nds-swatch__hex, .nds-swatch__token {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.7rem;
  color: var(--text-subtle, #85899e);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.nds-logo-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

.nds-logo {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.nds-logo__stage {
  height: 5.5rem;
  display: grid;
  place-items: center;
  padding: 0.75rem;
  background: #fff;
}

.nds-logo__stage--marine { background: var(--noribel-marine, #1c6c9e); }

.nds-logo__stage img {
  max-width: 100%;
  max-height: 3.25rem;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: none;
}

.nds-logo__stage--marine .nds-logo--invert {
  width: 8.5rem;
  max-height: 2rem;
  filter: brightness(0) invert(1);
}

.nds-logo figcaption {
  margin: 0;
  padding: 0.45rem 0.6rem 0.55rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.nds-split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 1.25rem;
  align-items: start;
}

.nds-chrome {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.nds-chrome__bar {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  height: 4rem;
  padding: 0 1rem;
  background: var(--noribel-marine, #1c6c9e);
  color: #fff;
  font-weight: 650;
}

.nds-chrome__bar img { width: 8.2rem; }
.nds-chrome__spacer { flex: 1; }
.nds-chrome__pill {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.4);
}
.nds-chrome__avatar {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.nds-chrome__body {
  display: grid;
  grid-template-columns: 9rem 1fr;
  min-height: 8rem;
  background: var(--bg-subtle, #f0f5fb);
}

.nds-chrome__rail {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.6rem;
  background: #fff;
  border-right: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text-muted);
}

.nds-chrome__rail .is-on {
  color: var(--noribel-marine);
  background: rgba(142, 199, 237, 0.28);
  border-radius: 8px;
  padding: 0.25rem 0.4rem;
}

.nds-chrome__canvas {
  padding: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.nds-mini-card {
  height: 2.4rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border);
}

.nds-mini-card--short { width: 60%; }

.nds-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.nds-table th, .nds-table td {
  text-align: left;
  padding: 0.5rem 0.35rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.nds-table th {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.nds-table code {
  font-size: 0.78rem;
  background: var(--bg-subtle);
  padding: 0.05rem 0.3rem;
  border-radius: 5px;
}

.nds-editor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.7rem;
}

.nds-color-field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.7rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card-muted, #f8fafd);
  font-size: 0.84rem;
  font-weight: 700;
}

.nds-color-field__name { font-size: 0.86rem; font-weight: 800; line-height: 1.2; }
.nds-color-field__help {
  font-size: 0.72rem;
  font-weight: 550;
  color: var(--text-muted);
  line-height: 1.35;
}

.nds-color-field code { font-size: 0.68rem; font-weight: 500; color: var(--text-subtle); }
.nds-color-field__row { display: flex; gap: 0.4rem; align-items: center; }
.nds-color-field input[type='color'] {
  width: 2.4rem;
  height: 2.1rem;
  padding: 0;
  border: 1px solid var(--border-solid, #e2e8f0);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.nds-hex, .nds-input {
  width: 100%;
  font: 600 0.85rem/1.2 Outfit, system-ui, sans-serif;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border-solid, #e2e8f0);
  border-radius: var(--radius-sm, 10px);
  background: #fff;
  color: var(--text);
}

.nds-hex { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.78rem; }

.nds-opts { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.nds-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  text-align: left;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.nds-opt.is-active {
  border-color: var(--noribel-marine, #1c6c9e);
  background: rgba(142, 199, 237, 0.22);
}

.nds-opt__label { font-size: 0.82rem; font-weight: 700; }
.nds-opt__blurb { font-size: 0.7rem; color: var(--text-muted); font-weight: 500; }

.nds-kicker {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 0.15rem;
}

.nds-type-stack { display: flex; flex-direction: column; gap: 0.85rem; margin-top: 1rem; }
.nds-type-stack p { margin: 0; }
.nds-t-display { font-size: var(--ds-display, 32px); font-weight: var(--ds-w-title, 800); letter-spacing: -0.03em; font-family: var(--font); }
.nds-t-title { font-size: var(--ds-title, 22px); font-weight: var(--ds-w-title, 800); font-family: var(--font); }
.nds-t-section { font-size: var(--ds-section, 18px); font-weight: 700; font-family: var(--font); }
.nds-t-body { font-size: var(--ds-body, 15px); font-weight: var(--ds-w-body, 400); line-height: 1.5; font-family: var(--font); }
.nds-t-muted { color: var(--text-muted); font-size: var(--ds-body, 15px); }
.nds-t-label { font-size: var(--ds-label, 12px); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }

.nds-explain {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.nds-explain__item {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-subtle, #f0f5fb);
  font-size: 0.82rem;
  font-weight: 700;
}

.nds-explain__item small {
  font-weight: 600;
  color: var(--text-muted);
}

.nds-gap {
  display: flex;
  align-items: center;
  min-height: 2.2rem;
}

.nds-gap i {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 4px;
  background: var(--noribel-marine, #1c6c9e);
}

.nds-sample-card {
  background: #fff;
  border: 1px solid var(--border-solid, #e2e8f0);
  padding: 0.65rem 0.7rem;
}

.nds-sample-card strong { display: block; }
.nds-sample-card em { font-style: normal; font-weight: 500; color: var(--text-muted); font-size: 0.78rem; }

.nds-sample-hero {
  background: var(--noribel-marine, #1c6c9e);
  color: #fff;
  padding: 0.85rem 0.75rem;
  font-weight: 800;
}

.nds-sample-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0 0.55rem;
  background: var(--noribel-marine, #1c6c9e);
  color: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.nds-sample-bar img {
  width: 5.5rem;
  height: auto;
  filter: brightness(0) invert(1);
}

.nds-sample-bar b { font-size: 0.78rem; }

.nds-elev-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.nds-elev {
  min-height: 6.5rem;
  border-radius: 14px;
  background: #fff;
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid var(--border);
}

.nds-elev strong { font-size: 1.1rem; }
.nds-elev span { font-size: 0.78rem; color: var(--text-muted); }
.nds-elev--0 { box-shadow: none; background: var(--bg-subtle); }
.nds-elev--1 { box-shadow: 0 1px 2px rgba(11, 34, 51, 0.06); }
.nds-elev--2 { box-shadow: 0 10px 28px rgba(11, 34, 51, 0.1); }
.nds-elev--3 { box-shadow: 0 22px 50px rgba(11, 34, 51, 0.18); }

.nds-btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.85rem; }
.nds-btn-row--end { justify-content: flex-end; }
.nds-dropdown-demo {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-top: 0.85rem;
  padding: 1.25rem;
  border-radius: var(--radius-md, 16px);
  background: var(--bg-subtle, #f0f5fb);
  border: 1px solid var(--border-solid, #e2e8f0);
}
.nds-dropdown-demo .nor-menu {
  position: relative;
  box-shadow: var(--ds-shadow-menu, 0 14px 32px rgba(11, 34, 51, 0.16));
}

.nds-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.75rem;
}

.nds-field { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.8rem; font-weight: 700; }
.nds-field small { font-weight: 600; color: var(--danger); }
.nds-field--error .nds-input { border-color: var(--danger); }

.nds-badge-row { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.nds-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: var(--ds-badge-radius, 999px);
  font-size: var(--ds-badge-size, 12px);
  font-weight: 700;
}

.nds-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
  gap: 0.75rem;
}

.nds-ctrl {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-subtle, #f0f5fb);
}

.nds-ctrl__name { font-size: 0.84rem; font-weight: 800; }
.nds-ctrl__now { font-size: 0.75rem; color: var(--text-muted); font-weight: 650; }
.nds-ctrl__now b { color: var(--noribel-marine); }
.nds-ctrl__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }

.nds-load-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.nds-load-card {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.nds-load-card figcaption {
  font-size: 0.8rem;
  font-weight: 800;
}

.nds-load-card figcaption span {
  display: block;
  font-size: 0.7rem;
  font-weight: 550;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.nds-load-demo {
  position: relative;
  isolation: isolate;
  min-height: 11rem;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-solid, #e2e8f0);
  background: var(--bg-subtle, #f0f5fb);
}

/* Keep studio specimens inside the card — never fixed / full-page */
.nds-page .nds-load-demo .noribel-loading-overlay {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  opacity: 1 !important;
  pointer-events: none !important;
}

.nds-load-demo--panel {
  background: var(--bg-card, #fff);
  min-height: 8.5rem;
}

.nds-load-demo--blur {
  background:
    linear-gradient(135deg, rgba(142, 199, 237, 0.35), transparent 55%),
    var(--bg-subtle, #f0f5fb);
  min-height: 11rem;
}

.nds-load-demo__fake {
  margin: 0;
  padding: 1rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.nds-page .btn {
  font-size: var(--btn-font, 14px);
  padding: var(--btn-pad-y, 10px) var(--btn-pad-x, 22px);
  border-radius: var(--radius-sm, 10px);
}
.nds-page .btn.btn--sm {
  font-size: var(--btn-sm-font, 13px);
  padding: var(--btn-sm-pad-y, 7px) var(--btn-sm-pad-x, 16px);
}

.nds-elev-live {
  min-height: 3.2rem;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--border-solid, #e2e8f0);
  font-weight: 700;
  font-size: 0.85rem;
}

.nds-applied {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--text-muted);
  line-height: 1.35;
}

.nds-menu-chip {
  display: inline-flex;
  padding: 0.35rem 0.55rem;
  background: color-mix(in srgb, var(--noribel-sky, #8ec7ed) 45%, white);
  color: var(--noribel-marine);
  font-size: 0.8rem;
  font-weight: 700;
}

.nds-app .is-flash {
  outline: 2px solid var(--noribel-blue, #42abe0);
  outline-offset: 2px;
}

.nds-sublabel {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 750;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nds-app__menu {
  margin-top: 0.55rem;
  padding: 0.55rem 0.65rem;
  background: #fff;
  border: 1px solid var(--border-solid, #e2e8f0);
  font-size: 0.78rem;
  font-weight: 700;
}
.nds-badge--marine { background: var(--noribel-marine); color: #fff; }
.nds-badge--live { background: rgba(16, 185, 129, 0.15); color: #047857; }
.nds-badge--danger { background: rgba(225, 29, 72, 0.12); color: #be123c; }
.nds-badge--muted { background: var(--bg-subtle); color: var(--text-muted); }
.nds-badge--sky { background: rgba(142, 199, 237, 0.45); color: var(--noribel-night); }

.nds-rail-demo {
  list-style: none;
  margin: 0;
  padding: 0.4rem;
  width: min(16rem, 100%);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.nds-rail-demo li {
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--text-muted);
}

.nds-rail-demo .is-on {
  background: rgba(142, 199, 237, 0.35);
  color: var(--noribel-marine);
}

.nds-rule {
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card-muted, #f8fafd);
}

.nds-rule strong { font-size: 0.84rem; }
.nds-rule p { margin: 0.25rem 0 0; font-size: 0.86rem; color: var(--text-muted); line-height: 1.45; }
.nds-rule--do { border-color: rgba(16, 185, 129, 0.35); background: rgba(16, 185, 129, 0.06); }
.nds-rule--dont { border-color: rgba(225, 29, 72, 0.28); background: rgba(225, 29, 72, 0.05); }

.nds-scope-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.2rem;
  margin-bottom: 0.8rem;
  font-size: 0.86rem;
  font-weight: 650;
}

.nds-scope-row label { display: inline-flex; align-items: center; gap: 0.35rem; }

.nds-linked { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.nds-linked__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card-muted);
}
.nds-linked__item strong { display: block; font-size: 0.88rem; }
.nds-linked__item code { font-size: 0.7rem; color: var(--text-subtle); }
.nds-linked__scope { font-size: 0.75rem; color: var(--text-muted); font-weight: 650; }

.nds-gate {
  max-width: 26rem;
  margin: 12vh auto;
  padding: 1.6rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.nds-gate img { width: 10rem; height: auto; filter: none; }
.nds-gate h1 { margin: 0; font-size: 1.35rem; }
.nds-gate[hidden], .nds-content[hidden] { display: none !important; }

.nds-demo-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(11, 34, 51, 0.45);
}

.nds-demo-modal[hidden] { display: none !important; }

.nds-demo-modal__card {
  width: min(26rem, 100%);
  padding: 1.2rem 1.2rem 1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 16px);
  box-shadow: 0 22px 50px rgba(11, 34, 51, 0.18);
}

.nds-demo-modal__card h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.nds-demo-modal__card p { margin: 0; }

.nds-preview {
  position: sticky;
  top: calc(var(--nds-bar) + 0.75rem);
  align-self: start;
}

.nds-preview__label {
  margin: 0 0 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.nds-app {
  border: 1px solid var(--border-solid, #e2e8f0);
  border-radius: var(--radius-md, 16px);
  overflow: hidden;
  background: var(--bg-subtle, #f0f5fb);
  color: var(--text, #0f1222);
  font-family: var(--font);
  font-size: var(--ds-body, 15px);
  font-weight: var(--ds-w-body, 400);
  box-shadow: 0 10px 28px rgba(11, 34, 51, 0.08);
}

.nds-app__bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  height: var(--nds-bar, 4rem);
  padding: 0 0.7rem;
  background: var(--noribel-marine, #1c6c9e);
  color: #fff;
  font-weight: 650;
  font-size: 0.82rem;
}

.nds-app__bar img {
  width: 6.4rem;
  height: auto;
  filter: brightness(0) invert(1);
}

.nds-app__grow { flex: 1; }

.nds-app__ghost {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.22rem 0.45rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.nds-app__avatar {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.65rem;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.nds-app__body {
  display: grid;
  grid-template-columns: var(--ds-rail-width, 104px) minmax(0, 1fr);
  min-height: 22rem;
}

.nds-app__rail {
  display: flex;
  flex-direction: column;
  gap: var(--ds-menu-gap, 4px);
  padding: 0.45rem;
  background: var(--bg-card, #fff);
  border-right: 1px solid var(--border-solid, #e2e8f0);
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--text-muted);
  width: auto;
  min-width: 0;
}

.nds-app__rail span {
  padding: 0.28rem 0.35rem;
  border-radius: var(--ds-menu-radius, 8px);
}

.nds-app__rail .is-on {
  color: var(--noribel-marine);
  background: color-mix(in srgb, var(--noribel-sky, #8ec7ed) 45%, white);
}

/* Layout: top tabs */
.nds-app[data-menu='top'] .nds-app__body {
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
}

.nds-app[data-menu='top'] .nds-app__rail {
  grid-row: 1;
  flex-direction: row;
  flex-wrap: wrap;
  border-right: 0;
  border-bottom: 1px solid var(--border-solid, #e2e8f0);
  width: 100%;
}

.nds-app[data-menu='top'] .nds-app__canvas { grid-row: 2; }

/* Layout: icon rail */
.nds-app[data-menu='compact'] .nds-app__body {
  grid-template-columns: 3.4rem minmax(0, 1fr);
}

.nds-app[data-menu='compact'] .nds-app__rail span {
  font-size: 0;
  line-height: 0;
  width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  align-self: center;
  background: var(--bg-subtle, #f0f5fb);
}

.nds-app[data-menu='compact'] .nds-app__rail .is-on {
  background: var(--noribel-marine);
  color: #fff;
}

/* Layout: bottom bar */
.nds-app[data-menu='bottom'] .nds-app__body {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr auto;
}

.nds-app[data-menu='bottom'] .nds-app__rail {
  grid-row: 2;
  flex-direction: row;
  justify-content: space-around;
  border-right: 0;
  border-top: 1px solid var(--border-solid, #e2e8f0);
  width: 100%;
}

.nds-app[data-menu='bottom'] .nds-app__canvas { grid-row: 1; }

/* Active item styles */
.nds-app[data-menu-style='pill'] .nds-app__rail .is-on {
  background: color-mix(in srgb, var(--noribel-sky, #8ec7ed) 55%, white);
  border-radius: 999px;
}

.nds-app[data-menu-style='underline'] .nds-app__rail .is-on {
  background: transparent;
  border-radius: 0;
  box-shadow: inset 0 -2px 0 var(--noribel-marine);
  color: var(--noribel-marine);
}

.nds-app[data-menu-style='ghost'] .nds-app__rail .is-on {
  background: transparent;
  color: var(--noribel-marine);
  font-weight: 800;
}

.nds-app__canvas {
  padding: 0.7rem 0.75rem 0.85rem;
  background-color: var(--bg-subtle, #f0f5fb);
}

.nds-app[data-bg='rings'] .nds-app__canvas {
  background-image:
    repeating-radial-gradient(circle at 85% 12%, transparent 0 48px, rgba(28, 108, 158, 0.07) 48px 49px),
    repeating-radial-gradient(circle at 10% 90%, transparent 0 36px, rgba(28, 108, 158, 0.05) 36px 37px);
}
.nds-app[data-bg='dots'] .nds-app__canvas {
  background-image: radial-gradient(rgba(28, 108, 158, 0.16) 1px, transparent 1.2px);
  background-size: 14px 14px;
}
.nds-app[data-bg='grid'] .nds-app__canvas {
  background-image:
    linear-gradient(rgba(28, 108, 158, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 108, 158, 0.1) 1px, transparent 1px);
  background-size: 22px 22px;
}
.nds-app[data-bg='diagonal'] .nds-app__canvas {
  background-image: repeating-linear-gradient(-32deg, transparent 0 10px, rgba(28, 108, 158, 0.08) 10px 11px);
}
.nds-app[data-bg='wash'] .nds-app__canvas {
  background-image:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(142, 199, 237, 0.35), transparent 60%),
    radial-gradient(ellipse 70% 50% at 95% 100%, rgba(28, 108, 158, 0.18), transparent 55%);
}
.nds-app[data-bg='mesh'] .nds-app__canvas {
  background-image:
    radial-gradient(circle at 20% 25%, rgba(142, 199, 237, 0.35), transparent 42%),
    radial-gradient(circle at 80% 20%, rgba(66, 171, 224, 0.22), transparent 38%),
    radial-gradient(circle at 70% 80%, rgba(28, 108, 158, 0.18), transparent 45%);
}
.nds-app[data-bg='vignette'] .nds-app__canvas {
  background-image: radial-gradient(ellipse 85% 75% at 50% 40%, transparent 35%, rgba(11, 34, 51, 0.12) 100%);
}
.nds-app[data-bg='none'] .nds-app__canvas,
.nds-app[data-bg='solid'] .nds-app__canvas {
  background-image: none;
}

.nds-jan-note {
  margin: 0.9rem 0 0;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--noribel-sky, #8ec7ed) 55%, #e2e8f0);
  background: color-mix(in srgb, var(--noribel-sky, #8ec7ed) 18%, #fff);
  font-size: 0.8rem;
  line-height: 1.45;
}
.nds-jan-note strong { display: block; margin-bottom: 0.35rem; font-size: 0.86rem; }
.nds-jan-note ol { margin: 0.25rem 0 0.45rem 1.1rem; padding: 0; }
.nds-jan-note li { margin: 0.2rem 0; }
.nds-jan-note code { font-size: 0.72rem; }
.nds-jan-note a { color: var(--noribel-marine); font-weight: 700; }

.nds-app__title {
  margin: 0;
  font-size: var(--ds-title, 22px);
  font-weight: var(--ds-w-title, 800);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.nds-app__muted {
  margin: 0.2rem 0 0.65rem;
  color: var(--text-muted);
  font-size: var(--ds-label, 12px);
}

.nds-app__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.nds-app__stats div {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-solid, #e2e8f0);
  border-radius: var(--radius-sm, 10px);
  padding: 0.4rem 0.45rem;
}

.nds-app__stats b { display: block; font-size: 0.95rem; }
.nds-app__stats span { font-size: 0.65rem; color: var(--text-subtle); font-weight: 650; }

.nds-app__card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-solid, #e2e8f0);
  border-radius: var(--radius-md, 16px);
  padding: 0.55rem 0.6rem;
  margin-bottom: 0.55rem;
}

.nds-app__card strong { font-size: var(--ds-section, 16px); }
.nds-app__card p { margin: 0.15rem 0 0.4rem; color: var(--text-muted); font-size: 0.75rem; }
.nds-app__row { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.nds-app__field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: var(--ds-label, 12px);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.nds-app__field input {
  font: inherit;
  font-weight: var(--ds-w-body, 400);
  font-size: var(--ds-body, 15px);
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--border-solid, #e2e8f0);
  border-radius: var(--radius-sm, 10px);
  background: var(--bg-card, #fff);
  color: var(--text);
}

.nds-app__actions { display: flex; gap: 0.35rem; }

@media (max-width: 1100px) {
  .nds-shell { grid-template-columns: 12rem minmax(0, 1fr); }
  .nds-preview { position: static; grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .nds-shell { grid-template-columns: 1fr; }
  .nds-side {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    max-height: none;
  }
  .nds-top__crumb { display: none; }
  .nds-elev-row { grid-template-columns: 1fr 1fr; }
  .nds-logo-row, .nds-split { grid-template-columns: 1fr 1fr; }
  .nds-linked__item { grid-template-columns: 1fr; }
  .nds-top__brand img { width: 7.2rem; }
}
