/* ===== TO2026 — page « Explorer la machine » ===== */
.to-mach { padding: 56px 0 24px; }
html body .to-mach h1 { font-size: 48px; line-height: 1.17; margin: 0; }
.to-mach-head { display: grid; grid-template-columns: 1.2fr 1fr; gap: 64px; align-items: end; margin-bottom: 48px; }
html body .to-mach-head p { margin: 0; color: var(--to-muted); }

/* le décor : moniteur à gauche, extensions, cartouche et lecteurs à droite, à la même échelle */
.to-rig { position: relative; display: flex; align-items: flex-end; gap: 0; color: var(--to-ink); }
.to-rig-left { position: relative; flex: 1080 1 0; min-width: 0; }
.to-rig-right { position: relative; flex: 680 1 0; min-width: 0; }
.to-rig svg { display: block; width: 100%; height: auto; overflow: visible; }

/* l'écran : 800 x 600 unités du dessin, soit exactement 4:3 */
.to-screen {
  position: absolute; left: 12.037%; top: 10.227%; width: 74.074%; height: 68.182%;
  background: #000; overflow: hidden; --to-bright: 1;
}
.to-screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; filter: brightness(var(--to-bright)); }
.to-screen-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 8%; text-align: center; color: #ffff00; background: #0010f0; font-size: 16px; line-height: 1.75; }
.to-screen-msg[hidden] { display: none; }
.to-screen:fullscreen { width: 100vw; height: 100vh; inset: 0; background: #000; }
.to-screen:-webkit-full-screen { width: 100vw; height: 100vh; background: #000; }
.to-rig:not(.is-on) .to-screen { background: #0b0b0c; }

/* parties cliquables */
.to-hit { cursor: pointer; outline: none; }
.to-hit:focus-visible > :first-child, .to-hit:hover > :first-child { filter: drop-shadow(0 0 0 #0010f0); }
.to-hit:focus-visible { outline: none; }
.to-hit:focus-visible rect:first-of-type { stroke: #0010f0; stroke-width: 4; }
.to-ext, .to-cart-body { transition: transform .25s steps(4); }
.to-ext:hover, .to-cart:hover .to-cart-body { transform: translateY(-8px); }
.to-cart.is-inserting .to-cart-body { animation: to-insert .5s steps(5); }
@keyframes to-insert { 0% { transform: translateY(-60px); opacity: .4; } 100% { transform: none; opacity: 1; } }
.to-rig.no-cart .to-cart-body { opacity: .18; }
.to-drive:hover .to-slot { fill: #0010f0; }

.to-drive.is-empty .to-drive-state { fill: #7d7d7d; }
.to-rig.is-on .to-drive.is-current .to-slot { fill: #0010f0; }

/* voyants */
.to-rig.is-on .to-led-pwr { fill: #2bd14a; }
.to-rig.is-on .to-led-idle { fill: #ff3324; }
.to-rig.is-on .to-drive.is-busy .to-led-idle { fill: #3a1212; }
.to-rig.is-on .to-drive.is-busy .to-led-on { fill: #36ff52; }
.to-ext-led { fill: #5a1208; }
.to-rig.is-on .to-ext-led.is-lit { fill: #ffff00; }

/* fenêtres surgissantes : cartouches et extensions */
.to-pop {
  position: absolute; z-index: 5; top: 2%; left: 4%; right: 4%;
  background: var(--to-paper); border: 2px solid var(--to-ink); box-shadow: 8px 8px 0 var(--to-ink);
  padding: 20px 20px 16px;
}
.to-pop[hidden] { display: none; }
html body .to-pop h2 { font-size: 16px; margin: 0 0 12px; }
.to-pop p { margin: 0 0 12px; font-size: 12px; color: var(--to-muted); line-height: 1.75; }
.to-pop-close { position: absolute; top: 8px; right: 8px; border: 0; background: none; font-size: 16px; cursor: pointer; padding: 6px 10px; color: var(--to-ink); }
.to-carts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.to-carts button {
  line-height: 1.3; width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; text-align: left;
  background: #fff; border: 2px solid var(--to-ink); padding: 12px 14px; cursor: pointer; font-size: 16px; color: var(--to-ink);
}
.to-carts button small { display: block; font-size: 12px; line-height: 1.5; margin-top: 4px; color: var(--to-muted); }
.to-carts button:hover:not([disabled]), .to-carts button[aria-pressed="true"] { background: var(--to-ink); color: var(--to-paper); }
.to-carts button:hover:not([disabled]) small, .to-carts button[aria-pressed="true"] small { color: #c9c9c9; }
.to-carts button[disabled] { opacity: .5; cursor: not-allowed; }
.to-carts .to-tag { font-size: 12px; background: #e8341c; color: #fff; padding: 2px 6px; }
.to-exts { list-style: none; margin: 0; padding: 0; }
.to-exts li { border-top: 2px dotted var(--to-rule); }
.to-exts label { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 12px 0; cursor: pointer; }
.to-exts input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: #0010f0; }
.to-exts b { font-weight: 400; display: block; }
.to-exts small { display: block; font-size: 12px; color: var(--to-muted); }

.to-disk-state { color: var(--to-ink) !important; }
.to-disk-btns { display: grid; gap: 8px; }
.to-disk-btns button { background: #fff; border: 2px solid var(--to-ink); padding: 8px 12px; cursor: pointer; font: inherit; font-size: 12px; color: var(--to-ink); text-align: left; }
.to-disk-btns button:hover { background: var(--to-ink); color: var(--to-paper); }

/* légende */
.to-legend { list-style: none; margin: 64px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--to-ink); }
.to-legend li { padding: 20px 24px 0 0; }
.to-legend b { display: block; font-weight: 400; font-size: 16px; margin-bottom: 8px; }
.to-legend span { display: block; font-size: 12px; color: var(--to-muted); line-height: 1.75; }
.to-legend i { font-style: normal; color: var(--to-blue); }

@media (max-width: 1099px) {
  .to-mach-head { grid-template-columns: 1fr; gap: 24px; }
  html body .to-mach h1 { font-size: 32px; }
  .to-legend { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .to-rig { flex-direction: column; align-items: stretch; gap: 24px; }
  .to-rig-left, .to-rig-right { flex: none; width: 100%; }
  .to-rig-right { max-width: 480px; margin: 0 auto; }
  .to-rig-right svg { margin-top: -17.65%; } /* le dessin commence sous sa marge haute */
  .to-legend { grid-template-columns: 1fr; }
  html body .to-mach h1 { font-size: 24px; }
}

html body .to-mach-tip { margin: 32px 0 0; font-size: 12px; color: var(--to-muted); }

/* écran de démarrage dessiné (accueil, « L'essayer ») */
.to-try-screen svg { display: block; width: 100%; height: auto; }
