@font-face {
  font-family: Roboto;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/roboto-latin.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --navy: #0877b7;
  --page: #eef2f5;
  --surface: #fff;
  --soft: #f3f6f8;
  --thread: #eef2f5;
  --ink: #202c38;
  --muted: #536473;
  --line: #dce3e9;
  --accent: #0878b9;
  --accent-hover: #06679f;
  --accent-text: #086da8;
  --tint: #e6f4fc;
  --outgoing: #dcefff;
  --incoming: #fff;
  --ping: #e4f3fb;
  --read: #236949;
  --red: #a93040;
  --red-soft: #f9e9ec;
  --shadow: 0 10px 32px #0a47701a, 0 2px 5px #0a47700b;
  font: 400 15px/1.45 Roboto, "Segoe UI", system-ui, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #111b26;
  --surface: #182634;
  --soft: #202f3e;
  --thread: #13202c;
  --ink: #e8eff5;
  --muted: #acbbca;
  --line: #344455;
  --accent: #1689c8;
  --accent-hover: #229bd7;
  --accent-text: #8bd3f5;
  --tint: #163b52;
  --outgoing: #1d4965;
  --incoming: #1e2d3b;
  --ping: #203b4a;
  --read: #9bdab7;
  --red: #ff9ba8;
  --red-soft: #482d36;
  --shadow: 0 10px 34px #070d1580;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--page); color: var(--ink); }
button, input, textarea { font: inherit; }
button { color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
h1, h2, p { margin: 0; }
h1, h2, strong { font-weight: 500; }
svg { flex: none; vertical-align: middle; }
a { color: var(--accent-text); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); font-size: .93rem; }
.loading { padding: 20px; color: var(--muted); font-size: .9rem; }
.boot { min-height: 100dvh; display: grid; align-content: center; justify-items: center; gap: 8px; }
.boot img { border-radius: 0; object-fit: contain; }
.boot strong { font-size: 1.35rem; }
.boot span { color: var(--muted); }

.button, .icon-button, .text-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 6px; font-weight: 500;
}
.button { min-height: 42px; padding: 7px 13px; line-height: 1.25; }
.button.full { width: 100%; }
.button.compact { min-height: 38px; padding: 5px 9px; font-size: .86rem; }
.primary, .icon-primary { color: #fff; background: var(--accent); }
.primary:hover, .icon-primary:hover { color: #fff; background: var(--accent-hover); }
.secondary { color: var(--accent-text); background: var(--surface); border-color: var(--line); }
.secondary:hover { background: var(--tint); }
.danger { color: var(--red); background: var(--red-soft); }
.danger:hover { border-color: var(--red); }
.text-button { padding: 3px 0; color: var(--accent-text); background: transparent; border: 0; }
.text-button:hover { text-decoration: underline; }
.text-button.quiet { color: var(--muted); font-weight: 400; }
.icon-button { width: 42px; height: 42px; padding: 0; flex: none; background: transparent; color: var(--muted); }
.icon-button:hover { color: var(--accent-text); background: var(--tint); }
.icon-button.icon-primary { color: #fff; background: var(--accent); }
.icon-button.icon-primary:hover { background: var(--accent-hover); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; white-space: nowrap; font-size: 1.3rem; font-weight: 500; line-height: 1.2; }
.brand img { display: block; object-fit: contain; border-radius: 0; flex: none; }

.form-stack { display: grid; gap: 14px; }
.form-stack label, .secret-label { display: grid; gap: 5px; font-size: .92rem; }
.form-stack input:not([type="checkbox"]), .form-stack textarea, .secret-label input, .secret-label textarea {
  width: 100%; min-width: 0; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  border-radius: 5px; padding: 10px 11px; font-size: 1rem;
}
.form-stack input::placeholder, .form-stack textarea::placeholder, .search input::placeholder, .message-form textarea::placeholder {
  color: var(--muted); opacity: .9;
}
.form-stack textarea, .secret-label textarea { resize: vertical; min-height: 70px; }
.code-input { font-family: ui-monospace, "Cascadia Mono", monospace; }
.uppercase { text-transform: uppercase; }
.form-message { color: var(--red); font-size: .9rem; }
.form-message:empty { display: none; }
.inline-check, .form-stack .inline-check { display: flex; align-items: center; gap: 8px; }
input[type="checkbox"] { flex: none; accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.password-field { display: grid; gap: 5px; font-size: .92rem; }
.password-input { position: relative; display: block; min-width: 0; }
.password-input input { padding-right: 48px !important; }
.password-input .password-toggle {
  position: absolute; top: 50%; right: 6px; display: grid; place-items: center; width: 36px; height: 36px;
  padding: 0; transform: translateY(-50%); border: 0; border-radius: 6px; background: transparent; color: var(--muted);
}
.password-input .password-toggle:hover { background: var(--tint); color: var(--accent-text); }
.password-input .password-toggle svg { display: block; }

.auth-page {
  min-height: 100dvh; display: flex; align-items: center; justify-content: flex-start;
  padding: clamp(48px, 9vh, 78px) 14px calc(26px + env(safe-area-inset-bottom, 0px));
  background: #1da1dc; color: #fff;
}
.auth-shell { width: min(460px, 100%); margin: 0 auto; }
.auth-brand {
  display: flex; align-items: center; gap: 15px; margin: 0 0 clamp(28px, 6vh, 46px);
  padding: 0 3px; background: transparent; min-height: 0;
}
.auth-brand img { display: block; flex: none; width: 78px; height: 78px; object-fit: contain; }
.auth-brand h1 { margin: 0 0 5px; color: #fff; font-size: clamp(1.22rem, 4.4vw, 1.58rem); line-height: 1.24; font-weight: 500; }
.auth-brand p { color: #eaf8ff; font-size: .94rem; line-height: 1.45; }
.auth-card { width: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.auth-form { display: grid; gap: 0; }
.auth-fields-panel { overflow: hidden; padding: 0 14px; border-radius: 5px; background: #fff; box-shadow: 0 2px 6px #075a8a1c; }
.auth-field { position: relative; display: flex !important; align-items: center; gap: 8px !important; min-height: 58px; margin: 0; padding: 0; color: #192d3a; font-size: .96rem; }
.auth-field + .auth-field { border-top: 1px solid #d2d8dc; }
.auth-field input {
  display: block; width: 100%; min-width: 0; min-height: 56px; padding: 12px 0 !important;
  border: 0 !important; border-radius: 0 !important; outline: 0; background: transparent !important;
  color: #172b39 !important; box-shadow: none !important; font-size: 1rem;
}
.auth-field input::placeholder { color: #687780; opacity: 1; }
.auth-field input:focus-visible { outline: 0; }
.auth-field:focus-within { box-shadow: inset 0 -2px #1688c5; }
.auth-field.password-field { display: flex; }
.auth-field.password-field input { padding-right: 4px !important; }
.auth-field .password-toggle {
  position: static; display: grid; flex: none; place-items: center; width: 38px; height: 38px;
  margin: 0 -4px 0 0; padding: 0; transform: none; border: 0; border-radius: 50%;
  background: transparent; color: #31546a;
}
.auth-field .password-toggle:hover { background: #e8f5fc; color: #075f99; }
.auth-field .password-toggle svg { display: block; }
.auth-forgot-row { display: flex; justify-content: flex-end; margin: 10px 2px 15px; }
.auth-forgot-row .text-button { color: #fff; font-size: .9rem; font-weight: 600; }
.auth-legal { margin: 11px 2px 15px; color: #effaff; font-size: .69rem; line-height: 1.5; }
.auth-card .form-message { margin: 8px 2px; color: #fff; font-size: .88rem; }
.auth-card .form-message:empty { display: none; }
.auth-submit, .auth-card .button.primary {
  width: 100%; min-height: 52px; margin: 0; padding: 10px 14px; border: 0; border-radius: 5px;
  background: #0c61a5; color: #fff; font-size: .98rem; font-weight: 700;
  box-shadow: 0 2px 5px #064c7c26;
}
.auth-submit:hover, .auth-card .button.primary:hover { background: #084f8a; }
.auth-footer { margin: 21px 0 0; color: #eaf8ff; text-align: center; font-size: .94rem; }
.auth-footer button { border: 0; padding: 2px 3px; background: transparent; color: #fff; font-weight: 700; }
.auth-footer button:hover, .auth-links button:hover { text-decoration: underline; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 18px; margin-top: 20px; font-size: .9rem; }
.auth-links .text-button { color: #fff; font-weight: 600; }
.auth-notice { padding: 18px 17px; border: 0; border-radius: 5px; background: #fff; color: #233746; font-size: .94rem; line-height: 1.6; box-shadow: 0 2px 6px #075a8a1c; }
.auth-notice:empty { display: none; }

.frame { position: fixed; inset: 0; display: flex; background: var(--surface); }
.sidebar {
  display: flex; flex-direction: column; flex: 0 0 clamp(312px, 34vw, 432px);
  min-width: 0; background: var(--surface); border-right: 1px solid var(--line);
}
.side-head, .room-header {
  display: flex; flex: none; align-items: center; min-height: calc(60px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 15px 0; color: #fff; background: var(--navy);
}
.side-head { justify-content: space-between; gap: 8px; }
.home-mark { display: inline-flex; align-items: center; min-height: 44px; padding: 0 3px 0 0; background: transparent; border: 0; }
.home-mark:focus-visible, .room-header .icon-button:focus-visible { outline-color: #d5ebff; }
.connection { display: inline-flex; align-items: center; gap: 6px; color: #f3d5aa; font-size: .81rem; }
.tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); flex: none; border-bottom: 1px solid var(--line); }
.tab {
  position: relative; display: grid; place-content: center; justify-items: center; gap: 2px; min-width: 0; min-height: 55px;
  padding: 5px 2px 6px; border: 0; border-bottom: 2px solid transparent; background: var(--surface); color: var(--muted); font-size: .76rem;
}
.tab[aria-current] { color: var(--accent-text); background: var(--tint); border-bottom-color: var(--accent); font-weight: 500; }
.tab:hover { background: var(--tint); }
.tab:focus-visible { outline-offset: -3px; }
.tab-badge {
  position: absolute; left: calc(50% + 8px); top: 5px; min-width: 16px; height: 16px; padding: 0 4px; display: grid; place-items: center;
  border-radius: 10px; background: var(--accent); color: #fff; font-size: .66rem;
}
.workspace { display: flex; flex: 1; flex-direction: column; min-height: 0; overflow: hidden; }

.inbox-toolbar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; flex: none; border-bottom: 1px solid var(--line); }
.search {
  display: flex; flex: 1; align-items: center; gap: 9px; height: 40px; min-width: 0; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: var(--soft);
}
.search:focus-within { border-color: var(--accent-text); }
.search input { width: 100%; min-width: 0; border: 0; outline: none; padding: 4px 0; color: var(--ink); background: transparent; }
.chat-list { flex: 1; min-height: 0; padding-bottom: env(safe-area-inset-bottom, 0px); overflow: auto; overscroll-behavior: contain; }
.chat-row {
  position: relative; width: 100%; min-height: 68px; display: flex; align-items: center; gap: 11px;
  padding: 9px 15px; border: 0; text-align: left; background: var(--surface);
}
.chat-row::after { content: ""; position: absolute; bottom: 0; left: 66px; right: 0; height: 1px; background: var(--line); }
.chat-row:hover, .chat-row.row-active { background: var(--tint); }
.chat-row:focus-visible { outline-offset: -3px; z-index: 1; }
.chat-summary, .chat-summary > strong, .snippet, .snippet > span:last-child { min-width: 0; }
.chat-summary { display: grid; flex: 1; gap: 2px; }
.chat-summary strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snippet { display: flex; gap: 5px; align-items: center; color: var(--muted); font-size: .87rem; }
.snippet > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-meta { min-height: 37px; display: grid; align-content: start; justify-items: end; gap: 3px; color: var(--muted); font-size: .75rem; }
.chat-meta time { white-space: nowrap; }
.unread { min-width: 19px; height: 19px; padding: 0 4px; display: grid; place-items: center; background: var(--accent); color: #fff; border-radius: 10px; font-size: .71rem; }

.avatar {
  position: relative; display: inline-grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px;
  border-radius: 50%; font-size: .9rem; font-weight: 500;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.avatar.small { flex-basis: 34px; width: 34px; height: 34px; font-size: .8rem; }
.avatar.tiny { flex-basis: 26px; width: 26px; height: 26px; font-size: .67rem; }
.avatar.large { flex-basis: 70px; width: 70px; height: 70px; border-radius: 17px; font-size: 1.65rem; }
.avatar-0 { background: #dfebf5; color: #2c4c6d; }
.avatar-1 { background: #dcece9; color: #285952; }
.avatar-2 { background: #e9e4f5; color: #544674; }
.avatar-3 { background: #f3e7dc; color: #774b32; }
.avatar-4 { background: #f2e1e7; color: #7b4257; }
.avatar-5 { background: #e4ebdd; color: #4b6037; }
.online-dot { position: absolute; width: 10px; height: 10px; right: 0; bottom: 0; background: #33996b; border: 2px solid var(--surface); border-radius: 50%; }

.empty, .welcome { display: grid; align-content: center; justify-items: center; gap: 7px; text-align: center; }
.empty { padding: clamp(26px, 6vw, 54px) 16px; }
.empty-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 4px; border-radius: 14px; background: var(--tint); color: var(--accent-text); }
.empty h2, .welcome h2 { font-size: 1.19rem; line-height: 1.25; }
.empty p, .welcome p { max-width: 31ch; color: var(--muted); font-size: .93rem; }
.empty .button { margin-top: 7px; }
.welcome { margin: auto; padding: 26px; }
.welcome img { width: 56px; height: 56px; margin-bottom: 7px; border-radius: 12px; }

.room { display: flex; flex: 1; flex-direction: column; min-width: 0; min-height: 0; background: var(--thread); }
.room-header { gap: 10px; border-bottom: 1px solid #ffffff20; }
.room-header .icon-button { color: #edf6ff; }
.room-header .icon-button:hover, .room-header .icon-button[aria-expanded="true"] { color: #fff; background: #ffffff17; }
.room-header .mobile-back { display: none; }
.room-person { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.room-person > div { min-width: 0; display: grid; }
.room-person strong, .room-person small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-person strong { font-size: 1.06rem; }
.room-person small { font-size: .81rem; color: #c0d2e3; }
.room-person .loading { padding: 0; color: #c0d2e3; }
.room-person .online-dot { border-color: var(--navy); }
.room-controls { position: relative; flex: none; }
.room-menu {
  position: absolute; z-index: 4; top: calc(100% + 6px); right: 0; width: 224px; max-width: calc(100vw - 28px);
  padding: 5px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
.room-menu button { width: 100%; min-height: 43px; display: flex; align-items: center; gap: 11px; padding: 6px 10px; border: 0; border-radius: 4px; background: transparent; text-align: left; font-size: .92rem; }
.room-menu button:hover { background: var(--tint); }
.room-menu button svg { color: var(--muted); }

.thread { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px clamp(15px, 4vw, 54px) 14px; }
.thread > .empty { min-height: 100%; }
.thread .older { display: flex; width: fit-content; min-height: 36px; margin: 7px auto; color: var(--muted); background: var(--surface); border-color: var(--line); font-size: .82rem; }
.day-marker { display: flex; align-items: center; gap: 12px; justify-content: center; margin: 14px 0; color: var(--muted); font-size: .76rem; }
.day-marker::before, .day-marker::after { content: ""; width: min(64px, 18%); height: 1px; background: var(--line); }
.message-line { display: flex; align-items: flex-start; gap: 6px; margin: 9px 0; }
.message-line.mine { justify-content: flex-end; }
.message-line.mine .message-more { order: -1; }
.message-line > .avatar { margin-top: 3px; }
.message-content { max-width: min(78%, 560px); min-width: 0; }
.bubble {
  padding: 6px 11px; border: 1px solid var(--line); border-radius: 7px 11px 11px 11px;
  background: var(--incoming); color: var(--ink); overflow-wrap: anywhere;
}
.mine .bubble { border-radius: 11px 7px 11px 11px; background: var(--outgoing); }
.message-body { white-space: pre-wrap; }
.bubble.bubble-ping { background: var(--ping); }
.bubble-ping .message-body { display: flex; align-items: center; gap: 6px; font-size: .92rem; }
.bubble-ping .message-body svg { color: var(--muted); }
.bubble-deleted .message-body { color: var(--muted); font-size: .87rem; font-style: italic; }
.message-caption { display: flex; align-items: center; gap: 6px; padding-bottom: 3px; color: var(--accent-text); font-size: .76rem; }
.message-time { min-height: 16px; display: flex; align-items: center; gap: 4px; padding: 1px 3px 0; color: var(--muted); font-size: .72rem; line-height: 1; }
.mine .message-time { justify-content: flex-end; }
.receipt {
  width: 16px; height: 16px; display: inline-grid; place-items: center; flex: 0 0 16px;
  border-radius: 50%; font-size: .72rem; font-weight: 500; line-height: 1; white-space: nowrap;
}
.receipt.is-read { color: var(--read); }
.receipt.is-delivered { color: var(--accent-text); }
.receipt.is-error { color: var(--red); font-size: 1rem; }
.receipt.is-pending, .receipt.is-sent { color: var(--muted); }
.message-more { width: 32px; height: 32px; }
.message-more svg { width: 16px; }
.bubble blockquote { padding: 4px 7px; margin: 0 0 4px; border-left: 2px solid var(--accent); border-radius: 3px; display: grid; background: var(--soft); color: var(--muted); font-size: .78rem; }
.bubble blockquote strong, .bubble blockquote span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.composer {
  padding: 8px clamp(12px, 4vw, 54px) calc(8px + env(safe-area-inset-bottom, 0px));
  flex: none; border-top: 1px solid var(--line); background: var(--surface);
}
.composer-notice { padding: 0 2px 6px; color: var(--muted); font-size: .81rem; }
.message-form { display: flex; align-items: flex-end; gap: 5px; }
.message-form textarea {
  flex: 1; min-width: 0; min-height: 43px; max-height: 140px; padding: 10px 10px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--soft); color: var(--ink); resize: none; overflow-y: auto;
}
.message-form .icon-button { height: 43px; }
.message-form .emoji-button[aria-expanded="true"] { color: var(--accent-text); background: var(--tint); }
.message-form .send-button { color: var(--accent-text); background: var(--tint); }
.message-form .send-button:hover { color: #fff; background: var(--accent); }
.reply-bar { display: flex; align-items: center; gap: 8px; border-left: 2px solid var(--accent); border-radius: 4px; padding: 3px 8px; margin-bottom: 6px; background: var(--soft); }
.reply-bar > div { flex: 1; min-width: 0; display: grid; font-size: .84rem; }
.reply-bar small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.reply-bar button { width: 34px; height: 34px; }
.emoji-tray { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 2px; max-height: min(178px, 30dvh); overflow: auto; margin-top: 7px; padding: 5px 0 1px; border-top: 1px solid var(--line); }
.emoji-tray button { min-height: 37px; border: 0; border-radius: 5px; background: transparent; font-size: 1.37rem; }
.emoji-tray button:hover { background: var(--tint); }

.screen { flex: 1; width: 100%; min-height: 0; padding: 14px 13px calc(24px + env(safe-area-inset-bottom, 0px)); overflow: auto; overscroll-behavior: contain; background: var(--page); }
.section-header { display: flex; justify-content: space-between; gap: 9px; min-height: 40px; align-items: center; }
.section-header h1 { font-size: 1.26rem; line-height: 1.2; }
.screen-header { margin-bottom: 12px; }
.screen-header > .button { font-size: .88rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
.list-section { margin-top: 15px; }
.list-section h2 { margin: 0 0 6px 2px; color: var(--muted); font-size: .95rem; }
.list-section h2 > span { margin-left: 4px; font-size: .79rem; }
.list-row { display: flex; align-items: center; min-width: 0; gap: 10px; padding: 9px 10px; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.row-identity { display: grid; flex: 1; min-width: 0; line-height: 1.4; }
.row-identity strong, .row-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-identity small { color: var(--muted); font-size: .82rem; }
.row-actions { display: flex; gap: 2px; align-items: center; }
.row-actions .icon-button { width: 38px; height: 38px; }
.update-card { margin-bottom: 9px; }
.update-card > .list-row { padding: 11px 11px 8px; }
.update-message { margin: 0 11px; padding: 9px 0 12px; border-top: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.listening { display: flex; align-items: center; gap: 9px; margin: 0 10px 10px; padding: 8px; background: var(--tint); color: var(--accent-text); border-radius: 5px; }
.listening > div { min-width: 0; display: grid; }
.listening small { font-size: .77rem; }
.listening strong { overflow-wrap: anywhere; font-size: .9rem; }

.profile-card { display: flex; gap: 15px; align-items: center; padding: 16px 14px; }
.profile-card-info { min-width: 0; }
.profile-card-info h2 { overflow-wrap: anywhere; font-size: 1.23rem; }
.profile-card-info p { color: var(--muted); overflow-wrap: anywhere; }
.profile-email { font-size: .85rem; }
.pin-label { margin: 7px 0 3px; color: var(--muted); font-size: .8rem; }
.pin-chip {
  display: inline-flex; align-items: center; gap: 9px; min-height: 33px; padding: 3px 8px;
  border: 1px solid var(--line); border-radius: 5px; background: var(--tint); color: var(--accent-text);
}
.pin-chip strong { font-family: ui-monospace, "Cascadia Mono", monospace; font-size: 1rem; letter-spacing: .08em; }
.pin-big strong { font-size: 1.42rem; }
.avatar-upload { display: inline-block; position: relative; flex: none; cursor: pointer; }
.avatar-camera {
  position: absolute; right: -3px; bottom: -3px; width: 27px; height: 27px; display: grid; place-items: center;
  border: 2px solid var(--surface); border-radius: 50%; background: var(--accent); color: #fff;
}
.avatar-upload:focus-within { outline: 2px solid var(--accent-text); outline-offset: 4px; border-radius: 17px; }
.settings { overflow: hidden; }
.setting-row { width: 100%; display: flex; align-items: center; gap: 11px; min-height: 51px; padding: 8px 11px; border: 0; background: var(--surface); text-align: left; }
.setting-row + .setting-row { border-top: 1px solid var(--line); }
.setting-row:hover { background: var(--soft); }
.setting-row:focus-visible { outline-offset: -3px; }
.setting-row > svg { color: var(--accent-text); }
.setting-row > span { flex: 1; min-width: 0; display: grid; }
.setting-row small { color: var(--muted); font-size: .81rem; }
.switch { position: relative; flex: none; width: 40px; height: 23px; background: var(--line); border-radius: 13px; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; background: #fff; border-radius: 50%; }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(17px); }

.modal {
  width: min(430px, calc(100vw - 26px)); max-height: min(690px, 89dvh); padding: 17px 19px; overflow: auto;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
.modal::backdrop { background: #0e192771; }
.modal-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 10px; }
.modal-title h2 { font-size: 1.25rem; line-height: 1.25; }
.modal-title .icon-button { width: 36px; height: 36px; }
.modal .muted { margin-bottom: 12px; }
.modal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.modal .empty { padding: 15px 3px 7px; }
.picker { max-height: min(300px, 32dvh); overflow: auto; padding: 0; }
.pick-row { width: 100%; border: 0; background: var(--surface); text-align: left; }
.pick-row:hover, .recipient:hover { background: var(--tint); }
.recipients, .music-form { margin: 0; border: 1px solid var(--line); border-radius: 5px; }
.recipient-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; font-size: .89rem; }
.form-stack .recipient { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 5px 9px; }
.music-form { display: grid; gap: 7px; padding: 8px 9px; }
.music-form legend { padding: 0 4px; color: var(--accent-text); font-size: .87rem; }

.toast {
  position: fixed; z-index: 20; bottom: calc(env(safe-area-inset-bottom, 0px) + 72px); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 26px); padding: 8px 13px; border-radius: 5px; box-shadow: var(--shadow);
  background: #203346; color: #f6f8fa; font-size: .9rem;
}

@media (max-width: 680px) {
  .sidebar { flex: 1; width: 100%; border-right: 0; }
  .room { display: none; }
  .room-open .sidebar { display: none; }
  .room-open .room { display: flex; }
  .room-header { padding-left: 6px; padding-right: 8px; gap: 5px; }
  .room-header .mobile-back { display: inline-flex; }
  .thread { padding-left: 10px; padding-right: 10px; }
  .composer { padding-left: 8px; padding-right: 8px; }
  .auth-card { box-shadow: none; }
}

@media (max-width: 350px) {
  .row-actions .icon-button { width: 34px; }
  .room-person { gap: 6px; }
  .modal { padding: 15px; }
}
