/* Loom: purple and Loom yellow, with the forums' pressable buttons. Rules: /custom/loom/DESIGN.md */

@font-face {
  font-family: "Rubik";
  src: url("/assets/fonts/rubik.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

:root {
  --bg: #120a2a;
  --nav: #170d36;
  --panel: #1f1446;
  --panel-2: #2a1b5a;
  --line: #352560;
  --line-2: #47347f;
  --stone: #3a2a72;
  --stone-hi: #46338a;
  --text: #f4f0ff;
  --muted: #a99fcb;
  --faint: #7c71a3;
  /* the accent is Loom yellow (the variable names stayed from the forums version) */
  --emerald: #ffcc1f;
  --emerald-hi: #ffdd5c;
  --emerald-edge: #c98a00;
  --ink: #1b1036;
  --card-black: rgba(12, 6, 32, 0.78);
  --red: #ff4d82;
  --aqua: #8b7bff;
  --raise: rgba(255, 255, 255, 0.04);
  --raise-2: #2a1b5a;
  /* names the app code still uses */
  --gold: var(--emerald);
  --card-solid: var(--panel);
  --like: var(--red);
  --ok: var(--emerald);
  --danger: var(--red);
  --verified: var(--aqua);
  --font: "Rubik", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --edge: 0 3px 0 rgba(0, 0, 0, 0.35);
  --top: 64px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--stone) var(--nav); background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* the purple sky, drifting slowly */
body::before {
  content: "";
  position: fixed;
  inset: -15vmax;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(60vmax 50vmax at 14% 40%, rgba(124, 58, 237, 0.32), transparent 62%),
    radial-gradient(50vmax 42vmax at 8% 100%, rgba(217, 70, 239, 0.2), transparent 60%),
    radial-gradient(50vmax 42vmax at 92% 90%, rgba(255, 186, 30, 0.14), transparent 60%),
    radial-gradient(60vmax 50vmax at 92% 14%, rgba(96, 72, 255, 0.2), transparent 60%),
    linear-gradient(180deg, #140b30 0%, #170d38 46%, #120a2a 100%);
  animation: ambient 28s ease-in-out infinite alternate;
}
@keyframes ambient {
  from { transform: translate3d(-3%, -2%, 0) scale(1); }
  to { transform: translate3d(3%, 3%, 0) scale(1.08); }
}

#loom-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--emerald); color: var(--ink); }

:focus-visible { outline: 2px solid var(--emerald); outline-offset: 2px; border-radius: 9px; }

[hidden] { display: none !important; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.boot-mark {
  position: fixed;
  inset: 0;
  margin: auto;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: var(--emerald) url("/assets/img/loom-mark.svg") center / 100% no-repeat;
  animation: boot 1.6s var(--ease) infinite;
}
@keyframes boot { 50% { transform: scale(0.9); opacity: 0.7; } }

/* ------------------------------------------------------------------ */
/* frame                                                               */
/* ------------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--top);
  background: var(--nav);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--edge);
}
.topbar-in {
  max-width: 1340px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; justify-self: start; }
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--emerald) url("/assets/img/loom-mark.svg") center / 100% no-repeat;
  box-shadow: 0 6px 22px -6px rgba(255, 196, 0, 0.6);
  transition: transform 0.4s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-word { font: 700 24px/1 var(--font); letter-spacing: -0.02em; color: #fff; }

.search {
  position: relative;
  max-width: 640px;
  width: 100%;
}
.search input {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 42px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search input::placeholder { color: var(--faint); }
.search input:focus { border-color: var(--emerald); box-shadow: 0 0 0 1px var(--emerald); }
.search .ic { position: absolute; left: 13px; top: 50%; translate: 0 -50%; width: 19px; height: 19px; color: var(--muted); pointer-events: none; }
.search-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 6px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--edge);
  max-height: 70vh;
  overflow: auto;
  animation: drop 0.14s var(--ease);
}
.search-pop .label { padding: 8px 10px 4px; color: var(--faint); font-size: 12px; font-weight: 600; }
.search-pop .row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 9px; }
.search-pop .row:hover, .search-pop .row.active { background: var(--panel-2); }
.search-pop .empty { padding: 14px 12px; color: var(--muted); }

.top-actions { display: flex; align-items: center; gap: 6px; }
.top-actions .search-btn { display: none; }
.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--panel); color: var(--text); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn .dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 2px var(--nav);
}
.icon-btn.ring .ic { animation: bell 0.6s steps(4); transform-origin: 50% 10%; }
@keyframes bell { 25% { transform: rotate(12deg); } 50% { transform: rotate(-10deg); } 75% { transform: rotate(6deg); } }

.me-btn { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 4px; border-radius: 9px; border: 0; background: transparent; cursor: pointer; }
.me-btn:hover { background: var(--panel); }
.me-btn .ic { color: var(--muted); width: 18px; height: 18px; }

.shell {
  max-width: 1340px;
  margin: 0 auto;
  padding: 16px 24px 60px;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}
.rail { position: sticky; top: calc(var(--top) + 16px); display: grid; gap: 16px; }
.rail-left { max-height: calc(100vh - var(--top) - 32px); overflow: auto; scrollbar-width: none; }
.rail-left::-webkit-scrollbar { display: none; }
main#view { min-width: 0; view-transition-name: view; }

/* ------------------------------------------------------------------ */
/* cards                                                               */
/* ------------------------------------------------------------------ */

.card {
  position: relative;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  transition: border-color 0.3s var(--ease), transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.card.post:hover { border-color: #5a44a0; transform: translateY(-2px); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.3); }

/* the forums' server card: black glass, thin light border that lights up on hover */
.card.mc,
.gate-card,
.me-card,
.preview-card {
  background: var(--card-black);
  border: 2px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  transition: border-color 0.12s ease;
}
.card.mc:hover,
.gate-card:hover,
.me-card:hover,
.preview-card:hover { border-color: rgba(255, 204, 31, 0.55); }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 6px; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; color: #fff; }
.card-head h3 .ic { width: 18px; height: 18px; color: var(--muted); }
.card-head a.more { color: var(--emerald); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.card-head a.more:hover { color: var(--emerald-hi); }

/* ------------------------------------------------------------------ */
/* left nav                                                            */
/* ------------------------------------------------------------------ */

.nav { position: relative; display: grid; gap: 2px; padding: 6px; }
.nav-pill {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 0;
  height: 46px;
  border-radius: 9px;
  background: var(--panel-2);
  box-shadow: inset 3px 0 0 var(--emerald);
  transition: transform 0.4s var(--ease), height 0.4s var(--ease), opacity 0.2s;
  opacity: 0;
}
.nav-item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 46px;
  padding: 0 14px 0 16px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
  text-align: left;
}
.nav-item:hover:not(.active) { background: var(--raise); color: var(--text); }
.nav-item.active { color: #fff; font-weight: 600; }
.nav-item.active .ic { color: var(--emerald); }
.nav-item .ic { width: 22px; height: 22px; }
.nav-item .badge { margin-left: auto; }
.nav-item.create { color: var(--emerald); }
.nav-item.create .ic { color: var(--emerald); }

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.nav-item.active .badge { background: var(--red); }

.list { display: grid; gap: 1px; padding: 4px 8px 10px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 9px; transition: background-color 0.15s; min-width: 0; }
.list-row:hover { background: var(--panel-2); }
.list-row .thumb {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--panel-2);
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.list-row .thumb .ic { width: 18px; height: 18px; }
.list-row .grow { min-width: 0; flex: 1; }
.list-row .t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .s { color: var(--muted); font-size: 13px; }
.list-row .live { width: 7px; height: 7px; border-radius: 50%; background: var(--emerald); flex: none; }
.trend-ic { color: var(--emerald); flex: none; }

/* the "in character" note in the left rail */
.gold-card {
  position: relative;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.06);
  background: var(--card-black);
}
.gold-card h4 { margin: 0 0 4px; color: #fff; font-size: 14px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.gold-card h4 .ic { width: 18px; height: 18px; color: var(--emerald); }
.gold-card p { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* ------------------------------------------------------------------ */
/* buttons: Minecraft style, they press down                           */
/* ------------------------------------------------------------------ */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 9px;
  border: 0;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  background: var(--stone);
  color: var(--text);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease), background-color 0.25s var(--ease), filter 0.25s var(--ease);
}
.btn:hover:not([disabled]) { filter: brightness(1.06); }
.btn:active:not([disabled]) { transform: translateY(2px); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.35); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-gold {
  background: var(--emerald);
  color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--emerald-edge), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-gold:hover:not([disabled]) { background: var(--emerald-hi); }
.btn-gold:active:not([disabled]) { box-shadow: inset 0 -1px 0 var(--emerald-edge); }
.btn-ghost { background: var(--stone); color: var(--text); }
.btn-ghost:hover:not([disabled]) { background: var(--stone-hi); }
.btn-line { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-line:hover:not([disabled]) { background: var(--panel-2); }
.btn-line:active:not([disabled]) { box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-danger { background: #4a2526; color: #ffb3b3; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.btn-danger:hover:not([disabled]) { background: #c93a3a; color: #fff; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn .ic { width: 18px; height: 18px; }
.btn.busy { color: transparent !important; pointer-events: none; }
.btn.busy::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 3px solid var(--text);
  border-radius: 50%;
  border-color: var(--text) transparent var(--text) transparent;
  animation: spin 0.8s linear infinite;
}
.btn-gold.busy::after { border-color: var(--ink) transparent var(--ink) transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.chip:hover { border-color: var(--line-2); background: #33236a; }
.chip.on { border-color: var(--emerald); color: var(--emerald); }
.chip .ic { width: 18px; height: 18px; color: var(--muted); }
.chip:hover .ic, .chip.on .ic { color: inherit; }

.ic { display: inline-block; width: 22px; height: 22px; flex: none; }
.ic svg { display: block; width: 100%; height: 100%; }

/* ------------------------------------------------------------------ */
/* heads and names                                                     */
/* ------------------------------------------------------------------ */

.av {
  position: relative;
  flex: none;
  display: block;
  width: var(--s, 48px);
  height: var(--s, 48px);
  border-radius: 28%;
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
.av img {
  width: 100%;
  height: 100%;
  border-radius: 28%;
  object-fit: cover;
  background: var(--panel-2);
  image-rendering: auto;
}
.av.pixel img { image-rendering: pixelated; }
.av .online {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 28%;
  height: 28%;
  border-radius: 50%;
  background: var(--emerald);
  border: 2px solid var(--panel);
}

.name { font-weight: 600; display: inline-flex; align-items: center; gap: 5px; min-width: 0; color: #fff; }
.name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name:hover > span { text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.4); text-underline-offset: 3px; }
.vbadge { width: 16px; height: 16px; flex: none; color: var(--aqua); }
.vbadge svg { width: 100%; height: 100%; display: block; }
.handle, .meta { color: var(--muted); }
.dotsep::before { content: "·"; margin: 0 6px; color: var(--faint); }

/* ------------------------------------------------------------------ */
/* composer                                                            */
/* ------------------------------------------------------------------ */

.composer { padding: 16px; display: flex; gap: 14px; align-items: flex-start; }
.composer .av { --s: 48px; }
.composer-main { flex: 1; min-width: 0; }
.composer textarea {
  width: 100%;
  min-height: 44px;
  max-height: 340px;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 17px;
  line-height: 1.45;
  padding: 10px 2px 8px;
  color: var(--text);
}
.composer textarea::placeholder { color: var(--faint); }
.composer-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.composer-tools .spacer { flex: 1; }
.composer .count { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.composer .count.warn { color: #ffcc55; }
.composer .count.over { color: var(--red); }
.composer-place {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 0 12px;
  height: 40px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--nav);
}
.composer-place input { flex: 1; border: 0; outline: none; background: transparent; }
.composer-place .ic { color: var(--emerald); width: 18px; height: 18px; }
.composer-preview { position: relative; margin-top: 10px; border-radius: 9px; overflow: hidden; max-height: 360px; background: var(--nav); }
.composer-preview img { width: 100%; max-height: 360px; object-fit: contain; }
.composer-preview .x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 0;
  background: rgba(0, 0, 0, 0.7);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.composer-preview .x:hover { background: #000; }
.composer.drag { outline: 2px dashed var(--emerald); outline-offset: -6px; }

/* ------------------------------------------------------------------ */
/* posts                                                               */
/* ------------------------------------------------------------------ */

.feed { display: grid; gap: 12px; }
.post {
  padding: 16px 16px 8px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  column-gap: 12px;
  align-items: start;
}
.post > .post-via { grid-column: 1 / -1; grid-row: 1; }
.post > .post-head { display: contents; }
.post-head > a:first-child { grid-column: 1; grid-row: 2 / span 4; }
.post-head > .post-who { grid-column: 2; grid-row: 2; }
.post-head > .icon-btn { grid-column: 3; grid-row: 2; margin: -8px -8px 0 0; width: 36px; height: 36px; }
.post > .post-body { grid-column: 2 / -1; grid-row: 3; }
.post > .media-wrap { grid-column: 2 / -1; grid-row: 4; }
.post > .post-actions { grid-column: 2 / -1; grid-row: 5; }
.feed > .post { animation: post-in 0.55s var(--ease) both; }
.feed > .post:nth-child(2) { animation-delay: 0.05s; }
.feed > .post:nth-child(3) { animation-delay: 0.1s; }
.feed > .post:nth-child(4) { animation-delay: 0.15s; }
.feed > .post:nth-child(5) { animation-delay: 0.2s; }
.feed > .post:nth-child(n+6) { animation-delay: 0.25s; }
@keyframes post-in { from { opacity: 0; transform: translateY(14px); } }
.post-via { display: flex; align-items: center; gap: 8px; margin: -2px 0 10px 2px; color: var(--muted); font-size: 13px; font-weight: 500; }
.post-via .ic { width: 16px; height: 16px; color: var(--emerald); }
.post-head { display: flex; gap: 12px; align-items: flex-start; }
.post-head .av { --s: 44px !important; }
.post-who { min-width: 0; min-height: 22px; display: flex; flex-direction: column; justify-content: center; }
.post-who .line1 { display: flex; align-items: center; flex-wrap: wrap; gap: 0 6px; font-size: 15px; line-height: 1.35; }
.post-who .line1 .handle, .post-who .line1 .when { font-size: 13px; font-weight: 400; }
.post-who .when:hover { color: var(--text); }
.post-place { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; margin-top: 1px; }
.post-place:hover { color: var(--emerald); }
.post-place .ic { width: 14px; height: 14px; }
.post-body {
  margin-top: 4px;
  font-size: 16px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.post-body a.tag, .post-body a.at { color: var(--emerald); font-weight: 500; }
.post-body a.tag:hover, .post-body a.at:hover { text-decoration: underline; text-underline-offset: 3px; }
.post .post-body { margin-top: 2px; }
.post .media-wrap { margin: 10px 0 0; }
.post.big .post-head > a:first-child { grid-row: 2; }
.post.big .post-head > .post-who { min-height: 44px; }
.post.big > .post-body, .post.big > .media-wrap, .post.big > .post-actions { grid-column: 1 / -1; }
.post.big .post-body { font-size: 18px; margin-top: 12px; }

.media {
  --c: #2a1d55;
  position: relative;
  overflow: hidden;
  border-radius: 9px;
  background: var(--c);
  cursor: zoom-in;
  isolation: isolate;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.media img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.3s var(--ease); }
.media.loaded img { opacity: 1; }
.post.big .media img { object-fit: contain; }
/* photos are revealed in strips, like a block texture loading in */
.media .weave { position: absolute; inset: 0; display: grid; grid-template-rows: repeat(7, 1fr); pointer-events: none; z-index: 2; }
.media .weave i { display: block; margin: -0.5px 0; background: var(--c); box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.08); }
.media.loaded .weave i { animation: weave-r 0.5s var(--ease) forwards; animation-delay: calc(var(--i) * 40ms); }
.media.loaded .weave i:nth-child(odd) { animation-name: weave-l; }
@keyframes weave-r { to { transform: translateX(101%); } }
@keyframes weave-l { to { transform: translateX(-101%); } }
.media.done .weave { display: none; }
.media .heart-pop { position: absolute; inset: 0; margin: auto; width: 30%; height: 30%; z-index: 3; color: var(--red); pointer-events: none; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.45)); }

.post-actions { display: flex; align-items: center; gap: 2px; margin: 6px 0 0 -10px; }
.act {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 10px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}
.act:hover { background: var(--panel-2); color: var(--text); }
.act .ic { width: 21px; height: 21px; }
.act:active .ic { transform: translateY(1px); }
.act.like.on { color: var(--red); }
.act.like.on .ic { animation: heart 0.3s steps(3); }
.act.repost.on { color: var(--emerald); }
.act.like:hover { color: var(--red); }
.act.repost:hover { color: var(--emerald); }
.act.comment:hover { color: var(--text); }
.post-actions .spacer { flex: 1; }
@keyframes heart { 50% { transform: scale(1.25); } }

.roll { display: inline-block; position: relative; overflow: hidden; height: 1.3em; line-height: 1.3em; vertical-align: -0.25em; font-variant-numeric: tabular-nums; }
.roll > span { display: block; }

.spark {
  position: fixed;
  z-index: 200;
  width: 6px;
  height: 6px;
  pointer-events: none;
  left: 0;
  top: 0;
}

/* ------------------------------------------------------------------ */
/* home                                                                */
/* ------------------------------------------------------------------ */

.page { display: grid; gap: 12px; }
.tabs { display: flex; gap: 0; padding: 0 6px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); position: relative; }
.tab {
  position: relative;
  z-index: 1;
  flex: 1;
  height: 46px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s;
}
.tab:hover { color: var(--text); }
.tab.on { color: #fff; }
.tab-pill {
  position: absolute;
  bottom: -1px;
  height: 3px;
  left: 0;
  border-radius: 3px 3px 0 0;
  background: var(--emerald);
  transition: transform 0.4s var(--ease), width 0.4s var(--ease);
}

.new-pill {
  position: sticky;
  top: calc(var(--top) + 10px);
  z-index: 20;
  justify-self: center;
  margin-bottom: -52px;
  height: 36px;
  padding: 0 14px 0 10px;
  border-radius: 9px;
  border: 0;
  background: var(--emerald);
  color: var(--ink);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: inset 0 -3px 0 var(--emerald-edge), inset 0 1px 0 rgba(255, 255, 255, 0.35), var(--edge);
  animation: drop 0.2s var(--ease);
}
.new-pill:active { transform: translateY(2px); }
.new-pill .ic { width: 18px; height: 18px; }

.empty-state { padding: 40px 28px; text-align: center; color: var(--muted); }
.empty-state .ic { width: 40px; height: 40px; color: var(--stone); margin-bottom: 10px; }
.empty-state h3 { margin: 0 0 6px; color: #fff; font-size: 18px; font-weight: 600; }
.empty-state p { margin: 0 auto 16px; max-width: 34ch; }

.sentinel { height: 2px; }
.loading-line { display: flex; justify-content: center; padding: 20px; }

/* loader: three blocks, like the server list ping */
.loom-load { position: relative; width: 30px; height: 10px; display: flex; gap: 3px; }
.loom-load i { position: static; flex: 1; height: 100%; border-radius: 3px; background: var(--stone); animation: ping 0.9s steps(1) infinite; }
.loom-load i:nth-child(2) { animation-delay: 0.15s; }
.loom-load i:nth-child(3) { animation-delay: 0.3s; }
@keyframes ping { 0% { background: var(--emerald); } 35%, 100% { background: var(--stone); } }

.skel { border-radius: 9px; background: var(--panel-2); animation: skel 1.2s steps(2) infinite; }
@keyframes skel { 50% { background: #33236a; } }

/* ------------------------------------------------------------------ */
/* right rail: your character                                          */
/* ------------------------------------------------------------------ */

.me-card { padding: 4px 16px 16px; }
.me-card .who { display: flex; align-items: center; gap: 14px; margin: 12px 0 16px; }
.me-card .who .av { --s: 64px; }
.me-card .who .n { font-size: 18px; font-weight: 600; color: #fff; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; margin-bottom: 14px; border-top: 1px solid rgba(255, 255, 255, 0.06); border-bottom: 1px solid rgba(255, 255, 255, 0.06); padding: 10px 0; }
.stats b { display: block; font-size: 17px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); font-size: 12px; }
.stats a:hover b { color: var(--emerald); }
.me-card .btn-line { background: var(--stone); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1); }
.me-card .btn-line:hover:not([disabled]) { background: var(--stone-hi); }
.me-card .btn-line:active:not([disabled]) { box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.35); }

/* ------------------------------------------------------------------ */
/* profile page                                                        */
/* ------------------------------------------------------------------ */

.profile-head { overflow: hidden; }
.profile-head > .profile-actions { position: absolute; top: 12px; right: 12px; z-index: 2; padding: 0; }
.profile-head > .profile-actions .icon-btn { background: rgba(0, 0, 0, 0.55); color: #fff; }
.profile-head > .profile-actions .icon-btn:hover { background: rgba(0, 0, 0, 0.8); }
.profile-head > .profile-actions .btn-line { background: rgba(0, 0, 0, 0.55); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.profile-head > .profile-actions .btn-line:hover:not([disabled]) { background: rgba(0, 0, 0, 0.8); }
/* banner: a dark tint of the character's colour with a faint block grid */
.profile-banner { height: 150px; position: relative; background: linear-gradient(120deg, hsl(var(--h, 265) 70% 32%), hsl(calc(var(--h, 265) + 50) 70% 26%) 60%, #2a1458); }
.profile-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 16px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.16) 0 1px, transparent 1px 16px);
}
.profile-body { padding: 0 20px 20px; text-align: center; }
.profile-top { display: flex; justify-content: center; margin-top: -52px; }
.profile-top .av { --s: 104px; box-shadow: 0 0 0 4px var(--panel); }
.profile-actions { display: flex; gap: 8px; padding-bottom: 4px; flex-wrap: wrap; justify-content: flex-end; }
.profile-name { margin: 12px 0 0; font-size: 22px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 7px; line-height: 1.25; color: #fff; }
.profile-name .vbadge { width: 20px; height: 20px; }
.profile-handle { color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.follows-you { font-size: 12px; padding: 1px 7px; border-radius: 9px; background: var(--panel-2); color: var(--muted); }
.profile-bio { margin: 10px auto 0; max-width: 60ch; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.profile-stats { display: flex; justify-content: center; gap: 20px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); flex-wrap: wrap; }
.profile-stats b { color: #fff; font-weight: 600; margin-right: 4px; font-variant-numeric: tabular-nums; }
.profile-stats a:hover b { color: var(--emerald); }
.suspended-tag { display: inline-flex; gap: 6px; align-items: center; padding: 3px 9px; border-radius: 9px; background: #4a2526; color: #ffb3b3; font-size: 13px; font-weight: 600; }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--c, #2a1d55);
  display: block;
}
.tile img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.3s; }
.tile.loaded img { opacity: 1; }
.tile::after { content: ""; position: absolute; inset: 0; border: 2px solid transparent; transition: border-color 0.12s; pointer-events: none; }
.tile:hover::after { border-color: rgba(255, 204, 31, 0.55); }
.tile .tile-meta {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  gap: 14px;
  padding: 24px 10px 8px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.8));
  font-weight: 600;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.15s;
}
.tile:hover .tile-meta { opacity: 1; }
.tile-meta span { display: inline-flex; gap: 5px; align-items: center; }
.tile-meta .ic { width: 16px; height: 16px; }
.tile.text { display: grid; place-items: center; padding: 14px; text-align: center; background: var(--panel-2); }
.tile.text p { margin: 0; font-size: 14px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }

.masonry { columns: 3 220px; column-gap: 8px; }
.masonry .tile { aspect-ratio: auto; margin: 0 0 8px; break-inside: avoid; }

/* ------------------------------------------------------------------ */
/* post page and comments                                              */
/* ------------------------------------------------------------------ */

.back-row { display: flex; align-items: center; gap: 10px; }
.back-row h2 { margin: 0; font-size: 18px; font-weight: 600; }
.comments { padding: 4px 16px 14px; display: grid; gap: 0; }
.comment { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); animation: rise 0.2s var(--ease); }
.comment:first-child { border-top: 0; }
.comment .av { --s: 36px; }
.comment .grow { flex: 1; min-width: 0; }
.comment .post-body { font-size: 15px; margin-top: 2px; padding: 0; }
.comment-form { display: flex; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); align-items: flex-end; }
.comment-form .av { --s: 36px; }
.comment-form textarea {
  flex: 1;
  min-height: 40px;
  max-height: 160px;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--nav);
  resize: none;
  outline: none;
}
.comment-form textarea:focus { border-color: var(--emerald); box-shadow: 0 0 0 1px var(--emerald); }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }

/* ------------------------------------------------------------------ */
/* notifications                                                       */
/* ------------------------------------------------------------------ */

.notif { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid var(--line); transition: background-color 0.15s; }
.notif:first-child { border-top: 0; }
.notif:hover { background: var(--panel-2); }
.notif.unseen { box-shadow: inset 3px 0 0 var(--emerald); background: rgba(255, 204, 31, 0.06); }
.notif .kind { position: relative; }
.notif .kind .ic {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 20px;
  height: 20px;
  padding: 3px;
  border-radius: 9px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.notif .kind.like .ic { color: var(--red); }
.notif .kind.repost .ic { color: var(--emerald); }
.notif .kind.follow .ic { color: var(--emerald); }
.notif .kind.comment .ic, .notif .kind.mention .ic { color: var(--text); }
.notif .grow { flex: 1; min-width: 0; }
.notif .snip { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif .pthumb { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; flex: none; }

/* ------------------------------------------------------------------ */
/* messages                                                            */
/* ------------------------------------------------------------------ */

.dm { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: calc(100vh - var(--top) - 40px); min-height: 480px; overflow: hidden; }
.dm-list { border-right: 1px solid var(--line); overflow: auto; display: flex; flex-direction: column; }
.dm-list-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 8px 16px; }
.dm-list-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.dm-row { display: flex; gap: 12px; align-items: center; padding: 10px 12px; margin: 0 6px; border-radius: 9px; transition: background-color 0.15s; }
.dm-row:hover { background: var(--panel-2); }
.dm-row.on { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--emerald); }
.dm-row .av { --s: 42px; }
.dm-row .grow { flex: 1; min-width: 0; }
.dm-row .prev { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-row.unread .prev { color: var(--text); font-weight: 500; }
.dm-row .udot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); flex: none; }
.dm-thread { display: flex; flex-direction: column; min-width: 0; }
.dm-thread-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dm-thread-head .av { --s: 38px; }
.dm-msgs { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.bubble {
  max-width: 74%;
  padding: 8px 12px;
  border-radius: 9px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  align-self: flex-start;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  animation: rise 0.15s var(--ease);
}
.bubble.mine {
  align-self: flex-end;
  background: #6b3fe0;
  border-color: #7c4dff;
  color: #fff;
}
.bubble .t { display: block; font-size: 11px; color: rgba(255, 255, 255, 0.55); margin-top: 2px; text-align: right; font-variant-numeric: tabular-nums; }
.day-sep { align-self: center; color: var(--faint); font-size: 12px; margin: 10px 0 4px; }
.dm-form { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.dm-form textarea { flex: 1; min-height: 40px; max-height: 140px; padding: 9px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--nav); resize: none; outline: none; }
.dm-form textarea:focus { border-color: var(--emerald); box-shadow: 0 0 0 1px var(--emerald); }
.dm-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 30px; }

/* ------------------------------------------------------------------ */
/* forms                                                               */
/* ------------------------------------------------------------------ */

.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 14px; }
.field .hint { color: var(--muted); font-size: 13px; }
.field .hint.ok { color: var(--emerald); }
.field .hint.bad { color: var(--red); }
.input, .textarea {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--nav);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.textarea { height: auto; min-height: 96px; padding: 11px 13px; resize: vertical; }
.input:focus, .textarea:focus { border-color: var(--emerald); box-shadow: 0 0 0 1px var(--emerald); }
.input-at { position: relative; }
.input-at .input { padding-left: 32px; }
.input-at::before { content: "@"; position: absolute; left: 13px; top: 50%; translate: 0 -52%; color: var(--muted); font-weight: 500; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ic-note {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 9px;
  background: var(--panel-2);
  box-shadow: inset 3px 0 0 var(--emerald);
  color: var(--text);
  font-size: 14px;
}
.ic-note .ic { color: var(--emerald); width: 20px; height: 20px; margin-top: 1px; }
.ic-note b { color: #fff; }
.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-weight: 500; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--emerald); flex: none; }

.section { padding: 20px; }
.section + .section { border-top: 1px solid var(--line); }
.section h2 { margin: 0 0 4px; font-size: 18px; font-weight: 600; color: #fff; }
.section > p.lead { margin: 0 0 16px; color: var(--muted); }

/* ------------------------------------------------------------------ */
/* gate: sign in and set up                                            */
/* ------------------------------------------------------------------ */

.gate { min-height: 100vh; display: grid; place-items: center; padding: 40px 16px; }
.gate-card { width: min(420px, 100%); padding: 22px 22px 20px; animation: gate-in 0.7s var(--ease) both; }
.gate-card.wide { width: min(860px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; }
@keyframes gate-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
.gate-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.gate-brand .brand-mark { width: 36px; height: 36px; }
.gate-brand .brand-word { font-size: 26px; }
.gate h1 { margin: 0 0 6px; font-size: 22px; font-weight: 600; line-height: 1.25; color: #fff; }
.gate p.lead { margin: 0 0 20px; color: var(--muted); }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.08); }
.gate-foot { margin-top: 18px; color: var(--muted); font-size: 13px; text-align: center; }
.gate-foot a { color: var(--emerald); }
.gate-foot a:hover { color: var(--emerald-hi); }
.gate .input { background: rgba(0, 0, 0, 0.45); border-color: rgba(255, 255, 255, 0.1); }
.gate .input:focus { border-color: var(--emerald); }
.notice { padding: 10px 12px; border-radius: 9px; background: #3a2122; box-shadow: inset 3px 0 0 var(--red); color: #ffc4c4; margin-bottom: 16px; font-size: 14px; }
.notice.good { background: #3a2d12; box-shadow: inset 3px 0 0 var(--emerald); color: #ffe9a8; }

.steps { display: flex; gap: 4px; margin-bottom: 20px; }
.steps i { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; position: relative; }
.steps i::after { content: ""; position: absolute; inset: 0; background: var(--emerald); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease); }
.steps i.on::after { transform: scaleX(1); }
.step-body { animation: step-in 0.25s var(--ease); }
@keyframes step-in { from { opacity: 0; transform: translateX(8px); } }
.step-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; }

.preview-card { align-self: center; padding: 20px; text-align: center; }
.preview-card .av { --s: 96px; margin: 0 auto 12px; }
.preview-card .pn { font-size: 20px; font-weight: 600; min-height: 1.3em; color: #fff; }
.preview-card .ph { color: var(--muted); min-height: 1.4em; }
.preview-card .tagline { margin-top: 12px; font-size: 12px; color: var(--faint); }

.rules { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: r; }
.rules li { display: flex; gap: 12px; counter-increment: r; }
.rules li::before {
  content: counter(r);
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--stone);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.35);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
}
.rules b { display: block; margin-bottom: 2px; color: #fff; }
.rules span { color: var(--muted); font-size: 14px; }

/* ------------------------------------------------------------------ */
/* overlays: menus, modals, toasts, lightbox                            */
/* ------------------------------------------------------------------ */

.menu {
  position: fixed;
  z-index: 120;
  min-width: 240px;
  max-height: calc(100vh - 20px);
  overflow: auto;
  padding: 4px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--edge);
  animation: drop 0.12s var(--ease);
}
.menu button, .menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
}
.menu button:hover, .menu a:hover { background: var(--panel-2); }
.menu .danger { color: #ff8c8c; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
.menu-label { padding: 8px 10px 4px; color: var(--faint); font-size: 12px; font-weight: 600; }
.menu .acct { gap: 10px; padding: 6px 8px; }
.menu .acct .av { --s: 32px !important; }
.menu .acct.on { background: var(--panel-2); box-shadow: inset 3px 0 0 var(--emerald); }
.menu .acct .ic { color: var(--emerald); margin-left: auto; }
.menu .acct .badge { margin-left: auto; }
.acct-text { display: grid; min-width: 0; line-height: 1.25; }
.acct-name { display: flex; align-items: center; gap: 5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-name .vbadge { width: 14px; height: 14px; }
.acct-handle { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu small { display: block; color: var(--faint); font-size: 12px; }
.menu button[disabled] { cursor: default; opacity: 0.6; }
.menu button[disabled]:hover { background: transparent; }
.menu .ic { width: 18px; height: 18px; color: var(--muted); }
.menu .danger .ic { color: #ff8c8c; }
@keyframes drop { from { opacity: 0; transform: translateY(-4px); } }

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.7);
  animation: fade-in 0.15s;
}
.overlay.closing { animation: fade-out 0.12s forwards; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; animation: modal-in 0.2s var(--ease); box-shadow: var(--edge); }
.overlay.closing .modal { animation: fade-out 0.12s forwards; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 4px 16px; }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 600; color: #fff; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px); } }

.lightbox { position: fixed; inset: 0; z-index: 110; background: rgba(0, 0, 0, 0.92); display: grid; place-items: center; padding: 30px; cursor: zoom-out; animation: fade-in 0.15s; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; }

.toasts { position: fixed; z-index: 150; left: 50%; bottom: 24px; translate: -50% 0; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 500;
  animation: toast-in 0.2s var(--ease);
}
.toast.bad { border-color: rgba(255, 85, 85, 0.5); }
.toast.bad .ic { color: var(--red); }
.toast .ic { color: var(--emerald); width: 18px; height: 18px; }
.toast.out { animation: fade-out 0.2s forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------------ */
/* staff                                                               */
/* ------------------------------------------------------------------ */

.report { padding: 14px 16px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.report:first-child { border-top: 0; }
.report .why { padding: 9px 12px; border-radius: 9px; background: #3a2122; box-shadow: inset 3px 0 0 var(--red); font-size: 14px; }
.report .target { padding: 12px; border-radius: 9px; background: var(--nav); border: 1px solid var(--line); }
.report .target .post { padding: 0; background: none; border: 0; box-shadow: none; }
.report .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.staff-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: #ffe28a; padding: 2px 8px; border-radius: 9px; background: #3a2d12; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.switch:first-of-type { border-top: 0; }
.switch .s { color: var(--muted); font-size: 13px; }
/* toggles look like the Minecraft options switch */
.toggle { position: relative; width: 48px; height: 26px; flex: none; }
.toggle input { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; margin: 0; }
.toggle i { position: absolute; inset: 0; border-radius: 9px; background: var(--nav); border: 1px solid var(--line-2); transition: background-color 0.15s; }
.toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 12px; background: var(--stone); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.35); transition: transform 0.15s var(--ease), background-color 0.15s; }
.toggle input:checked + i { background: var(--emerald-edge); border-color: var(--emerald); }
.toggle input:checked + i::after { transform: translateX(22px); background: var(--emerald); box-shadow: inset 0 -2px 0 var(--emerald-edge); }
.toggle input:focus-visible + i { outline: 2px solid var(--emerald); outline-offset: 2px; }

/* ------------------------------------------------------------------ */
/* phones and tablets                                                  */
/* ------------------------------------------------------------------ */

.tabbar { display: none; }

@media (max-width: 1180px) {
  .shell { grid-template-columns: 228px minmax(0, 1fr); }
  .topbar-in { grid-template-columns: 228px minmax(0, 1fr) auto; }
  .rail-right { display: none; }
}

@media (max-width: 860px) {
  :root { --top: 56px; }
  .shell { grid-template-columns: minmax(0, 1fr); padding: 10px 12px 90px; gap: 12px; }
  .rail-left { display: none; }
  .topbar-in { grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 0 12px; }
  .top-actions { justify-self: end; gap: 2px; }
  .brand-word { font-size: 22px; }
  .brand-mark { width: 30px; height: 30px; }
  .search input { height: 40px; }
  .top-actions .hide-sm { display: none; }
  .topbar-in > .search { display: none; }
  .top-actions .search-btn { display: inline-grid; }
  .tabbar {
    position: fixed;
    z-index: 45;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: var(--nav);
    border-top: 1px solid var(--line);
  }
  .tabbar a, .tabbar button {
    position: relative;
    height: 48px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    display: grid;
    place-items: center;
    color: var(--muted);
    cursor: pointer;
  }
  .tabbar .on { color: #fff; }
  .tabbar .on::after { content: ""; position: absolute; left: 30%; right: 30%; top: -7px; height: 3px; border-radius: 3px; background: var(--emerald); }
  .tabbar .ic { width: 24px; height: 24px; }
  .tabbar .plus { background: var(--emerald); color: var(--ink); margin: 2px 10px; height: 44px; box-shadow: inset 0 -3px 0 var(--emerald-edge), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
  .tabbar .plus:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 var(--emerald-edge); }
  .tabbar .dot { position: absolute; top: 9px; right: calc(50% - 15px); width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
  .post { padding: 12px 12px 6px; grid-template-columns: 40px minmax(0, 1fr) auto; column-gap: 10px; }
  .post-head .av { --s: 40px !important; }
  .post-head > a:first-child { grid-row: 2; }
  .post-head > .post-who { min-height: 40px; }
  .post > .post-body, .post > .media-wrap, .post > .post-actions { grid-column: 1 / -1; }
  .post .post-body { margin-top: 8px; }
  .post-who .line1 .handle { display: none; }
  .post-actions { margin-left: -8px; }
  .act { padding: 0 8px; }
  .composer { padding: 12px; gap: 10px; }
  .composer .av { --s: 40px !important; }
  .composer .chip .lbl { display: none; }
  .composer .chip { padding-left: 10px; padding-right: 10px; }
  .composer textarea { font-size: 16px; }
  .profile-top .av { --s: 84px !important; }
  .me-card .who .av { --s: 56px !important; }
  .profile-banner { height: 110px; }
  .profile-body { padding: 0 14px 16px; }
  .dm { grid-template-columns: minmax(0, 1fr); height: calc(100vh - var(--top) - 100px); }
  .dm.thread-open .dm-list { display: none; }
  .dm:not(.thread-open) .dm-thread { display: none; }
  .gate-card.wide { grid-template-columns: minmax(0, 1fr); }
  .gate-card.wide .preview-card { display: none; }
  .row3 { grid-template-columns: minmax(0, 1fr); }
  .masonry { columns: 2 140px; }
  .grid3 { gap: 2px; }
  .new-pill { top: calc(var(--top) + 6px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .media .weave { display: none; }
  body::before { animation: none; }
}

::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-old(view) { animation: vt-out 0.18s var(--ease) both; }
::view-transition-new(view) { animation: vt-in 0.45s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }
