:root {
  color-scheme: light;
  --page: #e5c4bf;
  --app: #fffdfb;
  --soft: #fff3ef;
  --soft-2: #f8f5f3;
  --text: #171719;
  --muted: #7a7372;
  --line: #eee6e2;
  --accent: #e94b20;
  --accent-2: #fb8b4a;
  --olive: #9aa333;
  --bubble: #ffffff;
  --keegon: #fff2eb;
  --shadow: 0 18px 70px rgba(77, 42, 36, 0.18);
  --radius: 26px;
  --tap: 44px;
}

* {
  box-sizing: border-box;
  min-width: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  display: grid;
  place-items: center;
  background: var(--page);
  color: var(--text);
  font-family: Inter, ui-rounded, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

button,
input,
label {
  max-width: 100%;
  font: inherit;
}

button,
label[for] {
  cursor: pointer;
}

button {
  border: 0;
}

.shell {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(100vw, 1180px);
  height: min(100dvh, 900px);
  overflow: hidden;
  background: var(--app);
  box-shadow: var(--shadow);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 18px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff9f6, #fffdfb);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fb8b4a, #df3818);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 900;
}

.brand-bee {
  display: block;
  font-size: 2em;
  line-height: 1;
  transform-origin: center;
  animation: bee-buzz 1.8s ease-in-out infinite;
}

@keyframes bee-buzz {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(-8deg);
  }

  25% {
    transform: translate3d(1px, -2px, 0) rotate(8deg);
  }

  50% {
    transform: translate3d(-1px, 1px, 0) rotate(-4deg);
  }

  75% {
    transform: translate3d(2px, -1px, 0) rotate(10deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-bee {
    animation: none;
  }
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  overflow: hidden;
  color: var(--text);
  font-size: 1.16rem;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar p {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  box-shadow: 0 8px 22px rgba(64, 36, 30, 0.1);
  font-size: 0.73rem;
  font-weight: 900;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  position: relative;
}

.n8soft-link {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  max-width: 220px;
  padding: 4px 10px 4px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 8px 22px rgba(64, 36, 30, 0.08);
  font-size: 0.72rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.n8soft-link:hover {
  color: var(--accent);
}

.n8soft-link img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}

.weather-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  max-width: 210px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  box-shadow: 0 8px 22px rgba(64, 36, 30, 0.08);
  font-size: 0.73rem;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.panel,
.chat-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.room-panel {
  background: var(--app);
}

.room-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto minmax(0, 160px);
  padding: 14px 12px;
  border-right: 1px solid var(--line);
}

.panel-title {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.spaced {
  margin-top: 10px;
}

.room-list,
.people-list {
  display: grid;
  align-content: start;
  gap: 2px;
  width: 100%;
  max-width: 100%;
  overflow: auto;
  scrollbar-width: none;
}

.room-list-wrap {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.room-list {
  height: 100%;
  padding: 0 4px 18px 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 24px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 24px), transparent 100%);
}

.room-list::-webkit-scrollbar,
.people-list::-webkit-scrollbar,
.messages::-webkit-scrollbar {
  display: none;
}

.room-button {
  display: grid;
  align-items: center;
  width: 100%;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-button:hover {
  background: #f4f1f1;
}

.room-button.active {
  background: #ffe0d8;
  color: #111;
}

.person {
  max-width: 100%;
  padding: 9px 11px;
  border-radius: 15px;
  background: var(--soft-2);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person.moderator {
  background: #fff0e7;
  color: var(--accent);
}

.chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-right: 1px solid var(--line);
  background: #fbfaf9;
}

.chat-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--app);
}

.eyebrow,
.room-subtitle {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.chat-head h2 {
  overflow: hidden;
  margin-top: 2px;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 950;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-subtitle {
  margin-top: 2px;
}

.small-button {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  box-shadow: 0 8px 24px rgba(64, 36, 30, 0.1);
  font-size: 0.76rem;
  font-weight: 900;
}

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

.small-button.ghost {
  background: #f0eeef;
  color: var(--muted);
}

.messages {
  min-height: 0;
  padding: 16px 18px;
  overflow: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, #fbfaf9, #fffdfb);
  scrollbar-width: none;
}

.message {
  width: fit-content;
  max-width: min(78%, 680px);
  margin: 0 0 12px;
  padding: 11px 13px;
  border-radius: 18px;
  background: var(--bubble);
  box-shadow: 0 8px 26px rgba(64, 36, 30, 0.08);
}

.message.moderator {
  background: var(--keegon);
}

.message.mine {
  margin-left: auto;
  background: #ffe0d8;
}

.message-meta {
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 950;
}

.message-body {
  overflow-wrap: anywhere;
  color: #232020;
  font-size: 0.95rem;
  line-height: 1.38;
}

.shared-photo {
  display: block;
  max-width: 100%;
  max-height: 280px;
  border-radius: 14px;
  object-fit: contain;
}

.composer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px 48px 48px 68px;
  gap: 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--app);
}

.composer input,
.name-input,
.password-input,
.join-card input {
  width: 100%;
  min-height: var(--tap);
  border: 0;
  border-radius: 999px;
  background: #f0eeef;
  color: var(--text);
  padding: 0 16px;
  font-size: 16px;
  outline: none;
}

.composer input:focus,
.name-input:focus,
.password-input:focus,
.join-card input:focus {
  box-shadow: 0 0 0 2px rgba(233, 75, 32, 0.25);
}

.composer button,
.join-card button,
.attach-button {
  min-height: var(--tap);
  border-radius: 999px;
  font-weight: 900;
}

.composer button,
.join-card button {
  background: var(--accent);
  color: #fff;
}

.photo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.attach-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f0eeef;
  color: var(--accent);
  cursor: pointer;
  font-size: 1.2rem;
}

