* {
  box-sizing: border-box;
}

:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  color-scheme: light dark;
  --brand: #176b57;
  --brand-strong: #0f5948;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, Canvas);
  --surface: Canvas;
  --surface-soft: color-mix(in srgb, CanvasText 4%, Canvas);
  --surface-raised: color-mix(in srgb, CanvasText 7%, Canvas);
  --border: color-mix(in srgb, CanvasText 14%, transparent);
  --border-strong: color-mix(in srgb, CanvasText 28%, transparent);
  --muted: color-mix(in srgb, CanvasText 68%, transparent);
  --danger: #a22b2b;
  --shadow: 0 18px 50px color-mix(in srgb, #000 12%, transparent);
  --radius: 1rem;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface-soft);
  color: CanvasText;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 2.75rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: 0.8rem;
  background: var(--surface);
  color: CanvasText;
  font-weight: 700;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: var(--surface-raised);
}

button:disabled {
  opacity: 0.52;
  cursor: wait;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
h2:focus-visible,
h3:focus-visible,
.message:focus-visible {
  outline: 3px solid Highlight;
  outline-offset: 3px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border-strong);
  border-radius: 0.8rem;
  background: var(--surface);
  color: CanvasText;
}

textarea {
  min-height: 2.75rem;
  max-height: 10rem;
  resize: vertical;
}

label {
  display: grid;
  gap: 0.4rem;
  font-weight: 700;
}

.skip-link {
  position: fixed;
  left: 0.75rem;
  top: 0.75rem;
  transform: translateY(-180%);
  padding: 0.65rem 0.85rem;
  border: 2px solid currentColor;
  border-radius: 0.6rem;
  background: var(--surface);
  color: CanvasText;
  z-index: 100;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  width: min(82rem, calc(100% - 1.5rem));
  margin-inline: auto;
  padding: 0.75rem 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark,
.empty-mark,
.conversation-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  font-weight: 900;
}

.brand-mark {
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.2rem;
}

