:root {
  color-scheme: dark;
  --side: #17222e;
  --panel: #1d2b39;
  --line: #ffffff12;
  --text: #eaf1f6;
  --muted: #a4b5c6;
  --blue: #75c2f7;
  --out: #2c5573;
  --in: #263542;
  font:
    16px -apple-system,
    BlinkMacSystemFont,
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  background: #0c1621;
  color: var(--text);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}
button:disabled {
  cursor: default;
}
svg {
  display: block;
  flex-shrink: 0;
}
i {
  font-style: normal;
}
img {
  display: block;
  object-fit: cover;
}
h1,
h2,
p {
  margin: 0;
}
#app {
  margin: auto;
  display: grid;
  grid-template-columns: clamp(290px, 29vw, 380px) minmax(0, 1fr);
  max-width: 1600px;
  height: 100vh;
  height: 100dvh;
  background: var(--side);
  border-inline: 1px solid var(--line);
}
#sidebar,
#chat {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
}
#sidebar {
  border-right: 1px solid var(--line);
}
.sidehead,
.chathead {
  min-height: 73px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidehead {
  justify-content: space-between;
}
.sidehead h1 {
  font-size: 28px;
  letter-spacing: -1px;
}
.local {
  font-size: 12px;
  font-weight: 500;
  color: #a0b2c3;
  border: 1px solid #394957;
  padding: 3px 8px;
  border-radius: 20px;
}
.search {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #243241;
  margin: 0 15px 12px;
  border-radius: 10px;
  padding: 0 12px;
  color: var(--muted);
}
.search input {
  width: 100%;
  height: 40px;
  background: none;
  border: 0;
  min-width: 0;
}
.search input::placeholder,
textarea::placeholder {
  color: #97aabb;
}
.search svg {
  width: 17px;
}
#list,
#messages {
  flex: 1;
  overflow: auto;
  min-height: 0;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #405365 transparent;
}
.row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  min-height: 72px;
  padding: 0 16px;
  transition: background 0.15s;
}
.row:hover {
  background: #213344;
}
.row.active {
  background: #263c4d;
}
.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: inline-grid;
  place-content: center;
  flex-shrink: 0;
  overflow: hidden;
  font-size: 19px;
  font-weight: 600;
  color: white;
}
.avatar img {
  height: 46px;
  width: 46px;
}
.orange {
  background: linear-gradient(125deg, #f39272, #b84e55);
}
.mint {
  background: linear-gradient(125deg, #40bdb2, #288179);
}
.violet {
  background: linear-gradient(125deg, #a796e3, #7963bc);
}
.rowbody {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
}
.rowline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.rowtime,
.status {
  font-size: 12px;
  color: var(--muted);
}
.preview {
  display: block;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
}
.rowline svg {
  width: 15px;
  color: var(--blue);
}
.media,
.online,
.letter {
  color: var(--blue);
}
.badge {
  font: 600 11px system-ui;
  background: #76bceb;
  color: #0c2738;
  border-radius: 12px;
  min-width: 18px;
  padding: 1px 5px;
  text-align: center;
}
.letter {
  width: 14px;
  font-size: 12px;
}
.sort {
  padding: 6px 16px;
  color: var(--muted);
  font-size: 12px;
}
.empty {
  padding: 22px;
  color: var(--muted);
  text-align: center;
}
#tabs {
  margin-top: auto;
  display: flex;
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding: 7px 4px max(7px, env(safe-area-inset-bottom));
}
#tabs button {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  flex: 1;
  font-size: 12px;
  color: var(--muted);
  min-height: 45px;
}
#tabs button[aria-pressed="true"] {
  color: var(--blue);
}
.chathead {
  background: var(--side);
  border-bottom: 1px solid var(--line);
}
#identity {
  display: flex;
  align-items: center;
  gap: 11px;
}
#identity .avatar,
#identity .avatar img {
  width: 42px;
  height: 42px;
}
#identity small {
  display: block;
  margin-top: 3px;
}
.icon,
.send {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  color: var(--muted);
}
.icon:hover {
  background: #ffffff0e;
  color: var(--text);
}
#back {
  display: none;
}
#messages {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 18px max(16px, calc((100% - 760px) / 2));
  background-color: #101e29;
  background-image:
    linear-gradient(110deg, #07152244, #253e450f), var(--doodle);
}
.day {
  flex: none;
  align-self: center;
  font-weight: 550;
  font-size: 12px;
  border-radius: 15px;
  background: #273a49;
  color: #ccdae5;
  padding: 3px 11px;
  margin: 2px 0 6px;
}
.bubble {
  align-self: flex-start;
  max-width: min(82%, 510px);
  flex: none;
  background: var(--in);
  padding: 9px 12px 5px;
  border-radius: 15px 15px 15px 4px;
  box-shadow: 0 1px 2px #0002;
  overflow-wrap: anywhere;
}
.bubble.out {
  align-self: flex-end;
  background: var(--out);
  border-radius: 15px 15px 4px 15px;
}
.txt {
  white-space: pre-wrap;
  line-height: 1.48;
}
.stamp {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  font-size: 10px;
  line-height: 14px;
  color: #b6c5d1;
}
.stamp svg {
  width: 14px;
  height: 14px;
  color: #91d8ff;
}
.picture {
  padding: 3px;
  position: relative;
  overflow: hidden;
}
.picture button {
  display: block;
}
.picture img {
  max-width: 100%;
  width: clamp(185px, 37vw, 355px);
  max-height: 300px;
  border-radius: 12px;
  object-fit: contain;
  background: #131f2b;
}
.picture .stamp {
  pointer-events: none;
  position: absolute;
  bottom: 7px;
  right: 8px;
  padding: 1px 5px;
  border-radius: 10px;
  background: #10202dc4;
  color: #fff;
}
.doc {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  min-height: 46px;
}
.docicon {
  width: 35px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 4px;
  background: #ff9c8c;
  color: #4a2320;
  font: 700 10px system-ui;
  clip-path: polygon(0 0, 71% 0, 100% 23%, 100% 100%, 0 100%);
}
.doc strong {
  font-size: 15px;
}
.doc small {
  display: block;
  color: #c0d0dd;
  font-size: 12px;
  margin-top: 3px;
}
#composer {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  background: var(--panel);
  padding: 10px max(12px, calc((100% - 760px) / 2))
    max(10px, env(safe-area-inset-bottom));
}
#entry {
  resize: none;
  background: #293a48;
  border: 0;
  border-radius: 20px;
  line-height: 22px;
  min-width: 0;
  flex: 1;
  padding: 10px 15px;
  max-height: 130px;
  scrollbar-width: thin;
}
.send,
.primary {
  background: #69bbf1;
  color: #112c40;
}
.send:disabled {
  background: #334957;
  color: #9cb1c1;
}
.send {
  width: 42px;
  height: 42px;
}
dialog {
  color: var(--text);
  background: var(--panel);
  border: 1px solid #445461;
  border-radius: 19px;
  padding: 15px 18px;
  width: min(440px, calc(100vw - 24px));
  max-height: 88dvh;
  overscroll-behavior: contain;
  box-shadow: 0 18px 70px #0006;
}
dialog::backdrop {
  background: #030b14aa;
}
dialog header,
.album,
.picked {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
dialog h2 {
  font-size: 21px;
}
.seg {
  display: flex;
  background: #13212d;
  border-radius: 11px;
  padding: 3px;
  margin: 7px 0 14px;
}
.seg button {
  flex: 1;
  border-radius: 8px;
  padding: 9px;
  font-size: 15px;
  color: var(--muted);
}
.seg button[aria-pressed="true"] {
  background: #30495e;
  color: #a4deff;
}
.choose {
  width: 100%;
  color: var(--blue);
  padding: 11px;
  border: 1px solid #456377;
  border-radius: 10px;
  font-size: 15px;
}
.album {
  font-size: 13px;
  color: var(--muted);
  margin: 13px 1px 8px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  overflow: hidden;
  border-radius: 10px;
}
.tile {
  position: relative;
  aspect-ratio: 1.4;
}
.tile img {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
}
.tile i {
  position: absolute;
  right: 5px;
  top: 5px;
  border-radius: 50%;
  width: 19px;
  height: 19px;
  border: 1.5px solid #eee;
  background: #13243266;
  font: 600 11px/17px system-ui;
}
.tile[aria-pressed="true"] {
  outline: 3px solid var(--blue);
  outline-offset: -3px;
  z-index: 1;
}
.tile[aria-pressed="true"] i {
  background: var(--blue);
  color: #143044;
  border-color: var(--blue);
}
.picked {
  padding: 7px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--line);
}
.picked span {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}
.picked img {
  width: 44px;
  height: 36px;
  border-radius: 5px;
}
.picked small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.primary {
  width: 100%;
  padding: 11px;
  border-radius: 10px;
  font-weight: 600;
  margin-top: 13px;
}
.primary:disabled {
  background: #344656;
  color: #94a7b5;
}
#viewer {
  width: auto;
  max-width: 95vw;
  background: #0b1621;
  padding: 8px;
  overflow: hidden;
}
#largeImg {
  max-width: 90vw;
  max-height: 80dvh;
  object-fit: contain;
}
#closePhoto {
  position: absolute;
  right: 10px;
  top: 10px;
  background: #142635d4;
  color: white;
}
#toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  background: #314854;
  padding: 9px 14px;
  border-radius: 9px;
  z-index: 4;
}
@media (max-width: 740px) {
  #app {
    display: flex;
    border: 0;
  }
  #sidebar,
  #chat {
    width: 100%;
  }
  #chat {
    display: none;
  }
  #app.in-chat #sidebar {
    display: none;
  }
  #app.in-chat #chat {
    display: flex;
  }
  #back {
    display: grid;
  }
  .chathead {
    padding: 4px 10px;
    min-height: 61px;
    gap: 5px;
  }
  .sidehead {
    padding-top: max(12px, env(safe-area-inset-top));
  }
  .chathead {
    padding-top: max(4px, env(safe-area-inset-top));
  }
  #messages {
    padding: 13px 12px;
  }
  .picture img {
    width: min(72vw, 325px);
  }
  #attachments {
    margin: auto 0 0;
    width: 100%;
    max-width: none;
    border-radius: 19px 19px 0 0;
    padding-bottom: max(13px, env(safe-area-inset-bottom));
  }
  .row.active {
    background: transparent;
  }
}

