/* ═══════════════════════════════════════════════════════════════
   PRAANA — MODULE · INTERLOCK  ·  css
   Every colour is a token. Prefix: mx-il-
   ═══════════════════════════════════════════════════════════════ */

.mx-il { display: block; width: 100%; }

/* ── head ─────────────────────────────────────────────────── */
.mx-il-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  margin-bottom: .6rem;
  font-family: var(--mono);
  font-size: var(--t-micro);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.mx-il-tag { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-il-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  color: var(--green); flex-shrink: 0;
  transition: color .35s var(--ease-out);
}
.mx-il-chip i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
  animation: mx-il-pulse 2.2s var(--ease-io) infinite;
  transition: background .35s var(--ease-out), box-shadow .35s var(--ease-out);
}
@keyframes mx-il-pulse { 0%, 100% { opacity: 1 } 50% { opacity: .35 } }
[data-mx-il-state="broker"] .mx-il-chip { color: var(--ink-3); }
[data-mx-il-state="broker"] .mx-il-chip i { background: var(--ink-3); box-shadow: 0 0 0 3px var(--rule); }
[data-mx-il-state="lab"] .mx-il-chip { color: var(--blue); }
[data-mx-il-state="lab"] .mx-il-chip i { background: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }

/* ── the two master switches ─────────────────────────────────
   These ARE the argument, so they carry the weight of a control,
   not a legend. Real <button>s, keyboard reachable, aria-pressed. */
.mx-il-switchbar {
  display: flex; flex-wrap: wrap; align-items: stretch;
  gap: .6rem;
  margin-bottom: .8rem;
}
.mx-il-switch {
  flex: 1 1 210px;
  display: flex; align-items: center; gap: .65rem;
  padding: .65rem .8rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--green-line);
  background: var(--green-soft);
  color: var(--ink);
  font-family: var(--display);
  text-align: left;
  cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .15s var(--ease), opacity .2s var(--ease);
}
.mx-il-switch:hover { transform: translateY(-1px); border-color: var(--green); }
.mx-il-switch:active { transform: translateY(0) scale(.995); }
.mx-il-switch:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.mx-il-switch.is-off {
  border-color: var(--rule-2);
  background: var(--paper-2);
  opacity: .85;
}

.mx-il-track {
  position: relative; flex: none;
  width: 32px; height: 18px;
  border-radius: var(--r-pill);
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.mx-il-track::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--green);
  transition: transform .25s var(--ease-out), background .2s var(--ease);
  transform: translateX(14px);
}
.mx-il-switch.is-off .mx-il-track { background: var(--paper-3); border-color: var(--rule-2); }
.mx-il-switch.is-off .mx-il-track::after { transform: translateX(0); background: var(--ink-4); }

.mx-il-sw-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mx-il-sw-name {
  font-weight: 700; font-size: .8rem; letter-spacing: .05em;
  display: flex; align-items: baseline; gap: .4rem;
}
.mx-il-sw-state {
  font-family: var(--mono); font-size: .62rem; letter-spacing: .12em;
  color: var(--green);
}
.mx-il-switch.is-off .mx-il-sw-state { color: var(--ink-4); }
.mx-il-sw-sub {
  font-family: var(--mono); font-size: .68rem; line-height: 1.4;
  color: var(--ink-3);
}

/* ── the canvas ───────────────────────────────────────────── */
.mx-il-stage {
  position: relative;
  border: 1px solid var(--rule-2);
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--sh-1);
  overflow: hidden;
}
.mx-il-cv { display: block; width: 100%; height: clamp(320px, 34vw, 440px); }

/* ── verdict panel — the state, in words, in the DOM ─────────
   Deliberately DOM rather than canvas text: selectable, translatable,
   readable by assistive tech without describing a picture. */
