/* The Casegen Workbench's own styles: the case-generation pages, over
   Form Studio's style.css (its tokens, controls, and layout). */

.next-step { background: var(--accent-soft); border-radius: var(--radius); padding: 0.6rem 0.9rem;
  margin-bottom: 1rem; display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.next-step b { color: var(--accent); }
.next-step .btn { margin-top: 0; padding: 0.3rem 0.8rem; text-decoration: none; }
.chip.plainchip { background: #eef1f4; color: var(--ink); font-weight: 500; }
.minibar { display: inline-block; width: 70px; height: 6px; background: var(--border);
  border-radius: 3px; overflow: hidden; vertical-align: middle; }
.minibar i { display: block; height: 100%; background: var(--accent); }
.storypick { margin: 0.15rem 0; }

/* Case Generation, Situations (cases_situations.html) */
.map-head { margin-top: 0.4rem; }
.map-head h2 { margin: 0; }
.map-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 1rem; align-items: start; }
@media (max-width: 900px) { .map-grid { grid-template-columns: 1fr; } }
.map-grid .card { margin-bottom: 0; }
.factor-name { font-weight: 600; }
.wbar { display: block; width: 100%; min-width: 3rem; height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.wbar i { display: block; height: 100%; background: var(--accent); }
.excl { font-size: 0.9rem; padding: 0.15rem 0; }
.rule-meta { font-size: 0.88rem; margin-top: 0.15rem; }
.rule-acts { display: flex; gap: 0.4rem; margin-top: 0.4rem; }
.rule-edit { display: flex; gap: 0.4rem; margin-top: 0.4rem; align-items: center; flex-wrap: wrap; }
.rule-edit input[type=text] { flex: 1; min-width: 12rem; }
.row-end { display: flex; justify-content: flex-end; margin-top: 0.4rem; }
.modal-card.docview { width: min(1100px, 94vw); max-width: none; height: 88vh; margin: 5vh auto; display: flex; flex-direction: column; }
.modal-card.docview iframe { flex: 1; width: 100%; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.quote-en { color: var(--ink); font-size: 0.85rem; margin-top: 0.1rem; }
/* a long job in progress: a large bar that moves even before the first step ends */
.running-card h3 { margin-top: 0; }
.bigbar { height: 14px; border-radius: 7px; background: var(--accent-soft); overflow: hidden; margin: 0.6rem 0 0.8rem; }
.bigbar i { display: block; height: 100%; min-width: 3%; border-radius: 7px; transition: width 0.6s ease;
  background: repeating-linear-gradient(45deg, var(--accent) 0 12px, #2a9a72 12px 24px);
  background-size: 34px 34px; animation: barstripes 1s linear infinite; }
@keyframes barstripes { to { background-position: 34px 0; } }
@media (prefers-reduced-motion: reduce) { .bigbar i { animation: none; } }
.run-count { font-size: 1.05rem; margin: 0 0 0.2rem; }
.map-col { display: grid; gap: 1rem; min-width: 0; }
.family-members { margin: 0.3rem 0 0; font-size: 0.92rem; }
.excl.dropped { opacity: 0.5; }

/* Case Generation, Stories (cases_stories.html) */
.viewswitch { display: inline-flex; gap: 0.2rem; margin-left: 0.8rem; vertical-align: middle; }
.viewswitch .vs { margin: 0; background: none; color: var(--muted); border: 1px solid var(--border);
  padding: 0.15rem 0.7rem; font-size: 0.85rem; border-radius: 999px; font-weight: 600; }
.viewswitch .vs.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }
.sitline { margin-top: 0.2rem; }
.goals { display: grid; gap: 0.4rem; margin: 0.6rem 0; }
table.plan tr.implausible td { background: #fff8ec; }
.covform { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.covform:last-child { border-bottom: 0; }
.bigbar.small { height: 8px; width: 12rem; margin: 0; display: inline-block; vertical-align: middle; }
.bigbar.small i { background: var(--accent); }
.covmiss { margin: 0.3rem 0 0 0.4rem; font-size: 0.9rem; }
table.pairgrid { width: auto; }
table.pairgrid td, table.pairgrid th { text-align: center; padding: 0.3rem 0.6rem; }
table.pairgrid th { text-transform: none; letter-spacing: 0; font-size: 0.85rem; }
table.pairgrid td.ok { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
table.pairgrid td.miss { background: #fdecea; color: var(--danger); font-size: 0.8rem; }
table.pairgrid td.excl { color: #a7b1bb; font-size: 0.8rem; }
/* the situation map's three parts as tabs (cases_situations.html) */
.maptabs { display: flex; flex-wrap: wrap; gap: 0.3rem; border-bottom: 1px solid var(--border); margin-bottom: 0.8rem; }
.maptab { margin: 0 0 -1px; background: none; color: var(--muted); border: 1px solid transparent; border-bottom: 0;
  border-radius: 8px 8px 0 0; padding: 0.5rem 0.9rem; font-weight: 600; }
.maptab:hover { color: var(--accent); filter: none; }
.maptab.on { background: var(--card); color: var(--ink); border-color: var(--border); border-bottom: 1px solid var(--card); }
.maptab .n { font-weight: 500; color: var(--muted); font-size: 0.85rem; margin-left: 0.2rem; }
.maptab .n .open { color: var(--warn); }
.factor-forms { margin-top: 0.25rem; font-weight: 400; display: flex; flex-wrap: wrap; gap: 0.2rem; }
.factor-forms .chip { font-size: 0.72rem; }
.rulefilters { margin-bottom: 0.6rem; }
.rulefilters input[type=text] { width: auto; flex: 1; min-width: 12rem; }
h4.rulegroup { margin: 1rem 0 0.2rem; padding-bottom: 0.2rem; border-bottom: 2px solid var(--accent-soft); }

/* Case Generation, Cases and a batch (cases_generate.html, cases_batch.html) */
.casegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 0.8rem; margin-bottom: 1rem; }
button.casebox { margin: 0; text-align: left; background: var(--card); color: var(--ink); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.8rem 0.9rem; font-weight: 400; display: grid; gap: 0.35rem; align-content: start; }
button.casebox:hover { border-color: var(--accent); filter: none; }
.casebox-head { display: flex; justify-content: space-between; gap: 0.5rem; }
.casebox ul { font-size: 0.9rem; margin: 0; }
.casecard .cv-body { overflow: auto; flex: 1; }
table.kvtable { margin-bottom: 0.8rem; }
table.kvtable th { text-transform: none; letter-spacing: 0; font-size: 0.88rem; width: 35%; font-weight: 600; color: var(--ink); }
.wbar.est i { background: repeating-linear-gradient(90deg, var(--accent) 0 5px, transparent 5px 8px); }
ol.trigger-forms { margin: 0.35rem 0 0.2rem 1.2rem; padding: 0; }
ol.trigger-forms li { margin: 0.15rem 0; }
ul.derivs { margin: 0.35rem 0 0; font-size: 0.88rem; }
ul.derivs li.dropped { opacity: 0.5; text-decoration: line-through; }
.modelrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; }
.modelrow .muted { display: block; font-size: 0.85rem; margin-top: 0.2rem; }
.storyforms { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 900px) { .storyforms { grid-template-columns: 1fr; } }
.formpicks { margin-bottom: 0.6rem; }
.formpicks .vs { margin: 0; background: none; color: var(--muted); border: 1px solid var(--border); padding: 0.2rem 0.8rem;
  border-radius: 999px; font-weight: 600; font-size: 0.88rem; }
.formpicks .vs.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }
.pvpage { position: relative; width: 100%; border: 1px solid var(--border); margin: 0.6rem 0; background: #fff; }
.pvpage img { display: block; width: 100%; height: 100%; }
button.pvbox { position: absolute; margin: 0; padding: 0; background: transparent; border: 2px solid; border-radius: 2px; cursor: pointer; }
button.pvbox:hover { background: rgba(16,122,87,.08); filter: none; }
button.pvbox.blank { border: 1.5px dashed #8a96a2; }
button.pvbox.sel { box-shadow: 0 0 0 3px #f5b94a; }
.field-col { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 1rem); max-height: 90vh; display: flex; flex-direction: column; gap: 0.5rem; }
button.fieldrow { display: flex; gap: 0.4rem; align-items: baseline; width: 100%; margin: 0; text-align: left; background: none;
  color: var(--ink); border: 0; border-bottom: 1px solid var(--border); padding: 0.35rem 0.2rem; font-weight: 400; font-size: 0.9rem; border-radius: 0; }
button.fieldrow:hover, button.fieldrow.on { background: var(--accent-soft); filter: none; }
#field-panel h4 { margin: 0 0 0.2rem; }
.personcard { display: flex; gap: 0.6rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); align-items: flex-start; }
.personcard .sw { width: 1rem; height: 1rem; margin-top: 0.2rem; }
.factor-forms .chip { white-space: normal; overflow-wrap: anywhere; text-align: left; max-width: 100%; }

/* Situations, Overview: events x forms (cases_situations.html) */
.ovwrap { overflow: auto; max-height: 75vh; border: 1px solid var(--border); border-radius: 8px; margin-top: 0.6rem; }
table.ovgrid { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; }
table.ovgrid th, table.ovgrid td { border-bottom: 1px solid var(--border); padding: 0.3rem 0.4rem; vertical-align: middle; }
table.ovgrid thead th { position: sticky; top: 0; background: var(--card); z-index: 2; text-transform: none; letter-spacing: 0;
  font-size: 0.8rem; color: var(--ink); font-weight: 600; max-width: 9.5rem; white-space: normal; text-align: center; }
table.ovgrid th.ov-event { position: sticky; left: 0; background: var(--card); z-index: 1; text-align: left; min-width: 15rem;
  max-width: 19rem; font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 0.88rem; color: var(--ink); }
table.ovgrid thead th.ov-event { z-index: 3; }
table.ovgrid th.ov-event .wbar { display: block; max-width: 8rem; margin-top: 0.15rem; }
table.ovgrid th.ov-empty { color: var(--danger); }
.ov-sub { font-weight: 400; color: var(--muted); font-size: 0.75rem; }
table.ovgrid td { text-align: center; min-width: 6.5rem; }
button.ov-cell { margin: 0; display: inline-flex; gap: 0.3rem; align-items: center; background: var(--card); color: var(--ink);
  border: 1.5px solid var(--border); border-radius: 6px; padding: 0.15rem 0.4rem; font-weight: 400; font-size: 0.8rem; }
button.ov-cell:hover { border-color: var(--accent); filter: none; }
button.ov-cell.assumed { border-style: dashed; border-color: #8a96a2; }
.ov-role { color: #fff; border-radius: 4px; padding: 0 0.35rem; font-size: 0.74rem; white-space: nowrap; max-width: 7rem;
  overflow: hidden; text-overflow: ellipsis; }
.ovdetail { margin-top: 0.8rem; border-top: 2px solid var(--accent-soft); padding-top: 0.6rem; }
ol.trigger-forms li.here { font-weight: 600; }
table.ovgrid th.ov-event button.link { text-align: left; }
/* a wait with no steps to count: the stripe slides across a full-width bar */
.bigbar.indeterminate i { width: 100% !important; }
#plan-running { margin: 0.6rem 0; }
.planned-note { background: #eef3fb; color: #2a5db0; border-radius: 8px; padding: 0.5rem 0.8rem; }
.bigbar.small.planned i { background: repeating-linear-gradient(45deg, #2a5db0 0 6px, #6f93d6 6px 12px); }
table.pairgrid td.ok.planned { background: #eef3fb; color: #2a5db0; }
/* the plan: an action bar on top, the stories grouped by event */
.planbar { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 0.4rem); z-index: 4; display: flex; gap: 0.6rem;
  align-items: center; flex-wrap: wrap; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.6rem 0.8rem; margin: 0.6rem 0; box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.planbar button { margin-top: 0; }
.evgroups { display: grid; gap: 0.4rem; }
details.evgroup { border: 1px solid var(--border); border-radius: 8px; padding: 0.4rem 0.7rem; }
details.evgroup > summary { cursor: pointer; display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; list-style: none; }
details.evgroup > summary::-webkit-details-marker { display: none; }
details.evgroup > summary::before { content: "▸"; color: var(--accent); }
details.evgroup[open] > summary::before { content: "▾"; }
details.evgroup[open] > summary { margin-bottom: 0.4rem; }
details.evgroup.allout { opacity: 0.55; }
.evforms .chip { font-size: 0.72rem; }
.planbar-text { flex: 1 1 22rem; min-width: 0; }
.planbar-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
details.evgroup > summary { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; }
details.evgroup > summary::before { grid-row: 1 / span 2; margin-top: 0.1rem; }
.evhead { display: flex; gap: 0.6rem; align-items: baseline; }
.evforms { grid-column: 2; display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.2rem; }
.writen { display: inline-flex; align-items: center; gap: 0.35rem; }
.writen input { width: 5em; }
.planbar .estimate { flex-basis: 100%; text-align: right; font-size: 0.85rem; }

/* Situations, Forms tab: each form's contract (parts by section, choices, flags) */
details.ctform { border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem 0.8rem; margin-bottom: 0.6rem; background: var(--card); }
details.ctform > summary { cursor: pointer; }
details.ctform h4 { margin: 0.9rem 0 0.3rem; }
.ctsection { border-left: 3px solid var(--border); padding-left: 0.7rem; margin: 0.5rem 0 0.7rem; }
.ctsec-head { margin-bottom: 0.2rem; }
.ctobj summary { cursor: pointer; }
.ctobj .ctgloss { font-weight: 600; }
.ctgroup { border: 1px dashed var(--border); border-radius: 6px; padding: 0.3rem 0.6rem; margin: 0.3rem 0; }
.ctgroup > ul { margin-left: 0.6rem; }
table.ctfields { margin: 0.3rem 0 0.4rem 1rem; width: auto; }
table.ctfields th { width: auto; font-weight: 500; }
table.ctfields tr.flagged td, table.ctfields tr.flagged th { background: #fff4e0; }
table.ctbinds td { vertical-align: top; font-size: 0.9rem; }
.ctbound { cursor: pointer; border: 0; }
.ctflags { background: #fff9ef; border-radius: 6px; padding: 0.3rem 0.7rem; margin: 0.5rem 0; }
@media (prefers-color-scheme: dark) {
  table.ctfields tr.flagged td, table.ctfields tr.flagged th, .ctflags { background: rgba(255, 170, 0, 0.12); }
}
table.ctbinds { table-layout: fixed; width: 100%; }
table.ctbinds td, table.ctbinds code { overflow-wrap: anywhere; word-break: break-word; }
details.ctconds { display: inline; }
details.ctconds summary { display: inline; cursor: pointer; text-decoration: underline dotted; }
details.ctconds ul { margin: 0.2rem 0 0.4rem 1rem; }
table.ctbinds .chip { white-space: normal; display: inline-block; max-width: 100%; }

/* Case Generation, Scenarios: the forest, its pool, its coverage */
.fo-set { gap: 0.8rem; margin: 0.4rem 0; }
.fo-stats { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.6rem 0 0.8rem; }
.fo-stat { border: 1px solid var(--border); border-radius: 6px; padding: 0.35rem 0.7rem; background: var(--card); min-width: 6.5rem; }
.fo-stat b { display: block; font-size: 1.15rem; }
.fo-stat span { color: var(--muted); font-size: 0.85rem; }
.fo-stat.warn b { color: var(--warn); }
details.fo-leaf { border: 1px solid var(--border); border-radius: 6px; padding: 0.45rem 0.7rem; margin-bottom: 0.45rem; background: var(--card); }
details.fo-leaf > summary { cursor: pointer; }
details.fo-leaf.written { border-left: 3px solid var(--accent); }
details.fo-leaf.writing { border-left: 3px solid var(--warn); }
.fo-leaf-text { font-weight: 600; }
.fo-leaf-forms { margin: 0.2rem 0 0 1rem; }
ol.fo-path { margin: 0.5rem 0 0.4rem 1.2rem; }
ol.fo-path li { margin-bottom: 0.15rem; }
.fo-people { font-size: 0.9rem; margin: 0.3rem 0; }
.fo-eff { margin: 0.2rem 0; }
.fo-eff .chip { margin: 0.1rem 0; }
.fo-effform { font-size: 0.85rem; color: var(--muted); margin-right: 0.3rem; }
.fo-conds { font-size: 0.85rem; }
details.fo-tree { border: 1px solid var(--border); border-radius: 6px; padding: 0.45rem 0.7rem; margin-bottom: 0.45rem; }
details.fo-tree > summary { cursor: pointer; }
ul.fo-kids { list-style: none; margin: 0.3rem 0 0.2rem 0; padding-left: 1.1rem; border-left: 2px solid var(--border); }
ul.fo-top { border-left: 0; padding-left: 0; }
li.fo-node { margin: 0.45rem 0; }
li.fo-node .fo-node-text { font-weight: 500; }
li.fo-node.cut > .fo-node-text, li.fo-node.cut > .fo-eff, li.fo-node.cut > .quote { opacity: 0.55; }
li.fo-node.merged > .fo-node-text { opacity: 0.7; }
ol.fo-waiting { margin-left: 1.2rem; }
details.fo-cov { margin-bottom: 0.5rem; }
details.fo-cov > summary { cursor: pointer; }
details.fo-cov ul { margin: 0.3rem 0 0.4rem 1rem; }
details.fo-cov li { margin: 0.2rem 0; }
.fo-leaf-ctx { font-size: 0.88rem; margin: 0.1rem 0 0 1rem; }
.fo-log { max-height: 18rem; overflow: auto; font-size: 0.8rem; white-space: pre-wrap; }

/* Scenarios, Trees: drawn trees, hover labels, overlaps */
.fo-treebar { gap: 1rem; margin: 0.4rem 0 0.6rem; flex-wrap: wrap; }
.fo-legend { font-size: 0.85rem; color: var(--muted); }
.fo-legend .lg { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 0.15rem 0 0.6rem; vertical-align: -1px; }
.fo-legend .lg.common, .fo-dot.common { background: var(--accent); fill: var(--accent); }
.fo-legend .lg.occasional, .fo-dot.occasional { background: #3b82f6; fill: #3b82f6; }
.fo-legend .lg.rare, .fo-dot.rare { background: #d97706; fill: #d97706; }
.fo-legend .lg.inner { background: var(--card); border: 2px solid var(--muted); }
.fo-legend .lg.shared { background: transparent; border: 2px solid #d97706; }
.fo-dot { cursor: pointer; stroke: var(--card); stroke-width: 1.5; }
.fo-dot.inner { fill: var(--card); stroke: var(--muted); stroke-width: 2; }
.fo-dot.cut { fill: #bbb; stroke: #999; }
.fo-dot.merged { fill: var(--card); stroke: #bbb; stroke-dasharray: 2 2; }
.fo-dot:hover { stroke: var(--ink); stroke-width: 2.5; }
.fo-ring { fill: none; stroke: #d97706; stroke-width: 2; }
.fo-edge { fill: none; stroke: #c9ced6; stroke-width: 1.4; }
.fo-edge.cut { stroke-dasharray: 3 3; stroke: #ddd; }
.fo-rootbox { fill: var(--accent); cursor: pointer; }
.fo-roottext { fill: #fff; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.fo-treegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(560px, 1fr)); gap: 0.7rem; }
@media (max-width: 640px) { .fo-treegrid { grid-template-columns: 1fr; } }
.fo-treecard { border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 0.7rem; background: var(--card); min-width: 0; }
.fo-treecard.lit { border-color: #d97706; box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.35); }
.fo-treehead .fo-details { margin-left: 0.4rem; }
.fo-treemeta { font-size: 0.85rem; margin-top: 0.15rem; }
.fo-partners { font-size: 0.85rem; margin-top: 0.25rem; }
.fo-pair { cursor: pointer; border: 0; }
.fo-svgwrap { overflow-x: auto; margin-top: 0.4rem; }
.fo-ovsum { border: 1px solid #f3d9a8; background: #fffaf0; border-radius: 6px; padding: 0.4rem 0.7rem; margin-bottom: 0.6rem; font-size: 0.9rem; }
.fo-ovsum > div { margin-top: 0.3rem; }
.fo-tip { position: fixed; z-index: 50; max-width: 330px; background: var(--card); border: 1px solid var(--border); border-radius: 6px;
  padding: 0.4rem 0.55rem; box-shadow: 0 4px 14px rgba(0,0,0,0.15); font-size: 0.88rem; pointer-events: none; }
.fo-modal-card { max-width: 860px; }
ol.fo-path li.here { font-weight: 600; }
@media (prefers-color-scheme: dark) { .fo-ovsum { background: rgba(217, 119, 6, 0.1); border-color: rgba(217, 119, 6, 0.4); } }
.ov-form { border-top: 1px solid var(--border); margin-top: 0.8rem; padding-top: 0.4rem; } .ov-form h4 { margin: 0.6rem 0 0.2rem; }
.wr-active { margin: 0.2rem 0 0.4rem 0.2rem; font-size: 0.9rem; }

/* Stories, Coverage on the scenarios */
.cv-legend { font-size: 0.85rem; color: var(--muted); margin: 0.2rem 0 0.6rem; }
.cvk { display: inline-block; width: 12px; height: 10px; border-radius: 2px; margin: 0 0.2rem 0 0.7rem; vertical-align: -1px; }
.cvk.w, .cv-bar i.w { background: var(--accent); }
.cvk.s, .cv-bar i.s { background: #9fd3bd; }
.cvk.n, .cv-bar i.n { background: #d7dbe0; }
.cv-form { border-top: 1px solid var(--border); padding: 0.6rem 0 0.4rem; }
.cv-head { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; }
.cv-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: #eef0f3; margin: 0.35rem 0 0.4rem; }
.cv-bar i { display: block; height: 100%; }
.cv-form h4 { margin: 0.5rem 0 0.2rem; }
.cv-sim { border-top: 1px solid var(--border); padding: 0.6rem 0; }
.cv-simgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 0.3rem; }
@media (max-width: 640px) { .cv-simgrid { grid-template-columns: 1fr; } }
details.cv-grp { margin: 0.15rem 0; }
details.cv-grp > summary { cursor: pointer; }
details.cv-grp ul { margin: 0.2rem 0 0.4rem 1.3rem; }
details.cv-grp .cv-write { margin-left: 0.5rem; }
.gap-ex { font-size: 0.88rem; margin: 0.2rem 0 0.3rem 0.4rem; }
.gap-note { width: 22em; margin-left: 0.4rem; } .gap-bar { margin: 0.3rem 0 0.2rem; }
.rule-acts .gap-note { flex: 0 1 22em; width: 22em; }

/* Cases: making a batch, the batch list, and reviewing a batch */
.gen-line { gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.gen-share { margin-top: -0.3rem; font-size: 0.88rem; }
.gen-stories { border: 1px solid var(--border); border-radius: 6px; padding: 0.4rem 0.7rem; margin: 0.4rem 0; max-height: 18rem; overflow: auto; }
table.batches td { vertical-align: top; }
.batch-acts { white-space: nowrap; }
.batchbtn { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.2rem 0.45rem; border: 1px solid var(--border); border-radius: 6px;
  background: var(--card); color: var(--ink); text-decoration: none; font-size: 0.85rem; margin-right: 0.25rem; cursor: pointer; }
.batchbtn:hover { border-color: var(--accent); color: var(--accent); }
.batchbtn.danger { color: var(--danger); }
.batchbtn.danger:hover { border-color: var(--danger); }
.rv-acts button svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 0.2rem; }
.rv-nav .iconbtn { padding: 0.15rem; }
.rv-top { position: sticky; top: 0; z-index: 20; background: var(--bg, #f6f7f9); display: flex; flex-wrap: wrap; gap: 0.6rem 1.2rem;
  align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--border); margin-bottom: 0.8rem; }
.rv-nav { display: flex; gap: 0.4rem; align-items: center; }
.rv-pos { min-width: 5.5em; text-align: center; font-weight: 600; }
.rv-sum { font-size: 0.85rem; width: 100%; }
.rv-headline { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.rv-headline h2 { margin: 0; }
.rv-scenario { margin: 0.5rem 0; }
.rv-acts { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.4rem 0; }
#rv-reject textarea { width: 100%; }
.rv-reviews .rv-review { border-top: 1px solid var(--border); padding: 0.35rem 0; font-size: 0.9rem; }
#rv-addnote textarea { width: 100%; }
.rv-notes h3 { font-size: 0.95rem; margin: 0.6rem 0 0.2rem; }
.rv-notes .rv-note { border-left: 3px solid var(--accent, #c8a200); background: var(--panel, rgba(127,127,127,0.06));
  padding: 0.35rem 0.6rem; margin: 0.35rem 0; font-size: 0.9rem; }
.rv-notes .rv-note > div:first-child { display: flex; gap: 0.5rem; align-items: baseline; }
.rv-notes .rv-note-text { white-space: pre-wrap; }
.rv-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 0.8rem; align-items: start; }
@media (max-width: 900px) { .rv-body { grid-template-columns: 1fr; } }
.rv-form h3 { margin-top: 0; }
.rv-page { display: block; max-width: 100%; height: auto; border: 1px solid var(--border); margin: 0.4rem 0; background: #fff; }
.rv-side { position: sticky; top: 4.5rem; max-height: calc(100vh - 5.5rem); overflow: auto; font-size: 0.88rem; }
.rv-person { margin-bottom: 0.6rem; }
.rv-person table.kvtable th { width: 45%; font-weight: 500; }
.rv-issues { background: #fff4e0; border-radius: 6px; padding: 0.4rem 0.7rem; margin: 0.5rem 0; font-size: 0.9rem; } .rv-issues ul { margin: 0.2rem 0 0 1rem; }
.rv-formhead { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; }
.rv-zoom { display: inline-flex; align-items: center; gap: 0.3rem; }
.rv-zoom .iconbtn { font-size: 1.05rem; line-height: 1; padding: 0.1rem 0.4rem; }
.rv-zpct { min-width: 3.2em; text-align: center; font-size: 0.85rem; color: var(--muted); }
.rv-pages { overflow-x: auto; }
.rv-pages .rv-page { width: calc(100% * var(--z, 1)); max-width: none; cursor: zoom-in; }
body.rv-out .rv-pages .rv-page { cursor: zoom-out; }
body.rv-drag .rv-pages .rv-page { cursor: grab; }
.rv-pages.panning, .rv-pages.panning .rv-page { cursor: grabbing !important; user-select: none; }
.rv-help { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 1.25rem; height: 1.25rem;
  margin-left: 0.3rem; border: 1px solid var(--border); border-radius: 50%; font-size: 0.78rem; font-weight: 600;
  color: var(--muted); cursor: help; }
.rv-help:hover, .rv-help:focus-visible { color: var(--accent); border-color: var(--accent); outline: none; }
.rv-help:hover::after, .rv-help:focus-visible::after { content: attr(data-tip); position: absolute; right: 0; top: 1.6rem; z-index: 30;
  white-space: nowrap; background: var(--card); color: var(--ink); border: 1px solid var(--border); border-radius: 6px;
  padding: 0.35rem 0.55rem; font-weight: 400; font-size: 0.82rem; box-shadow: 0 4px 14px rgba(0,0,0,0.15); }
.batch-stopped { margin-top: 0.25rem; display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.rv-pick { max-width: 28rem; }
.enhance-pages td { vertical-align: top; }
.enh-row { cursor: zoom-in; margin: .6rem 0 1rem; }
.enh-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.enh-pair figure { margin: 0; }
.enh-pair img { width: 100%; border: 1px solid var(--border); border-radius: 4px; background: #fff; }
.enh-pair figcaption { font-size: .85rem; color: var(--muted); text-align: center; }
.enh-zoom { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50; display: flex; flex-direction: column; padding: 2vh 2vw; }
.enh-zoom[hidden] { display: none; }
.enh-zoom-bar { display: flex; align-items: center; background: var(--card, #fff); padding: .4rem .8rem; border-radius: 6px 6px 0 0; }
.enh-zoom-panes { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; min-height: 0; background: var(--border); }
.enh-pane { overflow: auto; background: #fff; }
.enh-pane > div { position: sticky; top: 0; background: #fff; padding: .2rem .5rem; z-index: 1; }
.enh-pane img { display: block; max-width: none; }
/* Stories: each story's case, opened in a modal */
.casebtn { display: inline-flex; align-items: center; gap: .3rem; }
.casebtn svg { width: 16px; height: 16px; }
.modal-card.casemodal { width: min(1400px, 96vw); max-width: none; height: 92vh; margin: 3vh auto;
  display: flex; flex-direction: column; padding: .6rem; }
.modal-card.casemodal iframe { flex: 1; width: 100%; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); }
