.typing-stage [hidden] { display: none; }
.typing-stage > h2 { margin: 0 0 12px; }
.typing-stage > .btn { margin: 12px 8px 0 0; }
.typing-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}
.typing-main, .typing-side { min-width: 0; }
.typing-prompt, .typing-mode-row, .typing-hint { margin: 0 0 12px; }
.typing-prompt { color: #354b67; line-height: 1.5; }
.typing-form { display: grid; gap: 10px; }
.typing-reference, .typing-field { display: grid; gap: 4px; }
.typing-reference {
  padding: 10px 12px;
  border: 1px solid #d6dfeb;
  border-left: 4px solid #c18a27;
  border-radius: 8px;
  background: #f8f5ea;
}
.typing-reference span, .typing-field {
  color: #344a60;
  font-size: .89rem;
  font-weight: 680;
}
.typing-reference code, .typing-field input, .typing-signal {
  font: 500 clamp(.88rem, 2.5vw, 1rem)/1.55 Menlo, Consolas, 'Liberation Mono', monospace;
}
.typing-reference code { overflow-wrap: anywhere; color: #182c41; }
.typing-field input {
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  border: 1px solid #8194a8;
  border-radius: 8px;
  padding: 8px 10px;
  color: #14243a;
  background: #fff;
}
.typing-field input[readonly] { cursor: text; background: #f8fafc; }
.typing-lamps, .typing-actions, .typing-mode-row, .typing-demo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
}
.typing-lamps span {
  padding: 3px 7px;
  border-radius: 5px;
  background: #ecf2f7;
  color: #2f4b68;
  font-size: .76rem;
  font-weight: 690;
}
.typing-lamps .is-on { color: #4b3209; background: #ffda85; }
.typing-feedback { margin: 0; color: #7a4716; line-height: 1.4; }
.typing-feedback:empty { display: none; }
.typing-feedback.is-success { color: #176044; font-weight: 650; }
.typing-mode-row { margin-top: 10px; margin-bottom: 4px; }
.typing-mode, .typing-hint summary {
  border: 0;
  min-height: 36px;
  padding: 4px 0;
  color: #234e84;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 650;
  line-height: 1.4;
}
.typing-system { margin: 4px 0 8px; font-size: .9rem; line-height: 1.6; color: #354b67; }
.typing-system kbd {
  background: #e7edf4;
  color: #14243a;
  border-radius: 4px;
  padding: 3px 5px;
}
.typing-board {
  display: grid;
  gap: 4px;
  padding: 7px;
  border-radius: 9px;
  background: #14243a;
}
.typing-board-controls { display: flex; flex-wrap: wrap; gap: 4px; }
.typing-board button {
  min-width: 0;
  min-height: 36px;
  border: 1px solid #6f84a0;
  border-radius: 5px;
  padding: 3px 5px;
  background: #293e5b;
  color: #fff;
  cursor: pointer;
  font: 650 .78rem/1.2 system-ui, sans-serif;
  touch-action: manipulation;
}
.typing-board button:hover { background: #375577; }
.typing-board button[aria-pressed=true], .typing-board .typing-switch { background: #ffda85; color: #372809; border-color: #ffda85; }
.typing-board button:focus-visible { outline-color: #ffda85; }
.typing-key-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; }
.typing-key-row button { padding: 1px; font-size: .85rem; }
.typing-board-footer { justify-content: center; }
.typing-board-footer .typing-space { flex: 0 1 44%; }
.typing-demo, .typing-evidence, .typing-reply { border-radius: 12px; padding: 14px; }
.typing-demo {
  background: #14243a radial-gradient(ellipse at 98% -20%, #335c79, transparent 75%);
  color: #f4f7fb;
  margin-bottom: 10px;
}
.typing-demo h3, .typing-evidence h3 { margin: 0 0 8px; font-size: .95rem; }
.typing-signal { margin: 10px 0; color: #ffda85; overflow-wrap: anywhere; }
.typing-demo-actions button { min-height: 40px; }
.typing-evidence {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 6px;
  background: #edf4f7;
  color: #254460;
}
.typing-evidence h3 { margin: 0; }
.typing-evidence span { font-size: .86rem; font-weight: 700; }
.typing-evidence ul {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .85rem;
  line-height: 1.45;
}
.typing-evidence li + li { margin-top: 4px; }
.typing-evidence li[data-reward]::before { content: '✓ '; color: #176044; font-weight: 750; }
.typing-reply { margin: 0 0 10px; border-left: 4px solid #c18a27; background: #f8f5ea; }
@media (max-width: 740px) {
  .typing-columns { grid-template-columns: minmax(0, 1fr); }
  .typing-board button { min-height: 40px; }
  .typing-milestones li { gap: 4px; padding: 4px 6px 4px 4px; }
  .typing-milestones span { width: 17px; height: 17px; }
}
