/* =========================================================================
   PlacementFlow — Conditions & skills "Casebook" (student app.html section).
   Handbook + logbook fused: every row reads on the left and logs on the right.
   Fresh cs-* classes, scoped to body.app-dashboard #section-conditions.
   Loads after style.css; reuses only .conditions-mode-panel (show/hide) and
   .conditions-toast from the legacy sheet. No !important.
   ========================================================================= */

body.app-dashboard #section-conditions {
  --cb-brand: #1f6fd6;
  --cb-brand-2: #1559b0;
  --cb-brand-tint: #eaf2fd;
  --cb-ink: #16233f;
  --cb-slate: #5d6b84;
  --cb-mist: #8a97ad;
  --cb-line: #e9edf4;
  --cb-line-soft: #f1f4f9;
  --cb-ground: #f6f8fc;
  --cb-surface: #fff;
  --cb-green: #1a9e54;
  --cb-green-line: #bfe3cf;
  --cb-green-tint: #e4f5eb;
  --cb-teal-ink: #0b7a70;
  --cb-teal-line: #bfe3de;
  --cb-teal-tint: #e9f7f5;
  --cb-amber-ink: #b96f0c;
  --cb-amber-line: #f0d9b0;
  --cb-guide: #7c5cd6;
  --cb-guide-tint: #f1edfc;
  --cb-r: 14px;
  --cb-r-sm: 10px;
  --cb-sh: 0 1px 2px rgba(20, 33, 64, 0.04), 0 2px 8px rgba(20, 33, 64, 0.05);
  --cb-display: var(--font-application-display);
  color: var(--cb-ink);
}

body.app-dashboard #section-conditions .cs-header h2 {
  font-family: var(--cb-display);
  font-weight: 600;
  letter-spacing: -0.022em;
  color: var(--cb-ink);
}
body.app-dashboard #section-conditions .cs-header .card-subtitle {
  color: var(--cb-slate);
}

body.app-dashboard #section-conditions .cs-shell {
  position: relative;
}

/* ---------- stats strip ---------- */
body.app-dashboard #section-conditions .cs-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
body.app-dashboard #section-conditions .cs-stat {
  border: 1px solid var(--cb-line);
  border-radius: var(--cb-r);
  background: var(--cb-surface);
  box-shadow: var(--cb-sh);
  padding: 13px 16px 14px;
  min-width: 0;
}
body.app-dashboard #section-conditions .cs-stat-num {
  font-family: var(--cb-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
body.app-dashboard #section-conditions .cs-stat-num em {
  font-style: normal;
  font-size: 13px;
  color: var(--cb-mist);
  font-weight: 600;
}
body.app-dashboard #section-conditions .cs-stat > span {
  display: block;
  font-size: 11px;
  color: var(--cb-mist);
  font-weight: 600;
  margin-top: 2px;
}
body.app-dashboard #section-conditions .cs-bar {
  height: 5px;
  border-radius: 99px;
  background: var(--cb-line-soft);
  margin-top: 9px;
  overflow: hidden;
}
body.app-dashboard #section-conditions .cs-bar i {
  display: block;
  height: 100%;
  background: var(--cb-green);
  border-radius: 99px;
  transition: width 0.3s ease;
}
body.app-dashboard #section-conditions .cs-bar i.cs-bar-fill--brand,
body.app-dashboard #section-conditions .cs-bar-fill--brand {
  background: var(--cb-brand);
}
body.app-dashboard #section-conditions .cs-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cb-mist);
}
body.app-dashboard #section-conditions .cs-kicker i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3fc1b4;
  flex: none;
}
body.app-dashboard #section-conditions .cs-stat--focus b {
  display: block;
  font-family: var(--cb-display);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
body.app-dashboard #section-conditions .cs-stat--focus > span {
  margin-top: 3px;
}

/* ---------- mode tabs ---------- */
body.app-dashboard #section-conditions .cs-tabs {
  display: flex;
  gap: 7px;
  margin-top: 16px;
  flex-wrap: wrap;
}
body.app-dashboard #section-conditions .cs-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--cb-line);
  background: var(--cb-surface);
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--cb-slate);
  cursor: pointer;
}
body.app-dashboard #section-conditions .cs-tab[hidden] {
  display: none;
}
body.app-dashboard #section-conditions .cs-tab.is-active {
  background: var(--cb-brand-tint);
  border-color: #bcd6f5;
  color: var(--cb-brand-2);
}
body.app-dashboard #section-conditions .cs-tab-count {
  font-weight: 500;
  color: var(--cb-mist);
  font-variant-numeric: tabular-nums;
}
body.app-dashboard #section-conditions .cs-tab.is-active .cs-tab-count {
  color: var(--cb-brand);
}

/* ---------- timetable band ---------- */
body.app-dashboard #section-conditions .cs-band {
  margin-top: 16px;
  border: 1px solid var(--cb-teal-line);
  background: linear-gradient(180deg, #f2fbf9, #fff 80%);
  border-radius: var(--cb-r);
  box-shadow: var(--cb-sh);
  overflow: hidden;
}
body.app-dashboard #section-conditions .cs-band.is-hidden {
  display: none;
}
body.app-dashboard #section-conditions .cs-band-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px 2px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #0d9488;
}
body.app-dashboard #section-conditions .cs-band-kicker i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0d9488;
  animation: cs-pulse 2.2s infinite;
}
body.app-dashboard #section-conditions .cs-band-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px 13px;
  flex-wrap: wrap;
}
body.app-dashboard #section-conditions .cs-band-row p {
  flex: 1;
  font-size: 13px;
  color: var(--cb-slate);
  line-height: 1.5;
  min-width: 220px;
  margin: 0;
}
body.app-dashboard #section-conditions .cs-band-row p b {
  color: var(--cb-ink);
  font-weight: 700;
}
body.app-dashboard #section-conditions .cs-band-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
body.app-dashboard #section-conditions .cs-band-actions button {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--cb-teal-line);
  background: #fff;
  border-radius: 999px;
  padding: 5px 12px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--cb-teal-ink);
  cursor: pointer;
}
body.app-dashboard #section-conditions .cs-band-actions button:hover {
  background: var(--cb-teal-tint);
}
body.app-dashboard #section-conditions .cs-band-actions button b {
  font-weight: 600;
}

/* ---------- filters + search ---------- */
body.app-dashboard #section-conditions .cs-filters {
  display: flex;
  gap: 7px;
  margin-top: 14px;
  align-items: center;
  flex-wrap: wrap;
}
body.app-dashboard #section-conditions .cs-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--cb-line);
  background: var(--cb-surface);
  border-radius: 999px;
  padding: 5px 12px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--cb-slate);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
body.app-dashboard #section-conditions .cs-chip.is-active {
  background: var(--cb-ink);
  border-color: var(--cb-ink);
  color: #fff;
}
body.app-dashboard #section-conditions .cs-chip [data-cs-count] {
  opacity: 0.75;
  font-weight: 500;
}
body.app-dashboard #section-conditions .cs-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--cb-line);
  background: var(--cb-surface);
  border-radius: 999px;
  padding: 6px 14px;
  color: var(--cb-mist);
}
body.app-dashboard #section-conditions .cs-search:focus-within {
  border-color: var(--cb-brand);
}
body.app-dashboard #section-conditions .cs-search svg {
  width: 14px;
  height: 14px;
  flex: none;
}
body.app-dashboard #section-conditions .cs-search input {
  border: 0;
  background: none;
  outline: none;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--cb-ink);
  width: 150px;
}
body.app-dashboard #section-conditions .cs-search input::placeholder {
  color: var(--cb-mist);
}

