/* Atomurus workspace — product shell for /app
   Tokens inherit the lab console (cream / dark brown / Atomurus green). */

.ws-body {
  --ws-radius-sm: 6px;
  --ws-radius-md: 10px;
  --ws-radius-lg: 16px;
  --ws-space-1: 4px;
  --ws-space-2: 8px;
  --ws-space-3: 12px;
  --ws-space-4: 16px;
  --ws-space-5: 24px;
  --ws-space-6: 32px;
  --ws-dur: 180ms;
  --ws-sidebar: var(--ui-sidebar, 248px);
  --ws-topbar: var(--ui-topbar, 64px);
  --ws-bottom: 64px;
  --ws-success: var(--lc-green, #1E6A50);
  --ws-warning: var(--lc-amber, #B96B0C);
  --ws-danger: #9A4338;
  --ws-info: var(--lc-ink-2, #58544A);
  --ws-premium: var(--lc-green, #1E6A50);
  --ws-locked: var(--lc-ink-3, #8E8978);
  font-family: var(--lc-sans, 'Inter Tight', system-ui, sans-serif);
  color: var(--lc-ink, #14120E);
  background: var(--lc-bg, #F2EFE7);
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
}
.ws-body [hidden] { display: none !important; }

.ws-skip {
  position: absolute;
  left: 12px;
  top: 8px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--lc-paper, #F8F5EC);
  border: 1px solid var(--lc-rule, #D8D2BF);
  border-radius: var(--ws-radius-sm);
  color: inherit;
  text-decoration: none;
  transform: translateY(-160%);
}
.ws-skip:focus {
  transform: none;
}

[data-theme="dark"] .ws-body {
  --ws-danger: #E08A82;
}

.ws-body a { color: inherit; }
.ws-body :focus { outline: none; }
.ws-body :focus-visible {
  outline: 2px solid var(--lc-green, #1E6A50);
  outline-offset: 2px;
}

.ws-shell {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--ws-sidebar) minmax(0, 1fr);
  grid-template-rows: var(--ws-topbar) minmax(0, 1fr);
  grid-template-areas:
    "topbar topbar"
    "sidebar main";
}

.ws-topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  gap: var(--ws-space-3);
  padding: 0 18px;
  border-bottom: 1px solid var(--lc-rule, #D8D2BF);
  background: var(--lc-paper, #F8F5EC);
  position: sticky;
  top: 0;
  z-index: 30;
}

.ws-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
  color: inherit;
}
.ws-brand-name {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 22px;
  line-height: 1;
}
.ws-brand-tag {
  font-family: var(--lc-mono, ui-monospace, monospace);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--lc-ink-3, #8E8978);
}

.ws-search {
  flex: 1;
  min-width: 0;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--lc-rule, #D8D2BF);
  border-radius: var(--ws-radius-md);
  background: var(--lc-bg, #F2EFE7);
}
.ws-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
}
.ws-search button {
  border: 0;
  background: transparent;
  color: var(--lc-ink-2, #58544A);
  cursor: pointer;
  min-width: 32px;
  min-height: 32px;
}

.ws-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.ws-icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--lc-rule, #D8D2BF);
  border-radius: var(--ws-radius-md);
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--ws-dur) ease, background var(--ws-dur) ease;
}
.ws-icon-btn:hover { border-color: color-mix(in oklab, var(--lc-green) 40%, var(--lc-rule)); }
.ws-menu-btn { display: none; }

.ws-userchip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  min-height: 40px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--lc-rule, #D8D2BF);
  border-radius: 999px;
  max-width: 220px;
}
.ws-userchip-name {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ws-sidebar {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--lc-rule, #D8D2BF);
  background: color-mix(in oklab, var(--lc-paper, #F8F5EC) 88%, var(--lc-bg, #F2EFE7));
  padding: var(--space-4, 16px) var(--space-3, 12px) 18px;
  min-height: 0;
  overflow: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--lc-rule) transparent;
}
.ws-userchip-icon { flex: 0 0 16px; }
.ws-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.ws-nav-block { display: flex; flex-direction: column; gap: 4px; }
.ws-nav-block + .ws-nav-block { margin-top: 14px; }
.ws-nav-group {
  margin: 0 0 4px;
  padding: 0 12px;
  font-family: var(--lc-mono, ui-monospace, monospace);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--lc-ink-3, #8E8978);
  font-weight: 550;
}
.ws-nav-foot {
  margin-top: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--lc-rule-soft, #E4DECC);
}
.ws-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--control-height, 44px);
  padding: 0 12px;
  border-radius: var(--ws-radius-md);
  text-decoration: none;
  color: var(--lc-ink-2, #58544A);
  font-size: 14px;
  font-weight: 550;
  border-left: 3px solid transparent;
  transition: background var(--ws-dur) ease, color var(--ws-dur) ease, border-color var(--ws-dur) ease;
}
.ws-nav-item svg { flex: 0 0 18px; opacity: .85; }
.ws-nav-item:hover { background: color-mix(in oklab, var(--lc-green) 8%, transparent); color: var(--lc-ink); }
.ws-nav-item.is-locked { cursor: pointer; }
.ws-nav-item.is-locked .ws-nav-meta { opacity: .9; }
.ws-nav-item.is-active {
  color: var(--lc-green, #1E6A50);
  background: color-mix(in oklab, var(--lc-green) 10%, transparent);
  border-left-color: var(--lc-green, #1E6A50);
}
.ws-nav-site {
  padding-bottom: 8px;
}
.ws-nav-item.is-upgrade {
  margin-top: 8px;
  background: color-mix(in oklab, var(--lc-green) 12%, transparent);
  color: var(--lc-green, #1E6A50);
  font-weight: 650;
}
.ws-nav-label { flex: 1; min-width: 0; }
.ws-nav-meta {
  font-family: var(--lc-mono, ui-monospace, monospace);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--lc-ink-3);
}

.ws-main {
  grid-area: main;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 28px 32px 88px;
}
.ws-content { max-width: 1180px; width: 100%; }

/* One line where it fits: sections, a divider, then the tools for the section
   the user is in. Two stacked rows of chips was most of the chrome. */
.ws-study-nav {
  max-width: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 0 0 16px;
  padding: 0 0 8px;
  overflow: visible;
  border-bottom: 1px solid var(--lc-rule-soft);
}
.ws-context-nav,
.ws-local-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ws-local-nav {
  position: relative;
  padding-left: 11px;
}
/* The divider only makes sense when both groups share the line. */
.ws-local-nav::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 18px;
  margin-top: -9px;
  background: var(--lc-rule, #D8D2BF);
}
@media (max-width: 860px) {
  .ws-study-nav { gap: 2px 8px; }
  .ws-local-nav { padding-left: 0; width: 100%; }
  .ws-local-nav::before { content: none; }
}
.ws-context-nav::-webkit-scrollbar,
.ws-local-nav::-webkit-scrollbar { display: none; }
.ws-crumb {
  font-size: 12px;
  color: var(--lc-ink-3);
  margin: 0 0 12px;
}
.ws-viz-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.ws-viz-links a {
  color: var(--lc-ink);
  font-size: 14px;
  font-weight: 550;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--lc-green) 45%, transparent);
}
.ws-viz-links a:hover {
  color: var(--lc-green);
}
.ws-account-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 0 0 20px;
}
.ws-account-tab {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 13px;
  font-weight: 550;
  color: var(--lc-ink-2);
}
.ws-account-tab.is-active {
  color: var(--lc-green);
  border-color: color-mix(in oklab, var(--lc-green) 38%, var(--lc-rule));
  background: color-mix(in oklab, var(--lc-green) 11%, transparent);
}
.ws-account-tab:focus-visible {
  outline: 2px solid var(--lc-green);
  outline-offset: 2px;
}
.ws-account-dests {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}
.ws-account-dests a {
  display: flex;
  min-height: 44px;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--lc-rule);
  border-radius: var(--ws-radius-md);
  text-decoration: none;
}
.ws-overview-block { margin: 0 0 28px; }
.ws-study-hub {
  display: flex;
  flex-direction: column;
}
.ws-study-hub > .ws-kicker,
.ws-study-hub > .ws-title,
.ws-study-hub > .ws-lede,
.ws-study-hub > p { order: 0; }
.ws-hub-continue { order: 1; }
.ws-hub-review { order: 2; }
.ws-hub-practice { order: 3; }
.ws-hub-paths { order: 4; }
.ws-hub-sets { order: 5; }
.ws-hub-saved { order: 6; }
.ws-hub-notes { order: 7; }
.ws-hub-weak { order: 8; }
.ws-hub-insights { order: 9; }
.ws-hub-visualize { order: 10; }
.ws-hub-sessions { order: 11; }
.ws-hub-links { order: 12; }
.ws-study-hub[data-study-hub="guest"] .ws-hub-visualize { order: 1; }
.ws-study-hub[data-study-hub="guest"] .ws-hub-openlab { order: 2; }
.ws-study-hub[data-study-hub="guest"] .ws-hub-unlock { order: 3; }
.ws-study-hub[data-study-hub="guest"] .ws-hub-practice { order: 4; }
.ws-study-hub[data-study-hub="guest"] .ws-hub-paths { order: 5; }
.ws-hub-caughtup {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
  background: transparent;
}
.ws-hub-caughtup-text {
  margin: 0;
  font-size: 15px;
  color: var(--lc-ink-2);
}
.ws-hub-estimate {
  margin: 0 0 16px;
  font-family: var(--lc-mono, ui-monospace, monospace);
  font-size: 13px;
  color: var(--lc-ink-2);
}
.ws-hub-path-meta {
  font-family: var(--lc-mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--lc-ink-3);
}
.ws-hub-path.is-planned,
.ws-study-item.is-planned { opacity: .72; }
.ws-hub-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  margin: 0 0 16px;
}
.ws-hub-metric-value {
  font-family: var(--lc-mono, ui-monospace, monospace);
  font-size: 20px;
  letter-spacing: .02em;
}
.ws-hub-metric-label {
  font-size: 13px;
  color: var(--lc-ink-2);
}
.ws-hub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 8px 0 12px;
  padding-top: 8px;
}
.ws-hub-links a {
  color: var(--lc-ink);
  font-size: 14px;
  font-weight: 550;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--lc-green) 45%, transparent);
}
.ws-hub-planned {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--lc-ink-3);
}
.ws-pro-pillars {
  display: grid;
  gap: 12px;
}
.ws-study-nav-item {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: var(--ws-radius-md);
  color: var(--lc-ink-2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  transition: color var(--ws-dur) ease, background var(--ws-dur) ease, border-color var(--ws-dur) ease;
}
.ws-study-nav-item svg { flex: 0 0 15px; opacity: .8; }
/* Inside a section the icons repeat and carry nothing, so the tools go
   label-only and the row halves in width. */
.ws-local-nav .ws-study-nav-item svg { display: none; }
.ws-local-nav .ws-study-nav-item { font-size: 12.5px; padding: 0 8px; }
.ws-study-nav-item:hover {
  color: var(--lc-ink);
  background: color-mix(in oklab, var(--lc-green) 8%, transparent);
}
.ws-study-nav-item.is-active {
  color: var(--lc-green);
  border-color: color-mix(in oklab, var(--lc-green) 38%, var(--lc-rule));
  background: color-mix(in oklab, var(--lc-green) 11%, transparent);
}
.ws-study-nav-item.is-locked { cursor: pointer; }
.ws-study-nav-meta {
  font-family: var(--lc-mono, ui-monospace, monospace);
  font-size: 8px;
  letter-spacing: .1em;
  color: var(--lc-green);
}

.ws-bottom { display: none; }

.ws-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-family: var(--lc-mono, ui-monospace, monospace);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  border: 1px solid var(--lc-rule);
  color: var(--lc-ink-3);
  white-space: nowrap;
}
.ws-badge-pro,
.ws-badge-trial,
.ws-badge-admin,
.ws-badge-free {
  color: var(--lc-green, #1E6A50);
  border-color: color-mix(in oklab, var(--lc-green) 40%, var(--lc-rule));
  background: color-mix(in oklab, var(--lc-green) 8%, transparent);
}
.ws-badge-free { color: var(--lc-ink-3); }
.lc-plan-badge {
  display: inline-flex;
  margin-left: 6px;
  vertical-align: middle;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  font-family: var(--lc-mono, ui-monospace, monospace);
  font-size: 9px;
  letter-spacing: .12em;
  border: 1px solid color-mix(in oklab, var(--lc-green) 40%, var(--lc-rule));
  color: var(--lc-green);
}

.ws-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 22px;
}
.ws-kicker {
  font-family: var(--lc-mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--lc-ink-3);
  margin: 0 0 8px;
}
.ws-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 400;
  line-height: 1.08;
  margin: 0 0 8px;
}
.ws-title em { font-style: italic; color: var(--lc-green, #1E6A50); }
.ws-lede {
  margin: 0;
  max-width: 54ch;
  color: var(--lc-ink-2);
  font-size: 16px;
  line-height: 1.5;
}

.ws-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  padding: 22px 24px;
  border: 1px solid var(--lc-rule);
  border-radius: var(--ws-radius-lg);
  background: var(--lc-paper);
  margin-bottom: 22px;
}
.ws-hero:has(.ws-hero-aside) {
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, .8fr);
}
.ws-hero.is-ready {
  border-color: color-mix(in oklab, var(--lc-green) 35%, var(--lc-rule));
}
.ws-hero-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(26px, 3vw, 34px);
  margin: 0 0 8px;
}
.ws-hero-copy { margin: 0 0 16px; color: var(--lc-ink-2); }
.ws-hero-aside {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
  padding-left: 8px;
  border-left: 1px solid var(--lc-rule-soft);
}

