/* SilverVoice styles.
 *
 * Only --fg and --bg come from the theme. Every other colour is mixed from
 * those two, so a new theme is two hex values in theme.js and nothing here.
 * The mixes work for light and dark themes alike, because "bg with some fg
 * stirred in" means darker on a dark theme and lighter on a light one.
 *
 * The only fixed colours are the status dots, which mean the same thing on
 * every theme.
 */

:root {
  --fg: #fffb76;
  --bg: #382714;
  --media: #4a3728;

  --panel:  color-mix(in srgb, var(--bg) 88%, var(--fg));
  --raised: color-mix(in srgb, var(--bg) 78%, var(--fg));
  --edge:   color-mix(in srgb, var(--bg) 66%, var(--fg));
  --dim:    color-mix(in srgb, var(--fg) 72%, var(--bg));
  --quiet:  color-mix(in srgb, var(--fg) 46%, var(--bg));
  --alert:  #ff8a5c;
  --live:   var(--fg);

  --s-online: #3ba55d;
  --s-idle:   #f0b232;
  --s-dnd:    #ed4245;
  --s-off:    #80848e;

  --mono: ui-monospace, "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace;
  --round: 14px;
}

* { box-sizing: border-box; }

/* Any element given a display value ignores the hidden attribute, which is
   how both overlays ended up permanently on top of the page. */
[hidden] { display: none !important; }

html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body.no-anim *, body.no-anim *::before, body.no-anim *::after {
  transition: none !important;
  animation: none !important;
}

/* Only the owner (or anyone, on a LAN) sees edit controls. The server
   checks again, so this is about tidiness, not safety. */
body:not(.can-manage) .manage-only { display: none !important; }
body.can-manage .member-only { display: none !important; }
body[data-mode="lan"] .online-only { display: none !important; }
body[data-mode="lan"] .rail { display: none; }

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 8px;
  padding: 8px 14px;
  transition: background 120ms ease, border-color 120ms ease;
}

button:hover { background: var(--raised); }
button[disabled] { opacity: .45; cursor: default; }

button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

input[type="text"], input[type="email"], input[type="password"], select {
  font: inherit;
  color: var(--fg);
  background: color-mix(in srgb, var(--bg) 94%, var(--fg));
  border: 1px solid var(--edge);
  border-radius: 8px;
  padding: 9px 12px;
  width: 100%;
}

input[type="color"] {
  width: 30px; height: 30px;
  padding: 0;
  border: 1px solid var(--edge);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  overflow: hidden;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 50%; }
input[type="color"]::-moz-color-swatch { border: none; border-radius: 50%; }

input::placeholder { color: var(--quiet); }
input:disabled { opacity: .5; }

svg { flex: none; }

/* ------------------------------------------------------------------ shell */

#app {
  height: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  padding: 10px;
}

/* Server rail and channels side by side, with your own bar (and the call
   bar above it) running underneath both, from the far left edge. */
.left {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 0;
}
.left > .rail { grid-row: 1; grid-column: 1; }
.left > .side { grid-row: 1; grid-column: 2; }
.dock { grid-row: 2; grid-column: 1 / -1; display: flex; flex-direction: column; min-width: 0; }
body[data-mode="lan"] .left { grid-template-columns: 1fr; }
body[data-mode="lan"] .left > .side { grid-column: 1; }

/* server rail */

.rail {
  width: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 0;
}

.guildlist {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  overflow-y: auto;
  min-height: 0;
  padding: 2px;
  scrollbar-width: none;
}

.railbtn {
  width: 50px; height: 50px;
  flex: none;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--panel);
  border: 2px solid transparent;
  font-size: 15px;
  transition: border-radius 150ms ease, border-color 150ms ease;
}