/* ---------- library: chapters rail + rows ---------- */
body.app-dashboard #section-conditions .cs-body {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 22px;
  margin-top: 16px;
  align-items: start;
}
body.app-dashboard #section-conditions .cs-rail {
  position: sticky;
  top: 76px;
}
body.app-dashboard #section-conditions .cs-rail-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--cb-mist);
  margin-bottom: 9px;
}
body.app-dashboard #section-conditions .cs-rail a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--cb-slate);
  text-decoration: none;
  cursor: pointer;
}
body.app-dashboard #section-conditions .cs-rail a i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c3cfe2;
  flex: none;
}
body.app-dashboard #section-conditions .cs-rail a .cs-rail-count {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--cb-mist);
  font-variant-numeric: tabular-nums;
}
body.app-dashboard #section-conditions .cs-rail a.is-active {
  background: var(--cb-surface);
  box-shadow: var(--cb-sh);
  color: var(--cb-ink);
  font-weight: 600;
}
body.app-dashboard #section-conditions .cs-rail a.is-active i,
body.app-dashboard #section-conditions .cs-rail a.is-here i {
  background: #3fc1b4;
}

body.app-dashboard #section-conditions .cs-lib {
  border: 1px solid var(--cb-line);
  border-radius: var(--cb-r);
  background: var(--cb-surface);
  box-shadow: var(--cb-sh);
  overflow: hidden;
}
body.app-dashboard #section-conditions .cs-cat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 15px 18px 7px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--cb-mist);
}
body.app-dashboard #section-conditions .cs-cat b {
  color: var(--cb-slate);
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
body.app-dashboard #section-conditions .cs-cat-here {
  margin-left: auto;
  letter-spacing: 0.05em;
  color: var(--cb-teal-ink);
  display: flex;
  align-items: center;
  gap: 5px;
}
body.app-dashboard #section-conditions .cs-cat-here::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3fc1b4;
}

body.app-dashboard #section-conditions .cs-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 4px 14px;
  align-items: center;
  padding: 12px 18px;
  border-top: 1px solid var(--cb-line-soft);
  cursor: pointer;
}
body.app-dashboard #section-conditions .cs-row:hover {
  background: #fbfcfe;
}
body.app-dashboard #section-conditions .cs-row:focus-visible {
  outline: 2px solid var(--cb-brand);
  outline-offset: -2px;
}
body.app-dashboard #section-conditions .cs-row-main {
  min-width: 0;
}
body.app-dashboard #section-conditions .cs-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
body.app-dashboard #section-conditions .cs-row-title b {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.012em;
  color: var(--cb-ink);
}
body.app-dashboard #section-conditions .cs-row--logged .cs-row-title b {
  color: var(--cb-slate);
}
body.app-dashboard #section-conditions .cs-row-desc {
  font-size: 12.5px;
  color: var(--cb-mist);
  line-height: 1.45;
  margin: 2px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.app-dashboard #section-conditions .cs-tag {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--cb-mist);
  border: 1px solid var(--cb-line);
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
}
body.app-dashboard #section-conditions .cs-tag--read {
  color: var(--cb-brand-2);
  border-color: #bcd6f5;
  background: var(--cb-brand-tint);
}
body.app-dashboard #section-conditions .cs-tag--logged {
  color: var(--cb-green);
  border-color: var(--cb-green-line);
  background: var(--cb-green-tint);
}
body.app-dashboard #section-conditions .cs-tag--today {
  color: var(--cb-teal-ink);
  border-color: var(--cb-teal-line);
  background: var(--cb-teal-tint);
}
body.app-dashboard #section-conditions .cs-row-open {
  font-size: 12px;
  font-weight: 600;
  color: var(--cb-brand-2);
  white-space: nowrap;
  justify-self: end;
}

/* the exposure marks — log without leaving the list */
body.app-dashboard #section-conditions .cs-marks {
  display: flex;
  gap: 5px;
  justify-self: end;
}
body.app-dashboard #section-conditions .cs-mark {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--cb-line);
  border-radius: 6px;
  padding: 3px 8px;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--cb-mist);
  background: var(--cb-surface);
  cursor: pointer;
}
body.app-dashboard #section-conditions .cs-mark:hover {
  border-color: var(--cb-green-line);
  color: var(--cb-green);
}
body.app-dashboard #section-conditions .cs-mark.is-on {
  border-color: var(--cb-green-line);
  background: var(--cb-green-tint);
  color: var(--cb-green);
}
body.app-dashboard #section-conditions .cs-mark.is-on::before {
  content: "✓";
  font-size: 9px;
  font-weight: 600;
}
body.app-dashboard #section-conditions .cs-mark:focus-visible {
  outline: 2px solid var(--cb-brand);
  outline-offset: 1px;
}

body.app-dashboard #section-conditions .cs-empty {
  padding: 26px 18px;
  font-size: 13px;
  color: var(--cb-mist);
  text-align: center;
}
body.app-dashboard #section-conditions .cs-empty.is-hidden {
  display: none;
}

/* ---------- condition detail: article + your log ---------- */
body.app-dashboard #section-conditions .cs-detail-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 14px;
}
body.app-dashboard #section-conditions .cs-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--cb-slate);
  border: 1px solid var(--cb-line);
  border-radius: 999px;
  padding: 6px 13px;
  background: var(--cb-surface);
  cursor: pointer;
}
body.app-dashboard #section-conditions .cs-back:hover {
  color: var(--cb-brand-2);
}
body.app-dashboard #section-conditions .cs-mobile-title {
  font-family: var(--cb-display);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--cb-slate);
}

body.app-dashboard #section-conditions .cs-rd {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 22px;
  align-items: start;
}
body.app-dashboard #section-conditions .cs-article {
  background: var(--cb-surface);
  border: 1px solid var(--cb-line);
  border-radius: var(--cb-r);
  box-shadow: var(--cb-sh);
  padding: 28px 34px 22px;
  min-width: 0;
}
body.app-dashboard #section-conditions .cs-article-kicker {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cb-slate);
  border: 1.5px solid currentColor;
  border-radius: 4px;
  padding: 1px 6px;
  opacity: 0.7;
}
body.app-dashboard #section-conditions .cs-article-kicker--guide {
  color: var(--cb-guide);
}
body.app-dashboard #section-conditions .cs-article h3 {
  font-family: var(--cb-display);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.2;
  margin: 10px 0 8px;
  color: var(--cb-ink);
}
body.app-dashboard #section-conditions .cs-prov {
  font-size: 12px;
  color: var(--cb-mist);
  font-weight: 600;
  margin: 0;
}
body.app-dashboard #section-conditions .cs-prov b {
  color: var(--cb-slate);
  font-weight: 700;
}
body.app-dashboard #section-conditions .cs-article-body {
  border-top: 1px solid var(--cb-line);
  margin-top: 14px;
  padding-top: 16px;
  max-width: 65ch;
}
body.app-dashboard #section-conditions .cs-article-body p {
  font-size: 14.5px;
  line-height: 1.66;
  color: #2c3a55;
  margin: 0 0 13px;
}
body.app-dashboard #section-conditions .cs-article-body h4 {
  font-family: var(--cb-display);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--cb-ink);
  margin: 22px 0 9px;
}
body.app-dashboard #section-conditions .cs-article-body h4 em {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--cb-mist);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-right: 8px;
  position: relative;
  top: -1.5px;
}
body.app-dashboard #section-conditions .cs-article-body ul {
  margin: 0 0 13px;
  padding-left: 20px;
  display: grid;
  gap: 6px;
}
body.app-dashboard #section-conditions .cs-article-body li {
  font-size: 14px;
  line-height: 1.58;
  color: #2c3a55;
}
body.app-dashboard #section-conditions .cs-content-review-hold {
  border: 1px solid var(--cb-amber-line);
  background: linear-gradient(180deg, #fdf8ee, #fff);
  border-radius: 11px;
  padding: 14px 16px 2px;
}
body.app-dashboard #section-conditions .cs-content-review-hold h4 {
  margin-top: 0;
}
body.app-dashboard #section-conditions .cs-content-sources {
  border-top: 1px solid var(--cb-line);
  margin-top: 20px;
  padding-top: 13px;
  font-size: 12px;
  color: var(--cb-mist);
}
body.app-dashboard #section-conditions .cs-content-sources ul {
  margin-top: 8px;
}
body.app-dashboard #section-conditions .cs-content-sources a {
  color: var(--cb-brand-2);
  overflow-wrap: anywhere;
}
body.app-dashboard #section-conditions .cs-nevermiss {
  border: 1px solid var(--cb-amber-line);
  background: linear-gradient(180deg, #fdf6e8, #fff);
  border-radius: 11px;
  padding: 13px 16px;
  margin: 16px 0;
}
body.app-dashboard #section-conditions .cs-nevermiss-kicker {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cb-amber-ink);
  margin-bottom: 6px;
}
body.app-dashboard #section-conditions .cs-nevermiss ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 5px;
}
body.app-dashboard #section-conditions .cs-nevermiss li {
  font-size: 13.5px;
  line-height: 1.55;
}
body.app-dashboard #section-conditions .cs-article-foot {
  border-top: 1px solid var(--cb-line);
  margin-top: 18px;
  padding-top: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
