:root {
  font:
    16px/1.75 Tahoma,
    'Segoe UI',
    Arial,
    sans-serif;
  color-scheme: light;
  --bg: #f2f5f2;
  --surface: #fff;
  --ink: #1b2d2a;
  --muted: #516962;
  --accent: #075f52;
  --light: #e3f2eb;
  --border: #cbdad3;
  --error: #932d25;
  --shadow: 0 14px 40px rgba(27, 61, 48, 0.06);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}
.frame {
  width: min(100%, 52rem);
  margin: auto;
  padding: 1.4rem 1rem 6rem;
}
.mast,
.identity,
.row,
.actions,
.top,
.toolbar,
nav {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}
.mast,
.top {
  justify-content: space-between;
}
.mast {
  padding: 0.5rem 0.2rem 1.25rem;
}
.identity h1,
.identity small {
  margin: 0;
  display: block;
}
.identity h1 {
  font-size: 1.5rem;
  font-weight: 750;
  line-height: 1.3;
}
.identity small,
.muted,
small {
  color: var(--muted);
  font-size: 0.82rem;
}
.mark,
.avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  border-radius: 1rem;
  background: var(--accent);
  color: #fff;
  font-size: 1.8rem;
  width: 3rem;
  height: 3rem;
}
.avatar {
  background: var(--light);
  color: var(--accent);
  font-size: 1.1rem;
}
.pill,
.badge {
  font-size: 0.76rem;
  border-radius: 2rem;
  background: var(--light);
  padding: 0.15rem 0.7rem;
  color: var(--accent);
}
main {
  outline: 0;
}
.card,
.panel,
.item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.15rem;
  box-shadow: var(--shadow);
}
.card + .card,
.panel + .panel,
.item + .item {
  margin-top: 0.75rem;
}
h2,
h3,
p {
  margin: 0.15rem 0 0.65rem;
}
h2 {
  font-size: 1.35rem;
}
h3 {
  font-size: 1.02rem;
}
.stack,
form,
.list {
  display: grid;
  gap: 0.8rem;
}
.list {
  gap: 0.5rem;
}
.item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: none;
  margin: 0 !important;
}
.grow {
  flex: 1;
  min-width: 0;
}
.wrap,
.actions,
.toolbar {
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.empty {
  color: var(--muted);
  padding: 1.4rem 0.3rem;
  text-align: center;
}
button,
.button {
  border: 1px solid transparent;
  border-radius: 0.7rem;
  font: inherit;
  font-size: 0.93rem;
  line-height: 1.45;
  padding: 0.59rem 0.92rem;
  cursor: pointer;
  color: white;
  background: var(--accent);
  text-decoration: none;
  text-align: center;
}
button:hover {
  filter: brightness(0.93);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button.alt,
.button.alt {
  background: var(--light);
  color: var(--accent);
}
button.ghost,
.button.ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
}
button.warn {
  color: var(--error);
  background: #fbeeea;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #d89731;
  outline-offset: 2px;
}
input,
textarea,
select {
  max-width: 100%;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  padding: 0.55rem 0.75rem;
}
textarea {
  resize: vertical;
  min-height: 4rem;
}
label {
  font-size: 0.88rem;
  display: grid;
  gap: 0.2rem;
}
label.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
input[type='checkbox'],
input[type='radio'] {
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
}
fieldset {
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  min-width: 0;
}
legend {
  padding: 0 0.4rem;
  color: var(--muted);
}
.rules,
.body-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.rules {
  max-height: 15rem;
  overflow: auto;
  background: var(--bg);
  padding: 0.75rem 1rem;
  border-radius: 0.65rem;
}
.messages {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  overflow: auto;
  max-height: 58dvh;
  padding: 0.6rem 0.15rem;
  scroll-behavior: auto;
}
.bubble {
  display: grid;
  align-self: flex-end;
  max-width: 83%;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.4rem 0.78rem;
  border-radius: 0.92rem;
  gap: 0.25rem;
  overflow-wrap: anywhere;
}
.bubble.self {
  align-self: flex-start;
  background: var(--light);
}
.bubble small {
  font-size: 0.68rem;
}
.bubble img {
  max-width: 100%;
  max-height: 21rem;
  object-fit: contain;
}
.bubble audio {
  max-width: 100%;
  width: 15rem;
}
.bubble .link {
  border: 0;
  background: none;
  text-align: start;
  padding: 0;
  color: var(--muted);
  font-size: 0.72rem;
}
.error {
  color: var(--error);
  overflow-wrap: anywhere;
}
nav {
  position: fixed;
  bottom: max(0.5rem, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface);
  padding: 0.35rem;
  max-width: calc(100% - 1rem);
  box-shadow: var(--shadow);
  z-index: 2;
  justify-content: center;
}
nav button {
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
  font-size: 0.84rem;
}
nav button[aria-current='page'] {
  background: var(--light);
  color: var(--accent);
}
#toast:not(:empty) {
  background: var(--ink);
  color: white;
  position: fixed;
  bottom: 5.2rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.55rem 0.9rem;
  border-radius: 0.65rem;
  font-size: 0.85rem;
  z-index: 4;
  max-width: 90%;
  text-align: center;
}
.skip {
  position: absolute;
  top: -10rem;
}
.skip:focus {
  top: 0;
  background: #fff;
}
.thumb {
  width: 3rem;
  height: 3rem;
  border-radius: 0.8rem;
  object-fit: cover;
}
.choice {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.sel {
  outline: 2px solid var(--accent);
}
[hidden] {
  display: none !important;
}
details summary {
  cursor: pointer;
  color: var(--accent);
}
.sep {
  border: 0;
  border-top: 1px solid var(--border);
  width: 100%;
}
.owner .frame {
  width: min(61rem, 100%);
}
.owner .mark {
  background: #654533;
}
.metric {
  font-size: 1.5rem;
  font-weight: bold;
}
.compact {
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
}
.preview {
  width: 100%;
  max-height: 18rem;
  object-fit: contain;
  border-radius: 0.7rem;
}
.code {
  direction: ltr;
  text-align: left;
  font:
    0.85rem/1.6 Consolas,
    monospace;
  overflow-wrap: anywhere;
}
.menu-wrap {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.top {
  margin-bottom: 0.9rem;
}
.item p {
  margin: 0;
}
.nowrap {
  white-space: nowrap;
}
dialog {
  max-width: min(90vw, 28rem);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
}
dialog::backdrop {
  background: #14262080;
}
@media (max-width: 520px) {
  .frame {
    padding: 0.8rem 0.55rem 6rem;
  }
  .card,
  .panel,
  .item {
    padding: 0.8rem;
  }
  nav {
    width: calc(100% - 1rem);
    gap: 0.1rem;
  }
  nav button {
    flex: 1;
    padding: 0.55rem 0.25rem;
    font-size: 0.78rem;
  }
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #13201e;
    --surface: #1b2c29;
    --ink: #f1f7f4;
    --muted: #b2c6bd;
    --accent: #75c9ac;
    --light: #283f37;
    --border: #3a5149;
    --error: #ffb5aa;
  }
  button,
  .button,
  .mark {
    color: #10221b;
  }
  button.warn {
    color: var(--error);
    background: #453432;
  }
  #toast:not(:empty) {
    color: #152922;
  }
}
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f2f5f2;
  --surface: #fff;
  --ink: #1b2d2a;
  --muted: #516962;
  --accent: #075f52;
  --light: #e3f2eb;
  --border: #cbdad3;
  --error: #932d25;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #13201e;
  --surface: #1b2c29;
  --ink: #f1f7f4;
  --muted: #b2c6bd;
  --accent: #75c9ac;
  --light: #283f37;
  --border: #3a5149;
  --error: #ffb5aa;
}
:root[data-theme='dark'] button {
  color: #10221b;
}
:root[data-theme='dark'] button.alt,
:root[data-theme='dark'] button.ghost {
  color: var(--accent);
}
#requests-off {
  margin-top: 1rem;
}
.viewer {
  overflow: auto;
  text-align: center;
}
.viewer img {
  touch-action: pinch-zoom;
}
.composer {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  padding: 0.6rem 0;
}
.room {
  padding-bottom: 0.5rem;
}
.night {
  background: var(--bg);
}
.image-button {
  padding: 0;
  background: transparent;
  border: none;
}
.image-button img,
video {
  display: block;
  max-width: 100%;
  border-radius: 0.65rem;
}
.sticker {
  max-width: 9rem;
  max-height: 9rem;
}
.voice {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  flex-wrap: wrap;
}
.voice input {
  width: 7rem;
}
.voice small {
  direction: ltr;
}
.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5rem, 1fr));
  gap: 0.6rem;
}
.catalog img,
.catalog video {
  width: 100%;
  height: 4.4rem;
  object-fit: contain;
}
.full {
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  margin: 0;
  border: 0;
  border-radius: 0;
}
.zoom {
  max-height: 78dvh;
  overflow: auto;
  text-align: center;
}
.zoom img {
  max-width: 100%;
  max-height: 76dvh;
  object-fit: contain;
  touch-action: pinch-zoom;
}
.zoomed .zoom img {
  max-width: unset;
  max-height: unset;
  width: 170%;
}
.bubble {
  touch-action: pan-y;
  user-select: none;
}
.bubble .body-text {
  user-select: text;
}
.owner #sections {
  margin: 0 0 1rem;
}
.owner main > h2 {
  margin-bottom: 1rem;
}
.code {
  white-space: pre-wrap;
}
.room .messages {
  min-height: 12rem;
}
button[disabled] {
  cursor: not-allowed;
}
tg-sticker {
  display: inline-block;
  width: 8rem;
  height: 8rem;
  max-width: 100%;
}
.catalog tg-sticker {
  width: 100%;
  height: 4.4rem;
}
.grow {
  min-width: 0;
}
.row.wrap > label {
  min-width: 8rem;
}
#filter .row:has([name='minAge']) {
  flex-wrap: wrap;
}
#filter .row:has([name='minAge']) label {
  min-width: 5rem;
}
input,
textarea,
select {
  max-width: 100%;
}