.mx-il-verdict {
  display: grid;
  grid-template-columns: minmax(140px, 190px) 1fr;
  gap: .3rem 1.2rem;
  align-items: start;
  margin-top: .9rem;
  padding-top: .85rem;
  border-top: 1px solid var(--rule);
}
.mx-il-vtag {
  grid-column: 1 / 2;
  margin: 0;
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  line-height: 1.2;
  color: var(--green);
  transition: color .4s var(--ease-out);
}
[data-mx-il-state="broker"] .mx-il-vtag { color: var(--ink-3); }
[data-mx-il-state="lab"] .mx-il-vtag { color: var(--blue); }
.mx-il-vbody {
  grid-column: 2 / 3;
  margin: 0;
  font-size: var(--t-small); line-height: 1.6;
  color: var(--ink-2);
}
.mx-il-vbody b { color: var(--ink); font-weight: 650; }
.mx-il-vnote {
  grid-column: 2 / 3;
  margin: .4rem 0 0;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .02em;
  color: var(--ink-3); line-height: 1.55;
}

/* ── the three readouts ──────────────────────────────────── */
.mx-il-readouts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .6rem;
  margin-top: .9rem;
}
.mx-il-readout {
  padding: .65rem .75rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--card-tint);
}
.mx-il-rlabel {
  display: block;
  font-family: var(--mono); font-size: .62rem; letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}
.mx-il-rn {
  display: block;
  margin-top: .3rem;
  font-family: var(--display); font-weight: 700;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  letter-spacing: -.005em;
  color: var(--ink);
}
.mx-il-rd {
  display: block;
  margin-top: .2rem;
  font-size: .72rem; line-height: 1.5;
  color: var(--ink-3);
}

/* ── interaction hint ─────────────────────────────────────── */
.mx-il-hint {
  margin: .85rem 0 0;
  font-size: .78rem;
  line-height: 1.6;
  color: var(--ink-3);
}

/* ── footer: replay + honest labeling ────────────────────── */
.mx-il-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem;
  margin-top: .85rem;
}
.mx-il-replay {
  flex: none;
  font-family: var(--mono); font-size: .68rem; letter-spacing: .1em;
  color: var(--ink-3);
  background: transparent;
  border: 1px solid var(--rule-2);
  border-radius: var(--r-pill);
  padding: .42rem .9rem;
  cursor: pointer;
  /* hidden until the reader has taken manual control — nothing to
     replay while the argument is still playing itself */
  opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
[data-mx-il-manual="true"] .mx-il-replay { opacity: 1; pointer-events: auto; }
.mx-il-replay:hover { color: var(--green); border-color: var(--green-line); }
.mx-il-replay:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

.mx-il-fine {
  margin: 0;
  font-family: var(--mono); font-size: .68rem; line-height: 1.55;
  color: var(--ink-4);
}

/* ── responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .mx-il-readouts { grid-template-columns: 1fr; }
  .mx-il-verdict { grid-template-columns: 1fr; gap: .45rem; }
  .mx-il-vtag, .mx-il-vbody, .mx-il-vnote { grid-column: 1; }
}
@media (max-width: 720px) {
  .mx-il-switch { flex: 1 1 100%; }
  .mx-il-cv { height: clamp(300px, 74vw, 380px); }
  .mx-il-head { font-size: 9px; letter-spacing: .1em; }
}
@media (max-width: 480px) {
  .mx-il-cv { height: 330px; }
  .mx-il-readout { padding: .55rem .6rem; }
}

/* ── verdict/readouts/hint/footer copy suppressed per request —
   the switches + canvas carry the argument on their own ────── */
.mx-il-verdict, .mx-il-readouts, .mx-il-hint, .mx-il-foot { display: none; }

/* ── reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .mx-il-switch, .mx-il-track, .mx-il-track::after, .mx-il-vtag, .mx-il-chip, .mx-il-chip i {
    transition-duration: .001s;
  }
  .mx-il-chip i { animation: none; }
  .mx-il-switch:hover { transform: none; }
  [data-mx-il-static="true"] .mx-il-replay { display: none; }
}