body.app-dashboard #section-conditions .cs-foot-nav,
body.app-dashboard #section-conditions .cs-foot-read {
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 4px 2px;
  color: var(--cb-brand-2);
}
body.app-dashboard #section-conditions .cs-foot-nav:disabled {
  color: var(--cb-mist);
  opacity: 0.55;
  cursor: default;
}
body.app-dashboard #section-conditions .cs-foot-read {
  margin: 0 auto;
  border: 1px solid var(--cb-line);
  border-radius: 999px;
  padding: 6px 14px;
  color: var(--cb-slate);
  background: var(--cb-surface);
}
body.app-dashboard #section-conditions .cs-foot-read.is-read {
  border-color: var(--cb-green-line);
  background: var(--cb-green-tint);
  color: var(--cb-green);
}

/* your log rail */
body.app-dashboard #section-conditions .cs-log {
  border: 1px solid var(--cb-line);
  border-radius: var(--cb-r);
  background: var(--cb-surface);
  box-shadow: var(--cb-sh);
  overflow: hidden;
  position: sticky;
  top: 76px;
}
body.app-dashboard #section-conditions .cs-log-head {
  padding: 13px 16px 11px;
  border-bottom: 1px solid var(--cb-line-soft);
}
body.app-dashboard #section-conditions .cs-log-kicker {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--cb-mist);
}
body.app-dashboard #section-conditions .cs-log-head b {
  display: block;
  font-family: var(--cb-display);
  font-size: 13.5px;
  font-weight: 700;
  margin-top: 3px;
  color: var(--cb-ink);
}
body.app-dashboard #section-conditions .cs-logrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--cb-line-soft);
  cursor: pointer;
}
body.app-dashboard #section-conditions .cs-logrow:first-of-type {
  border-top: 0;
}
body.app-dashboard #section-conditions .cs-logrow input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
body.app-dashboard #section-conditions .cs-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid #cdd7e6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  background: var(--cb-surface);
}
body.app-dashboard #section-conditions .cs-logrow input:checked + .cs-checkbox {
  background: var(--cb-green);
  border-color: var(--cb-green);
}
body.app-dashboard #section-conditions .cs-logrow input:checked + .cs-checkbox::before {
  content: "✓";
}
body.app-dashboard #section-conditions .cs-logrow input:focus-visible + .cs-checkbox {
  outline: 2px solid var(--cb-brand);
  outline-offset: 1px;
}
body.app-dashboard #section-conditions .cs-logrow input:disabled + .cs-checkbox {
  opacity: 0.5;
}
body.app-dashboard #section-conditions .cs-logrow-main {
  flex: 1;
  min-width: 0;
}
body.app-dashboard #section-conditions .cs-logrow-main b {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--cb-ink);
}
body.app-dashboard #section-conditions .cs-logrow-main small {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--cb-mist);
}
body.app-dashboard #section-conditions .cs-when {
  font-size: 10.5px;
  color: var(--cb-mist);
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
body.app-dashboard #section-conditions .cs-reflect {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--cb-line-soft);
}
body.app-dashboard #section-conditions .cs-reflect-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
body.app-dashboard #section-conditions .cs-save-note {
  font-size: 10px;
  font-weight: 600;
  color: var(--cb-green);
}
body.app-dashboard #section-conditions .cs-reflect textarea {
  width: 100%;
  border: 1px solid var(--cb-line);
  border-radius: 9px;
  background: var(--cb-ground);
  padding: 9px 11px;
  font: inherit;
  font-size: 12px;
  color: var(--cb-ink);
  line-height: 1.5;
  margin-top: 8px;
  resize: vertical;
}
body.app-dashboard #section-conditions .cs-reflect textarea:focus {
  outline: none;
  border-color: var(--cb-brand);
  background: var(--cb-surface);
}
body.app-dashboard #section-conditions .cs-reflect-sub {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--cb-mist);
  margin-top: 12px;
}
body.app-dashboard #section-conditions .cs-hint {
  padding: 11px 16px 13px;
  border-top: 1px solid var(--cb-line-soft);
  font-size: 11.5px;
  color: var(--cb-mist);
  line-height: 1.5;
  margin: 0;
}
body.app-dashboard #section-conditions .cs-hint a {
  color: var(--cb-brand-2);
  font-weight: 500;
  text-decoration: none;
}

/* ---------- how-to guides ---------- */
body.app-dashboard #section-conditions .cs-guides-intro {
  margin: 14px 2px 12px;
  font-size: 13px;
  color: var(--cb-slate);
}
body.app-dashboard #section-conditions .cs-guide-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 4px 13px;
  align-items: center;
  padding: 12px 18px;
  border-top: 1px solid var(--cb-line-soft);
  cursor: pointer;
}
body.app-dashboard #section-conditions .cs-guide-row:first-child {
  border-top: 0;
}
body.app-dashboard #section-conditions .cs-guide-row:hover {
  background: #fbfcfe;
}
body.app-dashboard #section-conditions .cs-guide-ico {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--cb-guide-tint);
  color: var(--cb-guide);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  font-size: 12px;
  font-weight: 600;
}
body.app-dashboard #section-conditions .cs-guide-meta {
  font-size: 11.5px;
  color: var(--cb-mist);
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
body.app-dashboard #section-conditions #cs-guide-reader.is-hidden,
body.app-dashboard #section-conditions #cs-guides-view.is-hidden {
  display: none;
}
body.app-dashboard #section-conditions .cs-article--guide {
  max-width: 860px;
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  body.app-dashboard #section-conditions .cs-body {
    grid-template-columns: 1fr;
  }
  body.app-dashboard #section-conditions .cs-rail {
    position: static;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
  }
  body.app-dashboard #section-conditions .cs-rail-label {
    display: none;
  }
  body.app-dashboard #section-conditions .cs-rail a {
    border: 1px solid var(--cb-line);
    background: var(--cb-surface);
  }
  body.app-dashboard #section-conditions .cs-rd {
    grid-template-columns: 1fr;
  }
  body.app-dashboard #section-conditions .cs-log {
    position: static;
  }
}
@media (max-width: 700px) {
  body.app-dashboard #section-conditions .cs-stats {
    grid-template-columns: 1fr;
  }
  body.app-dashboard #section-conditions .cs-row {
    grid-template-columns: minmax(0, 1fr);
  }
  body.app-dashboard #section-conditions .cs-marks,
  body.app-dashboard #section-conditions .cs-row-open {
    justify-self: start;
  }
  body.app-dashboard #section-conditions .cs-search {
    margin-left: 0;
    flex: 1;
  }
  body.app-dashboard #section-conditions .cs-search input {
    width: 100%;
  }
  body.app-dashboard #section-conditions .cs-article {
    padding: 20px 18px 18px;
  }
  body.app-dashboard #section-conditions .cs-guide-row {
    grid-template-columns: auto minmax(0, 1fr);
  }
  body.app-dashboard #section-conditions .cs-guide-meta,
  body.app-dashboard #section-conditions .cs-guide-row .cs-row-open {
    grid-column: 2;
  }
}

