/* Teletype: a roll of paper under a glass hood, a cork strip for one pinned line, OLDER / NEWER / PIN keys.
   Radio: a speaker grille, a signal lamp and a subtitle window. */
.m-teletype .machine-body { display: grid; grid-template-columns: minmax(0, 1fr) 52px; grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 6px;
  grid-template-areas: "pin pin" "paper older" "paper newer" "paper pinbtn"; }
.tty-ctl { display: contents; }
[data-tty=older] { grid-area: older; } [data-tty=newer] { grid-area: newer; } [data-tty=pin] { grid-area: pinbtn; }
.tty-paper { grid-area: paper; }
.tty-pinned { grid-area: pin; display: flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 4px 10px; border: 0; border-radius: 3px; cursor: pointer; text-align: left;
  background: repeating-radial-gradient(circle at 30% 40%, #a87a4e 0 1px, #94693f 1px 3px), #9a6c40; box-shadow: inset 0 1px 4px rgba(0,0,0,0.6); color: rgba(40,25,10,0.7);
  font: 700 10px var(--font-type); letter-spacing: .04em; overflow: hidden; }
.tty-pin-icon { flex: none; width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff9a8a, #b0201a 70%); box-shadow: 0 2px 2px rgba(0,0,0,0.5); opacity: .35; }
.tty-pin-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tty-pinned.has { color: var(--ink); }
.tty-pinned.has .tty-pin-icon { opacity: 1; }
.tty-pinned.has .tty-pin-text { padding: 3px 6px; background: var(--paper); box-shadow: 0 1px 2px rgba(0,0,0,0.4); transform: rotate(-.6deg); }
.tty-paper { position: relative; min-height: 0; overflow: hidden; border-radius: 3px;
  background: repeating-linear-gradient(180deg, transparent 0 17px, rgba(120,140,170,0.16) 17px 18px), linear-gradient(90deg, var(--paper-lo), var(--paper) 8%, var(--paper) 92%, var(--paper-lo));
  box-shadow: inset 0 6px 10px -4px rgba(0,0,0,0.55), inset 0 0 0 1px rgba(0,0,0,0.3); }
.tty-paper::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 22px; background: linear-gradient(180deg, rgba(40,46,44,0.7), transparent); z-index: 1; pointer-events: none; }
.tty-lines { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 10px; }
.tty-line { font: 700 12.5px/18px var(--font-type); color: var(--ink); word-break: break-word; }
.tty-line.red { color: var(--ink-red); }
.tty-line.typing::after { content: "▌"; animation: blink-slow .5s steps(2) infinite; }
.tty-time { color: rgba(43,38,32,0.55); }
.tty-who { padding: 0 3px; background: rgba(43,38,32,0.1); }
.tty-head { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; background: linear-gradient(180deg, #8a918e, #4a504e); box-shadow: 0 -2px 4px rgba(0,0,0,0.35); }
.tty-btn { flex: 1; min-height: var(--tap); border: 0; border-radius: 5px; cursor: pointer; color: #e8e0c8; font: 700 13px/1 var(--font-stencil);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: linear-gradient(180deg, #3b3f40, #1f2224); box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), inset 0 0 0 1px rgba(0,0,0,0.6), 0 3px 0 #0b0d0e; }
.tty-btn small { font-size: 7.5px; letter-spacing: .14em; opacity: .7; }
.tty-btn:active { transform: translateY(2px); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.6), 0 1px 0 #0b0d0e; }
.tty-btn.dim { opacity: .5; }

.m-radio .machine-body { gap: 10px; align-items: stretch; }
.radio-grille { position: relative; flex: none; width: 104px; border-radius: 10px;
  background: radial-gradient(circle, #0b0c0c 0 1.6px, transparent 2px) 0 0 / 7px 7px, linear-gradient(180deg, #3b3226, #231d16);
  box-shadow: inset 0 0 0 2px #120e0a, inset 0 3px 8px rgba(0,0,0,0.7), 0 0 0 2px var(--brass-lo); }
.radio-lamp { position: absolute; right: 7px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: #3a0e08; box-shadow: inset 0 0 0 1px #000; }
.radio-lamp.on { background: radial-gradient(circle at 40% 35%, #ffd6cc, var(--red) 55%); box-shadow: 0 0 10px var(--red); }
.m-radio.talking .radio-grille { animation: speaker .14s infinite alternate; }
@keyframes speaker { to { box-shadow: inset 0 0 0 2px #120e0a, inset 0 3px 8px rgba(0,0,0,0.7), inset 0 0 14px rgba(255,170,60,0.12), 0 0 0 2px var(--brass-lo); } }
.radio-sub { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-radius: 4px; overflow: hidden;
  background: #0a0c0b; box-shadow: inset 0 1px 4px rgba(0,0,0,0.9), 0 0 0 2px #2a2f2e; }
.radio-who { font: 700 9px var(--font-stencil); letter-spacing: .24em; color: rgba(255,190,100,0.6); }
.radio-text { font: 700 13px/1.3 var(--font-type); color: #ffc66a; text-shadow: 0 0 6px rgba(255,160,40,0.55); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.m-radio:not(.talking) .radio-text { color: rgba(255,198,106,0.45); text-shadow: none; }