.railbtn img { width: 100%; height: 100%; object-fit: cover; }
.railbtn:hover { border-radius: 16px; }
.railbtn[aria-current="true"] { border-radius: 16px; border-color: var(--fg); }
.railbtn.add { font-size: 24px; color: var(--dim); border: 1px dashed var(--edge); }
.railbtn.admin { position: relative; overflow: visible; }
.railbtn.admin svg {
  width: 24px; height: 24px;
  fill: none;
  stroke: var(--dim);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.railbtn.admin:hover svg { stroke: var(--fg); }
.badge {
  position: absolute;
  right: -3px;
  bottom: -3px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  border: 3px solid var(--bg);
  background: var(--s-dnd);
  color: #fff;
  font-size: 11px;
  line-height: 14px;
  text-align: center;
}

/* whitelist */

.sheet.center { text-align: center; }
.sheet.center p { color: var(--dim); }
.pendingwho { font-size: 13px; color: var(--quiet); }

.userlist { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.userrow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 94%, var(--fg));
}
.userwho { flex: 1; min-width: 0; }
.username { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.usermeta {
  font-size: 12px;
  color: var(--quiet);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.userbadge {
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid var(--edge);
  font-size: 11px;
  font-weight: 400;
  color: var(--dim);
}
.userrow .approve { padding: 6px 12px; font-size: 13px; border-color: var(--s-online); color: var(--s-online); }

/* channel sidebar */

.side {
  width: 262px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 4px;
}

.side-close { display: none; }

.guildhead {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  font-size: 17px;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--panel);
  border: none;
  border-radius: var(--round);
  text-align: left;
}

.guildhead span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guildhead svg, .iconbtn svg, .chanedit svg {
  width: 18px; height: 18px;
  fill: none;
  stroke: var(--dim);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.guildhead[disabled] svg { display: none; }

.chans { flex: 1; min-height: 0; overflow-y: auto; padding-top: 6px; }

.group + .group { margin-top: 12px; }

.group h2 {
  display: flex;
  align-items: center;
  margin: 0 0 4px;
  padding: 2px 6px 2px 12px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--quiet);
}

.group h2 span { flex: 1; }

.plus {
  padding: 0 8px;
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1.3;
  color: var(--dim);
}

.chanrow { position: relative; display: flex; align-items: center; }

.chan {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 15px;
  color: var(--dim);
  text-align: left;
}

.chan .chanicon {
  width: 17px; height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .8;
}

.chan .channame { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan.tinted { color: color-mix(in srgb, var(--chan) 80%, var(--bg)); }
.chan:hover { background: var(--panel); color: var(--fg); }
.chan.tinted:hover { color: var(--chan); }
.chan[aria-current="true"] { background: var(--raised); color: var(--fg); }
.chan.tinted[aria-current="true"] {
  color: var(--chan);
  background: color-mix(in srgb, var(--chan) 16%, var(--raised));
}
.chan .n { margin-left: auto; font-size: 12px; color: var(--quiet); }

.chanedit {
  position: absolute;
  right: 4px;
  padding: 4px 6px;
  background: none;
  border: none;
  opacity: 0;
}
.chanrow:hover .chanedit, .chanedit:focus-visible { opacity: 1; }
.chanrow:hover .chan .n { visibility: hidden; }

.vmember {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 3px 10px 3px 30px;
  font-size: 14px;
  color: var(--dim);
  text-align: left;
}

.vmember:hover { background: var(--panel); }
.vmember .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vmember .marks { margin-left: auto; display: flex; gap: 4px; flex: none; }
.vmember .marks svg { width: 15px; height: 15px; }
.vmember.talking .face { box-shadow: 0 0 0 2px var(--s-online); }

.face {
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  background: var(--raised);
  border: 1px solid var(--edge);
  display: grid;
  place-items: center;
  font-size: 10px;
  overflow: hidden;
  box-shadow: 0 0 0 0 var(--live);
  transition: box-shadow 90ms linear;
}

.face img { width: 100%; height: 100%; object-fit: cover; }
.face.mid { width: 36px; height: 36px; font-size: 13px; }
.face.big { width: 34px; height: 34px; font-size: 12px; }
.face.huge { width: 78px; height: 78px; font-size: 24px; border-width: 4px; border-color: var(--panel); }

.vol-pop {
  padding: 4px 10px 10px 30px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.vol-pop input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--edge);
}

.vol-pop input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--fg);
  cursor: pointer;
}

.vol-pop input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px;
  border: none; border-radius: 50%;
  background: var(--fg);
  cursor: pointer;
}

.vol-pop output {
  font-size: 11px;
  color: var(--quiet);
  width: 40px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* voice connection strip and your own card */

.voicebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 14px;
  background: var(--panel);
  border-radius: var(--round) var(--round) 0 0;
}

.vb-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.vb-live { color: var(--s-online); font-size: 13px; text-transform: uppercase; }
.vb-where { font-size: 12px; color: var(--quiet); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voicebar .tray-btn { flex: none; width: 40px; }
.voicebar .tray-btn svg { stroke: var(--s-dnd); }

.mebar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  border-radius: var(--round);
  padding: 6px;
}
.voicebar:not([hidden]) + .mebar { border-radius: 0 0 var(--round) var(--round); }

