:root {
  --accent: #f97316;
  --bg: #f8fafc;
  --panel: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --nav-w: 248px;
  --toc-w: 168px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
.dlc-shell { display: flex; min-height: 100vh; }
.dlc-sidenav {
  position: sticky; top: 0; align-self: flex-start;
  width: var(--nav-w); max-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--panel); border-right: 1px solid var(--border);
  padding: 18px 12px 12px; flex-shrink: 0;
}
.dlc-nav-body { flex: 1; overflow-y: auto; padding-bottom: 12px; }
.dlc-brand {
  display: block; margin: 0 0 10px; padding: 2px 6px;
}
.dlc-brand:hover { color: inherit; }
.dlc-brand-mark {
  display: block; font-size: 16px; font-weight: 700;
  letter-spacing: -0.03em; color: var(--text);
}
.dlc-brand .sub {
  display: block; font-size: 11px; color: var(--muted);
  margin: 2px 0 0; font-weight: 500;
}
.dlc-nav-home {
  font-weight: 600; margin-bottom: 10px !important;
}
.dlc-nav-search {
  width: 100%; margin: 0 0 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); overflow: hidden;
}
.dlc-nav-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249,115,22,.15);
}
.dlc-nav-search .dash-input-element,
#nav-search {
  width: 100%; margin: 0; padding: 8px 10px;
  border: none; outline: none; background: transparent;
  font-size: 13px; color: var(--text);
  box-shadow: none !important;
}
.dlc-nav-family { margin: 14px 0 4px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.dlc-nav-item {
  display: block; padding: 4px 8px; border-radius: 6px;
  font-size: 13px; color: #334155; margin: 1px 0;
}
.dlc-nav-item:hover { background: #fff7ed; color: var(--accent); }
.dlc-nav-active {
  background: #fff7ed; color: var(--accent); font-weight: 600;
}
.dlc-nav-footer {
  flex-shrink: 0; padding: 12px 8px 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.dlc-nav-github {
  font-size: 12px; color: var(--muted); font-weight: 500;
  text-decoration: underline; text-underline-offset: 2px;
  display: inline-flex; align-items: center; gap: 5px;
}
.dlc-nav-github::before {
  content: "";
  display: inline-block; width: 14px; height: 14px;
  background: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.65 7.65 0 0 1 2-.27c.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.65 7.65 0 0 1 2-.27c.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z'/%3E%3C/svg%3E");
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  flex-shrink: 0;
}
.dlc-nav-github:hover { color: var(--accent); }
.dlc-nav-credits {
  display: block; font-size: 12px; color: var(--muted); font-weight: 500;
  margin-top: 6px;
}
.dlc-nav-credits:hover { color: var(--accent); }
.dlc-main { flex: 1; min-width: 0; padding: 28px 36px 48px; }

/* Overview */
.dlc-hero h1 { font-size: 30px; margin: 0 0 10px; letter-spacing: -0.03em; line-height: 1.15; }
.dlc-hero p { margin: 0 0 14px; color: var(--muted); max-width: 640px; line-height: 1.55; }
.dlc-hero-teaser {
  display: inline-block; margin: 0 0 28px; padding: 10px 14px;
  background: #0f172a; color: #e2e8f0; border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px; line-height: 1.4;
}
.dlc-family { scroll-margin-top: 24px; padding: 8px 0 32px;
  border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.dlc-family h2 { font-size: 18px; margin: 0 0 4px; }
.dlc-family .meta { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.dlc-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px;
}
.dlc-card-wrap { min-width: 0; transition: opacity .15s ease, filter .15s ease; }
.dlc-card {
  display: block; border: 1px solid var(--border); border-radius: 12px;
  background: var(--panel); padding: 14px 12px; scroll-margin-top: 24px;
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
  height: 100%;
}
.dlc-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(249,115,22,.15);
  transform: translateY(-1px);
}
.dlc-card .name { font-size: 12px; font-weight: 600; color: #334155; margin-bottom: 10px; }
.dlc-card .preview {
  display: flex; align-items: center; justify-content: center;
  min-height: 96px; width: 100%;
  /* Contain loaders whose animations/intrinsic size exceed the card slot */
  overflow: hidden; position: relative;
}

/* Detail page shell: content + right TOC */
.dlc-detail-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--toc-w);
  gap: 28px;
  align-items: start;
  padding-right: 24px;
}
.dlc-detail-content { min-width: 0; }
.dlc-detail-breadcrumb {
  font-size: 13px; color: var(--muted); margin: 0 0 8px; font-weight: 500;
}
.dlc-detail-kicker { color: var(--muted); }
.dlc-detail-sep { color: #cbd5e1; }
.dlc-detail-name { color: var(--text); font-weight: 600; }
.dlc-detail-title { font-size: 28px; margin: 0 0 6px; letter-spacing: -0.03em; }
.dlc-detail-desc { color: var(--muted); margin: 0 0 22px; max-width: 640px; line-height: 1.5; }

/* Workbench: preview | controls */
.dlc-workbench {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 320px);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 22px;
  scroll-margin-top: 24px;
}
.dlc-preview-panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  min-height: 320px; display: flex; align-items: center; justify-content: center;
  padding: 40px;
  /* Contain expanding animations (shimmer sweep, propagate, orbit rings, etc.) */
  overflow: hidden; position: relative;
}
.dlc-workbench-controls {
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  padding: 16px 16px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.dlc-workbench-controls-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.dlc-workbench-controls-body { flex: 1; }
.dlc-ctrl-row { margin-bottom: 14px; }
.dlc-ctrl-label {
  display: block; font-size: 13px; font-weight: 600; color: #334155;
  margin-bottom: 6px;
}
.dlc-size-presets {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.dlc-size-presets .dash-radio-items,
.dlc-size-presets {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.dlc-size-presets label {
  display: inline-flex !important; align-items: center; justify-content: center;
  margin: 0 !important; padding: 6px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 12px; font-weight: 600; color: #334155;
  background: var(--bg); cursor: pointer;
  transition: border-color .12s ease, background .12s ease, color .12s ease;
}
.dlc-size-presets label:has(input:checked),
.dlc-size-presets input:checked + label {
  border-color: var(--accent);
  background: #fff7ed;
  color: var(--accent);
}
.dlc-size-presets input[type="radio"] {
  position: absolute; opacity: 0; pointer-events: none;
}
.dlc-ctrl-color {
  width: 56px; height: 36px; padding: 2px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
  cursor: pointer;
}
.dlc-ctrl-input {
  width: 100%; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--border); font-size: 13px;
}
.dlc-ctrl-dropdown { font-size: 13px; }
.dlc-ctrl-check { font-size: 13px; }
.dlc-ctrl-slider { padding: 0 4px; }
.dlc-reset-btn {
  margin-top: 8px; align-self: flex-start;
  padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg);
  font-size: 12px; font-weight: 600; color: #334155; cursor: pointer;
}
.dlc-reset-btn:hover {
  border-color: var(--accent); color: var(--accent); background: #fff7ed;
}

/* Live dual snippets under workbench */
.dlc-snippets-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-bottom: 36px;
}
.dlc-snippet-block { margin: 0; min-width: 0; }
.dlc-snippet-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 6px;
}
.dlc-snippet {
  background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 16px 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; overflow-x: auto;
  margin: 0;
}
.dlc-snippet-doc { margin-top: 10px; }