@keyframes cs-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
@media (prefers-reduced-motion: reduce) {
  body.app-dashboard #section-conditions .cs-band-kicker i {
    animation: none;
  }
}


/* Quick-log marks write to the logbook — on touch screens they need real
   size (were ~20px tall dead-centre in a row that also opens the chapter). */
@media (max-width: 768px) {
  body.app-dashboard #section-conditions .cs-mark {
    min-height: 38px;
    padding: 6px 11px;
    font-size: 11px;
    border-radius: 9px;
  }
  body.app-dashboard #section-conditions .cs-marks {
    gap: 7px;
  }
  body.app-dashboard #section-conditions .cs-row-open {
    position: relative;
  }
  body.app-dashboard #section-conditions .cs-row-open::after {
    content: "";
    position: absolute;
    inset: -14px -10px;
  }
}

/* ============================================================================
   Casebook design refresh (2026-07-13): collection mechanics. Mobile-first —
   the cover, tiles, meters and log bar exist ONLY at <=768px; desktop keeps
   the classic two-pane and stat cards untouched.
   ========================================================================= */

/* new elements hidden on desktop */
#cs-cover,
body.app-dashboard #section-conditions .cs-tile,
body.app-dashboard #section-conditions .cs-meter,
body.app-dashboard #section-conditions .cs-mlabels,
body.app-dashboard #section-conditions .cs-rail-ring {
  display: none;
}

/* toast + celebration + sheets are viewport-level (any width, but only
   reachable from mobile flows) */
.cs-toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 150px);
  z-index: 3200;
  background: #0d2a5c;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 11px 16px;
  border-radius: 999px;
  box-shadow: 0 16px 40px rgba(6, 14, 32, 0.5);
  display: flex;
  gap: 14px;
  align-items: center;
  white-space: nowrap;
}
.cs-toast button {
  border: none;
  background: none;
  color: #8fb7ff;
  font: 600 12.5px var(--font-application-ui);
  cursor: pointer;
  padding: 6px;
  margin: -6px;
}