.meinfo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 4px 8px;
  background: none;
  border: none;
  text-align: left;
}

.me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.me-name, .me-status { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-status { font-size: 12px; color: var(--quiet); }

.tray { display: flex; gap: 2px; flex: none; }

.tray-btn {
  flex: none;
  width: 40px;
  display: grid;
  place-items: center;
  padding: 7px 0;
  background: none;
  border-color: transparent;
}

.tray-btn svg {
  width: 22px; height: 22px;
  fill: none;
  stroke: var(--fg);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tray-btn .slash { display: none; stroke: var(--alert); }
.tray-btn.off svg { stroke: var(--alert); }
.tray-btn.off .slash { display: block; }
.tray-btn.live { border-color: var(--fg); }
.tray-btn:hover { background: var(--raised); }

/* ------------------------------------------------------------------ panel */

.panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  background: var(--panel);
  border-radius: var(--round);
  padding: 12px 18px 16px;
}

.panel header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 8px;
  min-width: 0;
}

.panel header #channame {
  font-size: 19px;
  letter-spacing: .02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hash { font-size: 19px; color: var(--quiet); }

.menu { display: none; padding: 4px 10px; }

.iconbtn { padding: 5px 7px; background: none; border: none; }
.iconbtn:hover svg { stroke: var(--fg); }

.dot {
  width: 9px; height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--alert);
  margin-left: auto;
}

.dot.on { background: var(--fg); opacity: .5; }
.conn { font-size: 12px; color: var(--quiet); }

/* The background is painted on the wrapper, which does not scroll, so the
   picture stays put while messages slide over it. A wash of the panel
   colour on top keeps the text readable whatever the picture is. */
.chatwrap {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 10px;
  margin: 0 -8px;
}

.chatwrap.has-bg {
  background-image:
    linear-gradient(color-mix(in srgb, var(--panel) 62%, transparent),
                    color-mix(in srgb, var(--panel) 62%, transparent)),
    var(--chanbg);
  background-size: cover;
  background-position: center;
}

/* Chat text follows the reader's own font settings, nothing else does. */
.lines {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 6px 8px;
  font-family: var(--chat-font, var(--mono));
  font-size: var(--chat-size, 15px);
}
.composer input { font-family: var(--chat-font, var(--mono)); font-size: var(--chat-size, 15px); }

.msg {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  overflow-wrap: anywhere;
}

.msg.joined { margin-top: 2px; }
.msg .face { margin-top: 2px; }
.msgmain { min-width: 0; flex: 1; }
.msghead { display: flex; align-items: baseline; gap: 8px; }
.msg .from {
  padding: 0;
  background: none;
  border: none;
  font-weight: 600;
}
.msg .from:hover { background: none; text-decoration: underline; }
.face.clicky { cursor: pointer; }
.face.clicky:hover { filter: brightness(1.15); }
.msg .at { font-size: 11px; color: var(--quiet); }
.msg .body { white-space: pre-wrap; }

.side-at {
  width: 36px;
  flex: none;
  font-size: 10px;
  color: var(--quiet);
  text-align: right;
  padding-top: 4px;
  visibility: hidden;
}
.msg.joined:hover .side-at { visibility: visible; }

.msg figure {
  margin: 6px 0 0;
  padding: 6px;
  display: inline-block;
  max-width: min(460px, 100%);
  background: var(--media);
  border-radius: 10px;
}

.msg figure img, .msg figure video {
  display: block;
  max-width: 100%;
  max-height: 320px;
  border-radius: 6px;
}

.empty { color: var(--quiet); padding: 10px 2px; }

.welcome {
  max-width: 420px;
  margin: 12vh auto 0;
  text-align: center;
}
.welcome h2 { font-weight: 400; text-transform: uppercase; letter-spacing: .06em; }
.welcome p { color: var(--dim); }

.typing {
  height: 20px;
  font-size: 13px;
  color: var(--dim);
  padding-left: 2px;
}

.composer { position: relative; display: flex; gap: 8px; padding-top: 8px; }

/* ------------------------------------------------------------------ emotes */

/* About the height of a line of text, so they follow the reader's chosen
   text size. Wide ones keep their shape but stop at three heights across. */
.emote {
  height: 1.6em;
  width: auto;
  max-width: 4.8em;
  object-fit: contain;
  vertical-align: -0.45em;
  margin: 0 .05em;
}