.brand-lockup h1 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-lockup p {
  margin: 0.05rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

main {
  width: min(82rem, calc(100% - 1.5rem));
  margin-inline: auto;
  padding-bottom: 1rem;
}

.signed-in {
  min-height: calc(100dvh - 5rem);
}

.messenger-shell {
  display: grid;
  grid-template-columns: minmax(17rem, 22rem) minmax(0, 1fr);
  min-height: calc(100dvh - 5.75rem);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.chat-sidebar {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.sidebar-heading,
.conversation-header,
.settings-header,
.section-heading {
  display: flex;
  align-items: center;
}

.sidebar-heading {
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 4.5rem;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-heading h2,
.conversation-header h2,
.settings-header h2,
.section-heading h3 {
  margin: 0;
}

.sidebar-actions,
.call-actions,
.voice-draft-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chat-navigation {
  min-height: 0;
  overflow-y: auto;
}

.chat-list {
  display: grid;
  gap: 0.25rem;
  padding: 0.45rem;
}

.chat-item,
.user-result {
  width: 100%;
  min-height: 3.75rem;
  display: grid;
  gap: 0.1rem;
  padding: 0.65rem 0.75rem;
  border: 0;
  border-radius: 0.85rem;
  text-align: left;
}

.chat-item.is-current {
  background: var(--brand-soft);
  box-shadow: inset 3px 0 0 var(--brand);
}

.chat-username,
.chat-preview,
.conversation-peer,
.hint,
.message-meta {
  color: var(--muted);
}

.chat-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.88rem;
}

.chat-username {
  font-size: 0.83rem;
}

.search-panel {
  display: grid;
  gap: 0.55rem;
  margin: 0.55rem;
  padding: 0.8rem;
  border-radius: 0.9rem;
  background: var(--surface-soft);
}

.search-panel h3 {
  font-size: 1rem;
}

.user-results {
  display: grid;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.conversation-pane {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background: color-mix(in srgb, var(--brand) 3%, var(--surface));
}

.conversation-header {
  min-height: 4.5rem;
  gap: 0.7rem;
  padding: 0.65rem 0.8rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, Canvas 94%, transparent);
  backdrop-filter: blur(16px);
  z-index: 3;
}

.conversation-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.7rem;
  flex: 1 1 auto;
}

.conversation-avatar {
  width: 2.5rem;
  height: 2.5rem;
}

.conversation-name-block {
  min-width: 0;
}

.conversation-header h2,
.conversation-peer {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-header h2 {
  font-size: 1.05rem;
}

.conversation-peer {
  margin: 0.08rem 0 0;
  font-size: 0.82rem;
}

.conversation-empty {
  align-self: center;
  justify-self: center;
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}

.empty-mark {
  width: 4.5rem;
  height: 4.5rem;
  font-size: 1.8rem;
  opacity: 0.88;
}

.message-list {
  align-content: end;
  display: grid;
  gap: 0.5rem;
  min-height: 0;
  margin: 0;
  padding: 1rem;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.message,
.message-empty {
  width: min(40rem, 86%);
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
  overflow-wrap: anywhere;
  box-shadow: 0 3px 12px color-mix(in srgb, #000 5%, transparent);
}

.message-mine {
  justify-self: end;
  border-color: color-mix(in srgb, var(--brand) 36%, var(--border));
  background: var(--brand-soft);
  border-bottom-right-radius: 0.3rem;
}

.message-theirs,
.message-empty {
  justify-self: start;
  border-bottom-left-radius: 0.3rem;
}

.message-pending {
  opacity: 0.68;
}

.message-failed {
  border-color: var(--danger);
  border-style: dashed;
}

.message-author {
  display: block;
  color: var(--brand-strong);
  font-size: 0.78rem;
  font-weight: 800;
}

.message p {
  margin: 0.15rem 0 0.3rem;
  white-space: pre-wrap;
}

.message-meta {
  display: block;
  font-size: 0.75rem;
}

.retry-message {
  margin-top: 0.5rem;
}

html[data-message-view="compact"] .message-list {
  align-content: start;
  gap: 0;
  padding: 0;
  background: var(--surface);
}

html[data-message-view="compact"] .message,
html[data-message-view="compact"] .message-empty {
  width: 100%;
  justify-self: stretch;
  padding: 0.72rem 0.9rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}

html[data-message-view="compact"] .message-mine {
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--brand) 55%, transparent);
}

html[data-message-view="compact"] .message-author,
html[data-message-view="compact"] .message-meta {
  display: inline;
}

html[data-message-view="compact"] .message-author::after {
  content: " · ";
  color: var(--muted);
}

html[data-message-view="compact"] .message p {
  margin: 0.28rem 0 0;
}

.call-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  margin: 0.6rem 0.8rem 0;
  padding: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--border));
  border-radius: 0.9rem;
  background: var(--brand-soft);
}

.call-copy h2 {
  margin: 0;
  font-size: 0.95rem;
}

.call-copy p {
  margin: 0.1rem 0 0;
  font-size: 0.85rem;
}

.call-banner audio {
  display: none;
}

.composer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 0.45rem;
  padding: 0.65rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.composer-input-wrap {
  position: relative;
  min-width: 0;
}

.composer textarea {
  padding-right: 0.8rem;
  border-radius: 1.15rem;
  resize: none;
}

.composer-action {
  align-self: end;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  border-color: transparent;
}

.composer-action:hover:not(:disabled) {
  background: var(--brand-strong);
}

.send-action {
  display: none;
}

.composer-has-text:not(.voice-recording) .voice-action {
  display: none;
}

.composer-has-text:not(.voice-recording) .send-action {
  display: inline-flex;
}

.voice-recording .voice-action {
  display: inline-flex;
  background: var(--danger);
}

.voice-recording-status {
  position: absolute;
  right: 0.65rem;
  bottom: 0.7rem;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--danger);
  pointer-events: none;
}

.voice-draft-panel {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px dashed var(--border-strong);
  border-radius: 0.85rem;
  background: var(--surface-soft);
}

.voice-draft-panel > div:first-child {
  display: grid;
  gap: 0.15rem;
}

.voice-message {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.3rem;
}

.voice-message audio {
  display: none;
}

.voice-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.voice-progress {
  width: 100%;
}

.voice-time,
.voice-listen-status {
  display: block;
  font-size: 0.8rem;
}

.voice-listen-status:empty {
  display: none;
}

.auth-layout,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr));
  gap: 0.8rem;
}

