:root {
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  color: #203633;
  background: #efece3;
  font-synthesis: none;
  --pine: #224e45;
  --line: #d7d7c9;
  --muted: #53645d;
  --paper: #fcfaf4;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
button,
textarea {
  font: inherit;
}
button {
  border: 0;
  border-radius: 0.65rem;
  background: var(--pine);
  color: white;
  padding: 0.7rem 1rem;
  font-weight: 650;
  cursor: pointer;
}
button:hover {
  filter: brightness(1.12);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
textarea:focus-visible {
  outline: 3px solid #bd682f;
  outline-offset: 3px;
}
p {
  line-height: 1.5;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2 {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: normal;
  letter-spacing: -0.045em;
}
header {
  height: 64px;
  padding: 0 max(5vw, 18px);
  background: #1c3434;
  color: #f6f3e8;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font:
    600 1.3rem Georgia,
    serif;
}
.mark {
  width: 24px;
  height: 19px;
  display: inline-block;
  background: #f2a66d;
  border-radius: 8px 8px 8px 1px;
  position: relative;
  transform: rotate(-5deg);
}
.mark:after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 1px;
  border: 4px solid transparent;
  border-left-color: #f2a66d;
}
.large {
  width: 52px;
  height: 41px;
  border-radius: 16px 16px 16px 2px;
}
.large:after {
  bottom: -7px;
  border-width: 7px;
}
#connection {
  font-size: 0.85rem;
}
#entry {
  min-height: calc(100dvh - 64px);
  display: grid;
  place-items: center;
  padding: 1.3rem;
}
.welcome {
  background: var(--paper);
  padding: clamp(2rem, 7vw, 5rem);
  border: 1px solid var(--line);
  border-radius: 1.5rem;
  width: min(100%, 37rem);
}
.welcome h1 {
  font-size: clamp(3.2rem, 8vw, 5.4rem);
  margin: 1.8rem 0 0.9rem;
}
.welcome p {
  color: var(--muted);
  max-width: 34ch;
}
.welcome button {
  margin: 1.7rem 0 0.4rem;
}
#entry-error:not(:empty) {
  color: #9b331e;
  margin-top: 1rem;
}
#chat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 28%);
  max-width: 1160px;
  margin: clamp(12px, 3vh, 32px) auto;
  height: calc(100dvh - 64px - clamp(12px, 3vh, 32px) * 2);
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  overflow: hidden;
  background: var(--paper);
}
.conversation {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.roomhead {
  padding: 1.4rem 2rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.roomhead h1 {
  font-size: clamp(2.2rem, 4vw, 3.3rem);
}
.roomhead p,
#people-help,
.mycode,
small,
.meta {
  color: var(--muted);
  font-size: 0.86rem;
}
.roomhead p {
  margin-top: 0.25rem;
}
.quiet {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--pine);
}
#people-toggle {
  display: none;
}
#scroll {
  overflow: auto;
  flex: 1;
  padding: 1rem clamp(1rem, 3vw, 2.5rem);
  scrollbar-gutter: stable;
}
#empty {
  padding: clamp(2rem, 10vh, 6rem) 0;
  text-align: center;
  color: var(--muted);
}
#empty h2 {
  font-size: 2rem;
  color: #344c43;
}
#empty p {
  margin-top: 0.6rem;
}
#messages,
#members {
  list-style: none;
  margin: 0;
  padding: 0;
}
#messages li {
  margin: 0.8rem 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