.cs-celebrate {
  position: fixed;
  inset: 0;
  z-index: 3300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 16, 34, 0.42);
  animation: cs-fade-in 200ms ease;
}
.cs-celebrate-card {
  position: relative;
  background: linear-gradient(165deg, #0d2a5c, #123b82);
  color: #fff;
  border-radius: 22px;
  padding: 26px 28px 22px;
  width: min(84vw, 330px);
  text-align: center;
  box-shadow: 0 30px 70px rgba(4, 10, 24, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  animation: cs-pop-in 320ms cubic-bezier(0.2, 1.4, 0.4, 1);
}
.cs-celebrate-medal {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(160deg, #f4c545, #d9a514);
  color: #5d4703;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(217, 165, 20, 0.5);
}
.cs-celebrate-medal svg { width: 24px; height: 24px; }
.cs-celebrate-card b { font-size: 15px; letter-spacing: -0.01em; }
.cs-celebrate-card > span:not(.cs-celebrate-medal):not(.cs-celebrate-spark) { font-size: 12px; color: #c7d7f3; }
.cs-celebrate-card button {
  margin-top: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font: 600 12px var(--font-application-ui);
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
}
.cs-celebrate-spark {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #f4c545;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: cs-spark 700ms ease-out forwards;
}
.cs-celebrate-spark--a { top: -6px; left: 22%; }
.cs-celebrate-spark--b { top: -10px; right: 18%; width: 9px; height: 9px; animation-delay: 90ms; }
@keyframes cs-pop-in { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes cs-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cs-spark { 0% { transform: translateY(4px) scale(0.4); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateY(-10px) scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .cs-celebrate, .cs-celebrate-card, .cs-celebrate-spark { animation: none; }
}

/* milestone sheet rows + note sheet fields */
.cs-ms-list { display: flex; flex-direction: column; margin-top: 10px; }
.cs-ms-row { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 1px solid #f0f3f9; }
.cs-ms-row:last-child { border-bottom: 0; }
.cs-ms-row.is-locked { opacity: 0.55; }
.cs-ms-copy b { display: block; font-size: 13.5px; color: #16233f; }
.cs-ms-copy small { font-size: 11.5px; color: #8a97ad; }
.cs-medal {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.cs-medal svg { width: 13px; height: 13px; }
.cs-medal--earned { background: linear-gradient(160deg, #f4c545, #d9a514); color: #5d4703; box-shadow: 0 3px 9px rgba(217, 165, 20, 0.45); }
.cs-medal--locked { background: rgba(120, 138, 170, 0.12); border: 1.5px dashed #c2cddf; }
.cs-note-field { display: block; margin-top: 12px; }
.cs-note-field span { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #8a97ad; margin-bottom: 6px; }
.cs-note-field textarea {
  width: 100%;
  border: 1px solid #e6e8f3;
  border-radius: 12px;
  padding: 10px 12px;
  font: 500 13.5px/1.5 var(--font-application-ui);
  color: #16233f;
  resize: vertical;
}

/* ward pearl (renders on desktop too — it's content, and on-brand there) */
body.app-dashboard #section-conditions .cs-pearl {
  margin-top: 16px;
  border-radius: 16px;
  padding: 13px 15px;
  background: linear-gradient(160deg, #0d2a5c, #123b82);
  color: #fff;
  box-shadow: 0 12px 30px -14px rgba(8, 31, 71, 0.55);
}
body.app-dashboard #section-conditions .cs-pearl-kicker {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9fd9cd;
}
body.app-dashboard #section-conditions .cs-pearl p { margin: 7px 0 0; font-size: 13px; line-height: 1.6; color: #dbe7fb; }

/* ---------------- mobile collection look ---------------- */
@media (max-width: 768px) {
  /* the cover replaces the desktop stat cards */
  #cs-cover {
    display: block;
    position: relative;
    border-radius: 20px;
    padding: 16px 16px 13px;
    color: #fff;
    overflow: hidden;
    background:
      radial-gradient(150% 110% at 100% 0%, rgba(14, 159, 136, 0.55), transparent 55%),
      radial-gradient(120% 130% at 0% 110%, rgba(31, 111, 214, 0.4), transparent 55%),
      linear-gradient(160deg, #0a1f44, #0d2a5c 55%, #10395f);
    box-shadow: 0 18px 40px -16px rgba(8, 31, 71, 0.6);
  }
  #cs-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1.4px);
    background-size: 16px 16px;
    opacity: 0.5;
    pointer-events: none;
  }
  #cs-cover .cs-cover-row { display: flex; align-items: center; gap: 14px; position: relative; }
  #cs-cover .cs-arc { position: relative; width: 78px; height: 78px; flex: none; display: block; }
  #cs-cover .cs-arc svg { position: absolute; inset: 0; }
  #cs-cover .cs-arc-fill { transition: stroke-dashoffset 600ms cubic-bezier(0.22, 1, 0.36, 1); }
  #cs-cover .cs-arc-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
  #cs-cover .cs-arc-num b { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
  #cs-cover .cs-arc-num b i { font-style: normal; color: #9db9e8; font-size: 12px; }
  #cs-cover .cs-arc-num small { font-size: 8px; font-weight: 600; letter-spacing: 0.1em; color: #9fd9cd; margin-top: 3px; }
  #cs-cover .cs-cover-main { min-width: 0; flex: 1; display: block; }
  #cs-cover .cs-cover-kicker { display: block; font-size: 10.5px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: #9fd9cd; }
  #cs-cover .cs-cover-title { display: block; font-size: 16px; font-weight: 600; letter-spacing: -0.015em; margin-top: 3px; }
  #cs-cover .cs-cover-pills { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
  #cs-cover .cs-cpill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.18);
  }
  #cs-cover .cs-cpill svg { width: 10px; height: 12px; }
  #cs-cover .cs-cpill--week { color: #9fe8d6; }
  #cs-cover .cs-cover-shelf {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 13px;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: inherit;
    position: relative;
  }
  #cs-cover .cs-cover-shelf .cs-medal { width: 26px; height: 26px; }
  #cs-cover .cs-cover-shelf .cs-medal svg { width: 11px; height: 11px; }
  #cs-cover .cs-cover-shelf .cs-medal--locked { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.28); }
  #cs-cover .cs-shelf-more { margin-left: auto; font-size: 11.5px; font-weight: 600; color: #9db9e8; }

  body.app-dashboard #section-conditions .cs-stats { display: none; }

  /* chapters rail -> one-line chip row with progress rings */
  body.app-dashboard #section-conditions .cs-body { display: block; }
  body.app-dashboard #section-conditions .cs-rail { width: auto; border: none; background: none; padding: 0; margin-bottom: 4px; }
  body.app-dashboard #section-conditions .cs-rail-label { display: none; }
  body.app-dashboard #section-conditions #cs-chapters-list {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 2px 8px;
  }
  body.app-dashboard #section-conditions #cs-chapters-list::-webkit-scrollbar { display: none; }
  body.app-dashboard #section-conditions #cs-chapters-list a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 600;
    padding: 8px 13px;
    border-radius: 999px;
    border: 1px solid #e6e8f3;
    background: #fff;
    color: #5d6b84;
    flex: none;
  }
  body.app-dashboard #section-conditions #cs-chapters-list a.is-active { background: #16233f; border-color: #16233f; color: #fff; }
  body.app-dashboard #section-conditions #cs-chapters-list a i { display: none; }
  body.app-dashboard #section-conditions .cs-rail-ring { display: inline-flex; width: 13px; height: 13px; }
  body.app-dashboard #section-conditions .cs-rail-ring svg { width: 13px; height: 13px; }
  body.app-dashboard #section-conditions .cs-rail-count { font-size: 10px; opacity: 0.8; }

  /* specimen rows */
  body.app-dashboard #section-conditions .cs-row { align-items: flex-start; gap: 12px; }
  body.app-dashboard #section-conditions .cs-tile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    font-size: 14px;
    font-weight: 600;
    flex: none;
    position: relative;
    background: #eef1f7;
    color: #a4b0c4;
    margin-top: 2px;
  }
  body.app-dashboard #section-conditions .cs-tile--complete {
    background: linear-gradient(160deg, #0e9f88, #12c2a6) !important;
    color: #fff !important;
  }
  body.app-dashboard #section-conditions .cs-tile-medal {
    position: absolute;
    right: -5px;
    bottom: -5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(160deg, #f4c545, #d9a514);
    border: 2px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5d4703;
    font-style: normal;
  }
  body.app-dashboard #section-conditions .cs-tile-medal svg { width: 8px; height: 8px; }
  body.app-dashboard #section-conditions .cs-meter { display: flex; gap: 3px; margin-top: 8px; }
  body.app-dashboard #section-conditions .cs-meter i { flex: 1; height: 5px; border-radius: 3px; background: #e8ecf4; }
  body.app-dashboard #section-conditions .cs-meter i.is-on { background: #0e9f88; }
  body.app-dashboard #section-conditions .cs-mlabels { display: flex; gap: 3px; margin-top: 3px; }
  body.app-dashboard #section-conditions .cs-mlabels span { flex: 1; text-align: center; font-size: 8.5px; font-weight: 500; letter-spacing: 0.06em; color: #b3bfd2; }
  body.app-dashboard #section-conditions .cs-mlabels span.is-on { color: #0b7f6d; }
  /* unseen rows stay quiet so filled ones feel earned */
  body.app-dashboard #section-conditions .cs-row:not(.cs-row--logged) .cs-row-title b { color: #5d6b84; }

  /* reader = pushed page: hide the library chrome behind it */
  #section-conditions.cs-reader-open .cs-header,
  #section-conditions.cs-reader-open #cs-cover,
  #section-conditions.cs-reader-open .cs-tabs,
  #section-conditions.cs-reader-open .cs-band,
  #section-conditions.cs-reader-open .cs-filters { display: none !important; }
  /* the in-article log rail duplicates the pinned bar on mobile */
  #section-conditions.cs-reader-open .cs-log { display: none; }
  #section-conditions.cs-reader-open .cs-article { border: none; box-shadow: none; background: none; padding: 0; }
  /* reserve room for the pinned bar */
  #section-conditions.cs-reader-open .cs-detail { padding-bottom: 150px; }

  /* pinned log bar */
  .cs-logbar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 76px);
    z-index: 1300;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #e6e8f3;
    border-radius: 18px;
    box-shadow: 0 -12px 40px rgba(10, 22, 44, 0.2);
    padding: 11px 12px;
  }
  .cs-logbar.is-complete { border-color: #bfe6d8; background: linear-gradient(180deg, #f2fbf8, #fff); }
  .cs-logbar-row { display: flex; gap: 7px; align-items: center; }
  .cs-logbar .cs-logbar-mark {
    flex: 1;
    min-width: 0;
    height: 40px;
    border-radius: 11px;
    border: 1.5px solid #e6e8f3;
    background: #fff;
    font: 600 11.5px var(--font-application-ui);
    color: #8a97ad;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }
  .cs-logbar .cs-logbar-mark.is-on { background: #e9f8f3; border-color: #bfe6d8; color: #0b7f6d; }
  .cs-logbar .cs-logbar-mark svg { width: 10px; height: 10px; }
  .cs-logbar .cs-logbar-mark:active { transform: scale(0.94); }
  .cs-logbar-note {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #bfe6d8;
    background: #e9f8f3;
    color: #0b7f6d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
  }
  .cs-logbar-note svg { width: 15px; height: 15px; }
  .cs-logbar-hint { margin: 8px 2px 0; font-size: 11px; color: #8a97ad; }
  .cs-logbar.is-complete .cs-logbar-hint { color: #0b7f6d; font-weight: 500; }
}

/* mobile polish: rows are compact specimen cards (whole row = open target) */
@media (max-width: 768px) {
  body.app-dashboard #section-conditions .cs-row-open,
  body.app-dashboard #section-conditions .cs-row-desc { display: none; }
  /* one-line filter rail: chips + search scroll together */
  body.app-dashboard #section-conditions .cs-filters {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 7px;
    padding-bottom: 6px;
  }
  body.app-dashboard #section-conditions .cs-filters::-webkit-scrollbar { display: none; }
  body.app-dashboard #section-conditions .cs-chip { flex: none; }
  body.app-dashboard #section-conditions .cs-search { flex: none; min-width: 190px; }
}

/* ===== declutter layer: the cover is the page's one identity moment =====
   Rows are native grammar (title + the four log buttons); the session band
   drops its teal gradient + pulse for a quiet hairline card. Tile/meter/
   ring/count rules above are dead — app.js no longer emits those nodes. */
@media (max-width: 768px) {
  body.app-dashboard #section-conditions .cs-row {
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
  }
  body.app-dashboard #section-conditions .cs-row-title b { font-size: 14.5px; }
}
body.app-dashboard #section-conditions .cs-band {
  background: #fff;
  border-color: #e6ebf3;
  box-shadow: none;
}
body.app-dashboard #section-conditions .cs-band-kicker i {
  animation: none;
}

/* ===== v3 structure: search-first + native list grammar ===== */

/* full-width lead search — the page's primary control */
body.app-dashboard #section-conditions .cs-search--lead {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  padding: 0 14px;
  background: #eef1f6;
  border: 1px solid transparent;
  border-radius: 13px;
  color: #8a97ad;
}
body.app-dashboard #section-conditions .cs-search--lead:focus-within {
  background: #fff;
  border-color: #1f6fd6;
  box-shadow: 0 0 0 4px rgba(31, 111, 214, 0.10);
}
body.app-dashboard #section-conditions .cs-search--lead svg { width: 17px; height: 17px; flex: none; }
body.app-dashboard #section-conditions .cs-search--lead input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  outline: none;
  font: inherit;
  font-size: 16px;
  color: #16233f;
}

/* one segmented filter under the search */
body.app-dashboard #section-conditions .cs-filters--seg {
  display: flex;
  gap: 4px;
  margin-top: 10px;
  padding: 4px;
  background: #eef1f6;
  border-radius: 12px;
  overflow: visible;
}
body.app-dashboard #section-conditions .cs-filters--seg .cs-chip {
  flex: 1;
  min-height: 38px;
  margin: 0;
  padding: 0 8px;
  border: none;
  border-radius: 9px;
  background: none;
  color: #5d6b84;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
body.app-dashboard #section-conditions .cs-filters--seg .cs-chip.is-active {
  background: #fff;
  color: #1f6fd6;
  box-shadow: 0 2px 8px -2px rgba(22, 35, 63, 0.18);
}

@media (max-width: 768px) {
  /* the chapter rail's jump job is replaced by search + sticky headers */
  body.app-dashboard #section-conditions .cs-rail { display: none; }

  /* sticky section headers — rows slide underneath, iOS-list style */
  body.app-dashboard #section-conditions .cs-cat {
    position: sticky;
    top: 0;
    z-index: 5;
    background: rgba(246, 248, 252, 0.94);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    padding: 12px 18px 8px;
  }

  /* rows breathe: title line + roomy 44px log buttons */
  body.app-dashboard #section-conditions .cs-row {
    flex-direction: column;
    align-items: stretch;
    gap: 9px;
    padding: 14px 16px 15px;
  }
  body.app-dashboard #section-conditions .cs-row-title b { font-size: 15.5px; }
  body.app-dashboard #section-conditions .cs-marks {
    display: flex;
    gap: 8px;
    width: 100%;
  }
  body.app-dashboard #section-conditions .cs-marks .cs-mark {
    flex: 1;
    min-height: 44px;
    font-size: 13px;
  }
}