.ws-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 28px;
}
.ws-metric {
  padding: 16px 16px 14px;
  border: 1px solid var(--lc-rule);
  border-radius: var(--ws-radius-md);
  background: var(--lc-paper);
}
.ws-metric-value {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 32px;
  line-height: 1;
  margin-bottom: 6px;
}
.ws-metric-label { font-size: 13px; color: var(--lc-ink-2); }
.ws-metric-sub {
  margin-top: 8px;
  font-size: 12px;
  color: var(--lc-ink-3);
}

.ws-grid { display: grid; gap: 12px; }
.ws-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ws-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.ws-card,
.ws-study-item,
.ws-set-card,
.ws-flashcard,
.ws-empty,
.ws-locked,
.ws-account-card {
  border: 1px solid var(--lc-rule);
  border-radius: var(--ws-radius-md);
  background: var(--lc-paper);
}

.ws-study-item,
.ws-set-card,
.ws-account-card { padding: 16px; }

.ws-study-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}
.ws-item-symbol {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: var(--ws-radius-sm);
  border: 1px solid var(--lc-rule);
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 20px;
  color: var(--lc-green);
}
.ws-item-title { font-weight: 650; font-size: 16px; margin: 0 0 4px; }
.ws-item-meta, .ws-muted { color: var(--lc-ink-3); font-size: 13px; }
.ws-item-note {
  margin-top: 8px;
  color: var(--lc-ink-2);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ws-item-actions, .ws-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
#ws-weak-list .ws-study-item,
.ws-weak-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
#ws-weak-list .ws-btn,
.ws-weak-item .ws-btn {
  width: auto;
  justify-self: end;
  white-space: nowrap;
  flex: 0 0 auto;
}

.ws-set-card { display: grid; gap: 10px; }
.ws-set-card h3 { margin: 0; font-size: 18px; font-weight: 650; }
.ws-set-stats { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--lc-ink-2); font-size: 13px; }

.ws-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.ws-search-field,
.ws-select,
.ws-input,
.ws-textarea {
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--lc-rule);
  border-radius: var(--ws-radius-md);
  background: var(--lc-bg);
  color: inherit;
  font: inherit;
}
select.ws-input {
  appearance: none;
  padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--lc-ink-3) 50%), linear-gradient(135deg, var(--lc-ink-3) 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% - 3px), calc(100% - 10px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.ws-textarea {
  height: auto;
  min-height: 96px;
  padding: 12px;
  resize: vertical;
}
.ws-search-field { min-width: min(100%, 240px); flex: 1; }

.ws-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-chip {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--lc-rule);
  background: transparent;
  color: var(--lc-ink-2);
  font: inherit;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  appearance: none;
}
.ws-chip.is-on {
  color: var(--lc-green);
  border-color: color-mix(in oklab, var(--lc-green) 40%, var(--lc-rule));
  background: color-mix(in oklab, var(--lc-green) 10%, transparent);
}

.ws-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--ws-radius-md);
  border: 1px solid var(--lc-rule);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--ws-dur) ease, border-color var(--ws-dur) ease, transform var(--ws-dur) ease;
}
.ws-btn:hover { border-color: color-mix(in oklab, var(--lc-green) 40%, var(--lc-rule)); }
.ws-btn:active { transform: translateY(1px); }
.ws-btn[disabled] { opacity: .6; cursor: wait; transform: none; }
.ws-btn-primary {
  background: var(--lc-green);
  border-color: var(--lc-green);
  color: #F8F5EC;
}
[data-theme="dark"] .ws-btn-primary { color: #0E0D0C; }
.ws-btn-secondary { background: color-mix(in oklab, var(--lc-green) 10%, transparent); }
.ws-btn-ghost { background: transparent; }
.ws-btn-danger {
  color: var(--ws-danger);
  border-color: color-mix(in oklab, var(--ws-danger) 40%, var(--lc-rule));
}
.ws-btn-sm { min-height: 36px; padding: 0 10px; font-size: 13px; }
.ws-btn-icon { width: 44px; padding: 0; }

.ws-progress {
  height: 10px;
  border-radius: 999px;
  background: var(--lc-surface, #ECE7DA);
  overflow: hidden;
}
.ws-progress > span {
  display: block;
  height: 100%;
  background: var(--lc-green);
  border-radius: inherit;
}
.ws-progress.is-empty > span {
  width: 0 !important;
  background: transparent;
}
.ws-progress-label { font-size: 13px; color: var(--lc-ink-2); margin-bottom: 6px; }

.ws-empty,
.ws-locked { padding: 28px 22px; text-align: center; }
.ws-empty-illu,
.ws-locked-illu {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--lc-rule);
  border-radius: 50%;
  color: var(--lc-green);
}
.ws-empty h3,
.ws-locked h3 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 26px;
  font-weight: 400;
  margin: 0 0 8px;
}
.ws-empty p,
.ws-locked p {
  margin: 0 auto 16px;
  max-width: 46ch;
  color: var(--lc-ink-2);
}
.ws-locked {
  border-style: dashed;
  background: color-mix(in oklab, var(--lc-paper) 80%, transparent);
}