/* A message of nothing but emotes shows them big, like Discord does. */
.body.jumbo .emote { height: 3em; max-width: 9em; vertical-align: middle; margin: 2px 2px 0 0; }

.emotebtn { display: grid; place-items: center; padding: 0 11px; }
.emotebtn svg {
  width: 22px; height: 22px;
  fill: none;
  stroke: var(--dim);
  stroke-width: 1.7;
  stroke-linecap: round;
}
.emotebtn svg circle:not(:first-child) { fill: var(--dim); stroke: none; }
.emotebtn:hover svg, .emotebtn.live svg { stroke: var(--fg); }
.emotebtn.live { border-color: var(--fg); }

.emotepicker {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 15;
  width: min(360px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--round);
  box-shadow: 0 10px 30px color-mix(in srgb, #000 40%, transparent);
}

.emotepicker input { padding: 7px 10px; font-size: 14px; }

.emotegrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
}

.emotecell {
  height: 48px;
  padding: 4px;
  display: grid;
  place-items: center;
  background: none;
  border: 1px solid transparent;
}
.emotecell:hover, .emotecell:focus-visible { background: var(--raised); border-color: var(--edge); }
.emotecell .emote { height: 36px; max-width: 44px; margin: 0; vertical-align: middle; }

.emotefoot { display: flex; justify-content: space-between; gap: 8px; min-height: 18px; font-size: 13px; }
.emotefoot .hint { margin: 0; }

.emotesuggest {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 15;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--round);
  box-shadow: 0 10px 30px color-mix(in srgb, #000 40%, transparent);
}

.suggestrow {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 4px 8px;
  background: none;
  border: none;
  text-align: left;
  font-size: 14px;
}
.suggestrow .emote { height: 26px; max-width: 60px; margin: 0; vertical-align: middle; }
.suggestrow[aria-selected="true"] { background: var(--raised); }
.composer input { flex: 1; border-radius: 10px; padding: 12px 14px; }

/* ------------------------------------------------------------ member list */

.people {
  width: 250px;
  min-height: 0;
  overflow-y: auto;
  background: var(--panel);
  border-radius: var(--round);
  padding: 8px 8px 12px;
}

body.people-hidden .people { display: none; }

.mhead {
  margin: 14px 8px 6px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--quiet);
}
.mhead:first-child { margin-top: 6px; }

/* A person's row. With a background, the picture (or colour) fills the row
   and fades out towards the left so the name stays readable. */
.person {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 3px;
  padding: 6px 8px;
  background: none;
  border: none;
  border-radius: 10px;
  text-align: left;
  overflow: hidden;
  isolation: isolate;
}

.person:hover { background: var(--raised); }
.person.gone { opacity: .45; }
.person.gone:hover { opacity: .8; }

.person.has-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--bannercolor, transparent);
  background-image: var(--banner, none);
  background-size: cover;
  background-position: center;
  -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, .25) 0%, #000 70%);
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, .25) 0%, #000 70%);
}

.person.has-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, color-mix(in srgb, var(--panel) 75%, transparent),
                                     color-mix(in srgb, var(--panel) 10%, transparent));
}

.person.big { padding: 12px 14px; }

.facewrap { position: relative; flex: none; display: grid; }

.sdot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 3px solid var(--panel);
  background: var(--s-off);
}

.sdot.s-online { background: var(--s-online); }
/* idle is a crescent, like the screenshot's moon */
.sdot.s-idle {
  background: radial-gradient(circle at 30% 30%, var(--panel) 0 34%, var(--s-idle) 36%);
}
.sdot.s-dnd {
  background: linear-gradient(var(--panel), var(--panel)) center / 60% 24% no-repeat,
              var(--s-dnd);
}
.sdot.s-offline, .sdot.s-invisible {
  background: var(--panel);
  box-shadow: inset 0 0 0 2.5px var(--s-off);
}

.ptext { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }

.pname {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 3px color-mix(in srgb, var(--bg) 70%, transparent);
}
.pname svg { width: 14px; height: 14px; }