:root {
  --doodle: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22145%22%20height%3D%22140%22%20viewBox%3D%220%200%20145%20140%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22%2389a8bf%22%20stroke-opacity%3D%22.075%22%20stroke-width%3D%221.1%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m9%2016%2014-5-4%2014-3-6-7-3Zm7%203%205-6m63%2075%205-12%207%2012m-17%200h21M103%2020q-8%208%200%2011%205%202%209-3-9%200-9-8ZM35%20102l2%204%204%201-4%202-1%204-2-4-4-1%204-2z%22/%3E%3Ccircle%20cx%3D%2260%22%20cy%3D%2248%22%20r%3D%223%22/%3E%3Cpath%20d%3D%22m128%2060%202-3m-2%2052%204-2M21%2066l3%201m51-52%201-2%22/%3E%3C/g%3E%3C/svg%3E");
}
[hidden] {
  display: none !important;
}
#gate {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 26px 15px;
  background:
    radial-gradient(ellipse at 48% 0, #1d364a, transparent 65%), #0c1620;
}
.authcard {
  width: min(100%, 430px);
  border: 1px solid #344757;
  background: #182633;
  border-radius: 21px;
  overflow: hidden;
  box-shadow: 0 22px 70px #0004;
}
.cover {
  display: flex;
  align-items: flex-end;
  height: 112px;
  padding: 16px 24px;
  background:
    linear-gradient(0deg, #102338e0, #1636503b),
    url("./alpine.jpg") center 50% / cover;
  color: #e7f4ff;
  font-weight: 650;
  letter-spacing: 1px;
}
.authbody {
  padding: 24px;
}
.authhead,
#authAlt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.authhead h1 {
  font-size: 25px;
}
.link,
.authbody a {
  color: var(--blue);
  font-size: 14px;
}
.authbody p,
#accountPanel p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  margin: 10px 0;
}
#fields label {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  font-size: 14px;
}
#fields input {
  border-radius: 9px;
  background: #11202d;
  border: 1px solid #405263;
  padding: 11px 12px;
  width: 100%;
  font-size: 16px;
}
#authAlt {
  justify-content: center;
  margin-top: 12px;
  flex-wrap: wrap;
}
#authAlt:empty,
#authStatus:empty,
#sync:empty {
  display: none;
}
#authStatus:not(:empty) {
  color: #e3c8a8;
}
#fields canvas {
  display: block;
  max-width: 100%;
  margin: 13px auto;
  background: white;
  border-radius: 10px;
}
#sync {
  font-size: 13px;
  color: var(--muted);
  padding: 6px 16px;
}
#sync button {
  margin-left: 8px;
  color: var(--blue);
}
#older {
  padding: 6px;
  background: #182b3b;
}
#account,
.link,
.choose {
  min-height: 36px;
}
#account {
  max-width: 47%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hintline {
  font-size: 13px;
  color: var(--muted);
}
#messages .bubble {
  white-space: normal;
}
.photoOpen,
.doc {
  color: var(--text);
  text-align: left;
}
.photoOpen {
  display: block;
  padding: 7px;
}
.photoOpen img {
  max-height: 245px;
  max-width: min(70vw, 320px);
  border-radius: 9px;
}
.photoOpen .load {
  display: block;
  color: var(--blue);
  padding: 6px;
}
.send.busy {
  opacity: 0.65;
}
#confirmFiles:disabled {
  opacity: 0.65;
}
.picked img {
  object-fit: cover;
}
.textwarn {
  color: #ffb7ad;
}
.empty small {
  display: block;
  margin-top: 6px;
}
#admin {
  min-height: 100dvh;
  background: #101c27;
}
.bar {
  padding: 26px max(20px, calc((100vw - 1050px) / 2));
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1b2b39;
  border-bottom: 1px solid var(--line);
}
.bar small {
  color: #98b4c8;
}
.bar h1 {
  margin-top: 5px;
  font-size: 27px;
}
.chip {
  padding: 9px 14px;
  border: 1px solid #40586b;
  border-radius: 9px;
  font-size: 14px;
}
.adminbody {
  max-width: 1090px;
  margin: auto;
  padding: 32px 20px;
}
.adminhead,
.item,
.op,
.inventoryhead {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
}
.adminhead {
  margin-bottom: 20px;
}
.adminhead .primary {
  width: auto;
  margin: 0;
  padding: 10px 18px;
}
#adminTabs {
  display: flex;
  gap: 5px;
  border-radius: 10px;
  background: #1b2a36;
  padding: 4px;
}
#adminTabs button {
  padding: 9px 14px;
  color: #a7bbca;
  border-radius: 7px;
}
#adminTabs .on {
  background: #35556d;
  color: #def1ff;
}
.item,
.inventoryhead {
  padding: 16px 18px;
}
.inventoryhead {
  background: #213341;
  font-weight: 600;
}
.inventorycard {
  border: 1px solid #344758;
  border-radius: 14px;
  background: #182633;
  overflow: hidden;
}
.item {
  border-top: 1px solid #ffffff10;
}
.item .name {
  flex: 1;
  min-width: 0;
}
.item small {
  display: block;
  color: #a4b8c8;
  margin-top: 5px;
  font-size: 13px;
}
.item .state {
  font-size: 13px;
  color: #a6d9ce;
}
.item .off {
  color: #c3a89c;
}
.inventoryempty {
  padding: 34px 18px;
  text-align: center;
  color: #b5c7d5;
}
.inventoryempty .link {
  display: block;
  margin: 10px auto 0;
}
.op select,
#editFields select {
  background: #243646;
  border: 1px solid #405263;
  color: var(--text);
  border-radius: 7px;
  padding: 7px;
  max-width: 150px;
}
#editFields label,
#fields label {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  font-size: 14px;
}
#editFields input,
#editFields select {
  width: 100%;
  max-width: none;
  background: #12202b;
  border: 1px solid #425667;
  border-radius: 8px;
  padding: 10px;
  font-size: 16px;
}
#editStatus {
  color: #e9b7a0;
  line-height: 1.6;
  font-size: 13px;
}
#fields img.qr {
  width: 208px;
  height: 208px;
  display: block;
  margin: 16px auto;
  border-radius: 10px;
}
.bubble .photoOpen img {
  max-height: 240px;
}
.album-note {
  color: var(--muted);
  font-size: 14px;
  margin: 12px 0;
}
.account-actions {
  display: grid;
  gap: 8px;
}
.tip {
  font-size: 13px;
  color: #b0c4d3;
}
.bar button:focus-visible,
.item button:focus-visible {
  outline: 2px solid var(--blue);
}
@media (max-width: 680px) {
  .adminbody {
    padding: 18px 12px;
  }
  .bar {
    padding: 20px 16px;
  }
  .item {
    flex-wrap: wrap;
    padding: 12px;
  }
  .item .op {
    width: 100%;
    justify-content: flex-end;
  }
  .adminhead {
    gap: 4px;
  }
  .adminhead .primary,
  #adminTabs button {
    font-size: 14px;
    padding: 9px 11px;
  }
}

#channels{display:flex;gap:4px;padding:8px;background:#14212f}#channels a{flex:1;text-align:center;text-decoration:none;color:#aabcc9;border-radius:7px;padding:8px}#channels [aria-current=true]{background:#304d65;color:#bee4ff}.permissions{border:1px solid #395064;border-radius:8px;display:flex;gap:20px;margin-top:15px}.permissions legend{color:#b9ccda;font-size:14px}#editFields .permissions label{display:flex;align-items:center}.permissions input[type=checkbox]{width:18px!important;height:18px;accent-color:#60b8ed}