/* header ↔ cover breathing room (the subtitle was colliding with the card) */
body.app-dashboard #section-conditions .cs-header h2 { margin: 0 0 6px; }
body.app-dashboard #section-conditions .cs-header .card-subtitle { margin: 0 0 16px; line-height: 1.45; }
#cs-cover { margin-top: 4px; }

/* =========================================================================
   MLA REVISION — the national GMC content-map checklist mode.

   Scoped to body.app-dashboard #section-conditions like the rest of this
   sheet, and built from the same --cb-* aliases so it cannot drift from the
   page it lives in. No !important: every override below is written at full
   `body.app-dashboard #section-conditions.cs-mla-open` specificity so it
   out-weighs the base rules rather than shouting over them.

   One colour rule matters more than the others: REVISED IS BRAND BLUE, NEVER
   --cb-green. Green is the exposure "logged" fill on this page, and the two
   progress meanings must never share a colour.
   ========================================================================= */

/* --- placement chrome off: the national list has no placement --- */
body.app-dashboard #section-conditions.cs-mla-open #cs-cover,
body.app-dashboard #section-conditions.cs-mla-open .cs-stats,
/* The timetable band carries one-tap EXPOSURE logging. app.js suppresses it by
   mode, but renderSessionBand() re-runs on resume, on reconnect and on every
   condition save, so this is the backstop: even if a future JS path forgets the
   mode, the band cannot be painted over the national list. Mirrors the
   .cs-reader-open rule above. */
body.app-dashboard #section-conditions.cs-mla-open .cs-band,
/* The context band reads "Year 5 · Paediatrics · Northwick Park". Leaving that
   standing over a national assessment framework would be the single most
   misleading thing this page could say, so the mode states its own scope
   instead (.mla-scope) rather than rewriting a node app.js owns. */
body.app-dashboard #section-conditions.cs-mla-open .pf-pagecontext {
  display: none;
}

body.app-dashboard #section-conditions .mla-head {
  padding-top: 16px;
}
body.app-dashboard #section-conditions .mla-scope {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--cb-slate);
  margin: 0 2px 2px;
}
body.app-dashboard #section-conditions .mla-scope-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cb-brand);
  flex: none;
  /* Centre on the first line, including when the source text wraps. */
  margin-top: calc(0.75em - 3px);
}

/* --- head --- */
body.app-dashboard #section-conditions .mla-h {
  font-family: var(--cb-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.022em;
  color: var(--cb-ink);
  margin: 16px 0 0;
}
body.app-dashboard #section-conditions .mla-h:focus-visible {
  outline: 2px solid var(--cb-brand);
  outline-offset: 3px;
}
body.app-dashboard #section-conditions .mla-lede {
  font-size: 13px;
  line-height: 1.5;
  color: var(--cb-slate);
  margin: 6px 2px 0;
  max-width: 68ch;
}
/* The honest framing stays one click away rather than eating the first
   screen — a revision tool should open on the list. */