#messages .own {
  align-items: flex-end;
}
.meta {
  padding: 0.2rem 0.3rem;
  font-size: 0.76rem;
}
.bubble {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 82%;
  background: #efeee5;
  border: 1px solid #deded3;
  border-radius: 1rem 1rem 1rem 0.2rem;
  padding: 0.7rem 1rem;
  line-height: 1.48;
}
.own .bubble {
  background: #dae9db;
  border-color: #c7dbce;
  border-radius: 1rem 1rem 0.2rem 1rem;
}
.unreadable {
  color: var(--muted);
  font-style: italic;
}
#compose {
  padding: 0.8rem clamp(1rem, 3vw, 2rem) 1.4rem;
  border-top: 1px solid var(--line);
}
#notice {
  font-size: 0.84rem;
  color: #88451d;
}
#notice:not(:empty) {
  margin-bottom: 0.55rem;
}
.inputrow {
  display: flex;
  align-items: flex-end;
  gap: 0.7rem;
}
.inputrow textarea {
  color: inherit;
  resize: vertical;
  max-height: 8rem;
  min-height: 3rem;
  min-width: 0;
  flex: 1;
  background: #fffefa;
  border: 1px solid #aebbb0;
  border-radius: 0.8rem;
  padding: 0.65rem 0.8rem;
}
.inputrow button {
  min-height: 3rem;
}
aside {
  border-left: 1px solid var(--line);
  padding: 1.8rem 1.4rem;
  background: #f2f1e8;
  overflow: auto;
}
aside h2 {
  font-size: 1.7rem;
}
#people-help {
  margin: 0.7rem 0 1rem;
}
#members li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  overflow-wrap: anywhere;
  gap: 0.35rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
}
#members button {
  font-size: 0.8rem;
  padding: 0.4rem 0.65rem;
}
.mycode {
  border-top: 1px solid var(--line);
  margin-top: 1.2rem;
  padding-top: 1.2rem;
}
.mycode h3 {
  font-size: 0.85rem;
  color: #273b33;
  margin-bottom: 0.5rem;
}
code {
  display: block;
  font-size: 0.95rem;
  line-height: 1.6;
  letter-spacing: 0.035em;
  overflow-wrap: anywhere;
}
.mycode code {
  margin-top: 0.4rem;
}
dialog {
  max-width: min(27rem, 92vw);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--paper);
  padding: 1.6rem;
  color: inherit;
}
dialog::backdrop {
  background: #11252180;
}
dialog h2 {
  font-size: 2rem;
}
dialog p {
  margin: 0.8rem 0;
}
dialog code {
  background: #eeede3;
  padding: 0.75rem;
  border-radius: 0.4rem;
}
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1rem;
}
@media (max-width: 720px) {
  header {
    height: 50px;
  }
  #chat {
    height: calc(100dvh - 50px);
    margin: 0;
    border: 0;
    border-radius: 0;
    display: flex;
    position: relative;
  }
  .conversation {
    width: 100%;
  }
  .roomhead {
    padding: 0.8rem 1rem;
  }
  .roomhead h1 {
    font-size: 2.2rem;
  }
  #compose {
    padding-bottom: max(0.8rem, env(safe-area-inset-bottom));
  }
  #people-toggle {
    display: block;
  }
  aside {
    display: none;
    position: absolute;
    right: 0;
    top: 5.5rem;
    bottom: 0;
    width: min(92%, 24rem);
    box-shadow: -8px 0 28px #122c2420;
    border-top: 1px solid var(--line);
  }
  aside.open {
    display: block;
  }
  .bubble {
    max-width: 94%;
  }
  #entry {
    min-height: calc(100dvh - 50px);
  }
}
.groupbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.55rem clamp(0.8rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line);
}
.groupbar button,
.groupbar select {
  font-size: 0.85rem;
  min-height: 38px;
  padding: 0.45rem 0.7rem;
}
.pick {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
  max-width: 100%;
}
.pick select,
dialog input:not([type="checkbox"]),
#paste-invite input {
  border: 1px solid #afbbb0;
  border-radius: 0.5rem;
  background: #fffefa;
  color: #203633;
  padding: 0.55rem;
  font: inherit;
  max-width: 100%;
}
.pick select {
  max-width: 13rem;
  text-overflow: ellipsis;
}
.roomhead h1,
dialog h2 {
  overflow-wrap: anywhere;
}
dialog input:not([type="checkbox"]),
#paste-invite input {
  display: block;
  width: 100%;
  margin: 0.4rem 0 0.8rem;
}
dialog fieldset {
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  max-height: 38vh;
  overflow: auto;
  margin: 1rem 0;
  padding: 0.7rem;
}
#choices label {
  display: block;
  padding: 0.4rem;
}
#choices input {
  accent-color: #224e45;
}
#group-editor,
#invitation,
#alert-settings {
  width: min(28rem, 94vw);
  max-height: 90dvh;
  overflow-y: auto;
}
.pref {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 0.75rem 0;
}
.pref strong {
  font-size: 0.9rem;
}
#push-help,
#invite-status,
#group-status {
  font-size: 0.86rem;
  color: var(--muted);
}
#paste-invite {
  margin-top: 1.5rem;
}
.welcome #paste-invite button {
  margin-top: 0.4rem;
}
#add-existing {
  margin: 0.7rem 0;
}
.actions {
  flex-wrap: wrap;
}
@media (max-width: 720px) {
  .groupbar {
    padding: 0.45rem 0.7rem;
    gap: 0.35rem;
  }
  .groupbar button,
  .groupbar select {
    font-size: 0.82rem;
    min-height: 38px;
  }
  .roomhead h1 {
    font-size: 1.8rem;
  }
  .pick select {
    max-width: 10rem;
  }
  aside {
    z-index: 2;
    top: 5rem;
  }
  .roomhead {
    gap: 0.5rem;
    min-height: 5rem;
  }
  #scroll {
    min-height: 0;
  }
}
