/* The explorer stays quiet; the production widget supplies the materials and colour. */
.design-library { padding: 0; background: var(--material-solid); }
.design-library::before { display: none; }
.library-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.5rem; margin: 0; max-width: none; width: 100%; padding: .75rem 1.5rem; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: var(--material-solid); background-image: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.library-brand { display: flex; gap: .625rem; align-items: center; font-size: 1.25rem; font-weight: 700; color: var(--text); text-decoration: none; }
.library-brand > small { font-size: .875rem; font-weight: 500; color: var(--muted); border-left: 1px solid var(--line); padding-left: .75rem; margin-left: .25rem; }
.library-header-actions { display: flex; gap: .75rem; align-items: center; font-size: .875rem; }
.library-header-actions button, .library-header-actions select { width: auto; min-height: 2.75rem; padding: .5rem .75rem; font-size: .875rem; }
.library-header-actions > a { color: var(--muted); text-decoration: none; }
.library-status { color: var(--ok); display: flex; gap: .375rem; align-items: center; }
.library-status::before { content: ''; width: .375rem; height: .375rem; border-radius: 50%; background: currentColor; }
.library-layout { display: grid; grid-template-columns: 17rem minmax(0,1fr); min-height: calc(100vh - 4.5rem); }
.library-sidebar { position: sticky; top: 4.5rem; height: calc(100vh - 4.5rem); overflow: auto; padding: 1.5rem .875rem; border-right: 1px solid var(--line); background: transparent; }
.library-search { display: grid; gap: .5rem; padding: 0 .5rem; font-size: .875rem; font-weight: 600; color: var(--muted); }
.library-search input { width: 100%; min-width: 0; min-height: 2.75rem; padding: .625rem .625rem .625rem 2.25rem; font-size: 1rem; border-radius: .625rem; }
.library-filters { display: flex; flex-wrap: wrap; gap: .5rem; padding: .875rem .5rem .25rem; }
.library-filters button { min-height: 2.75rem; padding: .5rem .625rem; font-size: .875rem; border-radius: .5rem; box-shadow: none; }
.library-filters button[aria-pressed=true], .size-picker-button[aria-pressed=true] { background: var(--accent-fill); color: white; }
.library-count { font-size: .8125rem; color: var(--muted); margin: .75rem .5rem 1rem; }
.story-group { margin: 1.25rem .5rem .5rem; font-size: .875rem; font-weight: 650; color: var(--muted); letter-spacing: 0; text-transform: none; }
.story-link { display: flex; align-items: center; gap: .5rem; min-height: 2.75rem; padding: .625rem; margin: .125rem 0; border-radius: .5rem; text-decoration: none; color: var(--text); font-size: .875rem; line-height: 1.4; }
.story-link::before { content: '◈'; color: var(--muted); font-size: .875rem; }
.story-link[data-kind=characteristic]::before { content: '◇'; color: var(--cool); }
.story-link[aria-current=page] { background: color-mix(in srgb,var(--accent) 12%, transparent); color: var(--accent-ink); font-weight: 650; }
.library-main { padding: 2rem clamp(1.25rem,4vw,4rem) 4rem; max-width: 100rem; width: 100%; min-width: 0; }
.story-heading { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; align-items: flex-start; }
.story-heading > div { min-width: 0; }
.story-heading h1 { overflow-wrap: anywhere; font-size: clamp(1.75rem,3vw,2.25rem); margin: .375rem 0; letter-spacing: -.025em; scroll-margin-top: 6rem; }
.story-heading h1:focus-visible { outline: 2px solid var(--accent); outline-offset: .25rem; }
.story-heading p:last-child { font-size: 1rem; color: var(--muted); line-height: 1.6; max-width: 44rem; margin: .5rem 0 0; }
.story-eyebrow { color: var(--muted); font-size: .875rem; font-weight: 500; margin: 0; }
#copy-link { min-height: 2.75rem; white-space: nowrap; font-size: .875rem; margin-top: 1.75rem; }
.preview-card { border: 1px solid var(--line); border-radius: .75rem; overflow: hidden; background: transparent; box-shadow: none; }
.preview-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: .875rem 1rem; border-bottom: 1px solid var(--line); }
.preview-toolbar label { display: flex; gap: .5rem; align-items: center; min-width: 0; font-size: .875rem; color: var(--muted); }
.preview-toolbar select, .preview-toolbar button { width: auto; min-height: 2.75rem; font-size: 1rem; padding: .5rem .625rem; }
#size-picker { display: flex; flex-wrap: wrap; gap: .5rem; }
#size-picker button { flex: 0 0 2.75rem; width: 2.75rem; min-width: 2.75rem; height: 2.75rem; min-height: 2.75rem; padding: 0; border-radius: .5rem; font-size: .875rem; }
#reset { margin-left: auto; }
.preview-scroll { display: flex; justify-content: safe center; overflow-x: auto; padding: 1.5rem 1rem; min-height: 16.25rem; background-image: radial-gradient(var(--line) .8px, transparent .8px); background-size: 1rem 1rem; }
#preview { display: block; flex-shrink: 0; width: 393px; min-height: 13.75rem; padding: 1rem; border: 0; border-radius: 0; background: transparent; }
.preview-feedback { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: .75rem 1rem; padding: 1rem; border-top: 1px solid var(--line); }
#last-event { margin: .5rem 0 0; font-size: .875rem; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
#last-event[data-tone=error] { color: var(--error); }
.event-details > summary { min-height: 2.75rem; cursor: pointer; font-size: .875rem; font-weight: 600; padding: .5rem; }
.event-details[open] { grid-column: 1 / -1; }
.preview-note { margin: 0; padding: 0 1rem 1rem; color: var(--muted); font-size: .8125rem; line-height: 1.5; }
.story-panels { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: 2rem; margin-top: 1.5rem; }
.story-panel { min-width: 0; padding: 1.25rem 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; margin-bottom: 1rem; box-shadow: none; }
.story-panel h2 { margin: 0 0 .75rem; font-size: 1.125rem; }
.story-panel h3 { font-size: 1rem; color: var(--text); margin: 1.5rem 0 .75rem; letter-spacing: 0; text-transform: none; }
.panel-help { color: var(--muted); font-size: .875rem; line-height: 1.6; margin-bottom: 1.25rem; }
.knob { display: grid; grid-template-columns: minmax(0,1fr) minmax(7rem,46%); align-items: center; gap: .875rem; min-height: 2.75rem; padding: .75rem 0; border-bottom: 1px solid var(--line); font-size: .875rem; overflow-wrap: anywhere; }
.knob small { display: block; color: var(--muted); font-size: .8125rem; margin-top: .25rem; }
.knob input, .knob select { width: 100%; min-height: 2.75rem; font-size: 1rem; min-width: 0; padding: .5rem; }
.knob input[type=checkbox] { width: 1.5rem; height: 1.5rem; min-height: 0; justify-self: end; accent-color: var(--accent-fill); }
.rule { font-size: .9375rem; line-height: 1.65; color: var(--muted); margin: 0 0 .875rem; }
.rule strong { color: var(--text); }
.story-panel dl { display: grid; grid-template-columns: 7rem minmax(0,1fr); font-size: .875rem; gap: .75rem; margin: 0; }
.story-panel dt { color: var(--muted); }
.story-panel dd { margin: 0; overflow-wrap: anywhere; font-family: var(--mono); font-size: .8125rem; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; }
.panel-heading button { min-height: 2.75rem; font-size: .875rem; padding: .5rem .75rem; }
.event-log { list-style: none; margin: 0; padding: 0; max-height: 15rem; overflow: auto; }
.event-log li { padding: .625rem 0; border-top: 1px solid var(--line); color: var(--muted); font: .8125rem/1.6 var(--mono); overflow-wrap: anywhere; }
.fixture-panel > summary { min-height: 2.75rem; cursor: pointer; font-size: 1rem; font-weight: 600; padding: .5rem 0; }
.story-panel pre { margin: 0; max-height: 20rem; overflow: auto; font-size: .8125rem; padding: 1rem 0; border-radius: 0; }
.token-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,11rem),1fr)); gap: 1rem; }
.token-card { padding: 1rem; border: 1px solid var(--line); border-radius: .5rem; background: transparent; }
.token-swatch { height: 4rem; border-radius: .375rem; border: 1px solid var(--line); margin-bottom: .75rem; }
.token-shape { width: 7rem; height: 3.5rem; background: color-mix(in srgb, var(--accent) 14%, transparent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.token-ramp { display: grid; margin-bottom: 1rem; }
.token-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.token-sample { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.token-row code { flex: none; font-size: .8125rem; color: var(--muted); }
.token-card strong { display: block; font-size: .875rem; }.token-card code { font-size: .8125rem; color: var(--muted); }
.skip { position: fixed; top: -100px; left: .75rem; z-index: 50; }.skip:focus { top: .625rem; background: var(--material-solid); padding: .75rem; }
#stories { display: block; }
#view { width: 100%; min-width: 0; }
#story-browser > summary { display: none; }
#preview .characteristic-demo { padding: 1.5rem; }
#preview .characteristic-demo .control { margin: 0; }
#preview .characteristic-demo .control > span:first-child { max-width: 48%; }
#preview .protocol-note { color: var(--muted); line-height: 1.6; margin: 0; }
@media (hover: hover) and (pointer: fine) { .library-header-actions > a:hover { color: var(--text); text-decoration: underline; } }
@media (hover: none) { .design-library button:hover { transform: none; }.design-library button:active:not(:disabled) { transform: scale(.97); } }
@media (max-width: 1100px) { .library-header-actions > a,.library-status { display: none; }.story-panels { grid-template-columns: 1fr; gap: 0; }.library-layout { grid-template-columns: 15rem minmax(0,1fr); } }
@media (max-width: 700px) {
  .library-header { flex-wrap: wrap; padding: .75rem; gap: .5rem; }.library-brand { font-size: 1.125rem; gap: .375rem; }.library-brand > small { display: none; }.library-header-actions { gap: .5rem; }.library-header-actions select { font-size: 1rem; max-width: 7rem; padding: .5rem; }
  #theme { font-size: 0; width: 2.75rem; height: 2.75rem; padding: 0; flex: 0 0 auto; }#theme::before { content: '◐'; font-size: 1.25rem; }
  .library-layout { display: block; }.library-sidebar { position: static; height: auto; padding: .5rem .75rem; border-right: 0; border-bottom: 1px solid var(--line); }
  #story-browser > summary { display: list-item; min-height: 2.75rem; cursor: pointer; padding: .625rem .5rem; font-weight: 600; font-size: .875rem; }#story-browser[open] > summary { margin-bottom: .75rem; }#stories { max-height: 40vh; overflow: auto; }
  .library-main { padding: 1.25rem 1rem 3rem; }.story-heading { gap: .75rem; margin-bottom: 1.25rem; }#copy-link { font-size: .875rem; padding: .5rem; }
  .preview-toolbar { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.2fr) auto; gap: .75rem; padding: .75rem; }#size-picker { grid-column: 1 / -1; }.preview-toolbar label { display: grid; gap: .25rem; }.preview-toolbar select { width: 100%; min-width: 0; }#reset { align-self: end; margin-left: 0; }
  .knob { grid-template-columns: 1fr; gap: .5rem; }.knob input[type=checkbox] { justify-self: start; }
  .preview-scroll { justify-content: flex-start; padding: 1rem 0; }.preview-feedback { padding: .75rem; gap: .5rem; }.preview-note { padding: 0 .75rem .75rem; }
}