body.app-dashboard #section-conditions .mla-about {
  margin: 4px 2px 0;
}
body.app-dashboard #section-conditions .mla-about > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--cb-brand-2);
  cursor: pointer;
  list-style: none;
  padding: 4px 0;
  min-height: 24px;
}
body.app-dashboard #section-conditions .mla-about > summary::-webkit-details-marker {
  display: none;
}
body.app-dashboard #section-conditions .mla-about > summary::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 160ms ease;
}
body.app-dashboard #section-conditions .mla-about[open] > summary::before {
  transform: rotate(45deg);
}
body.app-dashboard #section-conditions .mla-about > summary:focus-visible {
  outline: 2px solid var(--cb-brand);
  outline-offset: 2px;
  border-radius: 4px;
}
body.app-dashboard #section-conditions .mla-about-body {
  border-left: 2px solid var(--cb-line);
  padding: 2px 0 2px 12px;
  margin: 6px 0 0;
  max-width: 72ch;
}
body.app-dashboard #section-conditions .mla-about-body p {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--cb-slate);
  margin: 0 0 8px;
}
body.app-dashboard #section-conditions .mla-src {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--cb-mist);
}
body.app-dashboard #section-conditions .mla-src b {
  color: var(--cb-slate);
  font-weight: 600;
}
body.app-dashboard #section-conditions .mla-src a {
  color: var(--cb-brand-2);
  font-weight: 600;
}

/* --- overview meters --- */
body.app-dashboard #section-conditions .mla-meters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}
body.app-dashboard #section-conditions .mla-meter {
  border: 1px solid var(--cb-line);
  border-radius: var(--cb-r);
  background: var(--cb-surface);
  box-shadow: var(--cb-sh);
  padding: 13px 15px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
body.app-dashboard #section-conditions .mla-meter-num {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--cb-ink);
  font-variant-numeric: tabular-nums;
}
body.app-dashboard #section-conditions .mla-meter-num em {
  font-style: normal;
  font-size: 12px;
  font-weight: 500;
  color: var(--cb-mist);
  margin-left: 5px;
}
body.app-dashboard #section-conditions .mla-meter-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--cb-slate);
}
body.app-dashboard #section-conditions .mla-meter-desc {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--cb-mist);
}
body.app-dashboard #section-conditions .mla-bar {
  height: 5px;
  border-radius: 999px;
  background: var(--cb-line-soft);
  overflow: hidden;
  margin-top: 8px;
}
body.app-dashboard #section-conditions .mla-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--cb-brand);
  transition: width 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- resume --- */
body.app-dashboard #section-conditions .mla-resume {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid var(--cb-line);
  border-radius: var(--cb-r-sm);
  background: var(--cb-ground);
}
body.app-dashboard #section-conditions .mla-resume-text {
  font-size: 12.5px;
  color: var(--cb-slate);
}
body.app-dashboard #section-conditions .mla-resume-btn {
  border: 1px solid #bcd6f5;
  background: var(--cb-brand-tint);
  color: var(--cb-brand-2);
  border-radius: 999px;
  padding: 5px 13px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  min-height: 30px;
}
body.app-dashboard #section-conditions .mla-resume-btn:focus-visible {
  outline: 2px solid var(--cb-brand);
  outline-offset: 2px;
}

/* --- domain sub-tabs (real ARIA tabs) --- */
body.app-dashboard #section-conditions .mla-domains {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 16px;
}
body.app-dashboard #section-conditions .mla-domain:focus-visible {
  outline: 2px solid var(--cb-brand);
  outline-offset: 2px;
}

/* --- controls --- */
body.app-dashboard #section-conditions .mla-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
body.app-dashboard #section-conditions .mla-search {
  margin-left: 0;
  width: 100%;
}
body.app-dashboard #section-conditions .mla-search input {
  width: 100%;
}
body.app-dashboard #section-conditions .mla-filters {
  margin-top: 0;
}
body.app-dashboard #section-conditions .mla-chip-count {
  opacity: 0.75;
  font-weight: 500;
}
/* Scoped to the MLA filters: the shipped exposure chips are .cs-chip too, and
   restyling them would be a change to an existing control this lane must leave
   alone. The MLA chips all render inside #mla-filters. */
body.app-dashboard #section-conditions .mla-filters .cs-chip:focus-visible {
  outline: 2px solid var(--cb-brand);
  outline-offset: 2px;
}

/* --- body: rail + list --- */
body.app-dashboard #section-conditions .mla-body {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 22px;
  margin-top: 16px;
  align-items: start;
}
body.app-dashboard #section-conditions .mla-rail[hidden] {
  display: none;
}
/* Search results have no rail, so the grid must give the list the full width
   rather than leaving it standing in the rail's 208px track. */
body.app-dashboard #section-conditions .mla-body.is-railless {
  grid-template-columns: minmax(0, 1fr);
}
body.app-dashboard #section-conditions .mla-rail a {
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr) auto;
  grid-template-areas: "dot name count" ". bar bar";
  gap: 4px 9px;
  align-items: center;
}
body.app-dashboard #section-conditions .mla-rail a i {
  grid-area: dot;
}
body.app-dashboard #section-conditions .mla-rail-name {
  grid-area: name;
  min-width: 0;
  overflow-wrap: anywhere;
}
body.app-dashboard #section-conditions .mla-rail a .cs-rail-count {
  grid-area: count;
}
/* Per-system progress at the unit a student actually revises in. */
body.app-dashboard #section-conditions .mla-rail-bar {
  grid-area: bar;
  display: block;
  height: 3px;
  border-radius: 999px;
  background: var(--cb-line-soft);
  overflow: hidden;
}
body.app-dashboard #section-conditions .mla-rail-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: var(--cb-brand);
}
body.app-dashboard #section-conditions .mla-rail a:focus-visible {
  outline: 2px solid var(--cb-brand);
  outline-offset: 2px;
}
body.app-dashboard #section-conditions .mla-letters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
body.app-dashboard #section-conditions .mla-letter {
  border: 1px solid var(--cb-line);
  background: var(--cb-surface);
  border-radius: 7px;
  width: 28px;
  height: 28px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--cb-slate);
  cursor: pointer;
}
body.app-dashboard #section-conditions .mla-letter:hover:not(:disabled) {
  border-color: #bcd6f5;
  color: var(--cb-brand-2);
}
body.app-dashboard #section-conditions .mla-letter:disabled {
  color: #c3cfe2;
  cursor: default;
}
body.app-dashboard #section-conditions .mla-letter:focus-visible {
  outline: 2px solid var(--cb-brand);
  outline-offset: 2px;
}

/* The list container deliberately does NOT use .cs-lib: that class sets
   overflow:hidden, which would make any future sticky heading silently fail. */
body.app-dashboard #section-conditions .mla-lib {
  border: 1px solid var(--cb-line);
  border-radius: var(--cb-r);
  background: var(--cb-surface);
  box-shadow: var(--cb-sh);
  min-width: 0;
}
body.app-dashboard #section-conditions .mla-lib:focus-visible {
  outline: 2px solid var(--cb-brand);
  outline-offset: 2px;
}
body.app-dashboard #section-conditions .mla-live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
body.app-dashboard #section-conditions .mla-cat {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 15px 18px 7px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--cb-mist);
}
body.app-dashboard #section-conditions .mla-cat b {
  margin-left: auto;
  color: var(--cb-slate);
  letter-spacing: 0;
  text-transform: none;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* --- row --- */
