:root {
  color-scheme: light;
  --canvas: #e8ebe3;
  --surface: #f3f0e6;
  --surface-subtle: #eae9df;
  --text: #242720;
  --muted: #697066;
  --line: #d5d9d1;
  --line-soft: #e4e8e0;
  --blue: #ad4b22;
  --blue-hover: #963f1c;
  --blue-tint: #f8eee8;
  --green: #54765a;
  --forest: #334d40;
  --berry: #7b4b61;
  --red: #953f4b;
  --shadow: 0 8px 30px rgb(30 38 29 / 7%);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #20251f;
  --surface: #2a3028;
  --surface-subtle: #333a31;
  --text: #ecede5;
  --muted: #adb4a7;
  --line: #485045;
  --line-soft: #3c4439;
  --blue: #df8a55;
  --blue-hover: #eea26f;
  --blue-tint: #49372d;
  --green: #9bb58e;
  --forest: #45644f;
  --berry: #d39bb0;
  --red: #e18d92;
  --shadow: 0 10px 32px rgb(0 0 0 / 22%);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--canvas);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--blue);
  font-weight: 500;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text);
  background: var(--surface-subtle);
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

button:hover:not(:disabled) {
  background-color: #e9ece6;
}

:root[data-theme="dark"] button:hover:not(:disabled) {
  background-color: #41483e;
}

button:active:not(:disabled) {
  transform: scale(0.985);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgb(173 75 34 / 28%);
  outline-offset: 2px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #c6cbc3;
  border-radius: 7px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select {
  border-color: var(--line);
}

input {
  min-height: 46px;
  padding: 0 13px;
}

select {
  min-height: 46px;
  padding: 0 13px;
}

textarea {
  min-height: 116px;
  padding: 10px 13px;
  resize: vertical;
  line-height: 1.45;
}

input::placeholder,
textarea::placeholder {
  color: #858b80;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgb(173 75 34 / 16%);
}

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 40px 20px;
}

.auth-shell {
  display: grid;
  width: min(420px, 100%);
}

.pick-shell {
  display: grid;
  width: min(620px, 100%);
}

