:root {
  font: 15px/1.5 Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #242b43; background: #f5f6fb;
  --line: #e8ecf6; --muted: #626d86; --blue: #285ed8; --danger: #a91f29;
}
* { box-sizing: border-box; }
body { margin: 0; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
[hidden] { display: none !important; }
.bar { min-height: 56px; background: #fff; border-bottom: 1px solid var(--line); padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 17px; }
.brand span { width: 30px; height: 30px; border-radius: 8px; background: #e5eaff; display: grid; place-items: center; }
.brand img { display: block; width: 34px; height: 34px; }
main { flex: 1; display: grid; grid-template-columns: 225px minmax(0, 1fr); min-height: 0; }
aside { background: #fff; border-right: 1px solid var(--line); padding: 12px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
h1, h2, p { margin: 0; }
h1 { font-size: 15px; padding-left: 8px; }
h2 { font-size: 22px; line-height: 1.3; }
.device { display: flex; align-items: center; gap: 12px; margin-top: 6px; padding: 12px; border-radius: 8px; background: #f0f3fa; }
.device svg { width: 22px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.connection { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 7px; }
.connection i { width: 8px; height: 8px; border-radius: 50%; background: #8490a6; }
.connection i.online { background: #148553; }
.host-mode { margin-top: 9px; }
.workspace { min-width: 0; min-height: 0; display: flex; flex-direction: column; position: relative; }
.welcome { display: grid; place-items: center; flex: 1; padding: 24px; text-align: center; }
.welcome p { color: var(--muted); margin: 9px 0 16px; max-width: 38ch; }
.welcome button + button { margin-left: 8px; }
button, input, textarea { font: inherit; }
button { border: 0; color: #fff; background: var(--blue); padding: 8px 14px; border-radius: 7px; min-height: 36px; cursor: pointer; }
button:hover { filter: brightness(.94); }
button:focus-visible, input:focus-visible, video:focus-visible { outline: 2px solid #3973ff; outline-offset: 3px; }
button.quiet { color: var(--blue); background: transparent; }
button.quiet:hover, button[aria-pressed="true"] { background: #e9efff; }
button:disabled { opacity: .55; cursor: wait; }
button.danger, .danger { color: var(--danger); }
.toolbar { padding: 4px 12px; display: flex; align-items: center; justify-content: space-between; background: white; border-bottom: 1px solid var(--line); gap: 8px; }
.toolbar span { font-size: 13px; }
.toolbar div { display: flex; gap: 2px; flex-wrap: wrap; }
.toolbar button { color: inherit; white-space: nowrap; }
.watch { min-height: 0; flex: 1; display: flex; background: #111725; position: relative; }
video { display: block; min-width: 0; min-height: 0; width: 100%; height: 100%; object-fit: contain; touch-action: none; }
#soft-keyboard { position: absolute; opacity: 0; width: 4px; height: 4px; left: 6px; bottom: 6px; }
form { width: min(100% - 32px, 420px); max-height: calc(100% - 24px); overflow: auto; z-index: 2; position: absolute; top: 12px; right: 16px; padding: 16px 20px; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 35px #242b431c; }
form label { display: block; margin: 10px 0 4px; font-size: 13px; font-weight: 600; }
input { color: inherit; background: #fff; border: 1px solid #bfcbe1; border-radius: 7px; padding: 7px 9px; width: 100%; min-width: 0; }
.code-field { display: flex; gap: 6px; }
form button[type=submit] { margin-top: 14px; }
form p { margin-top: 7px; font-size: 13px; }
.hint { color: var(--muted); }
@media (max-width: 720px), (pointer: coarse) {
  main { grid-template-columns: 1fr; grid-template-rows: max-content minmax(0, 1fr); }
  aside { border: 0; border-bottom: 1px solid var(--line); }
  body.in-session .bar, body.in-session aside { display: none; }
  body.in-session main { grid-template-rows: minmax(0, 1fr); }
  button { min-height: 48px; }
  .toolbar { flex-wrap: wrap; padding: 4px max(8px, env(safe-area-inset-right)) 4px max(8px, env(safe-area-inset-left)); }
  .toolbar div { gap: 8px; }
  .toolbar button { padding-right: 8px; padding-left: 8px; }
  .bar { padding: 0 12px; }
  form { max-height: calc(100% - 8px); top: 4px; }
}
