.g-layout,
.g-room,
.g-empty,
.g-select-list,
.g-member,
.g-invite {
  --g-border: var(--border, #e5e0ed);
  --g-muted: var(--muted, #635d72);
  --g-accent: var(--accent, #7053cd);
}
.g-layout,
.g-room {
  width: min(900px, 100%);
  margin: 0 auto;
}
.g-heading,
.g-room-head,
.g-thread,
.g-invite,
.g-member,
.g-compose,
.g-check,
.g-select-list label {
  display: flex;
  align-items: center;
  gap: 12px;
}
.g-heading {
  justify-content: space-between;
  margin: 0 0 22px;
}
.g-heading h2,
.g-room-head h2,
.g-box h3,
.g-empty h2,
.g-empty h3 {
  margin: 0;
}
.g-heading p,
.g-empty p {
  margin: 5px 0 0;
}
.subpage .g-box.panel {
  padding: 17px 22px;
  margin: 12px 0;
}
.g-box > h3 {
  padding: 0 0 10px;
}
.g-thread {
  border: 0;
  background: transparent;
  text-align: left;
  width: 100%;
  color: inherit;
  cursor: pointer;
  padding: 15px 8px;
  border-radius: 10px;
}
.g-thread:hover,
.g-select-list label:hover {
  background: #f3eff9;
}
.g-thread + .g-thread,
.g-invite + .g-invite,
.g-member + .g-member {
  border-top: 1px solid var(--g-border);
}
.g-avatar,
.g-empty-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 45px;
  height: 45px;
  border-radius: 15px;
  background: linear-gradient(145deg, #f4ecff, #e5dcf9);
  color: #563a94;
  border: 1px solid #d7c9ef;
  box-shadow: inset 0 1px #fff;
  font-weight: 750;
}
.g-small {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 14px;
}
.g-thread-info,
.g-thread-meta,
.g-invite > span:nth-child(2),
.g-card > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}
.g-thread-info {
  flex: 1;
}
.g-thread-info > * {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.g-thread-info span,
.g-thread-meta,
.g-invite small,
.g-member small,
.g-room-title small,
.g-card small,
.g-system,
.g-by,
.g-status {
  font-size: 12px;
  color: var(--g-muted);
}
.g-thread-meta {
  justify-items: end;
}
.g-unread {
  border-radius: 20px;
  background: #6548ac;
  color: white;
  min-width: 20px;
  padding: 1px 6px;
  text-align: center;
}
.g-invite,
.g-member {
  padding: 10px 0;
}
.g-invite > span:nth-child(2),
.g-member > span:not(.g-avatar) {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.g-empty {
  text-align: center;
  padding: 40px 18px;
}
.g-empty-icon {
  margin: 0 0 12px;
}
.g-empty > .btn {
  margin: 16px 0 0;
}
.g-select-list {
  max-height: 240px;
  overflow: auto;
  margin-top: 8px;
}
.g-select-list label {
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
}
.g-select-list input,
.g-check input,
.g-member input {
  width: auto;
  accent-color: var(--g-accent);
}
.g-member select {
  width: auto;
  max-width: 112px;
}
.g-danger {
  color: #942c49 !important;
  border-color: #ecceda !important;
}
.subpage .g-room.panel {
  overflow: hidden;
  padding: 0;
}
.g-room-head {
  padding: 16px 20px;
  background: linear-gradient(105deg, #f4effc, #fff 70%);
  border-bottom: 1px solid var(--g-border);
}
.g-room-title {
  flex: 1;
  min-width: 0;
}
.g-room-title h2 {
  font-size: 19px;
  overflow-wrap: anywhere;
}
.g-notice {
  padding: 7px 20px;
  background: #f5f0fc;
  color: #59427a;
  font-size: 13px;
}
.g-notice summary {
  cursor: pointer;
}
.g-notice p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.g-messages {
  height: min(54vh, 570px);
  min-height: 220px;
  overflow: auto;
  padding: 14px 20px;
  scrollbar-gutter: stable;
  background: #f8f7fa;
  overscroll-behavior: contain;
}
.g-older,
.g-report {
  background: none;
  border: 0;
  color: var(--g-accent);
  cursor: pointer;
}
.g-older {
  display: block;
  margin: 0 auto 12px;
}
.g-older[hidden] {
  display: none;
}
.g-system {
  text-align: center;
  margin: 12px 0;
}
.g-msg {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0;
}
.g-msg > div {
  max-width: min(78%, 620px);
  min-width: 0;
}
.g-by {
  margin: 0 0 3px;
}
.g-by time {
  color: var(--g-muted);
  margin-left: 4px;
}
.g-report {
  font-size: 11px;
  margin-left: 6px;
}
.g-mine {
  flex-direction: row-reverse;
}
.g-mine .g-by {
  text-align: right;
}
.g-bubble {
  background: white;
  border: 1px solid #e2dce9;
  color: #302a3a;
  box-shadow: 0 1px 3px rgba(49, 35, 73, 0.045);
  border-radius: 5px 15px 15px 15px;
  padding: 9px 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.g-mine .g-bubble {
  background: #eae2fb;
  border-color: #d8c9f1;
  color: #40315d;
  border-radius: 15px 5px 15px 15px;
}
.g-bubble img,
.g-bubble video {
  max-width: min(100%, 300px);
  max-height: 260px;
  display: block;
}
.g-card {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
}
.g-compose {
  display: grid;
  gap: 4px;
  padding: 12px 16px;
  border-top: 1px solid var(--g-border);
  background: #fff;
}
.subpage .g-compose textarea {
  display: block;
  width: 100%;
  min-height: 52px;
  max-height: 170px;
  resize: vertical;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 7px 8px;
  background: transparent;
  color: #33293f;
  font: inherit;
  line-height: 1.55;
}
.g-compose textarea:focus-visible {
  outline: 2px solid #b5a0ca;
  outline-offset: -1px;
}
.g-compose-bar,
.g-compose-tools {
  display: flex;
  align-items: center;
  gap: 5px;
}
.g-compose-bar {
  justify-content: space-between;
}
.g-compose .g-tool {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 36px;
  min-height: 36px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #655671;
  cursor: pointer;
  font-size: 13px;
}
.g-tool .ic {
  width: 17px;
  height: 17px;
}
.g-tool input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  cursor: pointer;
}
.g-tool:focus-within {
  outline: 2px solid #9376b2;
}
.g-tool:hover {
  background: #f3edf9;
  color: #584072;
}
.g-compose #g-send {
  min-height: 38px;
  padding-inline: 16px;
}
.g-compose-hint {
  margin: 0;
  padding: 0 16px 12px;
  font-size: 13px;
}
.g-status:not(:empty) {
  padding: 0 15px 10px;
}
.g-status .btn {
  padding: 3px 8px;
}
.g-check {
  gap: 6px;
}
@media (max-width: 620px) {
  .g-room-head {
    padding: 10px;
    gap: 7px;
    flex-wrap: wrap;
  }
  .g-room-head .btn,
  .g-invite .btn {
    padding: 6px 9px;
    font-size: 12px;
  }
  .g-room-title h2 {
    font-size: 16px;
  }
  .g-room-head > .g-avatar {
    display: none;
  }
  .g-messages {
    padding: 8px;
    height: 52vh;
  }
  .g-compose {
    padding: 8px;
    gap: 5px;
  }
  .subpage .g-box.panel {
    padding: 12px;
  }
  .g-heading {
    margin-bottom: 12px;
  }
  .g-thread {
    padding: 11px 2px;
  }
  .g-msg > div {
    max-width: 83%;
  }
}
.g-thread-info i {
  font-style: normal;
  font-size: 11px;
  color: var(--g-muted);
  border: 1px solid var(--g-border);
  border-radius: 4px;
  padding: 0 3px;
}
.g-thread-info .g-ping {
  color: #85364e;
  border-color: #e9c7d1;
  background: #fff2f5;
}
.g-nick-form {
  display: flex;
  align-items: end;
  gap: 8px;
}
.g-nick-form label {
  display: grid;
  gap: 5px;
  flex: 1;
}
.g-mention-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.g-mention-option:hover {
  background: #f3eff9;
}

.dialog :is(.g-member, .g-select-list, .g-nick-form) {
  --g-border: var(--border);
  --g-muted: var(--muted);
}
.dialog .g-select-list label,
.dialog .g-check {
  display: flex;
  align-items: center;
  gap: 9px;
}
.g-select-list label input,
.dialog .g-check input {
  margin: 0;
}
.g-empty-icon {
  width: 54px;
  height: 54px;
  border-radius: 17px;
}
.g-system {
  width: fit-content;
  max-width: 90%;
  margin: 13px auto;
  padding: 4px 10px;
  border-radius: 15px;
  background: #f0ecf5;
  color: #625970;
  overflow-wrap: anywhere;
}
.g-by {
  line-height: 1.4;
}
.g-bubble :is(img, video) {
  border-radius: 8px;
}
.g-card .ic {
  color: #6747a1;
  flex-shrink: 0;
}
.g-card span {
  overflow-wrap: anywhere;
}
@media (max-width: 420px) {
  .g-compose {
    padding: 8px;
  }
  .g-compose-tools {
    gap: 1px;
  }
  .g-compose .g-tool {
    padding-inline: 7px;
    min-height: 40px;
    gap: 4px;
  }
  .g-compose #g-send {
    padding-inline: 11px;
  }
  .g-room-head :is(.btn, .g-room-title) {
    min-height: 32px;
  }
  .g-room-head .g-room-title {
    flex-basis: 40%;
  }
  .g-msg > div {
    max-width: calc(100% - 42px);
  }
}
@media (max-width: 620px) {
  .g-room-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 6px;
  }
  .g-room-head .g-room-title {
    min-width: 0;
  }
  .g-room-head .g-room-title h2 {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
}
@media (max-width: 420px) {
  .g-messages {
    height: clamp(190px, calc(100dvh - 430px), 490px);
  }
}

.g-msg-content {
  width: fit-content;
}
.g-msg-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px;
  margin-top: 3px;
}
.g-mine .g-msg-actions {
  justify-content: flex-end;
}
.g-msg-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 7px;
  background: transparent;
  color: #6c6079;
  font: inherit;
  font-size: 12px;
  line-height: 1.45;
  text-decoration: none;
}
.g-msg-action:hover,
.g-msg-action:focus-visible {
  background: #eee8f5;
  color: #51396f;
}
.g-system .g-msg-actions {
  justify-content: center;
  margin: 0;
}
.g-system .g-msg-action {
  font-size: 11px;
  padding-block: 1px;
}
.g-bubble {
  white-space: normal;
}
.g-bubble .g-text {
  white-space: pre-wrap;
}
.g-bubble .g-link {
  color: #573f8b;
  text-decoration: underline;
  text-underline-offset: 0.16em;
  overflow-wrap: anywhere;
}
.g-quote,
.g-reply-preview {
  border-inline-start: 3px solid #b79bcf;
  border-radius: 3px 9px 9px 3px;
  background: #f4eff8;
  color: #62556d;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.g-quote {
  margin: 0 0 8px;
  padding: 7px 10px;
}
.g-mine .g-quote {
  background: #fbf8ffb8;
}
.g-quote strong,
.g-reply-preview strong {
  color: #554164;
  font-weight: 650;
}
.g-reply-preview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 6px 9px;
}
.g-quote-summary {
  min-width: 0;
}
#g-reply-cancel {
  flex: none;
  font-size: 12px;
  color: #684789;
  padding: 6px;
}
.g-kind-code {
  overflow: hidden;
  padding: 0;
}
.g-kind-code .g-quote {
  margin: 8px;
}
.g-bubble .g-code-block {
  max-width: 100%;
  min-width: min(215px, 100%);
  margin: 0;
  border: 0;
  border-radius: inherit;
}
.g-code-block .g-code-head {
  padding: 6px 12px;
}
.g-code-block pre {
  padding: 9px 12px;
  max-height: 300px;
  overflow: auto;
}
.g-bubble .g-card {
  min-width: min(175px, 100%);
  padding: 3px 1px;
}
.g-bubble .g-card > .ic {
  box-sizing: content-box;
  padding: 9px;
  border-radius: 10px;
  background: #f2edf8;
}
.g-image-link {
  display: block;
}
.g-code-form #g-code-source {
  white-space: pre;
  overflow: auto;
  font-family:
    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  tab-size: 4;
}
@media (hover: hover) and (pointer: fine) {
  .g-system .g-msg-actions {
    display: inline-flex;
    gap: 0;
    margin-inline-start: 6px;
  }
}
@media (max-width: 620px) {
  .g-msg-action {
    min-height: 31px;
  }
  .g-status .btn {
    min-height: 34px;
  }
}
@media (max-width: 360px) {
  .g-compose .g-tool {
    padding-inline: 5px;
  }
  .g-tool .g-tool-label {
    font-size: 12px;
  }
}
.g-quote,
.g-quote-summary {
  display: grid;
  gap: 2px;
}
.g-quote span,
.g-quote-summary span {
  overflow-wrap: anywhere;
}
