/* Ekalix - the Library (CONTRACT-V14). Colours only through the product's custom properties, so
   every theme draws it; tones come from the shared .t-* classes (--tone, --tone-bg, --tone-bd) and
   an estate's colour from .plat-* (--plat). Built to stay calm at a hundred servers: dense where
   the eye scans (tiles, the board), roomy where it reads (the question, the answer). */
.lib { display: flex; flex-direction: column; gap: 14px; }

/* ---- the estates: one dropdown in the header - the button names the estate, the list holds them all ---- */
.lib-epick { position: relative; flex: 0 0 auto; margin-right: 4px; }
.lib-ebtn {
  display: flex; align-items: center; gap: 10px; min-width: 230px; max-width: 320px; height: 44px; padding: 0 10px 0 7px;
  border: 1px solid color-mix(in srgb, var(--plat, var(--accent)) 55%, var(--border)); border-radius: var(--r);
  background: linear-gradient(120deg, color-mix(in srgb, var(--plat, var(--accent)) 16%, transparent), transparent 75%), var(--surface-1);
  color: var(--text); font: inherit; text-align: left; cursor: pointer;
  transition: border-color var(--t), box-shadow var(--t), transform 180ms ease;
}
.lib-ebtn:hover { border-color: var(--plat, var(--accent)); box-shadow: 0 6px 18px -12px var(--plat, var(--accent)); }
.lib-epick.open .lib-ebtn { border-color: var(--plat, var(--accent)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--plat, var(--accent)) 22%, transparent); }
.lib-ebtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lib-echev { margin-left: auto; color: var(--text-3); font-size: 15px; transform: rotate(90deg); transition: transform 200ms cubic-bezier(.2,.7,.3,1), color var(--t); }
.lib-epick.open .lib-echev { transform: rotate(-90deg); color: var(--plat, var(--accent)); }
.lib-eic { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; color: var(--plat, var(--accent));
  background: color-mix(in srgb, var(--plat, var(--accent)) 14%, transparent); border: 1px solid color-mix(in srgb, var(--plat, var(--accent)) 30%, transparent); }