/* Per-prop docs below workbench */
.dlc-prop-doc {
  scroll-margin-top: 28px;
  padding: 8px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.dlc-prop-doc:last-of-type { border-bottom: none; }
.dlc-prop-doc h2 {
  font-size: 20px; margin: 0 0 8px; letter-spacing: -0.02em;
}
.dlc-prop-doc-copy {
  margin: 0 0 12px; color: var(--muted); max-width: 640px; line-height: 1.55;
  font-size: 14px;
}

/* Right on-page TOC */
.dlc-toc {
  position: sticky; top: 24px;
  padding: 4px 0 4px 12px;
  border-left: 1px solid var(--border);
}
.dlc-toc-heading {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 10px;
}
.dlc-toc-link {
  display: block; font-size: 12.5px; color: #475569;
  padding: 3px 0; line-height: 1.35;
}
.dlc-toc-link:hover { color: var(--accent); }

/* Legacy prop card (unused on detail workbench; keep for safety) */
.dlc-prop {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 12px;
}
.dlc-prop h3 { margin: 0 0 4px; font-size: 14px; }
.dlc-prop .doc { margin: 0 0 10px; font-size: 12px; color: var(--muted); line-height: 1.4; }

.dlc-site-footer {
  margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--muted); line-height: 1.5;
}
.dlc-site-footer a { color: var(--text); font-weight: 500; text-decoration: underline;
  text-underline-offset: 2px; }
.dlc-site-footer a:hover { color: var(--accent); }
.dlc-footer-note { margin: 10px 0 0; font-size: 12px; color: var(--muted); opacity: 0.85; }
.dlc-404 { padding: 48px 0; }

/* Credits page */
.dlc-credits-intro { color: var(--muted); max-width: 720px; line-height: 1.6; margin: 0 0 28px; }
.dlc-credits-intro a { color: var(--text); font-weight: 500; text-decoration: underline;
  text-underline-offset: 2px; }
.dlc-credits-intro a:hover { color: var(--accent); }
.dlc-credits-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-bottom: 32px; }
.dlc-credits-table th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); padding: 8px 12px;
  border-bottom: 2px solid var(--border);
}
.dlc-credits-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  vertical-align: top; line-height: 1.45;
}
.dlc-credits-table tr:last-child td { border-bottom: none; }
.dlc-credits-table a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.dlc-credits-table a:hover { color: var(--text); }
.dlc-credits-table code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px; background: var(--bg); padding: 1px 5px; border-radius: 4px;
}
.dlc-credits-badge {
  display: inline-block; padding: 2px 7px; border-radius: 4px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
}
.dlc-credits-badge-mit { background: #ecfdf5; color: #065f46; }
.dlc-credits-badge-apache { background: #fff7ed; color: #9a3412; }
.dlc-credits-badge-gated { background: #fef3c7; color: #92400e; }
.dlc-credits-note {
  color: var(--muted); font-size: 13px; max-width: 720px; line-height: 1.55;
  margin: 0 0 12px;
}
.dlc-credits-skip { margin-top: 32px; }
.dlc-credits-skip h2 { font-size: 16px; margin: 0 0 6px; }
.dlc-credits-skip p { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0 0 8px; }

@media (max-width: 1100px) {
  .dlc-detail-page { grid-template-columns: 1fr; }
  .dlc-toc { position: relative; top: 0; border-left: none; border-top: 1px solid var(--border);
    padding: 16px 0 0; margin-bottom: 16px; order: -1; }
}
@media (max-width: 960px) {
  .dlc-shell { flex-direction: column; }
  .dlc-sidenav { position: relative; width: 100%; max-height: none; border-right: none;
    border-bottom: 1px solid var(--border); }
  .dlc-workbench { grid-template-columns: 1fr; }
  .dlc-snippets-row { grid-template-columns: 1fr; }
}

/* loading.dev Custom Classes demo (className passthrough) */
.opacity-40 {
  opacity: 0.4;
}