.attach-button.uploading {
  opacity: 0.62;
  pointer-events: none;
}

.mic-button {
  background: #f0eeef !important;
  color: var(--accent) !important;
  font-size: 1.1rem;
}

.emoji-button {
  background: #f0eeef !important;
  color: var(--accent) !important;
  font-size: 1.22rem;
}

.emoji-picker {
  position: absolute;
  right: 88px;
  bottom: calc(100% + 8px);
  z-index: 8;
  display: grid;
  width: min(320px, calc(100vw - 28px));
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(31, 23, 20, 0.18);
}

.emoji-picker[hidden] {
  display: none;
}

.emoji-picker button {
  min-height: 38px;
  border-radius: 12px;
  background: #f7f3ef;
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
}

.account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.password-input {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: #f0eeef;
  color: var(--text);
  padding: 0 13px;
  font-size: 16px;
  outline: none;
}

.account-button {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f0eeef;
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 900;
}

.account-button.reserve {
  background: var(--accent);
  color: #fff;
}

.menu-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 999px;
  background: #f0eeef;
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
}

.menu-check {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
}

.account-status {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.user-menu {
  position: relative;
  flex: 0 0 auto;
}

.user-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 38px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  list-style: none;
}

.user-menu summary span {
  display: block;
  width: 17px;
  height: 2px;
  border-radius: 99px;
  background: #fff;
}

.user-menu summary::-webkit-details-marker {
  display: none;
}

.user-menu-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 10px);
  right: 0;
  display: grid;
  gap: 8px;
  width: min(310px, calc(100vw - 24px));
  max-height: min(560px, calc(100dvh - 84px));
  overflow: auto;
  padding: 14px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 70px rgba(77, 42, 36, 0.22);
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

