/* Simulator page: layout on top of /site.css. The device keeps its own (dark plastic) colours in both themes. */
.sim { padding-top: 32px; }
.sim-head { max-width: 46em; }
.sim-head h1 { margin-bottom: .4rem; }
.sim-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; margin-top: 24px; align-items: start; }

.device { background: linear-gradient(180deg, #3a3a3c, #232324); border-radius: 22px; padding: 22px 22px 18px; padding-top: 22px;
  box-shadow: 0 22px 44px -18px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .08); }
.bezel { background: #111; border-radius: 6px; padding: 10px; }
.panel { position: relative; width: 100%; aspect-ratio: 792 / 272; background: #e6e3dc; overflow: hidden; border-radius: 2px; }
.panel canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.boot { position: absolute; inset: 0; display: grid; place-items: center; color: #6b6860; font-size: .95rem; }
.boot[hidden] { display: none; }

.controls { display: flex; align-items: center; justify-content: center; gap: 40px; margin-top: 20px; flex-wrap: wrap; }
.control { display: flex; flex-direction: column; align-items: center; gap: 8px; color: #b9b7b2; font-size: .8rem; user-select: none; -webkit-user-select: none; }
.control b { color: #ece9e2; font-weight: 600; }
.knob-wrap { display: flex; align-items: center; gap: 10px; }
.nudge { width: 32px; height: 32px; border-radius: 50%; border: 1px solid #555; background: #2f2f31; color: #ddd; cursor: pointer; font-size: 15px; }
.nudge:hover { background: #3a3a3d; }
.knob { width: 84px; height: 84px; border-radius: 50%; cursor: grab; touch-action: none; position: relative;
  background: repeating-conic-gradient(from 0deg, #4a4a4d 0 4deg, #2e2e30 4deg 9deg); box-shadow: 0 4px 10px rgba(0, 0, 0, .5), inset 0 0 0 2px #1d1d1e; }
.knob::after { content: ""; position: absolute; inset: 20px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #5b5b5f, #2f2f31 70%);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, .15); transition: transform .06s; }
.knob.pressed::after { transform: scale(.9); background: radial-gradient(circle at 40% 35%, #4a4a4e, #222224 70%); }
.knob .mark { position: absolute; left: 50%; top: 6px; width: 4px; height: 14px; margin-left: -2px; border-radius: 2px; background: #e9e6df; z-index: 1; }
.knob:focus-visible, .btn-hw:focus-visible, .nudge:focus-visible { outline: 2px solid #f0b429; outline-offset: 3px; }
.btn-hw { width: 64px; height: 44px; border-radius: 10px; background: #3b3b3e; border: 0; box-shadow: 0 4px 0 #1b1b1c, 0 6px 12px rgba(0, 0, 0, .4); cursor: pointer; }
.btn-hw.pressed { transform: translateY(3px); box-shadow: 0 1px 0 #1b1b1c; }
.legend { margin: 14px 0 0; color: #a6a39d; font-size: .8rem; text-align: center; }
kbd { font: .72rem ui-monospace, monospace; background: #3a3a3c; color: #eee; border-radius: 4px; padding: 1px 5px; }

.side { display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.card h2 { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; font-weight: 650; }
.card h2.gap { margin-top: 14px; }
.card summary { cursor: pointer; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; }
.hint { color: var(--muted); font-size: .85rem; margin: 8px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 999px; padding: 5px 12px; cursor: pointer; font: inherit; font-size: .85rem; }
.chip:hover { border-color: var(--muted); }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip:focus-visible, .linkish:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.time { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.time #rtcLocal { font-size: 1.5rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; font-size: .9rem; }
.led { width: 10px; height: 10px; border-radius: 50%; background: #8c877b; display: inline-block; vertical-align: middle; margin-right: 8px; }
.led.on { background: #f0b429; box-shadow: 0 0 10px #f0b429; }
.serial { height: 180px; overflow: auto; background: #111; color: #cfe8d8; font: .72rem/1.4 ui-monospace, monospace; border-radius: 8px; padding: 8px; margin-top: 10px; white-space: pre-wrap; word-break: break-all; }
.serial .out { color: #9cc4ff; }
.serial-in { width: 100%; margin-top: 6px; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: .75rem ui-monospace, monospace; }
.linkish { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }

@media (max-width: 960px) { .sim-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .device { padding: 12px 12px 14px; border-radius: 16px; }
  .bezel { padding: 6px; }
  .controls { gap: 18px; }
  .knob { width: 70px; height: 70px; }
  .knob::after { inset: 16px; }
  .nudge { width: 28px; height: 28px; }
  .legend { display: none; }
}