.ws-flashcard { padding: 16px; display: grid; gap: 10px; }
.ws-flash-kicker {
  font-family: var(--lc-mono, ui-monospace, monospace);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--lc-ink-3);
}
.ws-flash-front, .ws-flash-back {
  font-size: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ws-flash-back { color: var(--lc-ink-2); }

.ws-tabs { display: flex; gap: 6px; margin: 0 0 16px; }
.ws-tab {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--lc-ink-2);
  font: inherit;
  cursor: pointer;
}
.ws-tab.is-on { color: var(--lc-green); border-bottom-color: var(--lc-green); }

.ws-review {
  max-width: 640px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
  text-align: center;
}
.ws-review-progress { font-family: var(--lc-mono, ui-monospace, monospace); font-size: 12px; color: var(--lc-ink-3); }
.ws-review-face {
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 28px 22px;
  border: 1px solid var(--lc-rule);
  border-radius: var(--ws-radius-lg);
  background: var(--lc-paper);
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.25;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ws-review-ratings {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.ws-review-toolbar {
  display: flex;
  justify-content: flex-start;
}
@media (max-width: 860px) {
  .ws-review-ratings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.ws-review-ratings button,
.ws-review-reveal { min-height: 56px; font-weight: 650; }
.ws-grade-again { color: #8A4A32; border-color: color-mix(in oklab, #C47A5A 40%, var(--lc-rule)); }
.ws-grade-hard { color: var(--lc-ink-2); }
.ws-grade-good { color: var(--lc-green); border-color: color-mix(in oklab, var(--lc-green) 40%, var(--lc-rule)); }
.ws-grade-easy {
  background: var(--lc-green);
  border-color: var(--lc-green);
  color: #F8F5EC;
}
[data-theme="dark"] .ws-grade-easy { color: #0E0D0C; }
.ws-review-hint {
  font-family: var(--lc-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--lc-ink-3);
}
@media (pointer: coarse), (max-width: 860px) {
  .ws-review-hint { display: none; }
}

.ws-complete { text-align: center; padding: 32px 16px; }
.ws-complete-check {
  width: 56px; height: 56px; margin: 0 auto 12px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in oklab, var(--lc-green) 14%, transparent);
  color: var(--lc-green);
}

.ws-skeleton { display: grid; gap: 12px; }
.ws-skel {
  height: 18px;
  border-radius: 6px;
  background: color-mix(in oklab, var(--lc-rule) 70%, var(--lc-paper));
}
.ws-skel-lg { height: 88px; }
@media (prefers-reduced-motion: no-preference) {
  .ws-skel { animation: ws-pulse 1.2s ease-in-out infinite; }
}
@keyframes ws-pulse {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .ws-body * { transition: none !important; animation: none !important; }
}

.ws-toast-host {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: max(16px, env(safe-area-inset-bottom, 0px));
  z-index: 80;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
}
.ws-toast {
  padding: 12px 14px;
  border-radius: var(--ws-radius-md);
  border: 1px solid var(--lc-rule);
  background: var(--lc-paper);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(20,18,14,.12));
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.ws-toast-action {
  border: 0;
  background: transparent;
  color: var(--lc-green, #1E6A50);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}
.ws-toast-success { border-color: color-mix(in oklab, var(--lc-green) 40%, var(--lc-rule)); }
.ws-toast-danger { border-color: color-mix(in oklab, var(--ws-danger) 40%, var(--lc-rule)); }
.ws-toast.is-out { opacity: 0; }

.ws-dialog-host.is-open {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: end center;
}
.ws-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in oklab, #14120E 36%, transparent);
}
.ws-dialog {
  position: relative;
  width: min(520px, 100%);
  max-height: min(88vh, 720px);
  overflow: auto;
  background: var(--lc-paper);
  border: 1px solid var(--lc-rule);
  border-radius: var(--ws-radius-lg) var(--ws-radius-lg) 0 0;
  padding: 22px;
  display: grid;
  gap: 12px;
}
@media (min-width: 720px) {
  .ws-dialog-host.is-open { place-items: center; }
  .ws-dialog { border-radius: var(--ws-radius-lg); }
}
.ws-dialog-title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 26px;
  margin: 0;
}
.ws-dialog-body { color: var(--lc-ink-2); font-size: 15px; line-height: 1.5; }
.ws-dialog-body label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--lc-ink);
  margin: 10px 0 6px;
}
.ws-dialog-body .ws-input,
.ws-dialog-body .ws-textarea { width: 100%; }
.ws-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
body.ws-dialog-open { overflow: hidden; }

.ws-dropdown { position: relative; }
.ws-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 180px;
  display: none;
  flex-direction: column;
  padding: 6px;
  border: 1px solid var(--lc-rule);
  border-radius: var(--ws-radius-md);
  background: var(--lc-paper);
  z-index: 12;
  box-shadow: var(--shadow-md, 0 8px 24px rgba(20,18,14,.12));
}
.ws-dropdown.is-open .ws-menu { display: flex; }
.ws-menu button, .ws-menu a {
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  text-decoration: none;
  border-radius: 6px;
  cursor: pointer;
}
.ws-menu button:hover, .ws-menu a:hover { background: color-mix(in oklab, var(--lc-green) 8%, transparent); }

.ws-pager { display: flex; gap: 8px; align-items: center; margin-top: 16px; }
.ws-charcount {
  font-family: var(--lc-mono, ui-monospace, monospace);
  font-size: 11px;
  color: var(--lc-ink-3);
  text-align: right;
  visibility: hidden;
}
.ws-charcount.is-near { visibility: visible; color: var(--ws-warning); }

.ws-error {
  padding: 16px;
  border: 1px solid color-mix(in oklab, var(--ws-danger) 35%, var(--lc-rule));
  border-radius: var(--ws-radius-md);
  background: color-mix(in oklab, var(--ws-danger) 8%, var(--lc-paper));
}
.ws-bootstrap {
  padding: 18px;
  border: 1px solid var(--lc-rule);
  border-radius: var(--ws-radius-md);
  color: var(--lc-ink-2);
}

html.auth-pending .ws-private,
html.auth-error .ws-private { visibility: hidden; }
html.auth-pending #app-loading { display: block; }
html.auth-ready .ws-private { visibility: visible; }
html.auth-pending .ws-auth-only,
html.auth-error .ws-auth-only { visibility: hidden; }
#app-error { display: none; }
#app-error.show { display: block; }

.ws-drawer-backdrop { display: none; }
.ws-plan-row { display: flex; justify-content: space-between; gap: 12px; margin: 8px 0; }
.ws-h2 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 26px;
  font-weight: 400;
  margin: 28px 0 12px;
}
.ws-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.ws-dest-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 8px 0 28px;
}
.ws-dest-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--lc-rule);
  border-radius: var(--ws-radius-md);
  background: var(--lc-paper);
}
.ws-dest-card .ws-h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-family: var(--lc-sans);
}
.ws-dest-card .ws-lede {
  margin: 0 0 12px;
  flex: 1 1 auto;
}
.ws-dest-card .ws-btn {
  margin-top: auto;
  white-space: nowrap;
}

@media (max-width: 1024px) {
  .ws-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws-hero { grid-template-columns: 1fr; }
  .ws-hero-aside { border-left: 0; padding-left: 0; border-top: 1px solid var(--lc-rule-soft); padding-top: 12px; }
  .ws-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws-dest-grid { grid-template-columns: 1fr; }
  .ws-dest-card {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
  }
  .ws-dest-card .ws-h2 { flex: 1 1 auto; margin: 0; }
  .ws-dest-card .ws-lede { flex: 1 1 100%; margin: 0; order: 3; }
  .ws-dest-card .ws-btn { margin-top: 0; margin-left: auto; }
}

@media (max-width: 860px) {
  .ws-shell {
    grid-template-columns: 1fr;
    grid-template-areas: "topbar" "main";
  }
  .ws-menu-btn { display: inline-flex; }
  .ws-search { display: none; }
  .ws-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(84vw, 300px);
    z-index: 40;
    transform: translateX(-105%);
    transition: transform var(--ws-dur) ease;
    box-shadow: var(--shadow-lg, 0 18px 48px rgba(20,18,14,.16));
  }
  .ws-shell.is-nav-open .ws-sidebar { transform: none; }
  .ws-drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: color-mix(in oklab, #14120E 40%, transparent);
    z-index: 35;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--ws-dur) ease;
  }
  .ws-shell.is-nav-open .ws-drawer-backdrop { opacity: 1; pointer-events: auto; }
  .ws-main { padding: 16px 16px 96px; }
  .ws-study-nav {
    margin: 0 -16px 20px;
    padding: 0 16px 10px;
    scroll-padding-inline: 16px;
  }
  .ws-toast-host {
    bottom: calc(var(--ws-bottom) + 12px + env(safe-area-inset-bottom, 0px));
  }
  .ws-bottom {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed;
    left: 0; right: 0; bottom: 0;
    min-height: calc(var(--ws-bottom) + env(safe-area-inset-bottom, 0px));
    height: calc(var(--ws-bottom) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--lc-paper);
    border-top: 1px solid var(--lc-rule);
    z-index: 25;
  }
  .ws-bottom a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    font-size: 10px;
    color: var(--lc-ink-3);
    min-height: 56px;
    padding: 4px 2px 0;
    text-align: center;
    line-height: 1.15;
  }
  .ws-bottom a.is-active { color: var(--lc-green); }
  .ws-btn-sm { min-height: 44px; }
  .ws-study-item { grid-template-columns: auto minmax(0, 1fr); }
  .ws-item-actions { grid-column: 1 / -1; justify-content: flex-start; }
  #ws-weak-list .ws-study-item,
  .ws-weak-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  #ws-weak-list .ws-item-actions,
  .ws-weak-item .ws-item-actions {
    grid-column: auto;
    justify-content: flex-end;
  }
  .ws-grid-2, .ws-grid-3, .ws-dest-grid { grid-template-columns: 1fr; }
  .ws-review-ratings { grid-template-columns: 1fr 1fr; }
  .ws-userchip {
    width: 40px;
    padding: 0;
    justify-content: center;
  }
  .ws-userchip-name { display: none; }
}