.app-version {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.loading-screen {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 12px;
  color: var(--text);
  background: var(--canvas);
  text-align: center;
  transition: opacity 260ms ease, visibility 260ms ease;
}

.loading-screen.is-hidden {
  visibility: hidden;
  opacity: 0;
}

.loading-screen p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.loading-mark {
  display: grid;
  width: 44px;
  height: 44px;
  margin: 0 auto;
  place-items: center;
  border-radius: 12px;
  color: #ffffff;
  background: var(--forest);
  font-size: 15px;
  font-weight: 700;
  animation: loading-pulse 900ms ease-in-out infinite alternate;
}

.loading-dots {
  display: inline-block;
  width: 18px;
  overflow: hidden;
  vertical-align: bottom;
  animation: loading-dots 900ms steps(4, end) infinite;
}

@keyframes loading-pulse {
  from { transform: scale(.94); opacity: .72; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes loading-dots {
  0% { width: 0; }
  100% { width: 18px; }
}

.settings-button,
.settings-close {
  display: inline-grid;
  flex: 0 0 auto;
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  place-items: center;
  padding: 0;
  font-size: 19px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.report-button {
  display: inline-grid;
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  place-items: center;
  padding: 0;
  border: 1px solid #c96b73;
  border-radius: 7px;
  color: #ffffff;
  background: #953f4b;
  font-size: 20px;
  font-weight: 800;
}

.report-button:hover:not(:disabled),
.report-submit-button:hover:not(:disabled) {
  background: #7f303b;
}

.report-submit-button {
  border: 1px solid #c96b73;
  color: #ffffff;
  background: #953f4b;
  font-weight: 600;
}

.button-loading-screen {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  color: var(--text);
  background: rgb(232 235 227 / 86%);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transition: opacity 120ms ease;
}

.button-loading-screen.is-visible {
  opacity: 1;
}

.button-loading-screen p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

:root[data-theme="dark"] .button-loading-screen {
  background: rgb(32 37 31 / 88%);
}

.settings-dialog {
  width: min(420px, calc(100% - 28px));
  max-width: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 24px 70px rgb(0 0 0 / 24%);
}

.settings-dialog::backdrop {
  background: rgb(20 24 19 / 52%);
  backdrop-filter: blur(3px);
}

.settings-form {
  display: grid;
  gap: 20px;
  padding: 22px;
}

.settings-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.settings-heading h2 {
  font-size: 22px;
}

.settings-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.settings-fieldset legend {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-subtle);
}

.theme-options label {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.theme-options input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.theme-options span {
  display: grid;
  min-height: 36px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
}

.theme-options input:checked + span {
  border-color: var(--line);
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 3px rgb(0 0 0 / 8%);
}

.theme-options input:focus-visible + span {
  outline: 3px solid rgb(173 75 34 / 28%);
  outline-offset: 1px;
}

.settings-name-field {
  gap: 8px;
}

.settings-status {
  min-height: 18px;
  margin: -12px 0;
  color: var(--muted);
  font-size: 12px;
}

.app-shell > .app-version {
  grid-column: 1 / -1;
}

.panel {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-card {
  display: grid;
  gap: 20px;
  padding: 34px;
  border-top: 3px solid var(--blue);
}

.auth-card h1 {
  margin-top: -8px;
  font-size: 32px;
}

.auth-form-title {
  margin-top: -8px;
  font-size: 20px;
  font-weight: 600;
}

.public-intro {
  display: grid;
  gap: 10px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.public-intro h2 {
  color: var(--text);
  font-size: 18px;
}

.public-intro p {
  margin: 0;
}

.public-links,
.public-backlink {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0;
  font-size: 13px;
}

.public-shell {
  width: min(820px, 100%);
  margin: auto;
  padding: 28px 20px 42px;
}

.public-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 60px;
}

.public-nav-button {
  display: inline-grid;
  min-height: 38px;
  place-items: center;
  padding: 0 14px;
}

.public-hero {
  max-width: 670px;
  margin-bottom: 72px;
}

.public-hero h1 {
  max-width: 660px;
  margin: 0 0 16px;
  font-size: 48px;
  line-height: 1.04;
}

.public-lede {
  max-width: 590px;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.5;
}

.public-cta {
  display: inline-grid;
  min-height: 46px;
  place-items: center;
  padding: 0 18px;
  color: #ffffff;
}

.compact-hero {
  margin-bottom: 36px;
}

.compact-hero h1 {
  font-size: 42px;
}

.public-section {
  margin-bottom: 58px;
}

.public-section h2 {
  max-width: 600px;
  margin-bottom: 22px;
  font-size: 27px;
}

.public-section p {
  max-width: 650px;
  color: var(--muted);
  line-height: 1.6;
}

.seo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.seo-grid article,
.public-callout,
.faq-list details {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
}

.seo-grid article {
  padding: 18px;
}

.seo-grid h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.seo-grid p {
  margin: 0;
  font-size: 13px;
}

.public-callout {
  padding: 22px;
}

.public-callout p:last-child {
  margin-bottom: 0;
}

.faq-list {
  display: grid;
  gap: 9px;
  margin-bottom: 30px;
}

.update-list {
  display: grid;
  gap: 12px;
  margin-bottom: 30px;
}

.update-entry {
  padding: 20px 22px;
  border-left: 3px solid var(--blue);
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}

.update-entry time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.update-entry h2 {
  margin: 8px 0 7px;
  font-size: 19px;
}

.update-entry p {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.faq-list details {
  padding: 17px 18px;
}

.faq-list summary {
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}

.faq-list p {
  max-width: 680px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

@media (max-width: 680px) {
  .public-shell {
    padding: 20px 16px 34px;
  }

  .public-header {
    margin-bottom: 42px;
  }

  .public-hero {
    margin-bottom: 48px;
  }

  .public-lede {
    font-size: 16px;
  }

  .public-hero h1,
  .compact-hero h1 {
    font-size: 34px;
  }

  .seo-grid {
    grid-template-columns: 1fr;
  }
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.brand-lockup::after {
  margin-left: 2px;
  font-size: 16px;
  content: "🍂";
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: var(--forest);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.eyebrow::before {
  margin-right: 5px;
  content: "🍁";
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.16;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
  font-weight: 650;
}

h2 {
  font-size: 20px;
  font-weight: 600;
}

.auth-copy {
  margin: -11px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.join-form {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.form-error {
  min-height: 18px;
  margin: 0;
  color: var(--red);
  font-size: 13px;
}

.auth-switch {
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.auth-switch a {
  white-space: nowrap;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(260px, 310px) minmax(0, 1fr);
  gap: 16px;
  width: min(1280px, calc(100% - 48px));
  min-height: calc(100dvh - 48px);
  margin: 24px auto;
}

.setup-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
}

.title-row,
.chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.title-row h1 {
  font-size: 25px;
}

.status-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 99px;
  color: var(--muted);
  background: var(--surface-subtle);
  font-size: 12px;
  font-weight: 500;
}

.status-badge.ready::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  content: "";
}

.status-badge.error {
  border-color: #e4c6c3;
  color: var(--red);
  background: #fbf1ef;
}

:root[data-theme="dark"] .status-badge.error {
  border-color: #654047;
  background: #39282c;
}

:root[data-theme="dark"] .room-note,
:root[data-theme="dark"] .share-panel {
  background: #30362d;
}

:root[data-theme="dark"] .chat-header {
  background: #292f27;
}

:root[data-theme="dark"] .message:not(.mine) {
  background: #343b32;
}

:root[data-theme="dark"] .primary-button {
  color: #20251f;
}

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 13px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 13px;
}

.account-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.people-panel {
  display: grid;
  gap: 9px;
}

.people-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.people-heading h2 {
  font-size: 14px;
}

.people-count {
  display: inline-grid;
  min-width: 22px;
  min-height: 22px;
  place-items: center;
  border-radius: 99px;
  color: var(--green);
  background: var(--blue-tint);
  font-size: 11px;
  font-weight: 700;
}

.active-user-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.active-user {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--text);
  font-size: 12px;
}

.active-user-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.active-user strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-user-status {
  color: var(--muted);
  font-size: 10px;
}

.compact-button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.primary-button {
  color: #ffffff;
  background: var(--blue);
  font-weight: 600;
}

.primary-button:hover:not(:disabled) {
  background: var(--blue-hover);
}

.secondary-button {
  border-color: var(--line);
  color: var(--text);
  background: var(--surface);
  font-weight: 500;
}

.secondary-button:hover:not(:disabled) {
  border-color: #bbc2b8;
  background: var(--surface-subtle);
}

.room-actions {
  display: grid;
  gap: 8px;
}

.danger-button {
  border: 1px solid #c96b73;
  color: #ffffff;
  background: #953f4b;
  font-weight: 600;
}

.danger-button:hover:not(:disabled) {
  border-color: #a93440;
  background: #7f303b;
}

.leave-room-button {
  color: var(--red);
}

.leave-room-button span,
.danger-button span {
  margin-right: 5px;
}

:root[data-theme="dark"] .danger-button {
  color: #281f20;
  background: #e18d92;
}

:root[data-theme="dark"] .danger-button:hover:not(:disabled) {
  background: #eea6aa;
}

.ghost-button {
  color: var(--blue);
  background: transparent;
  font-weight: 500;
}

.ghost-button:hover:not(:disabled) {
  color: var(--blue-hover);
  background: var(--blue-tint);
}

.wide {
  width: 100%;
}

.not-found-link {
  display: grid;
  min-height: 44px;
  place-items: center;
  border-radius: 7px;
  color: #ffffff;
  text-decoration: none;
}

.not-found-link:hover {
  color: #ffffff;
  background: var(--blue-hover);
  text-decoration: none;
}

.choice-panel {
  display: grid;
  gap: 10px;
}

.big-choice {
  min-height: 54px;
  text-align: left;
}

.guide-panel {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
}

.guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.guide-header h2 {
  font-size: 15px;
}

.guide-pill {
  padding: 4px 9px;
  border-radius: 99px;
  color: var(--blue);
  background: var(--blue-tint);
  font-size: 11px;
  font-weight: 600;
}

.guide-pill::before {
  margin-right: 4px;
  content: "🎃";
}

.guide-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
}

.guide-list li + li {
  margin-top: 7px;
}

.guide-note {
  margin: 0;
  color: var(--berry);
  font-size: 12px;
}

.room-note {
  display: grid;
  gap: 8px;
  padding: 13px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--muted);
  background: #eeece2;
  font-size: 13px;
}

.room-note p {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
}

.room-note strong {
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
  text-align: right;
}

.voice-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--berry);
  border-radius: 8px;
  background: var(--surface);
}

.voice-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.voice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.voice-audio-host {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  pointer-events: none;
}

.chat-panel {
  display: grid;
  min-width: 0;
  min-height: 640px;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  overflow: hidden;
}

.chat-header {
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line-soft);
  background: #e9ebe2;
}

.chat-header h2 {
  font-size: 19px;
}

.chat-stats {
  display: grid;
  justify-items: end;
  gap: 3px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.chat-stats span {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-stats span:last-child {
  color: var(--text);
  font-weight: 600;
}

.messages {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 22px 24px;
  scroll-behavior: smooth;
}

.messages.drag-over {
  outline: 2px dashed var(--blue);
  outline-offset: -8px;
  background: var(--blue-tint);
}

.empty-note {
  max-width: 360px;
  margin: auto;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.message {
  max-width: min(76%, 620px);
  padding: 10px 13px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--text);
  background: #e7e9df;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.message.mine {
  align-self: flex-end;
  border-color: var(--forest);
  color: #ffffff;
  background: var(--forest);
}

.message.retraced {
  border-style: dashed;
  color: var(--muted);
  background: var(--surface-subtle);
}

.message-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.message-meta time {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.message.mine .message-meta time {
  color: rgb(255 255 255 / 72%);
}

.message-seen {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-align: right;
}

.message.mine .message-seen {
  color: rgb(255 255 255 / 75%);
}

.typing-indicator {
  min-height: 18px;
  margin: 0;
  padding: 0 24px 7px;
  color: var(--berry);
  font-size: 11px;
  font-weight: 600;
}

.message.mine .message-meta {
  color: rgb(255 255 255 / 78%);
}

.message.retraced .message-meta {
  color: var(--muted);
}

.chat-image {
  display: block;
  max-width: min(100%, 360px);
  max-height: 360px;
  border-radius: 7px;
  object-fit: contain;
}

.chat-video {
  display: block;
  width: min(100%, 420px);
  max-height: 420px;
  border-radius: 7px;
  background: #000000;
}

.unsend-button {
  min-height: 26px;
  margin-top: 6px;
  padding: 0;
  color: #ffffff;
  background: transparent;
  font-size: 12px;
}

.message:not(.mine) .unsend-button {
  color: var(--red);
}

.message.system {
  align-self: center;
  max-width: 90%;
  border: 0;
  color: var(--berry);
  background: transparent;
  font-size: 12px;
  text-align: center;
}

.composer-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 12px 24px 0;
  border-top: 1px solid var(--line-soft);
}

.emoji-button,
.file-button {
  display: inline-grid;
  min-width: 40px;
  min-height: 34px;
  place-items: center;
  padding: 0 10px;
}

.file-button {
  color: var(--blue);
}

.message-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  padding: 12px 24px 20px;
}

.message-form input {
  min-height: 44px;
}

.send-button {
  min-width: 76px;
}

.message-form.has-text .send-button {
  animation: send-ready 1.2s ease-in-out infinite;
}

.message-form.is-sending .send-button {
  animation: send-pulse 700ms ease-in-out infinite alternate;
}

@keyframes send-ready {
  0%, 100% { box-shadow: 0 0 0 0 rgb(173 75 34 / 0%); }
  50% { box-shadow: 0 0 0 5px rgb(173 75 34 / 16%); }
}

@keyframes send-pulse {
  from { transform: translateY(0); }
  to { transform: translateY(-2px) scale(1.02); }
}

.button-loading-screen.message-loading .loading-mark {
  border-radius: 50%;
  background: var(--blue);
  animation: send-orbit 650ms ease-in-out infinite alternate;
}

@keyframes send-orbit {
  from { transform: translateX(-10px) rotate(-12deg); }
  to { transform: translateX(10px) rotate(12deg); }
}

.create-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 300px);
  align-items: start;
  gap: 22px;
}

.generator-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  align-items: end;
  gap: 9px;
}