body.app-dashboard #section-conditions .mla-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: start;
  padding: 11px 18px;
  border-top: 1px solid var(--cb-line-soft);
}
body.app-dashboard #section-conditions .mla-row:hover {
  background: #fbfcfe;
}
body.app-dashboard #section-conditions .mla-box {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  border: 1.5px solid #c3cfe2;
  border-radius: 5px;
  background: var(--cb-surface);
  cursor: pointer;
  flex: none;
  display: grid;
  place-content: center;
  transition: background 140ms ease, border-color 140ms ease;
}
body.app-dashboard #section-conditions .mla-box::before {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0);
  transition: transform 140ms cubic-bezier(0.22, 1, 0.36, 1);
  margin-top: -2px;
}
body.app-dashboard #section-conditions .mla-box:checked {
  background: var(--cb-brand);
  border-color: var(--cb-brand);
}
body.app-dashboard #section-conditions .mla-box:checked::before {
  transform: rotate(-45deg) scale(1);
}
body.app-dashboard #section-conditions .mla-box:focus-visible {
  outline: 2px solid var(--cb-brand);
  outline-offset: 2px;
}
body.app-dashboard #section-conditions .mla-row-main {
  min-width: 0;
  cursor: pointer;
  display: block;
}
body.app-dashboard #section-conditions .mla-row-title {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.012em;
  line-height: 1.35;
  color: var(--cb-ink);
  overflow-wrap: anywhere;
}
/* Revision is an achievement to see, so a revised title keeps its ink rather
   than greying out the way a logged exposure row does. */
body.app-dashboard #section-conditions .mla-row.is-revised .mla-row-title {
  color: var(--cb-ink);
}
body.app-dashboard #section-conditions .mla-row-detail {
  display: block;
  font-size: 12px;
  line-height: 1.45;
  color: var(--cb-mist);
  margin-top: 2px;
  overflow-wrap: anywhere;
}
body.app-dashboard #section-conditions .mla-row-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  justify-self: end;
  flex-wrap: wrap;
  justify-content: flex-end;
}
body.app-dashboard #section-conditions .mla-kind,
body.app-dashboard #section-conditions .mla-row-group {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--cb-mist);
  border: 1px solid var(--cb-line);
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
}
body.app-dashboard #section-conditions .mla-kind {
  color: var(--cb-brand-2);
  border-color: #bcd6f5;
  background: var(--cb-brand-tint);
}
body.app-dashboard #section-conditions .mla-when {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--cb-mist);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* A row ticked under "To revise" stays put until the scope changes, so the
   list never jumps under a thumb and a mis-tap is undone where it happened. */
body.app-dashboard #section-conditions .mla-row.is-just-revised {
  background: var(--cb-brand-tint);
}

/* --- empty --- */
body.app-dashboard #section-conditions .mla-empty {
  padding: 26px 18px 28px;
  text-align: center;
}
body.app-dashboard #section-conditions .mla-empty.is-hidden {
  display: none;
}
body.app-dashboard #section-conditions .mla-empty-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--cb-slate);
  margin: 0;
}
body.app-dashboard #section-conditions .mla-empty-hint {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--cb-mist);
  margin: 7px auto 0;
  max-width: 46ch;
}
body.app-dashboard #section-conditions .mla-empty-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 14px;
}
body.app-dashboard #section-conditions .mla-empty-btn {
  border: 1px solid var(--cb-line);
  background: var(--cb-surface);
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--cb-brand-2);
  cursor: pointer;
  min-height: 32px;
}
body.app-dashboard #section-conditions .mla-empty-btn:hover {
  background: var(--cb-brand-tint);
  border-color: #bcd6f5;
}
body.app-dashboard #section-conditions .mla-empty-btn:focus-visible {
  outline: 2px solid var(--cb-brand);
  outline-offset: 2px;
}

/* --- tablet: the rail stops paying for itself at two columns --- */
@media (max-width: 1023.98px) {
  body.app-dashboard #section-conditions .mla-body {
    grid-template-columns: 176px minmax(0, 1fr);
    gap: 16px;
  }
}

/* --- mobile --- */
@media (max-width: 768px) {
  /* The first screen of a revision tool must reach the list. Everything above
     it is compressed here rather than stacked full-width. */
  body.app-dashboard #section-conditions .mla-head {
    padding-top: 12px;
  }
  body.app-dashboard #section-conditions .mla-scope {
    font-size: 11.5px;
    margin-bottom: 0;
  }
  body.app-dashboard #section-conditions .mla-h {
    font-size: 15px;
    margin-top: 12px;
  }
  body.app-dashboard #section-conditions .mla-lede {
    font-size: 12.5px;
    margin-top: 6px;
  }
  body.app-dashboard #section-conditions .mla-meters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 16px;
  }
  body.app-dashboard #section-conditions .mla-meter {
    padding: 10px 11px 11px;
    gap: 1px;
  }
  body.app-dashboard #section-conditions .mla-meter-num {
    font-size: 16px;
  }
  body.app-dashboard #section-conditions .mla-meter-num em {
    display: block;
    margin-left: 0;
    font-size: 11px;
  }
  body.app-dashboard #section-conditions .mla-meter-label {
    font-size: 11.5px;
  }
  /* "DOMAIN 5" is desktop detail; the label already says which list it is. */
  body.app-dashboard #section-conditions .mla-meter-desc {
    display: none;
  }
  body.app-dashboard #section-conditions .mla-resume {
    margin-top: 10px;
    padding: 9px 12px;
    gap: 8px;
  }
  body.app-dashboard #section-conditions .mla-resume-text {
    font-size: 12px;
  }
  body.app-dashboard #section-conditions .mla-body {
    display: block;
  }
  /* The rail becomes a horizontal scroller above the list: 24 body systems
     cannot be a sidebar on a phone, but they are still the unit of work. */
  body.app-dashboard #section-conditions .mla-rail {
    position: static;
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-bottom: 12px;
    scrollbar-width: none;
  }
  body.app-dashboard #section-conditions .mla-rail::-webkit-scrollbar {
    display: none;
  }
  body.app-dashboard #section-conditions .mla-rail .cs-rail-label {
    display: none;
  }
  body.app-dashboard #section-conditions .mla-rail a {
    grid-template-columns: 6px auto auto;
    grid-template-areas: "dot name count";
    flex: none;
    border: 1px solid var(--cb-line);
    border-radius: 999px;
    padding: 7px 13px;
    min-height: 38px;
    white-space: nowrap;
    background: var(--cb-surface);
  }
  body.app-dashboard #section-conditions .mla-rail-name {
    overflow-wrap: normal;
    white-space: nowrap;
  }
  body.app-dashboard #section-conditions .mla-rail-bar {
    display: none;
  }
  body.app-dashboard #section-conditions .mla-letters {
    flex-wrap: nowrap;
  }
  body.app-dashboard #section-conditions .mla-letter {
    flex: none;
    width: 34px;
    height: 34px;
  }
  body.app-dashboard #section-conditions .mla-row {
    padding: 12px 15px;
    gap: 3px 11px;
    align-items: center;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "box main" ". meta";
  }
  body.app-dashboard #section-conditions .mla-box {
    grid-area: box;
    /* comfortable thumb target without moving the visual box */
    width: 22px;
    height: 22px;
  }
  body.app-dashboard #section-conditions .mla-row-main {
    grid-area: main;
    /* the whole row height is the label, so the tap target is the row */
    padding: 5px 0;
  }
  body.app-dashboard #section-conditions .mla-row-meta {
    grid-area: meta;
    justify-self: start;
    justify-content: flex-start;
    margin-top: 1px;
  }
  body.app-dashboard #section-conditions .mla-row-title {
    font-size: 14.5px;
  }
  /* The parenthetical is the syllabus, so it is clamped rather than dropped —
     more generous than the exposure list, which hides .cs-row-desc entirely
     at this width. Search still matches the whole string. */
  body.app-dashboard #section-conditions .mla-row-detail {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.app-dashboard #section-conditions .mla-bar i,
  body.app-dashboard #section-conditions .mla-box,
  body.app-dashboard #section-conditions .mla-box::before,
  body.app-dashboard #section-conditions .mla-about > summary::before {
    transition: none;
  }
}