@media (max-width: 390px) {
  .ws-metrics { grid-template-columns: 1fr 1fr; }
  .ws-title { font-size: 28px; }
}

.price-compare {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 24px;
}
.price-compare th, .price-compare td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--lc-rule);
  font-size: 14px;
}
.price-compare th:not(:first-child),
.price-compare td:not(:first-child) { text-align: center; }
.price-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0 8px;
}
.price-step {
  padding: 16px;
  border: 1px solid var(--lc-rule);
  border-radius: 10px;
  background: var(--lc-paper);
}
.price-step-num {
  font-family: var(--lc-mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--lc-green);
  margin-bottom: 8px;
}
.price-save {
  display: inline-flex;
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--lc-green) 35%, var(--lc-rule));
  color: var(--lc-green);
  font-family: var(--lc-mono, ui-monospace, monospace);
  font-size: 11px;
}
.price-current {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid color-mix(in oklab, var(--lc-green) 35%, var(--lc-rule));
  background: color-mix(in oklab, var(--lc-green) 8%, var(--lc-paper));
}
@media (max-width: 820px) {
  .price-steps { grid-template-columns: 1fr; }
  .price-compare { display: block; overflow-x: auto; }
}

.auth-pw-reqs {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--lc-ink-3);
}
.auth-pw-reqs li.is-ok { color: var(--lc-green); }
#atomurus-study-save .study-save-heart { margin-right: 6px; }
#atomurus-study-save .study-pro-badge {
  margin-left: 6px;
  font-family: var(--lc-mono, ui-monospace, monospace);
  font-size: 9px;
  letter-spacing: .12em;
  color: var(--lc-green);
}

