/* Design tokens and shared styles, taken from docs/design/*.html */
:root {
  --ground: #181B21;
  --sidebar: #121418;
  --card: #1A1D24;
  --panel: #1A1E25;
  --input: #16191F;
  --hover: #1E222A;
  --active: #252A33;
  --line: #262A33;
  --line-2: #2A2F38;
  --line-3: #3A3F49;
  --text: #ECEEF2;
  --text-2: #D6D9DF;
  --muted: #A3A9B4;
  --faint: #7D8490;
  --accent: #FF8A4C;
  --accent-hover: #FFB088;
  --on-accent: #1A0E06;
  --voice: #3DD6C3;
  --danger: #F26B6B;
  --sans: 'Manrope', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--sidebar); color: var(--text); font-family: var(--sans); }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
[hidden] { display: none !important; }

.field {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 10px;
  background: var(--input); border: 1px solid var(--line-3); color: var(--text);
  font: 15px var(--sans);
}
.field:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.lab { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }

.btn-primary {
  height: 48px; border: 0; border-radius: 10px; background: var(--accent); color: var(--on-accent);
  font: 700 15px var(--sans); cursor: pointer;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: .6; cursor: default; }

.ib {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
  padding: 0; flex: none;
}
.ib:hover { background: var(--active); color: var(--text); }

.logo {
  width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: var(--on-accent);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; flex: none;
}

.avatar {
  border-radius: 50%; color: var(--sidebar); font-weight: 800; flex: none;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.avatar-img-muted { opacity: .45; filter: grayscale(1); }
.avatar .dot { z-index: 1; }

.error {
  margin: 0; padding: 10px 14px; border-radius: 10px; font-size: 14px;
  background: #2A1A1C; color: var(--danger); border: 1px solid #4A2629;
}

/* ---------- buttons ---------- */
.btn-block { width: 100%; }
.btn-inline { height: 44px; padding: 0 18px; display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 14px; }
.btn-secondary {
  height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-3); background: transparent;
  color: var(--text); font: 600 14px var(--sans); cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.btn-secondary:hover:not(:disabled) { background: var(--hover); }
.btn-secondary:disabled { opacity: .45; cursor: default; }
.btn-danger {
  height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid #5A2E31; background: transparent;
  color: #FF9C9C; font: 600 13px var(--sans); cursor: pointer; flex: none;
}
.btn-danger:hover { background: #2A1A1C; }
.mono { font-family: var(--mono); font-size: 13px; }
.hint { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.optional { font-weight: 400; color: var(--muted); }
.row-gap { display: flex; gap: 8px; }
.field-sm { height: 44px; padding: 0 12px; color-scheme: dark; }
select.field { font-weight: 600; }

/* ---------- dialogs (docs/design/Invite.html, CreateRoom.html) ---------- */
dialog.modal {
  width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-sizing: border-box; padding: 28px;
  background: var(--card); color: var(--text); font-family: var(--sans);
  border-radius: 16px; border: 1px solid var(--line-2); overflow-y: auto;
}
dialog.modal[open] { display: flex; flex-direction: column; gap: 20px; }
dialog.modal::backdrop { background: rgba(8, 9, 12, .7); }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h1 { margin: 0; font-size: 20px; font-weight: 800; }
.modal-form { display: flex; flex-direction: column; gap: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.chips { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.chip {
  height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--line-3); background: transparent;
  color: var(--text-2); font: 600 13px var(--sans); cursor: pointer;
}
.chip.selected { border-color: var(--accent); background: #2A1E17; color: #FFD2B8; }
fieldset.plain { margin: 0; padding: 0; border: 0; min-width: 0; }
.kind-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kind-option { display: flex; gap: 10px; padding: 14px; border-radius: 12px; border: 1px solid var(--line-3); cursor: pointer; }
.kind-option.selected { border: 2px solid var(--accent); background: #2A1E17; padding: 13px; }
.kind-option input, .radio-row input { accent-color: var(--accent); margin: 2px 0 0; }
.kind-title { display: block; font-weight: 700; font-size: 15px; }
.kind-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.radio-row { display: flex; gap: 20px; font-size: 14px; }
.radio-row label { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.manage-row { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--line-2); }
.manage-row .btn-danger { height: 44px; margin-left: auto; }
.invite-others { padding-top: 16px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 10px; }
.invite-others:empty { display: none; }
.invite-row { display: flex; align-items: center; gap: 12px; }
.invite-meta { flex: 1; font-size: 13px; color: var(--muted); }