.terminal {
  --terminal-green: #a3e6b1;
  width: min(880px, calc(100vw - 32px));
  height: min(700px, calc(100dvh - 40px));
  max-height: calc(100dvh - 40px);
  padding: 0;
  border: 1px solid #596d60;
  border-radius: 14px;
  background: #101714;
  color: #e0e8e2;
  box-shadow: 0 28px 100px #0008;
  font: 14px/1.65 'IBM Plex Mono', monospace;
}
.terminal::backdrop { background: #0b100bc4; backdrop-filter: blur(5px); }
.terminal[open] { display: flex; flex-direction: column; }
.terminal-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; background: #202a24; border-bottom: 1px solid #34463a; }
.terminal-header h2 { font: inherit; margin: 0; color: #b7c9ba; }
.terminal button { color: inherit; font: inherit; cursor: pointer; }
.terminal-close { background: transparent; border: 0; padding: 4px 8px; }
.terminal button:focus-visible, .terminal a:focus-visible, .terminal input:focus-visible { outline: 2px solid var(--terminal-green); outline-offset: 3px; }
.terminal-toolbar { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 18px; border-bottom: 1px solid #34463a; }
.terminal-toolbar button { background: #213c2b; border: 1px solid #52795e; padding: 4px 10px; border-radius: 4px; }
.terminal button:disabled { opacity: .6; cursor: default; }
.terminal-status { flex: 1 1 240px; margin: 0; font-size: 12px; color: #b7c9ba; }
.terminal-output { flex: 1; min-height: 0; overflow: auto; padding: 18px 22px; overscroll-behavior: contain; }
.terminal-banner { color: var(--terminal-green); font-size: clamp(12px, 2.6vw, 20px); line-height: 1.3; margin: 0 0 18px; }
.terminal-entry { margin: 0 0 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.terminal-entry[data-kind='visitor'] { color: var(--terminal-green); }
.terminal-entry[data-kind='notice'] { color: #b7c9ba; }
.terminal-entry[data-kind='error'] { color: #ffbba9; }
.terminal-sources { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; font-size: 12px; }
.terminal a { color: var(--terminal-green); text-decoration: underline; }
.terminal-form { display: flex; gap: 10px; align-items: center; border-top: 1px solid #34463a; padding: 16px 22px; }
.terminal-prompt { color: var(--terminal-green); }
.terminal-input { min-width: 0; flex: 1; border: 0; background: transparent; color: #fff; font: inherit; padding: 4px; }
.terminal-send { border: 1px solid #52795e; border-radius: 4px; background: #213c2b; padding: 4px 10px; }
@media (max-width: 600px) {
  .terminal { font-size: 13px; width: calc(100vw - 16px); height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); }
  .terminal-header, .terminal-toolbar, .terminal-output, .terminal-form { padding: 12px; }
  .terminal-prompt { font-size: 0; }
  .terminal-prompt::after { content: '>'; font-size: 14px; }
}

.room-topbar { flex-wrap: wrap; max-width: calc(100vw - 48px); }
@media (max-width: 640px) {
  .room-topbar { max-width: none; flex-wrap: nowrap; gap: 4px; }
  .room-topbar .topbar-link, .room-topbar .topbar-button { padding: 8px 10px; font-size: 13px; }
  .focus-card.is-overview { top: 90px; bottom: auto; max-height: calc(100dvh - 110px); }
}