.pstatus {
  font-size: 12px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* profile card */

.popcatch { position: fixed; inset: 0; z-index: 25; }

.profilecard {
  position: fixed;
  width: 320px;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--round);
  overflow: hidden;
  box-shadow: 0 12px 40px color-mix(in srgb, #000 45%, transparent);
}

.pc-banner {
  height: 96px;
  background: var(--raised);
  position: relative;
  isolation: isolate;
}
.pc-banner.has-banner {
  background-color: var(--bannercolor, var(--raised));
  background-image: var(--banner, none);
  background-size: cover;
  background-position: center;
}
.pc-face { margin: -42px 0 0 16px; width: max-content; }
.pc-face .sdot { width: 20px; height: 20px; right: 2px; bottom: 2px; border-width: 4px; }
.pc-body { padding: 8px 18px 18px; }
.pc-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 21px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.pc-name svg { width: 17px; height: 17px; }
.pc-handle {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  font-size: 14px;
  color: var(--dim);
}
.pc-state { font-size: 11px; color: var(--quiet); text-transform: uppercase; letter-spacing: .05em; }

.pc-h {
  margin: 14px 0 6px;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--quiet);
}

.pc-dates { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }
.pc-date { display: inline-flex; align-items: center; gap: 7px; }
.pc-appdot {
  width: 20px; height: 20px;
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: var(--raised);
  font-size: 8px;
  color: var(--dim);
}
.pc-appdot img { width: 100%; height: 100%; object-fit: cover; }

.pc-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tagchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 94%, var(--fg));
  font-size: 13px;
  line-height: 1.4;
}
.tagdot { width: 11px; height: 11px; flex: none; border-radius: 50%; }
.tagx { margin-left: 2px; color: var(--quiet); font-size: 13px; }
button.tagchip:hover { border-color: var(--alert); }
button.tagchip:hover .tagx { color: var(--alert); }

.tagpick {
  width: auto;
  padding: 3px 10px;
  border-style: dashed;
  border-radius: 999px;
  font-size: 13px;
  color: var(--dim);
  cursor: pointer;
}

.taglist { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.tagrow { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tagrow input[type="text"] { flex: 1; padding: 6px 10px; }
.tagrow button:not(.link) { padding: 6px 14px; }
.pc-text {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg) 94%, var(--fg));
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------- overlays */

.overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(3px);
  z-index: 20;
}

.overlay.dark { background: color-mix(in srgb, #000 80%, transparent); }
.overlay.solid { background: var(--bg); z-index: 40; }

.sheet {
  width: min(560px, 100%);
  max-height: 100%;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--round);
  padding: 22px 26px 22px;
}

.sheet.narrow { width: min(460px, 100%); }

.sheet h2 {
  margin: 0 0 20px;
  text-align: center;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.sheet h3 {
  margin: 22px 0 12px;
  padding-bottom: 6px;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--quiet);
  border-bottom: 1px solid var(--edge);
}
.sheet h2 + h3 { margin-top: 0; }

.row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.row > label {
  width: 140px;
  flex: none;
  font-size: 14px;
  text-transform: uppercase;
  color: var(--fg);
}

.row > input, .row > select { flex: 1; }

.hint { margin: -6px 0 14px; font-size: 12px; color: var(--quiet); }
.formerr { min-height: 20px; margin: 0 0 10px; font-size: 13px; color: var(--alert); }

.toggle {
  width: 84px;
  padding: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 96%, var(--fg));
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-size: 13px;
  text-transform: uppercase;
}

.toggle span {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--fg);
  flex: none;
  transition: transform 140ms ease;
}

.toggle[aria-pressed="false"] { flex-direction: row-reverse; color: var(--quiet); }
.toggle[aria-pressed="false"] span { background: var(--quiet); }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.swatch {
  width: 28px; height: 28px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid transparent;
}

.swatch[aria-pressed="true"] { border-color: var(--fg); box-shadow: inset 0 0 0 2px var(--panel); }
.swatch.none {
  background: linear-gradient(135deg, transparent 45%, var(--alert) 45% 55%, transparent 55%),
              color-mix(in srgb, var(--bg) 94%, var(--fg));
  border-color: var(--edge);
}
.swatch.none[aria-pressed="true"] { border-color: var(--fg); }

.pfprow, .pickrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pickrow button:not(.link) { padding: 6px 12px; font-size: 13px; }

.pfp {
  width: 58px; height: 58px;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 1px dashed var(--edge);
  background: color-mix(in srgb, var(--bg) 94%, var(--fg));
  font-size: 20px;
  color: var(--quiet);
}

.pfp img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cardpreview { margin-bottom: 16px; }
.cardpreview .person { cursor: default; background: color-mix(in srgb, var(--bg) 94%, var(--fg)); }

.iconpick { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 16px; }
.iconpick .hint { margin: 0; }

