.mirror-workspace { position: relative; }

.mini-comparison {
  position: absolute;
  z-index: 180;
  inset: 3.05rem auto auto clamp(.1rem, 1.5vw, 1.4rem);
  width: min(15.25rem, 44%);
  color: #293d35;
}
.mini-comparison-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .12rem .5rem;
  padding-bottom: .28rem;
  border-bottom: 1px solid #b3c1b2;
}
.mini-comparison h2 { margin: 0; font-size: .9rem; }
.mini-comparison-status { color: #4f675b; font-size: .78rem; }
.replay-lamps {
  padding: .15rem 0;
  border: 0;
  background: transparent;
  color: #315e51;
  font: inherit;
  font-size: .76rem;
  text-underline-offset: .22em;
  cursor: pointer;
}
.replay-lamps:hover, .replay-lamps:focus-visible { text-decoration: underline; }
.mini-comparison-open {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
  width: 100%;
  padding: .34rem 0 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.mini-comparison-open:hover .mini-board-heading { color: #155c52; text-decoration: underline; text-underline-offset: .15em; }
.mini-comparison-open:focus-visible { outline: 2px solid #4a937d; outline-offset: 4px; }
.mini-comparison-status { grid-column: 1 / -1; }
.mini-board-heading { display: flex; justify-content: space-between; gap: .3rem; margin-bottom: .27rem; font-size: .75rem; }
.mini-board-heading strong { font-weight: 740; font-variant-numeric: tabular-nums; }
.mini-lamp-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 2px; }
.mini-lamp { aspect-ratio: 1; border-radius: 1px; background: var(--lamp-color); transition: background-color .24s ease; }
.mini-lamp[data-lit="false"] { background: #dddcd1; transition: none; }
.funnel-flight-layer { position: absolute; inset: 0; z-index: 190; pointer-events: none; }
.funnel-flight {
  position: absolute;
  display: grid;
  gap: 2px;
  transform-origin: top left;
}
.funnel-flight-label {
  position: absolute;
  transform: translate(-50%, calc(-100% - 4px));
  padding: .14rem .32rem;
  border-radius: .14rem;
  background: #faf7ef;
  color: #31564c;
  font-size: .75rem;
  font-weight: 730;
  line-height: 1.2;
  white-space: nowrap;
}
.flight-lamp {
  border-radius: 1px;
  animation: funnel-light var(--light-duration) var(--light-delay) both;
}
@keyframes funnel-light {
  from { background-color: #c7cec0; opacity: .42; }
  to { background-color: var(--lamp-color); opacity: 1; }
}
.funnel-mirror-result { margin-top: .05em; font-variant-numeric: tabular-nums; }
.expert-actions button {
  min-height: 2rem;
  padding: .34rem .58rem;
  border: 1px solid #9eb4a7;
  border-radius: .26rem;
  background: #fffdf5;
  color: #235346;
  font-size: .85rem;
  font-weight: 720;
  cursor: pointer;
}
.expert-actions .analysis-entry { background: #155c52; border-color: #155c52; color: #fffdf5; }
.expert-actions button:hover { filter: brightness(.94); }

.analysis-dialog {
  width: min(62rem, calc(100% - 2rem));
  max-height: calc(100svh - 2rem);
  overflow: auto;
  margin: auto;
  padding: 0;
  border: 1px solid #5d8376;
  border-radius: .65rem;
  background: #fcf9f0;
  color: #243c33;
  box-shadow: 0 1.45rem 4rem #162a24a0;
}
.analysis-dialog::backdrop { background: #172e2bc9; }
.analysis-header {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .9rem;
  padding: .82rem clamp(1rem, 2.6vw, 1.65rem);
  background: #213c34;
  color: #fffaf0;
}
.analysis-header p { margin: 0 0 .2rem; color: #c1d9c9; font-size: .84rem; font-weight: 700; }
.analysis-header h2 { margin: 0; font-size: clamp(1.2rem, 3.1vw, 1.48rem); }
.analysis-header button {
  min-width: 2rem;
  min-height: 2rem;
  padding: 0 .3rem;
  border: 1px solid #7da29580;
  border-radius: .24rem;
  background: transparent;
  color: inherit;
  font-size: 1.33rem;
  cursor: pointer;
}
.analysis-content { padding: clamp(.85rem, 2.6vw, 1.55rem); }
.analysis-content h3 { margin: 0; font-size: 1.07rem; }
.analysis-note { margin: .4rem 0 .7rem; color: #4f675b; font-size: .86rem; line-height: 1.5; }
.analysis-text-button {
  padding: .3rem 0;
  border: 0;
  background: transparent;
  color: #155c52;
  text-decoration: underline;
  text-underline-offset: .19em;
  font-size: .85rem;
  font-weight: 680;
  cursor: pointer;
}
.analysis-dialog :is(button, a, select):focus-visible { outline: 2px solid #4a937d; outline-offset: 2px; }
.expert-spread { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.3fr); align-items: start; gap: 1rem; }
.clause-panel {
  padding: .86rem;
  border: 1px solid #cfcfbd;
  border-radius: .36rem;
  background: #fffdf7;
}
.clause-excerpt {
  margin: .7rem 0;
  padding: .7rem .78rem;
  min-height: 5rem;
  border-left: 2px solid #8aad95;
  background: #edf2e7;
  color: #244136;
  font-size: 1rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
}
.clause-excerpt mark { background: #f3dba4; color: #302618; padding-block: .12em; }
.rule-tag { display: inline-block; padding: .3rem .5rem; border-radius: .2rem; background: #efe9d7; color: #584a2f; font-size: .83rem; font-weight: 700; }
.rule-tag[data-tone="fit"] { background: #e2eee3; color: #1e604f; }
.rule-tag[data-tone="limited"] { background: #f4e4dc; color: #823f30; }
.rule-copy { margin: .55rem 0 0; font-size: .92rem; line-height: 1.62; }
.public-clause { margin-top: .7rem; padding-top: .55rem; border-top: 1px solid var(--line); color: #2c6255; font-size: .88rem; }
.public-clause summary { cursor: pointer; font-weight: 700; }
.public-clause blockquote { margin: .52rem 0 .35rem; color: #293e36; }
.public-clause a { color: inherit; text-underline-offset: .19em; }
.expert-table-box { border: 1px solid #ced7ca; border-radius: .32rem; overflow: hidden; background: #fffdf6; }
.expert-table { border-spacing: 0; width: 100%; text-align: left; font-size: .9rem; line-height: 1.52; }
.expert-table thead { background: #e8efe5; }
.expert-table th, .expert-table td { padding: .51rem .59rem; vertical-align: top; }
.expert-table tbody th { width: 26%; min-width: 6rem; font-weight: 760; }
.expert-table tbody small { display: block; color: #526c60; font-size: .8rem; font-weight: 530; white-space: nowrap; }
.expert-table tbody tr > * { border-top: 1px solid #d5ddcf; }
.expert-table td p { margin: 0; }
.expert-table-box > .analysis-note { margin: .58rem .6rem; }
.expert-score {
  display: inline-block;
  padding: .18rem .3rem;
  border-radius: .18rem;
  background: #eee6d4;
  color: #604e2b;
  font-size: .86rem;
  font-weight: 760;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.expert-score[data-score="2"] { background: #e3efdf; color: #1b584a; }
.expert-score[data-score="0"] { background: #f4e3da; color: #8b4938; }
.expert-actions { margin-top: .8rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem 1rem; }
.expert-actions .analysis-note { margin: 0; }

.comparison-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .55rem; margin-bottom: .66rem; }
.comparison-modes { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; min-inline-size: 0; padding: 0; border: 0; }
.comparison-modes label { position: relative; cursor: pointer; }
.comparison-modes input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.comparison-modes span, .family-filter select {
  display: block;
  padding: .42rem .59rem;
  border: 1px solid #aabeb1;
  border-radius: .28rem;
  background: #fffdf6;
  color: #284e42;
  font: inherit;
  font-size: .88rem;
  font-weight: 690;
}
.comparison-modes input:checked + span { background: #1b5e50; border-color: #1b5e50; color: #fffaf0; }
.comparison-modes input:focus-visible + span { outline: 2px solid var(--teal); outline-offset: 2px; }
.family-filter { display: flex; align-items: center; gap: .35rem; color: #466358; font-size: .89rem; }
.family-filter select { padding-right: .7rem; }
.evidence-boards { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .72rem; }
.evidence-board { min-width: 0; padding: .65rem; border: 1px solid #bccdbf; border-radius: .4rem; background: #f2f5eb; }
.evidence-board header { display: flex; align-items: baseline; justify-content: space-between; gap: .45rem; margin-bottom: .55rem; }
.evidence-board strong { color: #155c52; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.evidence-lamps { display: grid; grid-template-columns: repeat(var(--columns), minmax(0, 3.15rem)); justify-content: center; gap: .32rem; }
.evidence-lamp {
  min-width: 0;
  min-height: 1.7rem;
  aspect-ratio: 1.23;
  padding: 0;
  border: 1px solid #3c635c59;
  border-radius: .15rem;
  background: var(--lamp-color);
  color: #fffdf5;
  font-weight: 780;
  cursor: pointer;
  animation: paired-lamp .24s var(--reveal-delay) both;
}
:is(.evidence-lamp, .mini-lamp, .flight-lamp)[data-state="hit"] { --lamp-color: #348066; }
:is(.evidence-lamp, .mini-lamp, .flight-lamp)[data-state="miss"] { --lamp-color: #ad5c49; }
:is(.evidence-lamp, .mini-lamp, .flight-lamp)[data-state="missing"] { --lamp-color: #7a8a82; }
.evidence-lamp[data-funnel] { animation: none; }
.evidence-lamp[aria-pressed="true"] { outline: 2px solid #162f27; outline-offset: 1px; z-index: 1; }
@keyframes paired-lamp { from { background: color-mix(in srgb, var(--lamp-color) 45%, #e5e8df); color: #263731; } to { background: var(--lamp-color); color: #fffdf5; } }
.lamp-legend { margin: .6rem 0; color: #526c60; font-size: .84rem; }
.lamp-readout {
  border: 1px solid #c7d4c7;
  border-radius: .32rem;
  padding: .7rem .85rem;
  background: #fffdf7;
}
.round-answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.round-answers section { padding: .52rem .65rem; border-left: 2px solid #8eab99; background: #f1f4eb; }
.round-answers h4 { margin: 0 0 .35rem; font-size: .95rem; }
.round-answers p { margin: 0; font-size: .89rem; line-height: 1.55; }
.round-answers .audit-note { margin-top: .35rem; color: #813e30; }
.funnel-tables {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: .72rem;
  margin: 0 0 .85rem;
}
.funnel-tables :is(section, details) { min-width: 0; padding: .55rem .7rem; border-block: 1px solid #d2d9cc; }
.funnel-tables h3, .funnel-tables summary { font-size: .93rem; font-weight: 700; }
.funnel-tables summary { cursor: pointer; }
.funnel-tables table { width: 100%; border-collapse: collapse; margin-top: .35rem; font-size: .85rem; font-variant-numeric: tabular-nums; }
.funnel-tables :is(th, td) { padding: .31rem .2rem; border-bottom: 1px solid #d8dfd3; text-align: left; }
.funnel-tables td { color: #235849; font-weight: 680; }
.funnel-case-steps { padding: 0; margin: .4rem 0; list-style: none; font-size: .89rem; line-height: 1.55; }
.funnel-case-steps li + li { margin-top: .11rem; }
.funnel-case-steps strong { font-weight: 740; }
.scope-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .72rem; }
.scope-card { padding: .78rem .9rem; border: 1px solid #c4d2c3; border-radius: .36rem; background: #fffdf7; }
.scope-card dl { display: grid; gap: .55rem; margin: .6rem 0; }
.scope-card dt { color: #235b4c; font-weight: 730; }
.scope-card dd, .scope-card .scope-authority { margin: .13rem 0 0; font-size: .91rem; line-height: 1.5; }
.scope-card .scope-authority { margin-bottom: .6rem; padding: .45rem .53rem; background: #f0ead8; color: #594e35; }
.scope-card a { color: #155c52; font-size: .86rem; text-underline-offset: .2em; }
.result-record .trial-evidence { margin: .12rem 0 .25rem; }

@media (max-width: 760px) {
  .mini-comparison { position: relative; inset: auto; width: min(15.25rem, 100%); margin: .55rem auto .7rem; }
  .expert-spread, .scope-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 590px) {
  .evidence-boards, .round-answers, .funnel-tables { grid-template-columns: minmax(0,1fr); }
  .expert-table th, .expert-table td { padding: .43rem .4rem; font-size: .84rem; }
  .expert-table tbody th { min-width: 4.65rem; }
}
@media (prefers-reduced-motion: reduce) {
  .evidence-lamp, .flight-lamp { animation: none; }
  .mini-lamp { transition: none; }
}