.ws-lab-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 28px;
}
.ws-public-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 28px;
}
.ws-lab-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 144px;
  padding: 18px 16px 16px;
  border: 1px solid var(--lc-rule, #D8D2BF);
  border-radius: var(--ws-radius-md);
  background: var(--lc-paper, #F8F5EC);
  text-decoration: none;
}
.ws-card-arrow {
  color: var(--lc-green);
  font-size: 18px;
  line-height: 1;
  transition: transform var(--ws-dur) ease;
}
.ws-lab-card:hover .ws-card-arrow { transform: translateX(3px); }
@media (max-width: 860px) {
  .ws-public-grid { grid-template-columns: 1fr; }
}
.ws-lab-card-title {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 26px;
  font-weight: 400;
  margin: 0;
}
.ws-lab-card-copy { margin: 0; color: var(--lc-ink-2); font-size: 14px; flex: 1; }
.ws-lab-badge {
  font-family: var(--lc-mono, ui-monospace, Menlo, monospace);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--lc-green);
}
.ws-lab-overview {
  margin: 16px 0 28px;
  padding: 14px 16px;
  border: 1px solid var(--lc-rule);
  border-radius: var(--ws-radius-md);
  max-width: 28rem;
}
.ws-lab-overview .ws-h2 { margin-top: 0; font-size: 18px; font-family: var(--lc-sans); }
.ws-insight-cta { margin: 0; }
.ws-insights-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin: 0 0 20px;
}
.ws-insight-set { min-width: min(100%, 14rem); }
.ws-insight-set .ws-input { width: 100%; }
.ws-lab-tools, .ws-lab-actions, .ws-lab-picks, .ws-lab-picker, .ws-lab-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
}
.ws-lab-field { display: grid; gap: 4px; font-size: 13px; min-width: 7rem; }
.ws-lab-field span { color: var(--lc-ink-3); }
.ws-lab-scenario {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--lc-rule);
  border-radius: 10px;
  margin-bottom: 10px;
}
.ws-lab-results, .ws-lab-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ws-lab-result, .ws-lab-mol {
  border: 1px solid var(--lc-rule);
  border-radius: 10px;
  padding: 12px;
  background: var(--lc-paper);
}
.ws-lab-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
.ws-lab-dl dt { color: var(--lc-ink-3); font-family: var(--lc-mono, ui-monospace, monospace); font-size: 11px; }
.ws-lab-dl dd { margin: 0; }
.ws-lab-dl dd.is-highlight { color: var(--lc-green); font-weight: 600; }
.ws-lab-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ws-lab-table th, .ws-lab-table td { border-bottom: 1px solid var(--lc-rule); padding: 8px; text-align: left; vertical-align: top; }
.ws-lab-table th { font-weight: 500; }
.ws-lab-stack { display: none; }
.ws-lab-bar-row { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) 4.5rem; gap: 8px; align-items: center; margin: 6px 0; }
.ws-lab-bar-track { height: 8px; border-radius: 99px; background: color-mix(in oklab, var(--lc-rule) 70%, transparent); }
.ws-lab-bar-fill { height: 8px; border-radius: 99px; background: var(--lc-green); }
.ws-lab-bar-lab, .ws-lab-bar-val { font-family: var(--lc-mono, ui-monospace, monospace); font-size: 12px; }
.ws-lab-frame { width: 100%; height: 240px; border: 0; border-radius: 8px; background: #111; }
.ws-lab-bohr { color: var(--lc-green); }
.ws-lab-z { font-family: "Instrument Serif", Georgia, serif; font-size: 40px; margin: 0; }
.ws-lab-check { display: inline-flex; gap: 6px; align-items: center; margin: 4px 8px 4px 0; font-size: 13px; }
.ws-lab-chip { border: 1px solid var(--lc-green); background: transparent; color: var(--lc-green); border-radius: 99px; padding: 4px 10px; cursor: pointer; }
.ws-lab-session-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ws-lab-session-list li.ws-session-card,
.ws-lab-session-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.ws-lab-session-list a { text-decoration: none; }
.ws-lab-props { border: 1px solid var(--lc-rule); border-radius: 10px; padding: 10px 12px; margin: 12px 0; }
[data-aria-pressed="true"], .ws-lab-tools button[aria-pressed="true"] {
  border-color: var(--lc-green);
  color: var(--lc-green);
}

@media (max-width: 820px) {
  .ws-lab-grid, .ws-lab-results, .ws-lab-split { grid-template-columns: 1fr; }
  .ws-lab-table { display: none; }
  .ws-lab-stack { display: grid; gap: 10px; }
}
.ws-lab-card.is-flagship {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-height: 200px;
  margin: 0 0 14px;
  padding: 22px 18px 18px;
  border: 1px solid color-mix(in oklab, var(--lc-green, #1E6A50) 40%, var(--lc-rule, #D8D2BF));
  border-radius: var(--ws-radius-md);
  background: var(--lc-paper, #F8F5EC);
  text-decoration: none;
}
.ws-solver-eq-field { display: grid; gap: 6px; margin: 16px 0 10px; }
.ws-solver-eq-input {
  min-height: 5.5rem;
  width: 100%;
  max-width: 42rem;
  font-size: 16px;
  line-height: 1.45;
  resize: vertical;
}
.ws-eq {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4em 0.55em;
  margin: 18px 0 8px;
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(22px, 3.2vw, 34px);
  line-height: 1.25;
  color: var(--lc-ink);
}
.ws-eq-term { white-space: nowrap; }
.ws-eq-plus, .ws-eq-arrow { color: var(--lc-ink-3); }
.ws-solver-error {
  color: #8a2a22;
  font-size: 14px;
  margin: 0 0 12px;
}
[data-theme="dark"] .ws-solver-error { color: #f0b4ae; }
.ws-solver-headline {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: clamp(24px, 3vw, 32px);
  margin: 8px 0 12px;
}
.ws-solver-analysis {
  margin: 12px 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--lc-rule, #D8D2BF);
  border-radius: 10px;
  max-width: 42rem;
}
.ws-solver-analysis .ws-kicker { margin: 0 0 4px; }
.ws-solver-analysis .ws-solver-headline { font-size: 22px; margin: 0 0 6px; }
.ws-solver-analysis .ws-lede { margin: 0; }
.ws-solver-result { margin: 18px 0; }
.ws-solver-steps {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  gap: 8px;
}
.ws-solver-step {
  display: grid;
  grid-template-columns: 2.2rem minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--lc-rule);
  border-radius: 10px;
  background: var(--lc-paper);
}
.ws-solver-step-n {
  font-family: var(--lc-mono, ui-monospace, monospace);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--lc-ink-3);
  padding-top: 2px;
}
.ws-solver-step-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--lc-sans);
}
.ws-solver-step-body {
  margin: 0;
  font-size: 13px;
  color: var(--lc-ink-2);
  overflow-wrap: anywhere;
}
.ws-solver-qty-formula {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 22px;
}
.ws-solver-trust { max-width: 40rem; }
.ws-solver-shortcut {
  margin: 16px 0 24px;
  padding: 16px 18px;
  border: 1px solid color-mix(in oklab, var(--lc-green, #1E6A50) 35%, var(--lc-rule));
  border-radius: var(--ws-radius-md);
  max-width: none;
}
.ws-solver-shortcut .ws-h2 { margin-top: 0; font-size: 18px; font-family: var(--lc-sans); }
.solver-discover {
  margin: 12px 0 20px;
  padding: 12px 14px;
  border: 1px solid color-mix(in oklab, var(--lc-green, #1E6A50) 35%, var(--lc-rule, #D8D2BF));
  border-radius: 10px;
  background: color-mix(in oklab, var(--lc-paper, #F8F5EC) 88%, transparent);
  max-width: 42rem;
}
.solver-discover-badge {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--lc-green, #1E6A50);
}
.solver-discover p { margin: 6px 0 10px; color: var(--lc-ink-2, #58544A); font-size: 14px; }
.solver-discover-cta {
  font: inherit;
  text-decoration: none;
  display: inline-block;
  border-radius: 6px;
  padding: 8px 12px;
  background: var(--lc-green, #1E6A50);
  color: #fff;
}
.pt-solver-cta {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--lc-ink-3, #6b675c);
}
.pt-solver-cta a { color: var(--lc-green, #1E6A50); text-decoration: none; }
@media (max-width: 640px) {
  .ws-eq { font-size: 22px; }
  .ws-eq-arrow { flex-basis: 100%; }
}

.lab-search {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0 20px;
}
.lab-search input {
  flex: 1;
  min-width: 220px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--lc-rule, #D8D2BF);
  border-radius: 10px;
  background: var(--lc-bg, #F2EFE7);
  font: inherit;
}
.lab-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.lab-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr) minmax(180px, 1fr);
  gap: 16px;
  align-items: start;
}
.lab-pane {
  border: 1px solid var(--lc-rule, #D8D2BF);
  border-radius: 14px;
  padding: 16px;
  background: color-mix(in oklab, var(--lc-paper, #F8F5EC) 86%, transparent);
}
.lab-pane h2 {
  margin: 0 0 12px;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--lc-ink-3, #8E8978);
}
.lab-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lab-chip-group { margin: 0 0 12px; }
.lab-chip-group-title {
  display: block;
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--lc-ink-3, #8E8978);
}
.lab-chip {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--lc-rule, #D8D2BF);
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.lab-chip span { font-size: 11px; color: var(--lc-ink-3, #8E8978); width: 100%; }
.lab-chip-swatch {
  width: 10px;
  height: 10px;
  border-radius: 99px;
  box-shadow: inset 0 0 0 1px color-mix(in oklab, #000 12%, transparent);
}
.lab-bench { display: flex; flex-direction: column; align-items: stretch; }
.lab-glass-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  justify-content: center;
  min-height: 240px;
  padding: 12px 0 4px;
}
.lab-glass {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 118px;
  padding: 4px 6px 8px;
  border: 1px dashed transparent;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.lab-glass.is-active {
  border-style: solid;
  border-color: color-mix(in oklab, var(--lc-green, #1E6A50) 45%, var(--lc-rule, #D8D2BF));
  background: color-mix(in oklab, var(--lc-green, #1E6A50) 7%, transparent);
}
.lab-glass.is-pour-source {
  border-style: solid;
  border-color: color-mix(in oklab, var(--lc-green, #1E6A50) 55%, var(--lc-rule, #D8D2BF));
}
.lab-glass.is-pour-target {
  border-color: color-mix(in oklab, var(--lc-green, #1E6A50) 35%, var(--lc-rule, #D8D2BF));
}
.lab-glass-name { font-size: 12px; font-weight: 650; }
.lab-glass-meta { font-size: 11px; color: var(--lc-ink-3, #8E8978); }
.lab-glass-product {
  font-size: 11px;
  text-align: center;
  color: var(--lc-green, #1E6A50);
  line-height: 1.25;
}
.lab-pour-hint,
.lab-kv-product strong { color: var(--lc-green, #1E6A50); }
.lab-amount, .lab-bench-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.lab-amount .is-on,
.lab-bench-actions .is-on {
  color: var(--lc-green, #1E6A50);
  border-color: color-mix(in oklab, var(--lc-green, #1E6A50) 40%, var(--lc-rule, #D8D2BF));
  background: color-mix(in oklab, var(--lc-green, #1E6A50) 10%, transparent);
}
.lab-beaker-label { margin-top: 10px; font-size: 13px; color: var(--lc-ink-2, #58544A); }
@keyframes lab-stir {
  0% { transform: translateX(0); }
  40% { transform: translateX(3px); }
  100% { transform: translateX(0); }
}
@keyframes lab-bubbles {
  0% { background-position: 12% 80%, 48% 92%, 74% 70%; opacity: .35; }
  100% { background-position: 18% 40%, 42% 48%, 78% 28%; opacity: .8; }
}
.lab-kv { display: flex; justify-content: space-between; gap: 12px; margin: 6px 0; }
.lab-measures { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.lab-notes { margin: 0; padding-left: 18px; color: var(--lc-ink-2, #58544A); }
.lab-notes time { font-family: var(--lc-mono, ui-monospace, monospace); font-size: 12px; margin-right: 8px; }
.lab-msg {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--lc-rule, #D8D2BF);
  border-radius: 12px;
}
.ws-lab-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, .8fr);
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--lc-rule, #D8D2BF);
  border-radius: 16px;
  margin: 8px 0 28px;
  background: color-mix(in oklab, var(--lc-green, #1E6A50) 6%, var(--lc-paper, #F8F5EC));
}
.ws-lab-hero h2 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-size: 34px;
  font-weight: 400;
  margin: 0 0 8px;
}
@media (max-width: 900px) {
  .lab-grid, .ws-lab-hero { grid-template-columns: 1fr; }
}
.ws-lab-continue {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.ws-lab-continue a {
  font-size: 14px;
  font-weight: 550;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--lc-green) 45%, transparent);
}

.lab-board-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
  justify-content: space-between;
  margin: 0 0 14px;
}
.lab-board-bar .lab-search,
.lab-board-bar .lab-toolbar { margin: 0; }
.lab-board-layout {
  display: grid;
  grid-template-columns: minmax(196px, 250px) minmax(0, 1fr) minmax(230px, 300px);
  gap: 12px;
  align-items: stretch;
}
.lab-board-rail,
.lab-board-side {
  max-height: calc(100vh - 210px);
  overflow: auto;
}
.lab-board-stage-wrap {
  min-height: 480px;
  padding: 12px;
}
.lab-board-stage {
  position: relative;
  flex: 1;
  min-height: 480px;
  height: calc(100vh - 280px);
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--lc-rule, #D8D2BF);
  background:
    radial-gradient(circle, color-mix(in oklab, var(--lc-ink-3, #8E8978) 22%, transparent) 1.1px, transparent 1.6px) 0 0 / 22px 22px,
    color-mix(in oklab, var(--lc-paper, #F8F5EC) 88%, #fff);
  cursor: grab;
  touch-action: none;
  overscroll-behavior: contain;
  user-select: none;
}
.lab-board-stage:active { cursor: grabbing; }
.lab-board-world {
  position: absolute;
  left: 0;
  top: 0;
  width: 2400px;
  height: 1600px;
  transform-origin: 0 0;
  will-change: transform;
}
.lab-board .lab-piece,
.lab-board .lab-flask {
  position: absolute;
  z-index: 1;
  touch-action: none;
  width: 124px;
  overflow: visible;
}
.lab-board .lab-piece.is-active { z-index: 3; }
.lab-glass.is-heat-source {
  border-style: solid;
  border-color: color-mix(in oklab, #d06020 55%, var(--lc-rule, #D8D2BF));
}
svg.lab-links {
  position: absolute;
  left: 0;
  top: 0;
  width: 2400px;
  height: 1600px;
  max-width: none;
  pointer-events: none;
  overflow: visible;
}
.lab-links path {
  fill: none;
  stroke: color-mix(in oklab, var(--lc-green, #1E6A50) 62%, var(--lc-rule, #D8D2BF));
  stroke-width: 3.2;
  stroke-linecap: round;
}
.lab-ports {
  position: absolute;
  left: 4px;
  right: 4px;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 4;
}
.lab-ports-top { top: 4px; }
.lab-ports-bottom { top: 140px; }
.lab-port {
  display: block;
  box-sizing: border-box;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 2px solid color-mix(in oklab, var(--lc-paper, #F8F5EC) 80%, transparent);
  border-radius: 99px;
  background: var(--lc-green, #1E6A50);
  cursor: crosshair;
  touch-action: none;
}
.lab-port:hover,
.lab-port.is-open {
  background: color-mix(in oklab, var(--lc-green, #1E6A50) 75%, #fff);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--lc-green, #1E6A50) 24%, transparent);
}
.lab-hint {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  max-width: min(440px, calc(100% - 300px));
  text-align: center;
  margin: 0;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 99px;
  background: color-mix(in oklab, var(--lc-paper, #F8F5EC) 82%, transparent);
  font-size: 11px;
  color: var(--lc-ink-3, #8E8978);
  pointer-events: none;
}
@media (max-width: 1180px) { .lab-hint { display: none; } }

.lab-marquee {
  position: absolute;
  z-index: 6;
  pointer-events: none;
  border: 1px solid var(--lc-green, #1E6A50);
  background: color-mix(in oklab, var(--lc-green, #1E6A50) 12%, transparent);
  border-radius: 3px;
}
.lab-piece.is-active { outline: none; }
svg.lab-linking {
  position: absolute;
  left: 0;
  top: 0;
  width: 2400px;
  height: 1600px;
  max-width: none;
  pointer-events: none;
  overflow: visible;
  z-index: 3;
}
svg.lab-linking path {
  fill: none;
  stroke: var(--lc-green, #1E6A50);
  stroke-width: 3;
  stroke-dasharray: 7 6;
  stroke-linecap: round;
}
/* A tool near a host it can clip onto. */
.lab-piece.is-snap-target {
  border-style: solid;
  border-color: var(--lc-green, #1E6A50);
  background: color-mix(in oklab, var(--lc-green, #1E6A50) 9%, transparent);
}
/* A fitted tool sits inside its host: no caption of its own, and it reads
   through the glass rather than on top of it. */
.lab-piece.is-fitted .lab-glass-name,
.lab-piece.is-fitted .lab-glass-meta { display: none; }
.lab-piece.is-fitted { z-index: 0; }
.lab-piece.is-fitted .lab-svg-glass > * { fill: color-mix(in oklab, #fff 55%, transparent); }
.lab-readouts {
  position: absolute;
  top: 8px;
  left: 6px;
  right: 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  pointer-events: none;
}
.lab-readout {
  padding: 1px 7px;
  border-radius: 99px;
  border: 1px solid color-mix(in oklab, var(--lc-green, #1E6A50) 32%, transparent);
  background: color-mix(in oklab, var(--lc-paper, #F8F5EC) 94%, #fff);
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--lc-green, #1E6A50);
  white-space: nowrap;
}
.lab-zoom-label {
  min-width: 48px;
  text-align: center;
  font-size: 12px;
  color: var(--lc-ink-2, #58544A);
}
.lab-glass.is-heat-zone {
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--lc-green, #1E6A50) 45%, transparent);
}
.lab-guide-progress { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--lc-ink-3, #8E8978); }
.lab-guide-why { font-size: 13px; color: var(--lc-ink-2, #58544A); }
.lab-board-stage:focus { outline: 2px solid color-mix(in oklab, var(--lc-green, #1E6A50) 35%, transparent); }
@keyframes lab-slosh {
  0% { transform: translateX(0) skewX(0); }
  35% { transform: translateX(4px) skewX(-4deg); }
  100% { transform: translateX(0) skewX(0); }
}
.lab-guide { margin-top: 16px; }
.lab-guide ol { margin: 8px 0 0; padding-left: 18px; }
.lab-guide-step { margin: 6px 0; color: var(--lc-ink-2, #58544A); }
.lab-guide-step.is-done { color: var(--lc-green, #1E6A50); text-decoration: line-through; }
.lab-guide-step.is-now { color: var(--lc-ink, #1b1914); font-weight: 650; }
.lab-guide-done { color: var(--lc-green, #1E6A50); font-weight: 650; }
@keyframes lab-wave {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(7%); }
}
@keyframes lab-flame {
  0% { transform: scaleY(.92) translateY(1px); opacity: .82; }
  100% { transform: scaleY(1.08) translateY(-2px); opacity: 1; }
}
/* ── Lab glassware: one SVG per piece, liquid clipped to the real cavity ──── */
svg.lab-vessel {
  display: block;
  width: 100%;
  height: 172px;
  max-width: none;
  overflow: visible;
  pointer-events: none;
}
.lab-svg-glass > * {
  fill: color-mix(in oklab, #fff 24%, transparent);
  stroke: var(--lab-glass-ink, #2F2C28);
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lab-svg-shine > * {
  fill: none;
  stroke: color-mix(in oklab, #fff 78%, transparent);
  stroke-width: 3.4;
  stroke-linecap: round;
}
.lab-svg-marks > * {
  fill: none;
  stroke: color-mix(in oklab, var(--lc-ink-3, #8E8978) 62%, transparent);
  stroke-width: 1.2;
  stroke-linecap: round;
}
.lab-svg-surface { fill: color-mix(in oklab, #fff 38%, transparent); }
.lab-svg-sediment { fill: color-mix(in oklab, var(--lc-ink-2, #58544A) 32%, transparent); }
.lab-svg-phase-line {
  fill: none;
  stroke: color-mix(in oklab, #000 22%, transparent);
  stroke-width: 1;
}
.lab-svg-fill {
  transform-box: view-box;
  transform-origin: 50px 100px;
}
.lab-svg-fill.is-sloshing { animation: lab-slosh 640ms ease-out; }
.lab-svg-fill.is-stirring { animation: lab-stir 520ms ease-out; }
.lab-svg-fill.is-rising { animation: lab-fill-rise 420ms cubic-bezier(.22, 1, .36, 1); }
@keyframes lab-fill-rise {
  0% { transform: translateY(7px) scaleY(.9); }
  60% { transform: translateY(-1.5px) scaleY(1.02); }
  100% { transform: none; }
}
.lab-svg-bubble {
  fill: color-mix(in oklab, #fff 80%, transparent);
  transform-box: view-box;
  opacity: 0;
  animation: lab-bubble-rise 1700ms ease-in infinite;
  animation-delay: var(--lab-delay, 0ms);
}
@keyframes lab-bubble-rise {
  0% { transform: translateY(0) scale(.7); opacity: 0; }
  18% { opacity: .85; }
  100% { transform: translateY(calc(var(--lab-rise, 40px) * -1)) scale(1.1); opacity: 0; }
}
.lab-svg-flame > path {
  stroke: none;
  fill: color-mix(in oklab, #E8912A 78%, transparent);
  transform-box: view-box;
  transform-origin: 50px 54px;
  animation: lab-flame 620ms ease-in-out infinite alternate;
}
.lab-svg-flame > .lab-svg-flame-core { fill: color-mix(in oklab, #7EB6D9 72%, #fff); }
.lab-svg-flame.is-off > path {
  fill: color-mix(in oklab, var(--lc-ink-3, #8E8978) 26%, transparent);
  animation: none;
}
.lab-svg-vapor > path {
  fill: none;
  stroke: color-mix(in oklab, var(--lc-ink-3, #8E8978) 52%, transparent);
  stroke-width: 2.2;
  stroke-linecap: round;
  transform-box: view-box;
  animation: lab-vapor 2400ms ease-in-out infinite;
}
.lab-svg-vapor > path:nth-child(2) { animation-delay: 500ms; }
.lab-svg-vapor > path:nth-child(3) { animation-delay: 1000ms; }

.lab-piece.is-receiving .lab-vessel {
  filter: drop-shadow(0 0 3px color-mix(in oklab, var(--lc-green, #1E6A50) 55%, transparent));
}
.lab-piece.is-heating .lab-vessel { animation: lab-heat-pulse 720ms ease; }
.lab-piece.is-warm .lab-svg-glass > * { stroke: color-mix(in oklab, #C05A18 22%, var(--lab-glass-ink, #2F2C28)); }
.lab-glass.is-emulsion .lab-liquid { opacity: .95; }

/* Animation is a process signal, so it stops when the piece leaves the view. */
.lab-piece.is-offscreen .lab-svg-bubble,
.lab-piece.is-offscreen .lab-svg-flame > path,
.lab-piece.is-offscreen .lab-svg-vapor > path { animation-play-state: paused; }

html[data-reduced-motion] .lab-svg-bubble,
html[data-reduced-motion] .lab-svg-flame > path,
html[data-reduced-motion] .lab-svg-vapor > path,
html[data-reduced-motion] .lab-svg-fill,
html[data-reduced-motion] .lab-piece.is-heating .lab-vessel,
html[data-reduced-motion] .lab-piece.is-pouring,
html[data-reduced-motion] .lab-stream,
html[data-reduced-motion="1"] .lab-svg-bubble,
html[data-reduced-motion="1"] .lab-svg-flame > path,
html[data-reduced-motion="1"] .lab-svg-vapor > path,
html[data-reduced-motion="1"] .lab-svg-fill,
html[data-reduced-motion="1"] .lab-piece.is-heating .lab-vessel,
html[data-reduced-motion="1"] .lab-piece.is-pouring,
html[data-reduced-motion="1"] .lab-stream { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .lab-svg-bubble,
  .lab-svg-flame > path,
  .lab-svg-vapor > path,
  .lab-svg-fill,
  .lab-piece.is-heating .lab-vessel,
  .lab-piece.is-pouring,
  .lab-stream { animation: none; }
  .lab-svg-bubble { opacity: .5; }
}

/* ── Reactions and assembled apparatus ───────────────────────────────────── */
.lab-reaction,
.lab-rig {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid color-mix(in oklab, var(--lc-green, #1E6A50) 32%, var(--lc-rule, #D8D2BF));
  background: color-mix(in oklab, var(--lc-green, #1E6A50) 7%, transparent);
}
.lab-reaction-tag {
  display: block;
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--lc-green, #1E6A50);
}
.lab-reaction-eq {
  display: block;
  margin: 4px 0 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--lc-ink, #1b1914);
  overflow-x: auto;
}
.lab-multi {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid color-mix(in oklab, var(--lc-green, #1E6A50) 32%, transparent);
  background: color-mix(in oklab, var(--lc-green, #1E6A50) 7%, transparent);
}
.lab-multi p { margin: 4px 0 8px; font-size: 13px; }
.lab-multi .ws-lede { font-size: 12px; margin-bottom: 0; }

.lab-contents {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}
.lab-content-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 4px 4px 6px;
  border-radius: 8px;
  background: color-mix(in oklab, var(--lc-ink-3, #8E8978) 8%, transparent);
  font-size: 12.5px;
}
.lab-content-row span { flex: 1; min-width: 0; }
.lab-content-row b { font-variant-numeric: tabular-nums; font-weight: 650; }
.lab-content-drop {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--lc-ink-3, #8E8978);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.lab-content-drop:hover {
  background: color-mix(in oklab, #c0392b 16%, transparent);
  color: #a8321f;
}
.lab-kv-stack { display: block; margin-bottom: 4px; }

.lab-reaction p,
.lab-rig p { margin: 4px 0 8px; font-size: 12.5px; color: var(--lc-ink-2, #58544A); }
.lab-rig button { margin-top: 2px; }

.lab-piece.is-reacting .lab-vessel { animation: lab-react 900ms ease-out; }
.lab-piece.is-reacting .lab-svg-fill { animation: lab-stir 520ms ease-out; }
@keyframes lab-react {
  0% { filter: none; }
  25% { filter: brightness(1.25) saturate(1.4) drop-shadow(0 0 6px color-mix(in oklab, var(--lc-green, #1E6A50) 45%, transparent)); }
  100% { filter: none; }
}
.lab-piece.is-boiling .lab-svg-vapor > path { animation-duration: 900ms; }
.lab-piece.is-boiling .lab-vessel { animation: lab-heat-pulse 900ms ease; }
/* A heater under a vessel would stack its caption on top of the vessel's. */
.lab-piece.is-cupped .lab-glass-name,
.lab-piece.is-cupped .lab-glass-meta { display: none; }
.lab-piece.is-cupped { z-index: 0; }

html[data-reduced-motion] .lab-piece.is-reacting .lab-vessel,
html[data-reduced-motion] .lab-piece.is-boiling .lab-vessel,
html[data-reduced-motion="1"] .lab-piece.is-reacting .lab-vessel,
html[data-reduced-motion="1"] .lab-piece.is-boiling .lab-vessel { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .lab-piece.is-reacting .lab-vessel,
  .lab-piece.is-boiling .lab-vessel { animation: none; }
}

/* ── Lab board v2: floating Miro-style dock, side tabs, action bar ───────── */
.lab-board-bar { align-items: center; gap: 10px 14px; margin-bottom: 10px; }
.lab-board-title .ws-title { font-size: clamp(22px, 3.2vw, 34px); margin: 0; }
.lab-board-bar .lab-toolbar { gap: 6px; }
.lab-board-title { min-width: 200px; }
.lab-board-bar .lab-search { flex: 1 1 260px; max-width: 420px; }
.lab-zoom { display: inline-flex; align-items: center; gap: 4px; }
.lab-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--lc-rule, #D8D2BF);
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.lab-icon-btn.is-off { color: var(--lc-ink-3, #8E8978); opacity: .8; }
.lab-icon-btn:hover { border-color: var(--lc-green, #1E6A50); }

.lab-stage-shell {
  display: flex;
  align-items: stretch;
  gap: 10px;
  isolation: isolate;
}
.lab-stage-frame { position: relative; flex: 1 1 auto; min-width: 0; display: flex; }
.lab-stage-shell.is-dock-open .lab-side { flex-basis: clamp(230px, 22%, 272px); }
.lab-stage-shell .lab-board-stage {
  width: 100%;
  height: clamp(460px, calc(100vh - 260px), 780px);
}

.lab-dock {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-height: 0;
}
.lab-dock-rail {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  overflow-y: auto;
  scrollbar-width: none;
  border-radius: 14px;
  border: 1px solid var(--lc-rule, #D8D2BF);
  background: color-mix(in oklab, var(--lc-paper, #F8F5EC) 94%, #fff);
  box-shadow: 0 6px 20px color-mix(in oklab, #000 10%, transparent);
}
.lab-dock-rail::-webkit-scrollbar { display: none; }
.lab-dock-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 56px;
  min-height: 52px;
  padding: 6px 2px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--lc-ink-2, #58544A);
  font: inherit;
  cursor: pointer;
}
.lab-dock-btn:hover { background: color-mix(in oklab, var(--lc-green, #1E6A50) 8%, transparent); }
.lab-dock-btn.is-on {
  border-color: var(--lc-green, #1E6A50);
  background: color-mix(in oklab, var(--lc-green, #1E6A50) 12%, transparent);
  color: var(--lc-green, #1E6A50);
}
.lab-dock-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.lab-dock-name { font-size: 9.5px; line-height: 1.1; text-align: center; letter-spacing: .02em; }
.lab-dock-dot {
  position: absolute;
  top: 5px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--lc-green, #1E6A50);
}
.lab-dock-panel {
  width: min(292px, 40vw);
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1px solid var(--lc-rule, #D8D2BF);
  background: color-mix(in oklab, var(--lc-paper, #F8F5EC) 96%, #fff);
  box-shadow: 0 10px 28px color-mix(in oklab, #000 14%, transparent);
  overflow: hidden;
}
.lab-dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 8px 10px 14px;
  border-bottom: 1px solid var(--lc-rule, #D8D2BF);
}
.lab-dock-head h2 { margin: 0; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--lc-ink-3, #8E8978); }
.lab-dock-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.lab-dock-close:hover { background: color-mix(in oklab, var(--lc-ink-3, #8E8978) 14%, transparent); }
.lab-dock-body { padding: 12px 14px 16px; overflow: auto; }
.lab-dock-body .lab-chip { min-height: 38px; padding: 6px 10px; font-size: 13px; }
.lab-dock-note { margin: 10px 0 0; font-size: 12px; color: var(--lc-ink-3, #8E8978); }
.lab-chip.is-wanted {
  border-color: var(--lc-green, #1E6A50);
  background: color-mix(in oklab, var(--lc-green, #1E6A50) 10%, transparent);
  font-weight: 650;
}

.lab-create-list { display: grid; gap: 10px; }
.lab-create-card {
  border: 1px solid var(--lc-rule, #D8D2BF);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 6px;
}
.lab-create-card.is-active { border-color: var(--lc-green, #1E6A50); }
.lab-create-card h3 { margin: 0; font-size: 15px; }
.lab-create-card p { margin: 0; font-size: 12.5px; color: var(--lc-ink-2, #58544A); }
.lab-create-meta { font-size: 11px !important; letter-spacing: .06em; text-transform: uppercase; color: var(--lc-ink-3, #8E8978) !important; }
.lab-create-card button { justify-self: start; }

.lab-side {
  flex: 0 0 clamp(250px, 26%, 312px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1px solid var(--lc-rule, #D8D2BF);
  background: color-mix(in oklab, var(--lc-paper, #F8F5EC) 96%, #fff);
  box-shadow: 0 10px 28px color-mix(in oklab, #000 12%, transparent);
  overflow: hidden;
}
.lab-side-tabs { display: flex; border-bottom: 1px solid var(--lc-rule, #D8D2BF); }
.lab-side-tab {
  flex: 1;
  min-height: 42px;
  padding: 8px 6px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--lc-ink-3, #8E8978);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.lab-side-tab.is-on { color: var(--lc-green, #1E6A50); border-bottom-color: var(--lc-green, #1E6A50); font-weight: 650; }
.lab-side-body { padding: 12px 14px 16px; overflow: auto; }
.lab-side-body .lab-measures { display: flex; flex-wrap: wrap; gap: 6px; }

/* Floating clusters instead of one long permanent toolbar. */
.lab-hud,
.lab-context {
  position: absolute;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--lc-rule, #D8D2BF);
  background: color-mix(in oklab, var(--lc-paper, #F8F5EC) 96%, #fff);
  box-shadow: 0 6px 20px color-mix(in oklab, #000 13%, transparent);
}
.lab-hud-left { left: 12px; bottom: 12px; }
.lab-hud-right { right: 12px; bottom: 12px; }
.lab-context { z-index: 8; }
.lab-context[hidden] { display: none; }
.lab-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--lc-ink-2, #58544A);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.lab-tool-btn:hover { background: color-mix(in oklab, var(--lc-green, #1E6A50) 12%, transparent); }
.lab-tool-btn.is-on {
  background: color-mix(in oklab, var(--lc-green, #1E6A50) 18%, transparent);
  color: var(--lc-green, #1E6A50);
}
.lab-tool-btn.is-danger:hover { background: color-mix(in oklab, #c0392b 16%, transparent); color: #a8321f; }
.lab-tool-btn .lab-dock-icon { width: 19px; height: 19px; }
.lab-tool-wide { padding: 0 10px; font-size: 12.5px; }
.lab-tool-sep {
  width: 1px;
  height: 20px;
  margin: 0 3px;
  background: var(--lc-rule, #D8D2BF);
}
@media (max-width: 900px) {
  .lab-hud-left { left: 8px; bottom: 8px; }
  .lab-hud-right { right: 8px; bottom: 8px; }
}

.lab-guide-now { margin: 10px 0 8px; font-size: 15px; font-weight: 650; color: var(--lc-ink, #1b1914); }
.lab-guide-bar {
  height: 6px;
  border-radius: 99px;
  background: color-mix(in oklab, var(--lc-ink-3, #8E8978) 22%, transparent);
  overflow: hidden;
}
.lab-guide-bar i { display: block; height: 100%; background: var(--lc-green, #1E6A50); }
.lab-do-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.lab-do-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 6px 11px;
  border-radius: 99px;
  border: 1px solid var(--lc-green, #1E6A50);
  background: color-mix(in oklab, var(--lc-green, #1E6A50) 10%, transparent);
  color: var(--lc-green, #1E6A50);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.lab-do-chip:hover { background: color-mix(in oklab, var(--lc-green, #1E6A50) 18%, transparent); }
.lab-do-or { align-self: center; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--lc-ink-3, #8E8978); }
.lab-hints { margin: 8px 0; padding-left: 18px; font-size: 13px; color: var(--lc-ink-2, #58544A); }
.lab-hints li { margin: 4px 0; }
.lab-guide-all { margin: 10px 0; font-size: 13px; }
.lab-guide-all summary { cursor: pointer; color: var(--lc-ink-3, #8E8978); }
.lab-guide-empty { display: grid; gap: 8px; }
.lab-tower { margin: 10px 0; font-size: 13px; }
.lab-tower summary { cursor: pointer; color: var(--lc-ink-3, #8E8978); }
.lab-tower-list {
  margin: 8px 0 0;
  padding: 0 0 0 10px;
  list-style: none;
  border-left: 2px solid color-mix(in oklab, var(--lc-green, #1E6A50) 35%, transparent);
}
.lab-tower-list li {
  position: relative;
  padding: 4px 0 4px 10px;
  color: var(--lc-ink-2, #58544A);
}
.lab-tower-list li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 12px;
  width: 8px;
  height: 2px;
  background: color-mix(in oklab, var(--lc-green, #1E6A50) 55%, transparent);
}

@media (max-width: 1100px) {
  .lab-board-layout { grid-template-columns: 1fr; }
  .lab-board-rail,
  .lab-board-side { max-height: none; }
  .lab-board-stage { height: 520px; }
  .lab-stage-shell .lab-board-stage { height: 560px; }
  .lab-side { flex-basis: 250px; }
  .lab-dock-panel { width: min(252px, 34vw); }
}

@media (max-width: 900px) {
  .lab-stage-shell { flex-direction: column; }
  .lab-stage-shell .lab-board-stage { height: 58vh; min-height: 360px; }
  .lab-dock { flex-direction: column; order: -1; }
  .lab-dock-rail {
    flex-direction: row;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .lab-dock-rail::-webkit-scrollbar { display: none; }
  .lab-dock-btn { width: 62px; flex: 0 0 auto; }
  .lab-dock-panel { width: auto; max-height: 46vh; }
  .lab-side { flex: 1 1 auto; }
  .lab-actionbar {
    left: 8px;
    right: 8px;
    transform: none;
    justify-content: flex-start;
    border-radius: 12px;
  }
}
.lab-stream {
  position: absolute;
  height: 4px;
  border-radius: 999px;
  transform-origin: left center;
  pointer-events: none;
  z-index: 8;
  opacity: .9;
  box-shadow: 0 0 6px color-mix(in oklab, currentColor 35%, transparent);
  animation: lab-stream-fade 760ms ease-out forwards;
}
.lab-stream.is-drip {
  width: 10px !important;
  height: 12px;
  border-radius: 50%;
  transform-origin: center;
  animation: lab-drip 480ms ease-out forwards;
}
.lab-piece.is-pouring {
  animation: lab-pour-tilt 700ms ease;
  transform-origin: 50% 78%;
}
@keyframes lab-pour-tilt {
  0% { transform: rotate(var(--lab-rot, 0deg)); }
  35% { transform: rotate(calc(var(--lab-rot, 0deg) + 22deg)); }
  100% { transform: rotate(var(--lab-rot, 0deg)); }
}
@keyframes lab-stream-fade {
  0% { opacity: .95; }
  70% { opacity: .7; }
  100% { opacity: 0; }
}
@keyframes lab-drip {
  0% { transform: translateY(0) scale(1); opacity: .95; }
  100% { transform: translateY(18px) scale(.6); opacity: 0; }
}
@keyframes lab-vapor {
  0% { transform: translateY(8px) scale(.92); opacity: .25; }
  45% { transform: translateY(-6px) scale(1.05); opacity: .7; }
  100% { transform: translateY(-22px) scale(1.12); opacity: .12; }
}
@keyframes lab-heat-pulse {
  0% { filter: none; }
  40% { filter: saturate(1.2) brightness(1.08); }
  100% { filter: none; }
}

/* ---- My Work: one page of groups, filtered by a chip row ---- */
.ws-work-search { margin: 0 0 12px; }
.ws-work-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 18px;
}
.ws-work-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid var(--ws-line, rgba(15, 23, 42, .12));
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ws-ink-soft, #475569);
  text-decoration: none;
  background: var(--ws-surface, #fff);
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}
.ws-work-chip:hover { border-color: var(--ws-accent, #2563eb); color: var(--ws-accent, #2563eb); }
.ws-work-chip.is-active {
  background: var(--ws-accent, #2563eb);
  border-color: var(--ws-accent, #2563eb);
  color: #fff;
}
.ws-work-group + .ws-work-group { margin-top: 26px; }

/* ---- Study home: the library with what is due on top ---- */
.ws-study-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 0 18px;
  margin: 0 0 18px;
  border-bottom: 1px solid var(--ws-line, rgba(15, 23, 42, .12));
}
.ws-study-strip-main { flex: 1 1 320px; min-width: 0; }
.ws-study-strip-main .ws-title { margin: 2px 0 6px; }
.ws-study-strip-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.ws-study-strip-links { margin: 0; }
@media (max-width: 640px) {
  .ws-study-strip { align-items: flex-start; }
  .ws-study-strip-side { width: 100%; }
}

/* ============================================================
   Lab as an application canvas (prompt 68)
   The Workspace stops being a scrolling page while the board is
   open: the shell keeps its own height, the board takes what is
   left, and only the panels scroll.
   ============================================================ */
.is-lab-surface .ws-main {
  overflow: hidden;
  padding: 14px 18px 18px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.is-lab-surface .ws-content {
  max-width: none;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.is-lab-surface #app-study {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.is-lab-surface .ws-study-nav { margin-bottom: 10px; }
.is-lab-surface .lab-board {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.is-lab-surface .lab-stage-shell {
  flex: 1 1 auto;
  min-height: 0;
}
/* The stage no longer guesses its height from the viewport: it takes what the
   flex column has left, which is correct whether or not the nav wrapped. */
.is-lab-surface .lab-stage-shell .lab-board-stage,
.is-lab-surface .lab-board-stage {
  height: auto;
  min-height: 0;
  flex: 1 1 auto;
}
.is-lab-surface .lab-side { max-height: none; }
.is-lab-surface .lab-side-body { flex: 1 1 auto; min-height: 0; }
.is-lab-surface .lab-dock-panel { max-height: none; }

/* Focus mode: the global sidebar steps out, the exit stays on the bar. */
.is-lab-focus .ws-shell { grid-template-columns: 0 minmax(0, 1fr); }
.is-lab-focus .ws-sidebar { display: none; }
.is-lab-focus .ws-main { padding-left: 18px; }

/* The mini-toolbar that replaced the page header. */
.lab-board-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}
.lab-bar-group { display: flex; align-items: center; gap: 4px; }
.lab-bar-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex: 0 1 auto;
}
.lab-bar-title strong {
  font-size: 15px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lab-save-state {
  font-size: 11.5px;
  color: var(--lc-ink-3, #8E8978);
  white-space: nowrap;
}
.lab-save-state.is-pending { color: var(--lc-green, #1E6A50); }
.lab-bar-search { flex: 1 1 220px; max-width: 360px; margin: 0; }
.lab-bar-search input { height: 32px; }
.lab-board-bar .lab-toolbar { margin-left: auto; }
@media (max-width: 900px) {
  .lab-bar-search { order: 9; flex-basis: 100%; max-width: none; }
  .lab-board-bar .lab-toolbar { margin-left: 0; }
}

/* Notebook is the third side panel tab, not a section under the board. */
.lab-side-body .lab-notes { margin: 0; padding-left: 18px; }
.lab-bar-note {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--lc-rule, #D8D2BF);
  color: var(--lc-ink-3, #8E8978);
  white-space: nowrap;
}

/* ---- Zoom control: [ − ] [ 82% ] [ + ] [ Fit ] with a menu of exact steps ---- */
/* The HUD is already absolutely positioned at the stage corner, so it is its
   own containing block. Making it position:relative stretched it to the full
   stage height and threw the menu up under the global topbar. */
.lab-zoom-label {
  min-width: 52px;
  padding: 4px 6px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: inherit;
  cursor: pointer;
}
.lab-zoom-label:hover { background: color-mix(in oklab, var(--lc-green, #1E6A50) 10%, transparent); }
.lab-zoom-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  min-width: 152px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-radius: 11px;
  border: 1px solid var(--lc-rule, #D8D2BF);
  background: var(--lc-paper, #F8F5EC);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .16);
  z-index: 7;
}
.lab-zoom-item {
  padding: 6px 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.lab-zoom-item:hover:not(:disabled) { background: color-mix(in oklab, var(--lc-green, #1E6A50) 12%, transparent); }
.lab-zoom-item.is-on { font-weight: 700; color: var(--lc-green, #1E6A50); }
.lab-zoom-item:disabled { opacity: .42; cursor: default; }
.lab-zoom-rule {
  height: 1px;
  margin: 4px 2px;
  background: var(--lc-rule, #D8D2BF);
}

/* ---- Select and Hand sit above the dock categories, as modes not drawers ---- */
.lab-dock-mode.is-on {
  background: color-mix(in oklab, var(--lc-green, #1E6A50) 14%, transparent);
  color: var(--lc-green, #1E6A50);
}
.lab-dock-rule {
  display: block;
  height: 1px;
  margin: 5px 8px;
  background: var(--lc-rule, #D8D2BF);
}
.lab-board-stage.is-hand { cursor: grab; }
.lab-board-stage.is-hand:active { cursor: grabbing; }
.lab-board-stage.is-hand .lab-piece { cursor: grab; }
