/* Petits logiciels, en direct dans la page. Les cadres sont leurs interfaces. */
.rd-demo { width: 100%; min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 26px; background: var(--surface-soft); color: var(--text); font-size: 14px; line-height: 1.4; }
.rd-demo button { -webkit-appearance: none; appearance: none; min-width: 44px; min-height: 44px; border: 1px solid transparent; border-radius: 12px; padding: 8px 12px; line-height: 1.3; transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease); }
.rd-demo button:disabled { cursor: default; }
.rd-demo button:focus-visible, .rd-demo input:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }
.rd-demo svg { width: 22px; height: 22px; flex: 0 0 auto; }
.rd-caption { margin: 12px 0 0; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.4; }
.rd-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 12px; }
.rd-switch button { color: var(--muted); background: transparent; font-size: 13px; }
.rd-switch button[aria-pressed='true'] { color: var(--text); background: var(--surface-solid); border-color: var(--line); box-shadow: 0 2px 5px rgb(0 0 0 / 4%); font-weight: 600; }
.rd-switch button:not(:disabled):hover { color: var(--text); background: var(--surface-solid); }
/* Quota : deux fenêtres de consommation, comme dans le vrai popover Mac. */
.rd-quota-window { max-width: 390px; margin-inline: auto; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-solid); box-shadow: 0 9px 22px rgb(0 0 0 / 6%); }
.rd-quota-head { display: flex; align-items: center; gap: 9px; margin-bottom: 19px; }
.rd-app-icon { display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 36px; color: var(--accent); }
.rd-quota-head > div { min-width: 0; }
.rd-quota-head strong { display: block; font-size: 14px; font-weight: 650; }
.rd-quota-head > div > span { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.rd-quota-state { margin-left: auto; color: var(--success); font-size: 11px; text-align: right; max-width: 84px; }
.rd-quota.is-limited .rd-quota-state { color: var(--error); }
.rd-quota-metric + .rd-quota-metric { margin-top: 17px; }
.rd-quota-metric > div:first-child { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.rd-quota-metric strong { font-variant-numeric: tabular-nums; font-weight: 600; }
.rd-quota-metric small { display: block; color: var(--muted); font-size: 11px; margin-top: 6px; }
.rd-meter { height: 7px; margin-top: 9px; overflow: hidden; border-radius: 6px; background: var(--surface-soft); }
.rd-meter > span { display: block; height: 100%; width: 100%; border-radius: inherit; background: var(--success); transform-origin: left center; transition: transform .45s var(--ease), background .2s var(--ease); }
.rd-quota.is-limited [data-quota-meter='session'] > span { background: var(--error); }
/* Douze touches AZERTY et une barre d’espace : assez pour sentir la texture. */
.rd-thock { container-type: inline-size; }
.rd-thock-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rd-thock-head > span { display: flex; align-items: center; gap: 8px; }
.rd-thock-head strong { font-size: 13px; font-weight: 550; }
.rd-thock-head svg { width: 20px; height: 20px; color: var(--muted); }
.rd-demo .rd-sound-toggle { border-color: var(--line); background: var(--surface-solid); color: var(--text); font-size: 12px; padding-inline: 11px; }
.rd-demo .rd-sound-toggle[aria-pressed='true'] { color: var(--button-text); border-color: var(--button-bg); background: var(--button-bg); }
.rd-demo .rd-sound-toggle:not(:disabled):hover { border-color: var(--text); }
.rd-keyboard { display: grid; grid-template-columns: repeat(6,minmax(44px,1fr)); gap: 5px; max-width: 360px; margin: 14px auto 0; }
.rd-demo .rd-key { min-height: 49px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-solid); color: var(--text); font-size: 14px; font-weight: 500; box-shadow: 0 3px 3px rgb(0 0 0 / 12%); }
.rd-demo .rd-key:not(:disabled):hover { background: var(--bg); border-color: var(--muted); }
.rd-demo .rd-key:active, .rd-demo .rd-key.is-pressed { transform: translateY(2px); color: var(--accent); box-shadow: 0 1px 2px rgb(0 0 0 / 8%); }
.rd-keyboard .rd-key-space { grid-column: 1 / -1; font-size: 12px; font-weight: 400; color: var(--muted); }
@container (max-width: 290px) {
 .rd-keyboard { grid-template-columns: repeat(4,minmax(44px,1fr)); }
 .rd-thock-head { flex-wrap: wrap; }
}
@media (max-width: 500px) {
 .rd-demo { padding: 12px; border-radius: 20px; }
 .rd-quota-window { padding: 15px; }
 .rd-quota-head { gap: 6px; margin-bottom: 17px; }
 .rd-app-icon { width: 24px; }
 .rd-quota-head strong { font-size: 13px; }
 .rd-quota-state { font-size: 10px; max-width: 64px; }
 .rd-keyboard { gap: 2px; margin-top: 10px; }
 .rd-demo .rd-key { min-height: 44px; }
 .rd-thock-head > span { gap: 5px; }
 .rd-thock-head strong { font-size: 12px; }
 .rd-thock-head svg { width: 17px; height: 17px; }
 .rd-thock .rd-caption { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
 .rd-demo *, .rd-demo *::before, .rd-demo *::after { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
 .rd-demo button[aria-pressed='true'] { outline: 2px solid Highlight; outline-offset: -3px; }
 .rd-meter { border: 1px solid CanvasText; }
 .rd-meter > span { background: Highlight; }
}

.rd-sound-feedback { display: block; min-height: 2.8em; margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.4; text-align: center; }