dialog {
  width: min(360px, calc(100vw - 28px));
  border: 0;
  border-radius: 24px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

textarea {
  width: 100%;
  min-height: 110px;
  resize: none;
  border: 0;
  border-radius: 16px;
  background: #f0eeef;
  color: var(--text);
  padding: 12px;
  font: inherit;
  font-size: 16px;
}

.dialog-copy,
.info-copy {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 7px;
}

.report-button,
.admin-delete-button,
.admin-ban-button {
  display: inline-flex;
  margin-top: 7px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
}

.admin-delete-button,
.admin-ban-button {
  color: #b00020;
}

.message.alert {
  width: 100%;
  max-width: 100%;
  background: #ffe1dc;
  border-left: 5px solid #d71920;
}

.message.alert .message-meta {
  color: #b00020;
}

.message.spam {
  background: #eeeeee;
  border: 1px solid #dedede;
  color: #555;
  box-shadow: none;
  opacity: 1;
}

.message.spam .message-meta {
  color: #8a1c1c;
}

.message.spam .message-body {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #555;
}

.spam-cross {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #d71920;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 950;
  line-height: 1;
}

.join-card {
  display: grid;
  gap: 12px;
}

.join-card h2 {
  font-size: 1.05rem;
}

@media (max-width: 760px) {
  body {
    display: block;
    background: var(--app);
  }

  .shell {
    width: 100vw;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    box-shadow: none;
  }

  .topbar {
    min-height: 64px;
    padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  }

  .brand-avatar {
    width: 38px;
    height: 38px;
  }

  h1 {
    font-size: 1.06rem;
  }

  .topbar p {
    display: none;
  }

  .status-pill {
    min-width: 54px;
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.68rem;
  }

  .top-actions {
    gap: 5px;
  }

  .n8soft-link {
    left: auto;
    right: 10px;
    bottom: 66px;
    max-width: 34px;
    width: 34px;
    min-height: 32px;
    padding: 3px;
    justify-content: center;
  }

  .n8soft-link span {
    position: absolute;
    left: -9999px;
  }

  .weather-pill {
    max-width: 112px;
    min-height: 32px;
    padding: 0 9px;
    font-size: 0.66rem;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .room-panel {
    grid-template-rows: auto auto;
    gap: 8px;
    padding: 9px 12px 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .room-panel .panel-title {
    display: none;
  }

  .room-list,
  .people-list {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
  }

  .room-list-wrap {
    height: auto;
    min-width: 0;
    overflow: hidden;
  }

  .room-list {
    height: auto;
    padding-right: 28px;
    padding-bottom: 0;
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 34px), transparent 100%);
    mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 34px), transparent 100%);
  }

  .room-button {
    flex: 0 0 auto;
    width: auto;
    max-width: 142px;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    background: #f4f1f1;
    font-size: 0.8rem;
  }

  .room-button.active {
    background: #ffc7bb;
  }

  .people-list {
    min-height: 28px;
  }

  .person {
    flex: 0 0 auto;
    max-width: 118px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
  }

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

  .chat-head {
    min-height: 56px;
    padding: 8px 14px;
  }

  .eyebrow {
    display: none;
  }

  .chat-head h2 {
    font-size: 1rem;
  }

  .room-subtitle {
    font-size: 0.72rem;
  }

  .small-button {
    min-height: 34px;
    padding: 0 11px;
    font-size: 0.7rem;
  }

  .chat-actions {
    gap: 5px;
  }

  .messages {
    padding: 12px 12px 52px;
  }

  .message {
    max-width: 88%;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 18px;
  }

  .message-meta {
    font-size: 0.7rem;
  }

  .message-body {
    font-size: 0.91rem;
  }

  .composer {
    grid-template-columns: minmax(0, 1fr) 42px 42px 42px 58px;
    gap: 8px;
    padding: 9px 12px;
  }

  .emoji-picker {
    right: 10px;
    bottom: calc(100% + 7px);
    grid-template-columns: repeat(6, 1fr);
  }

  .composer input,
  .name-input {
    min-height: 42px;
    padding: 0 14px;
    font-size: 16px;
  }

  .composer button {
    min-height: 42px;
    font-size: 16px;
  }

  .account-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .account-status {
    display: block;
  }

  .password-input,
  .account-button {
    min-height: 36px;
    font-size: 16px;
  }

  .account-button {
    padding: 0 9px;
  }

  .user-menu-panel .panel-title,
  .user-menu-panel .field-label,
  .user-menu-panel .spaced {
    display: block;
  }

  .top-actions {
    gap: 5px;
  }

  .shared-photo {
    max-height: 230px;
  }
}

@media (max-width: 360px) {
  .brand-avatar {
    display: none;
  }

  .composer {
    grid-template-columns: minmax(0, 1fr) 38px 38px 38px 54px;
    gap: 6px;
  }
}

.page-body {
  display: block;
  min-height: 100%;
  overflow: auto;
  background: var(--page);
}

.content-page {
  width: min(760px, calc(100vw - 28px));
  margin: 24px auto;
  padding: 24px;
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--shadow);
}

.content-page h1 {
  white-space: normal;
  margin-bottom: 14px;
}

.content-page h2 {
  margin-top: 22px;
  margin-bottom: 10px;
}

.content-page p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.45;
}

.back-link {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--accent);
  font-weight: 900;
  text-decoration: none;
}

.contact-page-form {
  display: grid;
  gap: 10px;
}

.contact-page-form input,
.contact-page-form textarea {
  width: 100%;
  border: 0;
  border-radius: 18px;
  background: #f0eeef;
  padding: 13px 14px;
  font-size: 16px;
}

.contact-page-form button {
  min-height: 44px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}
[hidden] {
  display: none !important;
}