.bigicon {
  width: 84px; height: 84px;
  padding: 0;
  border-radius: 24px;
  overflow: hidden;
  border: 1px dashed var(--edge);
  background: color-mix(in srgb, var(--bg) 94%, var(--fg));
  font-size: 26px;
  color: var(--dim);
  display: grid;
  place-items: center;
}
.bigicon img { width: 100%; height: 100%; object-fit: cover; display: block; }

.bgpreview {
  height: 110px;
  margin: -4px 0 14px;
  border-radius: 10px;
  border: 1px solid var(--edge);
  background-size: cover;
  background-position: center;
}

.invite { display: flex; align-items: center; gap: 8px; flex: 1; flex-wrap: wrap; }
.invite code {
  padding: 6px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg) 94%, var(--fg));
  letter-spacing: .15em;
  font-size: 16px;
}
.invite button { padding: 6px 12px; font-size: 13px; }

.seg { display: flex; gap: 0; }
.seg button { border-radius: 0; padding: 7px 16px; }
.seg button:first-child { border-radius: 8px 0 0 8px; }
.seg button:last-child { border-radius: 0 8px 8px 0; border-left: none; }
.seg button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 18px;
  color: var(--quiet);
  font-size: 12px;
  text-transform: uppercase;
}
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--edge); }

.link {
  background: none;
  border: none;
  padding: 4px 0;
  font-size: 13px;
  color: var(--dim);
  text-decoration: underline;
}

.link:hover { background: none; color: var(--fg); }
.link.center { display: block; margin: 12px auto 0; }
.link.danger { color: var(--alert); }

.quality {
  margin: 4px 0 18px;
  font-size: 12px;
  color: var(--quiet);
  text-align: center;
  min-height: 18px;
}

.done { width: 100%; padding: 12px; text-transform: uppercase; }

/* sliders in settings */

.slider { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; }

.slider input[type="range"], .vol-pop input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 0;
  height: 4px;
  border-radius: 2px;
  background: var(--edge);
}

.slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--fg);
  cursor: pointer;
}

.slider input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border: none; border-radius: 50%;
  background: var(--fg);
  cursor: pointer;
}

.slider output {
  width: 52px;
  flex: none;
  text-align: right;
  font-size: 13px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

/* mic check */

.mictest { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; }
.mictest button { flex: none; padding: 7px 12px; font-size: 13px; }
.mictest button.live { border-color: var(--s-online); color: var(--s-online); }

.meter {
  position: relative;
  flex: 1;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg) 94%, var(--fg));
  border: 1px solid var(--edge);
}

.meter span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--quiet);
  transition: width 50ms linear;
}
.meter span.live { background: var(--s-online); }
.meter span.hot { background: var(--s-dnd); }

/* the silence gate: quieter than this and nothing is sent */
.meter .gate {
  position: absolute;
  top: 0; bottom: 0;
  left: 36%;
  width: 2px;
  background: var(--fg);
  opacity: .5;
}

.fontpreview {
  margin: -4px 0 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--bg) 94%, var(--fg));
  font-family: var(--chat-font, var(--mono));
  font-size: var(--chat-size, 15px);
}

/* screen viewer */

.viewer {
  width: min(1280px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.viewer-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--fg);
  text-transform: uppercase;
  font-size: 14px;
}

.viewer-bar button { margin-left: auto; }

#viewcanvas {
  width: 100%;
  height: auto;
  background: #000;
  border: 1px solid var(--edge);
  border-radius: 10px;
}

/* ------------------------------------------------------------------ small */

/* Below this the member list becomes a drawer from the right. */
@media (max-width: 1100px) {
  #app { grid-template-columns: auto 1fr; }
  .people {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(290px, 86vw);
    z-index: 30;
    border-radius: 0;
    transform: translateX(104%);
    transition: transform 180ms ease;
  }
  body.people-hidden .people { display: block; }
  body.people-open .people { transform: none; }
}

@media (max-width: 760px) {
  #app { grid-template-columns: 1fr; padding: 8px; }
  .menu { display: block; }
  .left {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(340px, 92vw);
    z-index: 30;
    background: var(--bg);
    padding: 10px;
    transform: translateX(-104%);
    transition: transform 180ms ease;
  }
  .side { width: auto; min-width: 0; }
  body.side-open .left { transform: none; }
  .side-close { display: block; align-self: flex-end; padding: 4px 12px; }
  .row { flex-wrap: wrap; gap: 8px; }
  .row > label { width: 100%; }
  .chanedit { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