.refresh-button {
  width: 46px;
  min-width: 46px;
  min-height: 46px;
  padding: 0;
  color: var(--blue);
  font-size: 20px;
}

.share-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #eeece2;
}

.share-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.share-grid > div {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: var(--surface);
}

.qr-invite {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface);
  font-size: 11px;
  font-weight: 600;
}

.qr-invite > div {
  display: grid;
  width: 180px;
  height: 180px;
  place-items: center;
  overflow: hidden;
  border-radius: 4px;
}

.qr-invite img,
.qr-invite canvas {
  display: block;
  width: 180px;
  height: 180px;
  max-width: 100%;
  border-radius: 4px;
}

.share-grid span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
}

.share-grid strong {
  display: block;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.back-button {
  min-height: 38px;
}

.guest-mode .choice-panel {
  grid-template-columns: 1fr;
}

.guest-mode #goCreateButton {
  display: none;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: minmax(220px, 270px) minmax(0, 1fr);
    width: calc(100% - 32px);
    min-height: calc(100dvh - 32px);
    margin: 16px auto;
    gap: 12px;
  }

  .setup-panel {
    padding: 18px;
  }

  .chat-header,
  .messages {
    padding-right: 18px;
    padding-left: 18px;
  }

  .composer-tools {
    padding-right: 18px;
    padding-left: 18px;
  }

  .message-form {
    padding-right: 18px;
    padding-left: 18px;
  }

  .create-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .auth-page {
    align-items: start;
    padding: 24px 14px;
  }

  .auth-card {
    gap: 18px;
    padding: 24px 20px;
  }

  .app-shell {
    grid-template-columns: minmax(0, 1fr);
    width: calc(100% - 20px);
    min-height: auto;
    margin: 10px auto;
    gap: 10px;
  }

  .setup-panel {
    gap: 12px;
    padding: 16px;
  }

  .guide-panel {
    margin-top: 0;
  }

  .chat-panel {
    min-height: 62dvh;
    grid-template-rows: auto minmax(220px, 1fr) auto auto;
  }

  .chat-header {
    padding: 15px 16px;
  }

  .messages {
    padding: 16px;
  }

  .composer-tools {
    padding: 10px 16px 0;
  }

  .message-form {
    padding: 10px 16px 16px;
  }
}

@media (max-width: 420px) {
  .auth-card {
    padding: 22px 17px;
  }

  .auth-card h1 {
    font-size: 28px;
  }

  .title-row h1 {
    font-size: 22px;
  }

  .chat-header,
  .message-form {
    gap: 8px;
  }

  .chat-stats span {
    max-width: 120px;
  }

  .message {
    max-width: 90%;
  }

  .share-grid {
    grid-template-columns: 1fr;
  }
}

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