.lib-et { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; line-height: 1.3; }
.lib-et b { font-size: 13px; font-weight: 650; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-et i { font-style: normal; font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-ebad { flex: 0 0 auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center;
  background: var(--critical-bg); border: 1px solid var(--critical-bd); color: var(--critical); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.lib-emenu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; width: 340px; max-height: min(460px, 70vh); overflow: auto;
  display: flex; flex-direction: column; gap: 2px; padding: 8px;
  border: 1px solid var(--border-2); border-radius: var(--r); background: var(--surface-1); box-shadow: var(--shadow);
  animation: libMenu 170ms cubic-bezier(.2,.7,.3,1) both;
}
@keyframes libMenu { from { opacity: 0; transform: translateY(-5px) scale(.98); } to { opacity: 1; transform: none; } }
.lib-emh { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.lib-emh i { font-style: normal; font-size: 11px; padding: 0 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); letter-spacing: 0; }
.lib-estate {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 1px solid transparent; border-radius: var(--r-s);
  background: transparent; color: var(--text-2); font: inherit; text-align: left; cursor: pointer; transition: background var(--t), border-color var(--t);
}
.lib-estate.cur { background: var(--surface-2); }
.lib-estate.on { background: linear-gradient(120deg, color-mix(in srgb, var(--plat, var(--accent)) 16%, transparent), transparent 80%); border-color: color-mix(in srgb, var(--plat, var(--accent)) 45%, transparent); }
.lib-eok { flex: 0 0 16px; text-align: center; color: var(--plat, var(--accent)); font-weight: 800; }

/* ---- the page: the list on the left, the question or the board on the right ---- */
.lib-body { display: grid; grid-template-columns: minmax(270px, 320px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1000px) { .lib-body { grid-template-columns: 1fr; } .lib-side { position: static; max-height: 420px; } }
.lib-side { position: sticky; top: 8px; max-height: calc(100vh - 150px); overflow: auto; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-1); padding: 10px; scrollbar-width: thin; }
.lib-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }

/* ---- the list of questions ---- */
.lib-list { display: flex; flex-direction: column; }
.lib-search { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--r-s); background: var(--surface-2); color: var(--text-3); transition: border-color var(--t), box-shadow var(--t); }
.lib-search:focus-within { border-color: var(--accent-bd); box-shadow: 0 0 0 3px var(--accent-bg); color: var(--accent); }
.lib-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; }
.lib-scopes { display: flex; gap: 4px; margin: 9px 0 2px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.lib-scopes::-webkit-scrollbar { display: none; }
.lib-scope { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--text-2); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.lib-scope i { font-style: normal; font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.lib-scope:hover { color: var(--text); border-color: var(--border-2); }
.lib-scope.on { color: var(--text); border-color: var(--accent-bd); background: var(--accent-bg); }
.lib-scope.t-serious.on { border-color: var(--tone-bd); background: var(--tone-bg); }
.lib-group { margin-top: 8px; }
.lib-gh { width: 100%; display: flex; align-items: center; gap: 6px; padding: 5px 6px; border: 0; border-radius: var(--r-xs); background: transparent; color: var(--text-3); font: inherit; cursor: pointer; text-align: left; }
.lib-gh:hover:not(:disabled) { background: var(--surface-2); color: var(--text-2); }
.lib-gh:disabled { cursor: default; }
.lib-gh .exchev { font-size: 11px; transition: transform 200ms ease; }
.lib-gname { font-size: 10.5px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-gn, .lib-gbad { font-size: 10.5px; padding: 0 6px; border-radius: 999px; border: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.lib-gbad { color: var(--serious); border-color: var(--serious-bd); background: var(--serious-bg); font-weight: 700; }
.lib-item { position: relative; display: flex; align-items: stretch; border-radius: var(--r-s); margin: 1px 0; }
.lib-item::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 3px; background: transparent; transition: background var(--t); }
.lib-item:hover { background: var(--surface-2); }
.lib-item.on { background: var(--accent-bg); }
.lib-item.on::before { background: var(--accent); }
.lib-item.cur { box-shadow: inset 0 0 0 1px var(--accent-bd); }
.lib-item.off { opacity: .55; }
.lib-ib { flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: 18px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; padding: 6px 4px 6px 9px; border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.lib-dot { grid-row: 1 / span 2; align-self: center; display: inline-flex; justify-content: center; font-size: 11px; font-weight: 800; color: var(--tone, var(--muted)); }
.lib-dot.auto { opacity: .8; }
.lib-iname { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-isub { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-pin { flex: 0 0 auto; width: 26px; border: 0; background: transparent; color: var(--text-3); font-size: 14px; cursor: pointer; opacity: 0; transition: opacity var(--t), color var(--t), transform 160ms ease; }
.lib-item:hover .lib-pin, .lib-pin:focus-visible { opacity: 1; }
.lib-pin:hover { color: var(--warning); transform: scale(1.15); }
.lib-pin.on { opacity: 1; color: var(--warning); }
.lib-none { color: var(--text-3); font-size: 12.5px; padding: 10px 2px; display: flex; gap: 8px; align-items: center; }
.lib-note { font-size: 12px; color: var(--text-2); padding: 5px 9px; border: 1px dashed var(--border-2); border-radius: var(--r-xs); }

/* ---- cards ---- */
.lib-q, .lib-ed, .lib-morning, .lib-welcome { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-1); padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.lib-qtitle { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lib-qic, .lib-wic { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: var(--plat, var(--accent));
  background: color-mix(in srgb, var(--plat, var(--accent)) 14%, transparent); border: 1px solid color-mix(in srgb, var(--plat, var(--accent)) 30%, transparent); }
.lib-qtitle h2, .lib-edh h2, .lib-welcome h2 { font-size: 17px; font-weight: 650; margin: 0; }
.lib-badges { display: flex; gap: 5px; flex-wrap: wrap; }
.lib-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--border); color: var(--text-2); white-space: nowrap; }
.lib-badge.bi { border-color: var(--info-bd); color: var(--info); }
.lib-badge.own { border-color: var(--accent-bd); color: var(--accent); }
.lib-badge.off { border-color: var(--muted-bd); color: var(--muted); }
.lib-desc { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.55; max-width: 980px; }
.lib-qacts { display: flex; gap: 6px; flex-wrap: wrap; }
.lib-script summary, .lib-more summary, .lib-msgs summary { cursor: pointer; font-size: 12px; color: var(--text-2); }
.lib-code { margin: 8px 0 0; padding: 10px 12px; max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: var(--r-s); background: var(--surface-2); color: var(--code-fg, var(--text)); font: 12px/1.5 var(--mono); white-space: pre; }
.lib-runbar { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--r); background: linear-gradient(180deg, var(--surface-2), var(--surface-1)); }
.lib-params { display: flex; flex-wrap: wrap; gap: 10px; }
.lib-param { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); min-width: 150px; }
.lib-param input, .lib-param select { font: inherit; font-size: 13px; }

/* ---- choosing servers ---- */
.lib-pick { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.lib-pickh { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lib-pickc { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.lib-pickc b { font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; margin-right: 2px; }
.lib-pickq { flex: 1 1 220px; max-width: 360px; display: flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid var(--border); border-radius: var(--r-s); background: var(--surface-1); color: var(--text-3); }
.lib-pickq:focus-within { border-color: var(--accent-bd); color: var(--accent); }
.lib-pickq input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 12.5px; }
.lib-quick { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; align-items: center; }
.lib-qk { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-1); color: var(--text-2); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: border-color var(--t), color var(--t), background var(--t); }
.lib-qk i { font-style: normal; font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.lib-qk:hover:not(:disabled) { color: var(--text); border-color: var(--tone-bd, var(--border-2)); background: var(--tone-bg, var(--surface-2)); }
.lib-qk:disabled { opacity: .5; cursor: default; }
.lib-qk.t-serious { color: var(--serious); }
.lib-qk.set { padding: 0 2px 0 0; gap: 0; border-color: var(--warning-bd); }
.lib-qk.set > button { border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 0 6px 0 10px; height: 24px; display: inline-flex; align-items: center; gap: 5px; }
.lib-qk.set > button:first-child { color: var(--text); }
.lib-qkx { width: 20px; height: 20px !important; padding: 0 !important; border-radius: 50% !important; justify-content: center; color: var(--text-3) !important; font-size: 10px !important; }
.lib-qkx:hover { background: var(--surface-3) !important; color: var(--text) !important; }
.lib-qk.add { border-style: dashed; color: var(--text-3); }
.lib-qkin { flex: 0 0 180px; height: 26px; padding: 0 10px; border: 1px solid var(--accent-bd); border-radius: 999px; background: var(--surface-1); color: var(--text); font: inherit; font-size: 12px; outline: 0; box-shadow: 0 0 0 3px var(--accent-bg); }
.lib-pickl { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow: auto; padding: 2px 4px 2px 0; scrollbar-width: thin; }
.lib-pick.single .lib-pickl { max-height: 180px; }
.lib-pickg { display: flex; flex-direction: column; gap: 6px; }
.lib-pickgh { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; padding: 2px 6px 2px 2px; border: 0; border-radius: var(--r-xs); background: transparent; color: var(--text-2); font: inherit; font-size: 11px; cursor: pointer; }
.lib-pickgh b { font-size: 11px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--tone, var(--text-2)); }
.lib-pickgh i { font-style: normal; color: var(--text-3); font-variant-numeric: tabular-nums; }
.lib-pickgh:hover:not(:disabled) { background: var(--surface-2); }
.lib-pickgh:disabled { cursor: default; }
.lib-tri { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--border-2); position: relative; flex: 0 0 auto; }
.lib-tri.some::after { content: ''; position: absolute; left: 2px; right: 2px; top: 5px; height: 2px; border-radius: 2px; background: var(--accent); }
.lib-tri.all { background: var(--accent); border-color: var(--accent); }
.lib-tri.all::after { content: ''; position: absolute; left: 4px; top: 1px; width: 3px; height: 7px; border: solid var(--on-accent, #fff); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.lib-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lib-chip { display: inline-flex; align-items: center; gap: 7px; max-width: 240px; height: 28px; padding: 0 11px 0 9px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-1); color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap; transition: border-color var(--t), background var(--t), color var(--t), box-shadow var(--t); }
.lib-chip:hover { color: var(--text); border-color: var(--border-2); }
.lib-chip.on { color: var(--text); border-color: var(--accent-bd); background: var(--accent-bg); box-shadow: 0 0 0 1px var(--accent-bd) inset; }
.lib-cdot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: var(--tone, var(--muted)); box-shadow: 0 0 0 3px var(--tone-bg, transparent); }
.lib-cn { overflow: hidden; text-overflow: ellipsis; }
.lib-crole { font-size: 9.5px; font-weight: 800; padding: 0 5px; border-radius: 6px; background: var(--accent-bg); color: var(--accent); border: 1px solid var(--accent-bd); }
.lib-runacts, .lib-edbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lib-edbar { align-items: flex-start; }
.lib-edbar > .lib-pick { flex: 1 1 360px; }
.lib-edacts { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.lib-limits { font-size: 11.5px; color: var(--text-3); }
.lib-est { font-size: 12.5px; color: var(--text-2); padding: 6px 10px; border-left: 3px solid var(--ok); background: var(--ok-bg); border-radius: 0 var(--r-xs) var(--r-xs) 0; }
.lib-est.heavy { border-left-color: var(--warning); background: var(--warning-bg); }

/* ---- a run ---- */
.lib-run { display: flex; flex-direction: column; gap: 12px; }
.lib-verdict { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--tone-bd); border-radius: var(--r); background: linear-gradient(110deg, var(--tone-bg), transparent 85%), var(--surface-1); }
.lib-vg { font-size: 20px; font-weight: 800; color: var(--tone); width: 26px; display: inline-flex; justify-content: center; flex: 0 0 auto; }
.lib-vt { flex: 1 1 auto; min-width: 0; }
.lib-vsub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.lib-vnote { margin-top: 5px; font-size: 11.5px; color: var(--text-2); padding: 3px 8px; border-left: 2px solid var(--info); background: var(--info-bg); border-radius: 0 4px 4px 0; }
.lib-seg { display: inline-flex; border: 1px solid var(--border-2); border-radius: var(--r-s); overflow: hidden; flex: 0 0 auto; }
.lib-seg button { border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 12px; font-weight: 600; padding: 5px 11px; cursor: pointer; white-space: nowrap; }
.lib-seg button + button { border-left: 1px solid var(--border-2); }
.lib-seg button.on { background: var(--accent-bg); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.lib-runmap { display: flex; flex-direction: column; gap: 9px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-1); }
.lib-obar { display: flex; height: 8px; border-radius: 5px; overflow: hidden; background: var(--surface-3); gap: 2px; min-width: 60px; }
.lib-obar i { flex: 1 1 0; background: var(--tone); min-width: 3px; }
.lib-obar i.run { background: repeating-linear-gradient(-45deg, var(--info-bg), var(--info-bg) 5px, var(--info-bd) 5px, var(--info-bd) 10px); background-size: 28px 28px; animation: libStripe 900ms linear infinite; }
@keyframes libStripe { to { background-position: 28px 0; } }
.lib-ochips { display: flex; gap: 6px; flex-wrap: wrap; }
.lib-och { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border: 1px solid var(--tone-bd); border-radius: 999px; background: var(--tone-bg); color: var(--text-2); font: inherit; font-size: 11.5px; cursor: pointer; white-space: nowrap; }
.lib-och b { color: var(--text); font-variant-numeric: tabular-nums; }
.lib-ochg { color: var(--tone); font-weight: 800; }
.lib-och:disabled { cursor: default; }
.lib-och.on { box-shadow: 0 0 0 2px var(--tone-bd); color: var(--text); }
.lib-map { display: flex; flex-direction: column; gap: 6px; }
.lib-mapg { display: flex; align-items: flex-start; gap: 10px; }
.lib-mapl { flex: 0 0 64px; display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; color: var(--tone, var(--text-3)); }
.lib-mapl i { font-style: normal; font-weight: 500; color: var(--text-3); }
.lib-tiles { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.lib-tile { width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0; border: 1px solid var(--tone-bd); border-radius: 7px; background: var(--tone-bg); color: var(--tone); font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; transition: transform 140ms ease, opacity var(--t), box-shadow var(--t); }
.lib-tile:hover { transform: translateY(-1px) scale(1.08); box-shadow: 0 4px 12px -6px var(--tone); }
.lib-tile.on { box-shadow: 0 0 0 2px var(--accent); }
.lib-tile.dim { opacity: .22; }
.lib-tile.run { animation: libPulse 1.6s ease-in-out infinite; }
@keyframes libPulse { 50% { opacity: .55; } }
.lib-map.named .lib-tile { width: auto; height: 28px; padding: 0 10px; border-radius: 999px; font-size: 12px; }
.lib-tn { color: var(--text); font-weight: 600; white-space: nowrap; }
.lib-tile i { font-style: normal; font-weight: 500; color: var(--text-3); font-size: 11px; }
.lib-fails { display: flex; flex-direction: column; gap: 5px; padding: 9px 11px; border: 1px solid var(--critical-bd); border-radius: var(--r-s); background: var(--critical-bg); }
.lib-failh { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 650; color: var(--text); }
.lib-failh span { color: var(--critical); }
.lib-fail { display: grid; grid-template-columns: 28px minmax(0, 1.2fr) minmax(0, 1fr); gap: 8px; align-items: baseline; font-size: 12px; }
.lib-failn { font-weight: 800; color: var(--critical); text-align: right; font-variant-numeric: tabular-nums; }
.lib-failt { color: var(--text-2); overflow-wrap: anywhere; }
.lib-failw { display: flex; flex-wrap: wrap; gap: 4px; }
.lib-failw i { font-style: normal; color: var(--text-3); font-size: 11px; }
.lib-failb { border: 1px solid var(--border-2); border-radius: 999px; background: var(--surface-1); color: var(--text); font: inherit; font-size: 11px; padding: 1px 8px; cursor: pointer; }
.lib-failb:hover { border-color: var(--accent-bd); }
.lib-each { display: grid; grid-template-columns: minmax(200px, 250px) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 1100px) { .lib-each { grid-template-columns: 1fr; } }
.lib-slist { position: sticky; top: 8px; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-1); padding: 8px; }
.lib-slistb { display: flex; flex-direction: column; gap: 2px; max-height: 560px; overflow: auto; scrollbar-width: thin; }
.lib-srow { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto auto; gap: 7px; align-items: center; padding: 6px 7px; border: 0; border-radius: var(--r-xs); background: transparent; color: var(--text); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.lib-srow:hover { background: var(--surface-2); }
.lib-srow.on { background: var(--accent-bg); box-shadow: inset 3px 0 0 var(--accent); }
.lib-srg { color: var(--tone); font-weight: 800; font-size: 11px; text-align: center; }
.lib-srn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-sre { font-size: 10px; font-weight: 700; color: var(--text-3); letter-spacing: .04em; }
.lib-srr { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.lib-eachd { min-width: 0; }
.lib-sres { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.lib-sh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.lib-sv { color: var(--tone); font-size: 12.5px; }
.lib-ms { font-size: 11.5px; color: var(--text-3); }
.lib-msgs { font-size: 12px; color: var(--text-2); }
.lib-msgs .mono { font-size: 11.5px; padding: 2px 0; }

/* ---- an answer table, and what its values say ---- */
.lib-set { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.lib-setfoot { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--text-3); }
.lib-read { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; }
.lib-readk { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-right: 2px; }
.lib-readm { color: var(--text-3); }
.lib-pill { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--tone-bd); background: var(--tone-bg); color: var(--text); font-size: 11.5px; font-weight: 650; line-height: 1.5; white-space: nowrap; }
.lib-pill.t-critical, .lib-pill.t-serious, .lib-pill.t-warning { color: var(--tone); }
.lib-pill.t-muted { color: var(--text-3); font-weight: 550; }
.lib-pill.t-ok { font-weight: 550; }
.lib-pill i { font-style: normal; font-weight: 500; color: var(--text-3); font-size: 10.5px; }
.lib-pct { display: inline-flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; }
.lib-pct.t-critical, .lib-pct.t-serious, .lib-pct.t-warning { color: var(--tone); font-weight: 700; }
.lib-pct i { width: 46px; height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; display: inline-block; }
.lib-pct i b { display: block; height: 100%; background: var(--tone); border-radius: 4px; }
.lib-readt.on { color: var(--accent); border-color: var(--accent-bd); background: var(--accent-bg); }
.lib-chart { display: grid; gap: 4px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-s); background: var(--surface-2); }
.lib-bar { display: grid; grid-template-columns: minmax(80px, 240px) minmax(0, 1fr) 90px; gap: 10px; align-items: center; font-size: 12px; }
.lib-bl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.lib-bt { height: 9px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.lib-bt i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.lib-bt i.t-critical, .lib-bt i.t-serious, .lib-bt i.t-warning { background: var(--tone); }
.lib-bt i.t-ok { background: color-mix(in srgb, var(--ok) 72%, transparent); }
.lib-charth { font-size: 10.5px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 3px; }
.lib-bv { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- earlier answers, versions ---- */
.lib-hist { display: flex; flex-direction: column; gap: 3px; }
.lib-hrow { display: grid; grid-template-columns: 18px 110px 90px 90px minmax(0, 1fr); gap: 8px; align-items: center; padding: 5px 8px; border: 1px solid transparent; border-radius: var(--r-xs); background: transparent; color: var(--text); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.lib-hrow:hover { background: var(--surface-2); }
.lib-hrow.on { border-color: var(--accent-bd); background: var(--accent-bg); }
.lib-hrow .lib-dot { grid-row: auto; }
.lib-hist.named .lib-hrow { grid-template-columns: 18px minmax(0, 2.4fr) 100px 90px 90px minmax(0, 1fr); }
.lib-hname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-hby { color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-vers { display: flex; flex-direction: column; gap: 4px; min-width: min(520px, 80vw); }
.lib-vrow { display: grid; grid-template-columns: 50px 110px 120px 120px auto; gap: 10px; align-items: center; font-size: 12.5px; padding: 4px 0; border-bottom: 1px solid var(--hairline); }
.lib-cur { color: var(--text-3); font-size: 11.5px; }

/* ---- the editor ---- */
.lib-edh { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.lib-edsub { font-size: 12px; color: var(--text-3); }
.lib-grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 14px; }
.lib-grid2 label, .lib-scriptl { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.lib-grid2 label.wide { grid-column: 1 / -1; }
.lib-grid2 input, .lib-grid2 select, .lib-prow input, .lib-prow select { font: inherit; font-size: 13px; min-width: 0; }
.lib-grid2 .lib-inl, .lib-prow .lib-inl { flex-direction: row; align-items: center; gap: 6px; }
.lib-inl { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.lib-codeed { width: 100%; min-height: 220px; resize: vertical; padding: 10px 12px; border: 1px solid var(--border-2); border-radius: var(--r-s); background: var(--surface-2); color: var(--code-fg, var(--text)); font: 12.5px/1.55 var(--mono); tab-size: 4; white-space: pre; box-sizing: border-box; }
.lib-check { font-size: 12.5px; padding: 6px 10px; border-radius: var(--r-xs); border: 1px solid var(--tone-bd); background: var(--tone-bg); color: var(--text-2); }
.lib-check.t-ok span, .lib-check.t-critical span { color: var(--tone); }
.lib-more { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r-s); }
.lib-more[open] > * + * { margin-top: 8px; }
.lib-prow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lib-prow input[type=text] { width: 150px; }
.lib-prow input[type=number] { width: 80px; }
.lib-edt { font-size: 12px; color: var(--text-2); }

/* ---- morning checks ---- */
.lib-mgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 18px; }
@media (max-width: 900px) { .lib-mgrid { grid-template-columns: 1fr; } }
.lib-msearch { width: 100%; margin-bottom: 6px; padding: 6px 9px; border: 1px solid var(--border); border-radius: var(--r-s); background: var(--surface-2); color: var(--text); outline: 0; font: inherit; font-size: 13px; box-sizing: border-box; }
.lib-msearch:focus { border-color: var(--accent-bd); }
.lib-mlist { max-height: 330px; overflow: auto; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--border); border-radius: var(--r-s); padding: 6px; scrollbar-width: thin; }
.lib-mitem { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 7px; align-items: center; font-size: 12.5px; padding: 3px 4px; cursor: pointer; border-radius: var(--r-xs); }
.lib-mitem:hover { background: var(--surface-2); }
.lib-mitem span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-mitem i { font-style: normal; color: var(--text-3); font-size: 11px; white-space: nowrap; }
.lib-mrun { margin-top: 12px; }
.lib-board { display: flex; flex-direction: column; gap: 12px; }
.lib-bsum { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lib-qstrip { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-1); }
.lib-qsr { display: grid; grid-template-columns: 24px minmax(160px, 1.3fr) minmax(120px, 1fr) minmax(120px, auto); gap: 10px; align-items: center; font-size: 12.5px; padding: 3px 0; }
.lib-qno { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font-size: 10.5px; font-weight: 800; font-variant-numeric: tabular-nums; margin-right: 6px; }
.lib-qsr .lib-qno { margin-right: 0; }
.lib-qname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-qw { font-size: 11.5px; color: var(--tone); font-weight: 650; white-space: nowrap; text-align: right; }
.lib-btable { display: grid; overflow: auto; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-1); max-height: 640px; scrollbar-width: thin; }
.lib-btable > * { border-bottom: 1px solid var(--hairline); }
.lib-bh { position: sticky; top: 0; z-index: 1; padding: 8px 9px; background: var(--surface-2); font-size: 10.5px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-bh.c { text-align: center; }
.lib-bq, .lib-bs { display: flex; align-items: center; padding: 6px 9px; font-size: 12.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lib-bsg { color: var(--tone); font-weight: 800; font-size: 11px; width: 16px; flex: 0 0 auto; }
.lib-bcell { display: inline-flex; align-items: center; justify-content: center; gap: 5px; margin: 3px 4px; padding: 3px 6px; min-height: 26px; border: 1px solid var(--tone-bd); border-radius: 7px; background: var(--tone-bg); color: var(--tone); font: inherit; font-weight: 800; font-size: 12px; cursor: pointer; transition: transform 120ms ease; }
.lib-bcell:hover:not(:disabled) { transform: scale(1.05); }
.lib-bcell:disabled { cursor: default; }
.lib-bcell.run { animation: libPulse 1.6s ease-in-out infinite; }
.lib-bcell i { font-style: normal; font-weight: 500; color: var(--text-2); font-size: 11px; }
.lib-bg { display: flex; align-items: center; gap: 7px; padding: 7px 9px; border: 0; background: color-mix(in srgb, var(--tone, var(--accent)) 7%, var(--surface-1)); color: var(--text-2); font: inherit; font-size: 11px; cursor: pointer; text-align: left; white-space: nowrap; overflow: hidden; }
.lib-bg b { font-weight: 750; letter-spacing: .05em; text-transform: uppercase; color: var(--tone, var(--text)); overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.lib-bg i { flex: 0 0 auto; font-variant-numeric: tabular-nums; padding: 0 6px; border-radius: 999px; border: 1px solid var(--border); }
.lib-bg i { font-style: normal; color: var(--text-3); }
.lib-bgw { display: grid; place-items: center; background: color-mix(in srgb, var(--tone, var(--accent)) 7%, var(--surface-1)); color: var(--tone); font-weight: 800; font-size: 11px; }

/* ---- the estate at a glance ---- */
.lib-wh { display: flex; align-items: center; gap: 12px; }
.lib-wic { width: 42px; height: 42px; border-radius: 12px; }
.lib-wsub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.lib-welcome p { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.6; max-width: 900px; }
.lib-wcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.lib-wcard { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); min-width: 0; }
.lib-wcard.t-serious { border-color: color-mix(in srgb, var(--serious) 30%, var(--border)); }
.lib-wcard.t-accent { background: linear-gradient(140deg, var(--accent-bg), transparent 80%), var(--surface-2); border-color: var(--accent-bd); }
.lib-wct { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--text-2); margin-bottom: 4px; }
.lib-wct i { font-style: normal; font-size: 11px; padding: 0 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.lib-wcx { font-size: 12.5px; color: var(--text-2); line-height: 1.5; margin-bottom: 8px; }
.lib-wcard .btn { align-self: flex-start; }
.lib-wq { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 7px; align-items: center; padding: 4px 4px; border: 0; border-radius: var(--r-xs); background: transparent; color: var(--text); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.lib-wq:hover { background: var(--surface-3); }
.lib-wq .lib-dot { grid-row: auto; }
.lib-wqn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-wq i { font-style: normal; color: var(--text-3); font-size: 11px; white-space: nowrap; }
