:root {
  color-scheme: light;
  font: 16px/1.55 system-ui, -apple-system, sans-serif;
  color: #111827;
  background: #f3f4f6;
  --accent: #4f46e5;
  --muted: #4b5563;
  --border: #e5e7eb;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.topbar { background: #111827; color: #fff; }
.header-inner, main { width: min(1180px, 100% - 48px); margin-inline: auto; }
.header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.brand img { width: 38px; height: 38px; border-radius: 8px; }
.brand small { margin-inline-start: 12px; padding-inline-start: 12px; border-inline-start: 1px solid #4b5563; color: #d1d5db; font-size: .85rem; font-weight: 500; }
main { padding-block: 32px; }
.page-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; margin-bottom: 24px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.5rem, 4vw, 2rem); }
h2 { font-size: 1.125rem; margin-bottom: 18px; }
#status { color: var(--muted); background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; font-size: .875rem; overflow-wrap: anywhere; }
.workspace { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 24px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 24px; box-shadow: 0 2px 8px #11182708; }
.login { width: min(100%, 420px); margin: 32px auto; }
.login .primary { width: 100%; margin-top: 16px; }
label { display: block; margin-bottom: 5px; font-size: .875rem; font-weight: 650; }
input, select { display: block; width: 100%; margin-bottom: 16px; padding: 10px 12px; min-height: 44px; border-radius: 7px; border: 1px solid #d1d5db; background: #fff; color: inherit; font: inherit; }
button, .tools a { cursor: pointer; border: 1px solid transparent; border-radius: 7px; padding: 9px 13px; min-height: 44px; font: inherit; font-size: .875rem; font-weight: 650; }
:focus-visible { outline: 3px solid #818cf8; outline-offset: 3px; }
button:disabled { opacity: .48; cursor: default; }
.primary { color: white; background: var(--accent); }
.primary:hover:not(:disabled) { background: #4338ca; }
.quiet { color: inherit; background: transparent; }
.quiet:hover:not(:disabled) { background: #eef2ff; color: #3730a3; }
.danger { color: #991b1b; background: #fef2f2; border-color: #fecaca; }
.destructive { color: #991b1b; }
.room-info { color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
.room-info:not(:empty) { margin: -5px 0 16px; }
.actions { margin-top: 16px; display: flex; gap: 8px; }
.actions .primary { flex: 1; }
.tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 20px; }
.tools a { color: #4338ca; text-align: center; text-decoration: none; }
.caption-body { min-height: 320px; max-height: 65vh; overflow: auto; }
#partial, #final li { white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px 14px; }
#partial:not(:empty) { background: #eef2ff; color: #312e81; border-radius: 7px; margin-bottom: 10px; }
#final { padding: 0; margin: 0; list-style: none; }
#final li { border-bottom: 1px solid var(--border); }
.empty { padding: 36px 12px; text-align: center; color: var(--muted); }
#partial:not(:empty) ~ .empty, #final:not(:empty) ~ .empty { display: none; }
@media (max-width: 760px) {
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .header-inner, main { width: calc(100% - 32px); }
  .panel { padding: 18px; }
  .caption-body { min-height: 220px; }
}
.header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
dialog.panel { width: min(440px, calc(100% - 32px)); }
dialog::backdrop { background: #11182780; }
#audioStatus { color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
#devices { color: #4338ca; }
@media (max-width: 480px) {
  .brand small { display: none; }
  .header-inner { gap: 8px; }
  .header-actions button { padding-inline: 8px; }
}
.room-info { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 12px; }
.room-info:not(:empty) { margin: 4px 0 16px; padding: 12px; background: #f9fafb; border-radius: 7px; }
.room-info dt { font-weight: 650; }
.room-info dd { margin: 0; color: #111827; }

#status:empty { display: none; }