.auth-layout {
  width: min(54rem, 100%);
  margin: 3vh auto 0;
}

.card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.card h2,
.card h3 {
  margin-top: 0;
}

.form-stack {
  display: grid;
  gap: 0.9rem;
}

.hint {
  margin: 0;
  font-size: 0.88rem;
}

.settings-dialog {
  width: min(64rem, calc(100% - 2rem));
  max-height: min(88dvh, 54rem);
  margin: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  background: var(--surface-soft);
  color: CanvasText;
  box-shadow: var(--shadow);
}

.settings-dialog::backdrop {
  background: color-mix(in srgb, #000 44%, transparent);
  backdrop-filter: blur(3px);
}

.settings-header {
  position: sticky;
  top: 0;
  z-index: 2;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.settings-header .eyebrow {
  margin: 0 0 0.05rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.settings-grid {
  padding: 0.8rem;
}

.developer-details {
  margin: 0 0.8rem 0.8rem;
  padding: 0.7rem;
  border: 1px dashed var(--border-strong);
  border-radius: 0.85rem;
  background: var(--surface);
}

.developer-details summary {
  cursor: pointer;
  font-weight: 700;
}

.diagnostics-panel {
  padding-top: 0.7rem;
}

.details-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.55rem;
  margin: 0.8rem 0;
}

.details-list div {
  padding: 0.65rem;
  border-radius: 0.7rem;
  background: var(--surface-soft);
  overflow-wrap: anywhere;
}

.details-list dt {
  font-weight: 800;
}

.details-list dd {
  margin: 0.15rem 0 0;
}

.compact-details {
  grid-template-columns: 1fr;
}

.switch-row {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.switch-row input[type="checkbox"] {
  width: 1.35rem;
  min-height: 1.35rem;
  margin: 0;
}

.session-list {
  display: grid;
  gap: 0.55rem;
  padding: 0;
  list-style: none;
}

.session-list li {
  display: grid;
  gap: 0.4rem;
  padding: 0.7rem;
  border-radius: 0.75rem;
  background: var(--surface-soft);
}

.session-list span {
  font-size: 0.88rem;
}

.session-list button {
  justify-self: start;
}

.result-box {
  margin-top: 0.8rem;
  padding: 0.8rem;
  border: 1px solid var(--border-strong);
  border-radius: 0.75rem;
  background: var(--surface-soft);
}

.result-box code {
  display: block;
  overflow-wrap: anywhere;
  user-select: all;
}

.danger-button {
  color: var(--danger);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  min-width: 2.75rem;
  height: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  font-size: 0;
}

.button-with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

[data-icon]::before {
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

[data-icon="compose"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 5v14M5 12h14' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
[data-icon="settings"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 15.5A3.5 3.5 0 1 0 12 8a3.5 3.5 0 0 0 0 7.5ZM19.4 15a1.7 1.7 0 0 0 .34 1.88l.06.06-2.83 2.83-.06-.06A1.7 1.7 0 0 0 15 19.4a1.7 1.7 0 0 0-1 .6 1.7 1.7 0 0 0-.4 1.1V21H9.6v-.1A1.7 1.7 0 0 0 8 19.4a1.7 1.7 0 0 0-1.88.34l-.06.06-2.83-2.83.06-.06A1.7 1.7 0 0 0 3.6 15a1.7 1.7 0 0 0-.6-1 1.7 1.7 0 0 0-1.1-.4H2V9.6h.1A1.7 1.7 0 0 0 3.6 8a1.7 1.7 0 0 0-.34-1.88l-.06-.06 2.83-2.83.06.06A1.7 1.7 0 0 0 8 3.6a1.7 1.7 0 0 0 1-.6 1.7 1.7 0 0 0 .4-1.1V2h4v.1A1.7 1.7 0 0 0 15 3.6a1.7 1.7 0 0 0 1.88-.34l.06-.06 2.83 2.83-.06.06A1.7 1.7 0 0 0 19.4 8c.13.4.35.74.66 1 .3.27.7.42 1.1.4h.1v4h-.1c-.4-.02-.8.13-1.1.4-.31.26-.53.6-.66 1Z' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
[data-icon="back"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m15 18-6-6 6-6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
[data-icon="phone"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.12.9.33 1.8.62 2.65a2 2 0 0 1-.45 2.11L8 9.73a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.85.29 1.74.5 2.65.62A2 2 0 0 1 22 16.9Z' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
[data-icon="phone-off"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m2 2 20 20M8.5 8.5 7.2 9.8a16 16 0 0 0 7 6.2l1.1-1.1M5.2 5.2A19.7 19.7 0 0 1 3 4.2 2 2 0 0 1 5 2h2a2 2 0 0 1 2 1.7c.08.58.2 1.15.37 1.7M16.2 13.3c.4.17.8.31 1.22.43.85.29 1.74.5 2.65.62A2 2 0 0 1 22 16.9v3a2 2 0 0 1-.38 1.16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
[data-icon="refresh"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6v6h-6M4 18v-6h6M6.5 8a7 7 0 0 1 11-2L20 8M4 16l2.5 2a7 7 0 0 0 11-2' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
[data-icon="mic"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='9' y='2' width='6' height='12' rx='3' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M5 10a7 7 0 0 0 14 0M12 17v5M8 22h8' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
[data-icon="mic-off"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m2 2 20 20M9 5v5a3 3 0 0 0 4.2 2.75M15 9V5a3 3 0 0 0-5.1-2.15M5 10a7 7 0 0 0 11.4 5.4M19 10a7 7 0 0 1-.7 3M12 17v5M8 22h8' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
[data-icon="send"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m22 2-7 20-4-9-9-4 20-7Z' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='m22 2-11 11' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
[data-icon="trash"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 6h18M8 6V4h8v2M19 6l-1 15H6L5 6M10 11v6M14 11v6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
[data-icon="close"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 6l12 12M18 6 6 18' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
[data-icon="logout"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M10 17l5-5-5-5M15 12H3M14 3h5a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
[data-icon="bell"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9M10 21h4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
[data-icon="bell-off"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m2 2 20 20M6.3 6.3A6 6 0 0 0 6 8c0 7-3 7-3 9h14M18 13.7c-.1-1.4 0-3 0-5.7a6 6 0 0 0-8.6-5.4M10 21h4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
[data-icon="play"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m8 5 11 7-11 7V5Z' fill='black'/%3E%3C/svg%3E"); }
[data-icon="pause"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 5h4v14H7zM13 5h4v14h-4z' fill='black'/%3E%3C/svg%3E"); }
[data-icon="rewind"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m11 6-7 6 7 6V6Zm9 0-7 6 7 6V6Z' fill='black'/%3E%3C/svg%3E"); }
[data-icon="forward"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m4 6 7 6-7 6V6Zm9 0 7 6-7 6V6Z' fill='black'/%3E%3C/svg%3E"); }
[data-icon="speed"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 14a8 8 0 1 1 16 0M12 14l4-4M5 18h14' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

.voice-action[aria-pressed="true"] {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m22 2-7 20-4-9-9-4 20-7Z' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='m22 2-11 11' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.mobile-only {
  display: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

@media (max-width: 48rem) {
  .site-header,
  main {
    width: 100%;
  }

  .site-header {
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
  }

  .brand-lockup p {
    display: none;
  }

  main {
    padding: 0;
  }

  .messenger-shell {
    display: block;
    min-height: calc(100dvh - 3.9rem);
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .chat-sidebar,
  .conversation-pane {
    min-height: calc(100dvh - 3.9rem);
  }

  .chat-sidebar {
    border-right: 0;
  }

  body:not(.conversation-open) .conversation-pane {
    display: none;
  }

  body.conversation-open .chat-sidebar {
    display: none;
  }

  .mobile-only {
    display: inline-grid;
  }

  .conversation-header {
    position: sticky;
    top: 0;
  }

  .message,
  .message-empty {
    width: min(92%, 36rem);
  }

  html[data-message-view="compact"] .message,
  html[data-message-view="compact"] .message-empty {
    width: 100%;
  }

  .call-banner {
    grid-template-columns: 1fr;
  }

  .composer {
    position: sticky;
    bottom: 0;
  }

  .voice-draft-panel {
    display: grid;
  }

  .settings-dialog {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .auth-layout {
    padding: 0.8rem;
  }
}
