/* The /demo/ page. Everything is scoped under .lc-demo. Inside the three windows each program keeps its own look; colours below are
   sampled from real captures (napari's dark theme tokens, Fiji's Swing look, JupyterLab Light, NucleiSky's STYLE_CSS card colours). */
.lc-demo { margin: 1rem 0 2rem; }
.lc-demo__notice, .lc-demo__experimental { margin: 0 0 .6rem; padding: .35rem .7rem; border-radius: 6px; font-size: var(--fs-ui); }
.lc-demo__notice { background: #eef5ee; border: 1px solid #b9d3b9; }
.lc-demo__experimental { background: #fff4e5; border: 1px solid #e8c48a; }
.lc-demo__live, .lc-demo [hidden] { display: none; }
.lc-demo.is-live .lc-demo__live { display: block; }
.lc-demo.is-live .lc-demo__static { display: none; }
.lc-demo__tabs { display: inline-flex; gap: .4rem; margin-right: .6rem; }
.lc-demo__tabs .lc-btn[aria-selected="false"] { background: #fff; color: #1c5f1c; border: 1px solid #1c5f1c; }
.lc-demo__panel { margin-top: .8rem; overflow-x: auto; border: 1px solid #c9ccd1; border-radius: 6px; }
/* the two parts as wide numbered buttons, then the program tabs (with their logos) of the installed app, then the hint line */
[dir] .lc-demo__parts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; width: 100%; margin: 0 0 .8rem; }
[dir] .md-typeset .lc-demo__part { display: flex; align-items: center; gap: .7rem; padding: .8rem 1rem; font-size: var(--fs-body); text-align: left; cursor: pointer; }
.lc-demo__part[aria-selected="true"] .lc-num { background: #fff; color: var(--lc-accent-strong); }
[dir] .lc-demo__views { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; width: 100%; margin: 0 0 .8rem; }
[dir] .md-typeset .lc-demo__view { display: flex; align-items: center; justify-content: center; gap: .55rem; padding: .7rem 1rem; font-size: var(--fs-body); cursor: pointer; }
.lc-demo__view .lc-logo { width: 24px; height: 24px; margin: 0; border-radius: 3px; background: #fff; }
.lc-demo__views[hidden] { display: none; }
.lc-demo__os { margin: .5rem 0 0; }
@media (max-width: 40rem) { [dir] .lc-demo__parts { grid-template-columns: 1fr; } }
.lc-demo__static { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.lc-demo__fig img { width: 100%; height: auto; }
.lc-demo__how { margin: 1rem 0; }
.lc-demo button:focus-visible, .lc-demo input:focus-visible, .lc-demo [tabindex]:focus-visible { outline: 2px solid #fff; box-shadow: 0 0 0 4px #2563eb; }
.lc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.np__layer.is-selected .np__name::before { content: '\25B8  '; }
@media (forced-colors: active) { .np__layer.is-selected { outline: 2px solid Highlight; } .lc-demo__tabs [aria-selected="true"] { border: 3px solid Highlight; } }
/* The picture shared by the three windows: layers stacked in a square (the region around the match). */
.lc-view { position: relative; width: 100%; aspect-ratio: 1; background: #000; overflow: hidden; }
.lc-view__layer { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.lc-view__blend { mix-blend-mode: screen; }
.lc-view__query { inset: 0 auto auto 0; width: var(--q); height: auto; }
.lc-view__outline { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.lc-view__outline polygon { fill: none; stroke: #ffe14d; stroke-width: 2; vector-effect: non-scaling-stroke; }
/* ---- Jupyter notebook (JupyterLab Light + NucleiSky card colours) ---- */
.nb { font: 13px/1.45 "Helvetica Neue", Arial, sans-serif; color: #212121; background: #fff; min-width: 640px; }
.nb__menu { display: flex; gap: 1rem; padding: .35rem .6rem; background: #eee; border-bottom: 1px solid #bdbdbd; }
.nb__logo { width: 14px; height: 14px; border-radius: 50%; background: #f37726; }
.nb__body { display: flex; min-height: 26rem; }
.nb__side { width: 11rem; background: #eee; border-right: 1px solid #bdbdbd; padding: .5rem; font-size: 12px; }
.nb__filter { background: #fff; border: 1px solid #bdbdbd; padding: .15rem .3rem; color: #757575; }
.nb__path { margin: .4rem 0; color: #616161; }
.nb__side ul { margin: 0; padding: 0; list-style: none; }
.nb__side li { padding: .15rem .3rem; }
.nb__side .is-open { background: #1976d2; color: #fff; }
.nb__main { flex: 1; min-width: 0; }
.nb__tabs { display: flex; gap: 2px; background: #bdbdbd; padding: 2px 2px 0; }
.nb__tab { border: 0; background: #e0e0e0; padding: .3rem .7rem; font: inherit; cursor: pointer; }
.nb__tab[aria-selected="true"] { background: #fff; font-weight: 600; }
.nb__toolbar { display: flex; gap: .4rem; align-items: center; padding: .3rem .5rem; background: #fafafa; border-bottom: 1px solid #e0e0e0; }
.nb__tool, .nb__btn { border: 1px solid #bdbdbd; background: #fff; padding: .2rem .6rem; font: inherit; cursor: pointer; border-radius: 3px; }
.nb__tool[aria-pressed="true"] { background: #e3f2fd; border-color: #2196f3; }
.nb__kernel { margin-left: auto; color: #616161; font-size: 12px; }
.nb__doc { padding: 1rem 1.4rem; max-height: 34rem; overflow-y: auto; }
.nb__h1 { margin: 0 0 .4rem; font-size: 1.7rem; font-weight: 600; border-bottom: 1px solid #e0e0e0; padding-bottom: .3rem; }
.nb__h2 { margin: .9rem 0 .3rem; font-size: 1.2rem; font-weight: 600; }
.nb__cell { display: flex; gap: .6rem; margin: .7rem 0; }
.nb__play { width: 2rem; height: 2rem; border: 0; background: #212121; color: #fff; border-radius: 3px; cursor: pointer; flex: none; }
.nb__play:disabled { background: #9e9e9e; cursor: not-allowed; }
.nb__src { flex: 1; min-width: 0; background: #f5f5f5; border: 1px solid #e0e0e0; padding: .4rem .6rem; }
.nb__collapsed { margin: 0; color: #616161; font-family: monospace; }
.nb__code { margin: 0; white-space: pre-wrap; font: 12px/1.4 monospace; }
.nb__table { width: 100%; border-collapse: collapse; margin: .6rem 0; font-size: 12px; display: block; overflow-x: auto; }
.nb__table th { background: #c24e00; color: #fff; padding: .4rem; text-align: center; }
.nb__table td { padding: .4rem; border: 1px solid #e0e0e0; vertical-align: middle; }
.nb__table td:last-child { padding-inline: 1rem; }   /* room for the guide loop round the button, so the table does not scroll */
.nb__open { background: #1565c0; color: #fff; border: 0; border-radius: 4px; padding: .5rem .9rem; font-weight: 700; cursor: pointer; }
.nb__open:disabled { background: #bdbdbd; cursor: not-allowed; }
.nb__ok, .nb__result { margin: .3rem 0; }
.nb__note { color: #616161; font-size: 12px; }
.nb__field { display: block; margin: .3rem 0; }
.nb__field input { margin-left: .4rem; background: #eee; border: 1px solid #bdbdbd; }
.nb__update { background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 6px; padding: .6rem .8rem; color: #1e293b; }
.ns-card { background: #fff; border: 1px solid #cbd5e1; border-radius: 8px; padding: .7rem .9rem; margin: .6rem 0; color: #1e293b; }
.ns-label { margin: 0 0 .4rem; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #475569; }
[data-after][hidden], [data-done][hidden] { display: none; }
.ns-page { max-width: 40rem; margin: .6rem 0; color: #1e293b; background: #f1f5f9; padding: .8rem; border-radius: 8px; }
.ns-title { margin: 0 0 .2rem; font-size: 1.1rem; font-weight: 700; } .ns-sub { margin: 0 0 .6rem; color: #475569; }
.ns-header { margin: 0 0 .4rem; font-weight: 700; }
.ns-row { display: flex; gap: .6rem; align-items: center; margin: .25rem 0; }
.ns-flabel { flex: 0 0 11rem; color: #475569; }
.ns-input { flex: 1; background: #fff; border: 1px solid #cbd5e1; border-radius: 4px; padding: .2rem .5rem; min-height: 1.6rem; overflow-wrap: anywhere; }
.ns-btn { margin-top: .4rem; padding: .5rem 1rem; border: 0; border-radius: 6px; background: #2563eb; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.ns-btn:disabled { background: #94a3b8; cursor: not-allowed; }
.nb__log { margin: .4rem 0; padding: .5rem .7rem; background: #fff; border: 1px solid #e0e0e0; font: 12px/1.4 monospace; white-space: pre-wrap; overflow-x: auto; }
.nb__qc { width: 100%; height: auto; margin: .3rem 0 .8rem; }
.nb__qc.nb__seg { max-width: 34rem; }
.nb__appicon { width: 2.4rem; height: 2.4rem; border-radius: 8px; }
.ns-pill { display: inline-block; padding: .2rem .7rem; border: 1px solid #cbd5e1; border-radius: 999px; }
.ns-pill.is-on { background: #2563eb; border-color: #2563eb; color: #fff; }
.ns-images { display: flex; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.ns-images figure { margin: 0; max-width: 14rem; font-size: 12px; }
.nb__thumb { max-height: 14rem; width: auto; max-width: 100%; }
.nb__thumb--q { max-height: 9rem; }
.nb__cards .lc-view { max-width: 26rem; }
.nb__facts { margin: .5rem 0 0; padding-left: 1.2rem; }
/* the "app is installed" start screen */
.nb__launch { padding: 2rem 1.4rem; min-height: 14rem; background: #f1f5f9; color: #1e293b; }
.nb__app { display: inline-flex; align-items: center; gap: .6rem; margin: .6rem 0; padding: .6rem 1rem; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.lc-demo__about { margin: 1rem 0; max-width: 52rem; }
/* ---- napari (stock dark theme) ---- */
.np { font: 12px/1.4 "DejaVu Sans", Arial, sans-serif; color: #f0f1f2; background: #23242b; min-width: 720px; }
.np__menu { display: flex; gap: 1rem; padding: .3rem .6rem; }
.np__cols { display: grid; grid-template-columns: 22% 1fr 36%; gap: 4px; padding: 4px; }
.np__dock { margin-bottom: 4px; }
.np__title { margin: 0; padding: .2rem .4rem; text-align: right; color: #d1d2d4; }
.np__panel, .np__form { background: #2e333e; padding: .5rem; }
.np__row { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin: .25rem 0; }
.np__row input[type="range"] { flex: 1; height: 24px; }
.np__combo, .np__field { background: #424a54; padding: .2rem .5rem; border-radius: 3px; min-width: 4rem; text-align: center; }
.np__full { display: block; margin: .25rem 0; text-align: left; }
.np__head { margin: .6rem 0 .2rem; text-align: center; font-weight: 700; }
.np__desc, .np__hint, .np__note, .np__foot { color: #b4b6ba; margin: .3rem 0; }
.np__foot { padding: .3rem .6rem; font-size: 11px; }
.np__layers { margin: 0; padding: 0; list-style: none; background: #2e333e; }
.np__layer { display: flex; align-items: center; gap: .2rem; margin: 2px; background: #424a54; }
.np__layer.is-selected { background: #4560c4; }
.np__eye, .np__name { border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer; padding: .35rem .4rem; }
.np__eye[aria-pressed="false"] { opacity: .35; text-decoration: line-through; }
.np__name { flex: 1; text-align: center; font-weight: 700; }
.np__viewer { background: #000; display: flex; flex-direction: column; justify-content: center; }
.np__canvas { background: #000; }
.np__run { width: 100%; margin: .5rem 0; padding: .35rem; border: 0; border-radius: 3px; background: #424a54; color: #f0f1f2; font: inherit; cursor: pointer; }
.np__status { margin: .2rem 0; word-break: break-word; min-height: 2.6em; }
.np__file { padding-left: 1rem; } .np__file .np__field { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.np__chip { background: #424a54; padding: .2rem .5rem; border-radius: 3px; white-space: nowrap; }
.np__tick { justify-content: flex-start; } .np__box, .fj__box { flex: none; width: 13px; height: 13px; border-radius: 2px; border: 1px solid #8a8f98; background: transparent; }
.np__box.is-on { background: #4560c4; border-color: #4560c4; }
.np__dim { opacity: .5; }
.fj__chip { border: 1px solid #d5d5d5; background: #fff; padding: .15rem .7rem; border-radius: 3px; }
.fj__box { background: #fff; border-color: #888; } .fj__box.is-on { background: #3b73b9; border-color: #3b73b9; }
.np__small { color: #a0a2a8; font-size: 11px; justify-content: space-between; }
/* ---- Fiji (flat light Swing look) ---- */
.fj { font: 12px/1.4 Arial, Helvetica, sans-serif; color: #1a1a1a; background: #000; min-width: 640px; padding: .5rem; }
.fj__bar { background: #ededed; padding: .3rem .6rem; border-radius: 3px; max-width: 34rem; }
.fj__bar p { margin: .15rem 0; }
.fj__menu { display: flex; gap: .9rem; }
.fj__tools { display: flex; gap: 4px; }
.fj__tools i { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; color: #333; background: #f4f4f4; border: 1px solid #c4c4c4; }
.fj__tools svg { width: 16px; height: 16px; }
.fj__link { border: 0; background: none; padding: .3rem 0; min-height: 24px; color: #1a56a8; text-decoration: underline; font: inherit; cursor: pointer; }
.fj__status { color: #444; }
.fj__stage { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-start; margin-top: .6rem; }
.fj__win { background: #ededed; border: 4px solid #fff; max-width: 17rem; }
.fj__wtitle { margin: 0; padding: .15rem .4rem; background: #d9d9d9; font-weight: 700; }
.fj__info { margin: 0; padding: .1rem .4rem; font-size: 11px; }
.fj__img { background: #000; } .fj__img img { display: block; width: 100%; height: auto; }
.fj__dialog { background: #f2f2f2; border: 1px solid #a0a0a0; padding: .6rem .8rem; width: 26rem; max-width: 100%; }
.fj__dtitle { margin: 0 0 .4rem; font-weight: 700; }
.fj__row { display: flex; align-items: center; gap: .5rem; margin: .25rem 0; }
.fj__row label { flex: 0 0 11rem; text-align: right; }
.fj__field { flex: 1; background: #fff; border: 1px solid #d2d2d2; padding: .15rem .4rem; }
.fj__msg { margin: .3rem 0; color: #444; }
.fj__buttons { display: flex; justify-content: flex-end; gap: .4rem; margin: .6rem 0 0; }
.fj__btn { border: 1px solid #d5d5d5; background: #fff; padding: .25rem .9rem; font: inherit; cursor: pointer; border-radius: 3px; }
.fj__btn--ok { background: #eaf3fb; border-color: #a8c6e1; }
.fj__log { color: #ddd; margin: .6rem 0 0; font-family: monospace; }
@media (max-width: 860px) {
  .nb, .np, .fj { min-width: 0; }
  .nb__side, .nb__menu, .np__menu, .fj__menu, .fj__tools { display: none; }
  .np__cols { grid-template-columns: 1fr; }
  .np__cols > *, .np__row input[type="range"] { min-width: 0; }
}
/* phones: a label above its value (the fixed label column of the real widgets leaves no room), the notebook table as one card per notebook */
@media (max-width: 40rem) {
  .nb__doc { padding: .8rem; }
  .ns-row, .fj__row { flex-wrap: wrap; row-gap: .15rem; }
  .ns-row .ns-flabel, .ns-row .ns-field + .ns-flabel, .fj__row label { flex: 1 1 100%; text-align: left; }
  .ns-row .ns-field + .ns-flabel { margin-top: .3rem; }
  .ns-select { min-width: 0; }
  .fj__row:has(.fj__box) label { flex: 0 1 auto; }
  .fj__field { min-width: 0; overflow-wrap: anywhere; }
  .nb__table, .nb__table tbody, .nb__table tr, .nb__table td { display: block; }
  .nb__table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .nb__table { overflow: visible; }
  .nb__table tr { margin: 0 0 .6rem; border: 1px solid #e0e0e0; }
  .nb__table td, .nb__table td:last-child { display: flex; gap: .6rem; padding-inline: .4rem; border: 0; border-top: 1px solid #eee; }
  .nb__table td:first-child { border-top: 0; font-weight: 700; background: #fbe9dc; }
  .nb__table td:not(:first-child)::before { flex: 0 0 6.5rem; color: #616161; font-weight: 600; }
  .nb__table td:nth-child(2)::before { content: "Description"; }
  .nb__table td:nth-child(3)::before { content: "Local Version"; }
  .nb__table td:nth-child(4)::before { content: "Status"; }
  .nb__table td:nth-child(5)::before { content: "Update?"; }
  .nb__table td:nth-child(6)::before { content: "Open Notebook"; }
}
@media (prefers-reduced-motion: no-preference) { .lc-view__layer { transition: opacity .15s; } }

/* the guide: a hand-drawn red loop around the next thing to click, and one line (in a handwriting font where the system has one) saying what to do */
.lc-demo__next { margin: 0 0 .8rem; padding: .55rem .9rem; border-left: 4px solid var(--lc-accent-strong, #1c5f1c); border-radius: 0 .4rem .4rem 0; background: var(--lc-band, #ebf4e7); font-size: var(--fs-ui); font-weight: 600; line-height: 1.45; color: var(--lc-strong, #10211a); }
.lc-demo__next:empty { display: none; }
.is-next, .is-explain { position: relative; }
.is-next::after, .is-explain::after { content: ""; position: absolute; inset: -12px -16px; pointer-events: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 100' preserveAspectRatio='none'%3E%3Cpath d='M12 54C6 22 44 5 104 7C162 5 197 24 192 52C188 80 150 95 96 92C42 95 8 80 12 46C16 22 52 9 96 9C130 8 150 12 160 18' fill='none' stroke='%23e11d48' stroke-width='3.2' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") no-repeat center / 100% 100%; transform: rotate(-1.2deg); }
.nb__app.is-selected { background: #dbeafe; }
.nb__guide { margin: .6rem 0; padding: .5rem .8rem; border: 2px dashed #e11d48; border-radius: 8px; background: #fff1f2; font-size: 12px; }
.nb__guide p { margin: 0 0 .3rem; } .nb__guide ol { margin: 0; padding-left: 1.2rem; }
@media (prefers-reduced-motion: no-preference) { .is-next::after, .is-explain::after { animation: lc-pulse 1.6s ease-in-out infinite; } }
@keyframes lc-pulse { 50% { opacity: .45; } }

/* "running" while the precomputed result is being shown */
.is-busy { cursor: progress; }
.nb__play.is-busy span { display: none; }
.is-busy::before { content: ""; display: inline-block; width: .85em; height: .85em; margin-right: .4em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -.1em; }
@media (prefers-reduced-motion: no-preference) { .is-busy::before { animation: lc-spin .8s linear infinite; } }
@keyframes lc-spin { to { transform: rotate(360deg); } }
.lc-demo[data-busy] .lc-demo__panel button:not(.is-busy) { pointer-events: none; }
.nb__cards .lc-view { max-width: 34rem; }
.nb__legend { margin: .3rem 0; font-size: 12px; }
.nb__legend b { display: inline-block; width: .9em; height: .9em; vertical-align: -.1em; margin-right: .3em; }

/* "How the connection works": a diagram and a clickable list of steps, only for napari and Fiji */
.lc-how { margin: 1rem 0; } .lc-how ol { padding-left: 1.4rem; max-width: 46rem; }
.lc-how__diagram { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .6rem 0; }
.lc-how__box { padding: .5rem .8rem; border: 2px solid #cbd5e1; border-radius: 8px; background: #fff; color: inherit; font: inherit; cursor: pointer; }
.lc-how__box:hover { border-color: #e11d48; }
.lc-how__box + .lc-how__box::before { content: "\2192"; margin-right: .6rem; color: #64748b; }
.lc-how__box.is-active { border-color: #e11d48; background: #fff1f2; font-weight: 700; }
.lc-how__step { display: block; width: 100%; padding: .35rem .5rem; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.lc-how__step[aria-pressed="true"] { background: #fff1f2; box-shadow: inset 3px 0 0 #e11d48; font-weight: 600; }
/* NucleiSky widgets that can be explored (toggles, dropdown, accordions); values never recompute a result */
button.ns-pill { font: inherit; background: #fff; color: #1e293b; cursor: pointer; }
.ns-pill + .ns-pill { margin-left: .3rem; }
.ns-field { font: inherit; background: #fff; border: 1px solid #cbd5e1; border-radius: 4px; padding: .2rem .4rem; color: #1e293b; max-width: 100%; }
.ns-field:disabled { background: #e2e8f0; color: #64748b; }
.ns-select { min-width: 12rem; }
.ns-acc { display: block; width: 100%; margin: .5rem 0 .2rem; padding: .4rem .6rem; text-align: left; font: inherit; font-weight: 600; background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 4px; color: #1e293b; cursor: pointer; }
.ns-acc::before { content: '\25B6\00a0'; font-size: .7em; } .ns-acc[aria-expanded="true"]::before { content: '\25BC\00a0'; }
.ns-ph { color: #64748b; }
.ns-row input[type="range"] { flex: 1; max-width: 12rem; }
.ns-row .ns-field { flex: 1 1 7rem; min-width: 0; }
.ns-row .ns-field + .ns-flabel { flex: 0 0 auto; }
.ns-row input[type="number"].ns-field { max-width: 14rem; }
.lc-how__hosts { max-width: 46rem; font-size: var(--fs-ui); } .lc-how__hosts th, .lc-how__hosts td { text-align: left; vertical-align: top; }
.lc-how__hosts code { white-space: normal; word-break: normal; overflow-wrap: break-word; }
@media (max-width: 40rem) { .lc-how__hosts thead { display: none; } .lc-how__hosts, .lc-how__hosts tbody, .lc-how__hosts tr, .lc-how__hosts th, .lc-how__hosts td { display: block; } .lc-how__hosts tr { margin: 0 0 .8rem; } }
