:root {
  color-scheme: dark;
  --bg: #101010;
  --panel: #1b1b1b;
  --input: #151515;
  --line: #343434;
  --text: #ededed;
  --muted: #b6b6b6;
  --accent: #a8ceb6;
  --ink: #171717;
  font-family: Inter, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.topbar { border-bottom: 1px solid var(--line); }
.topbar-inner, main { width: min(1120px, 100% - 48px); margin: auto; }
.topbar-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.top-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: end; gap: 8px 12px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 1.05rem; font-weight: 600; }
.brand-accent { color: var(--text); }
.community { color: var(--muted); font-weight: 650; font-size: .9rem; }
.hero { isolation: isolate; overflow: hidden; position: relative; padding: 48px 40px; margin: 24px 0 16px; border-radius: 16px; background: #161616; border: 1px solid var(--line); }
.hero.signed-in { padding-block: 24px; }
.hero.signed-in h1 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); }
.hero.signed-in p { margin-top: 4px; }
.hero-rays { position: absolute; inset: 0 0 0 36%; background: repeating-linear-gradient(119deg, transparent 0 13%, #ffffff0b 16%, #ffffff19 18%, transparent 25% 34%); mask-image: linear-gradient(#000, transparent); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); line-height: 1.04; letter-spacing: -.045em; font-weight: 600; }
.hero-content { position: relative; z-index: 2; }
.hero p { color: var(--muted); margin-top: 12px; line-height: 1.5; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.login { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 19px; }
.login > div:nth-child(2) { flex: 1 1 220px; }
h2 { font-size: clamp(1.25rem, 3vw, 1.5rem); letter-spacing: -.025em; font-weight: 600; overflow-wrap: anywhere; }
.muted, .login p { color: var(--muted); line-height: 1.5; }
.login p, .profile > p, .waiting > p, #peer-bio { margin-top: 6px; }
.notice { border: 1px solid var(--line); background: var(--panel); color: var(--text); margin: 0 0 16px; padding: 12px 16px; border-radius: 8px; }
.notice.error { border-color: #865c5b; color: #ffe4df; background: #3a2828; }
.section-icon { display: grid; place-items: center; width: 44px; height: 44px; background: #272727; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; }
.actions, .chat-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid transparent; border-radius: 8px; padding: 8px 16px; font-weight: 600; font-size: .92rem; text-align: center; text-decoration: none; }
.button:hover { text-decoration: none; filter: brightness(1.12); }
.button:disabled { opacity: .55; cursor: default; }
.primary { background: var(--text); color: var(--ink); }
.secondary { background: #272727; border-color: var(--line); color: var(--text); }
.quiet { border-color: var(--line); color: var(--muted); background: transparent; }
.workspace { display: grid; grid-template-columns: minmax(270px, .83fr) minmax(0, 1.17fr); gap: 16px; align-items: start; }
#profile-form { display: grid; margin-top: 20px; gap: 9px; }
#profile-form > label, legend { font-size: .91rem; font-weight: 650; }
input, textarea { min-width: 0; width: 100%; color: var(--text); background: var(--input); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
textarea { resize: vertical; }
#profile-form > input, #profile-form > textarea { margin-bottom: 7px; }
fieldset { margin: 0 0 7px; padding: 0; min-width: 0; border: 0; }
legend { margin-bottom: 9px; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { position: relative; }
.chip > input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.chip > span { display: block; padding: 8px 12px; border-radius: 8px; background: #242424; color: var(--text); border: 1px solid var(--line); cursor: pointer; font-size: .88rem; }
.chip > input:checked + span { color: var(--accent); background: #25302a; border-color: #557360; }
.chip > input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.waiting { min-height: 245px; display: grid; align-content: center; justify-items: center; text-align: center; }
.waiting .section-icon { margin-bottom: 12px; }
.waiting button { margin-top: 18px; }
.peer-topics { font-size: .88rem; margin-top: 5px; }
.chat-heading { overflow-wrap: anywhere; }
.participants { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: 8px; margin-top: 12px; }
.participants > div { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--input); }
.participants strong, .message strong { font-weight: 600; }
.participants p { font-size: .875rem; }
#session-dialog { width: min(500px, 100% - 32px); max-height: calc(100% - 32px); padding: 20px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 16px; }
#session-dialog::backdrop { background: #0009; }
.session-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#session-form { display: grid; gap: 8px; margin-top: 16px; }
#session-error { margin: 12px 0 0; }
.session-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.session-section h3 { margin: 0 0 8px; font-size: 1rem; font-weight: 600; }
.session-section .muted:not(:empty) { margin: 0 0 8px; }
#verification-admin-list { padding-left: 20px; }
#verification-admin-list li + li { margin-top: 8px; }
#verification-admin-list summary { cursor: pointer; }
#verification-admin-list details button { margin-top: 8px; }
.chat-tools { margin-top: 12px; margin-bottom: 12px; }
.messages { min-height: 180px; height: min(45vh, 364px); overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px; margin: 12px 0; background: var(--input); border: 1px solid var(--line); border-radius: 8px; }
.message { max-width: min(86%, 400px); align-self: start; padding: 8px 12px; border-radius: 8px; background: #292929; overflow-wrap: anywhere; white-space: pre-wrap; }
.message.mine { align-self: end; background: #25302a; color: #e5f2e9; }
.compose { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
footer { display: flex; justify-content: space-between; gap: 10px; margin: 24px 0 max(24px, env(safe-area-inset-bottom)); color: var(--muted); font-size: .88rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 700px) {
  .topbar-inner, main { width: calc(100% - 32px); }
  .topbar-inner { min-height: 64px; }
  .hero { margin-top: 16px; padding: 24px; }
  .panel { padding: 16px; }
  .brand { white-space: nowrap; gap: 8px; }
  .topbar-inner { gap: 8px; }
  .top-actions { padding-block: 8px; }
  #session-open { min-height: 36px; padding-inline: 8px; font-size: .82rem; }
  .workspace { grid-template-columns: 1fr; }
  .workspace.is-chatting .conversation { grid-row: 1; }
}
@media (max-width: 360px) {
  .hero { padding: 20px; }
  .brand img { width: 31px; height: 31px; }
  .compose button { padding-inline: 8px; }
}
