:root {
  color-scheme: dark;
  --bg: #1e1f22;
  --surface: #2b2d31;
  --surface-raised: #313338;
  --surface-hover: #35373c;
  --line: #242529;
  --line-bright: #404249;
  --text: #f2f3f5;
  --muted: #b5bac1;
  --subtle: #949ba4;
  --accent: #5865f2;
  --accent-bright: #7983f5;
  --accent-wash: rgba(88, 101, 242, 0.14);
  --success: #23a559;
  --radius: 12px;
  --radius-small: 8px;
  --shell: min(1180px, calc(100% - 40px));
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.012) 1px, transparent 1px);
  background-size: 32px 32px;
  content: "";
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  width: var(--shell);
  margin-inline: auto;
}

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

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius-small);
  background: var(--accent);
  color: #fff;
  transform: translateY(-160%);
  transition: transform .2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(42, 46, 56, .75);
  background: rgba(16, 17, 22, .82);
  backdrop-filter: blur(18px);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 750;
  letter-spacing: -.02em;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border: 1px solid var(--line-bright);
  transform: rotate(45deg);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  position: absolute;
  background: var(--accent-bright);
  content: "";
}

.brand-mark::before {
  width: 9px;
  height: 9px;
}

.brand-mark::after {
  width: 3px;
  height: 21px;
  opacity: .65;
}

.brand-mark span {
  width: 21px;
  height: 3px;
  opacity: .65;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: .92rem;
  font-weight: 600;
  transition: color .2s ease, background .2s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  background: var(--surface-raised);
  color: var(--text);
}

.nav-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.nav-toggle > span:not(.sr-only) {
  display: block;
  width: 16px;
  height: 2px;
  margin: 5px auto;
  background: currentColor;
  transition: transform .2s ease;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(87,184,138,.1);
}

.hero {
  display: grid;
  min-height: calc(100vh - 68px);
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  gap: 64px;
  padding-block: 80px;
}

.hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(3.25rem, 7vw, 6.4rem);
  line-height: .96;
  letter-spacing: -.065em;
}

.hero h1 span {
  color: var(--subtle);
}

.hero-intro {
  max-width: 640px;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.16rem);
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-top: 36px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  font-size: .91rem;
  font-weight: 700;
  transition: transform .2s var(--ease), background .2s ease, border-color .2s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--accent);
  color: white;
}

.button-primary:hover {
  background: var(--accent-bright);
}

.button-secondary {
  border-color: var(--line-bright);
  background: var(--surface-raised);
}

.button-secondary:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}

.text-link {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 650;
  transition: color .2s ease;
}

.text-link:hover {
  color: var(--text);
}

.hero-sigil {
  position: relative;
  width: min(36vw, 440px);
  aspect-ratio: 1;
  margin-left: auto;
}

.sigil {
  position: absolute;
  inset: 0;
  margin: auto;
  border: 1px solid var(--line-bright);
  border-radius: 50%;
}

.sigil::before,
.sigil::after {
  position: absolute;
  inset: 50% auto auto 50%;
  background: var(--line-bright);
  content: "";
  transform: translate(-50%, -50%);
}

.sigil::before { width: 110%; height: 1px; }
.sigil::after { width: 1px; height: 110%; }
.sigil-outer { width: 100%; height: 100%; animation: rotate-slow 42s linear infinite; }
.sigil-outer::before { transform: translate(-50%, -50%) rotate(45deg); }
.sigil-outer::after { transform: translate(-50%, -50%) rotate(45deg); }
.sigil-middle { width: 72%; height: 72%; border-style: dashed; opacity: .72; animation: rotate-reverse 28s linear infinite; }
.sigil-inner { width: 42%; height: 42%; border-color: var(--accent); box-shadow: 0 0 70px rgba(124,132,244,.13); }

.sigil-core {
  position: absolute;
  inset: 0;
  display: grid;
  width: 76px;
  height: 76px;
  margin: auto;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  transform: rotate(45deg);
}

.sigil-core span {
  border: 1px solid var(--accent-bright);
  background: var(--accent-wash);
}

.sigil-label {
  position: absolute;
  padding: 5px 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--subtle);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .62rem;
  letter-spacing: .12em;
}

.sigil-label-one { top: 14%; right: -2%; }
.sigil-label-two { bottom: 20%; left: -4%; color: var(--success); }

@keyframes rotate-slow { to { transform: rotate(360deg); } }
@keyframes rotate-reverse { to { transform: rotate(-360deg); } }

.world-section,
.featured-section {
  padding-block: 110px;
}

.section-heading {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  margin-bottom: 42px;
  align-items: end;
}

.section-heading h2,
.featured-copy h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -.045em;
}

.section-heading > p,
.featured-copy > p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.signal-grid {
  border-top: 1px solid var(--line);
}

.signal-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 24px;
  padding: 32px 12px;
  border-bottom: 1px solid var(--line);
  transition: padding-left .3s var(--ease), background .3s ease;
}

.signal-card:hover {
  padding-left: 22px;
  background: linear-gradient(90deg, var(--accent-wash), transparent 70%);
}

.signal-number,
.record-code {
  color: var(--subtle);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .7rem;
  letter-spacing: .08em;
}

.signal-card h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.signal-card p {
  max-width: 700px;
  margin: 0;
  color: var(--muted);
}

.featured-panel {
  display: grid;
  min-height: 390px;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.featured-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(36px, 6vw, 72px);
}

.featured-copy > p {
  margin: 22px 0 30px;
}

.pixel-party {
  position: relative;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: radial-gradient(circle at 50% 60%, rgba(124,132,244,.17), transparent 45%), linear-gradient(135deg, var(--surface-raised), #121319);
}

.pixel-party::before {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 18px 18px;
  content: "";
  mask-image: linear-gradient(to top, #000, transparent 85%);
}

.mini-chibi,
.chibi-placeholder {
  display: grid;
  place-items: center;
  font-weight: 800;
  image-rendering: pixelated;
}

.character-chibi {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: filter .3s ease, transform .4s var(--ease);
}

.character-card:hover .character-chibi {
  filter: brightness(1.04);
  transform: scale(1.018);
}

.mini-chibi {
  position: absolute;
  bottom: 19%;
  width: 72px;
  height: 90px;
  border: 8px solid #2a2e3a;
  border-radius: 24px 24px 10px 10px;
  background: #333848;
  box-shadow: 0 12px 0 #17191f;
}

.mini-chibi::before {
  position: absolute;
  top: -32px;
  width: 62px;
  height: 52px;
  border: 8px solid #2a2e3a;
  border-radius: 22px 22px 16px 16px;
  background: #464c5f;
  content: "";
}

.mini-chibi span { z-index: 2; margin-top: -22px; }
.mini-chibi-one { left: 16%; transform: scale(.84); }
.mini-chibi-two { left: 42%; bottom: 21%; border-color: #38343a; background: #5b463d; transform: scale(1.12); z-index: 2; }
.mini-chibi-two::before { border-color: #38343a; background: #6d574e; }
.mini-chibi-three { left: 70%; transform: scale(.76); }

.site-footer {
  display: grid;
  min-height: 120px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  border-top: 1px solid var(--line);
  color: var(--subtle);
  font-size: .78rem;
}

.site-footer > span { text-align: right; }
.site-footer p { margin: 0; }
.brand-small { color: var(--muted); font-size: .85rem; }
.brand-small .brand-mark { width: 20px; height: 20px; transform: rotate(45deg) scale(.7); }

/* Characters */
.characters-page main {
  min-height: calc(100vh - 188px);
}

.roster-header {
  display: grid;
  grid-template-columns: 1fr minmax(380px, .72fr);
  gap: 80px;
  padding-block: 84px 48px;
  align-items: end;
}

.roster-title h1 {
  margin: 0;
  font-size: clamp(3.7rem, 8vw, 7.5rem);
  line-height: .86;
  letter-spacing: -.07em;
}

.roster-title > p:last-child {
  max-width: 600px;
  margin: 32px 0 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.roster-tools {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.search-field {
  display: flex;
  height: 46px;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
  transition: border-color .2s ease, box-shadow .2s ease;
}

.search-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.search-field svg {
  width: 18px;
  fill: none;
  stroke: var(--subtle);
  stroke-width: 1.8;
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-field input::placeholder { color: var(--subtle); }

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-chip {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 650;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}

.filter-chip:hover { border-color: var(--line-bright); color: var(--text); }
.filter-chip.is-active { border-color: rgba(124,132,244,.35); background: var(--accent-wash); color: var(--accent-bright); }

.roster-section {
  padding-bottom: 110px;
}

.roster-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--subtle);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.roster-meta p { margin: 0; }
.archive-state .status-dot { width: 6px; height: 6px; }

.character-grid {
  columns: 2 480px;
  column-gap: 18px;
}

.character-card {
  display: inline-grid;
  width: 100%;
  grid-template-columns: minmax(170px, 42%) 1fr;
  margin: 0 0 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  break-inside: avoid;
  transition: transform .35s var(--ease), border-color .25s ease, box-shadow .35s var(--ease), opacity .2s ease;
}

.character-card:hover {
  z-index: 2;
  border-color: var(--line-bright);
  box-shadow: 0 16px 42px rgba(0,0,0,.24);
  transform: translateY(-5px);
}

.character-card[hidden] { display: none; }

.character-art {
  position: relative;
  display: flex;
  min-height: 270px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background-color: #1b1e25;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 16px 16px;
}

.card-featured .character-art { min-height: 330px; }
.card-compact .character-art { min-height: 235px; }
.character-art::after { position: absolute; inset: auto 0 0; height: 45%; background: linear-gradient(transparent, rgba(0,0,0,.17)); content: ""; }
.art-blue { background-color: #1a2132; }
.art-amber { background-color: #29231f; }
.art-red { background-color: #291d22; }
.art-violet { background-color: #231f30; }
.art-green { background-color: #192821; }
.art-neutral { background-color: #1c1e23; }

.record-code {
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 2;
}

.art-note {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 2;
  color: rgba(255,255,255,.42);
  font-size: .61rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.chibi-placeholder {
  position: relative;
  width: 112px;
  height: 128px;
  border: 10px solid rgba(255,255,255,.09);
  border-radius: 40px 40px 18px 18px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.38);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.35rem;
  box-shadow: 0 14px 0 rgba(0,0,0,.12);
  transform: translateY(16px);
}

.chibi-placeholder::before {
  position: absolute;
  top: -53px;
  left: 50%;
  width: 96px;
  height: 80px;
  border: 10px solid rgba(255,255,255,.09);
  border-radius: 34px 34px 24px 24px;
  background: rgba(255,255,255,.11);
  content: "";
  transform: translateX(-50%);
}

.chibi-placeholder::after {
  position: absolute;
  top: -19px;
  left: 50%;
  width: 39px;
  height: 7px;
  border-right: 6px solid rgba(255,255,255,.34);
  border-left: 6px solid rgba(255,255,255,.34);
  content: "";
  transform: translateX(-50%);
}

.chibi-placeholder span { position: relative; z-index: 2; margin-top: 4px; }

.character-info {
  align-self: center;
  padding: 24px 22px;
}

.character-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.character-heading p {
  margin: 0 0 5px;
  color: var(--subtle);
  font-size: .64rem;
  font-weight: 750;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.character-heading h2 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1;
  letter-spacing: -.035em;
}

.profile-badge {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid rgba(124,132,244,.25);
  border-radius: 4px;
  background: var(--accent-wash);
  color: var(--accent-bright);
  font-size: .57rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.badge-restricted { border-color: rgba(200,100,120,.22); background: rgba(200,100,120,.09); color: #d994a3; }
.badge-active { border-color: rgba(87,184,138,.22); background: rgba(87,184,138,.09); color: #7acba3; }
.badge-pending { border-color: var(--line); background: rgba(255,255,255,.035); color: var(--subtle); }

.character-info > p {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.66;
}

.character-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}

.character-traits span {
  padding: 4px 7px;
  border-radius: 4px;
  background: var(--surface-raised);
  color: var(--subtle);
  font-size: .63rem;
  font-weight: 650;
}

.empty-state {
  padding: 100px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty-pixel {
  display: grid;
  width: 56px;
  height: 56px;
  margin: 0 auto 22px;
  place-items: center;
  border: 6px solid var(--line-bright);
  color: var(--subtle);
  font-family: ui-monospace, monospace;
  font-weight: 800;
  image-rendering: pixelated;
}

.empty-state h2 { margin: 0 0 6px; color: var(--text); font-size: 1.2rem; }
.empty-state p { margin: 0; }

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
}

@media (max-width: 900px) {
  :root { --shell: min(100% - 32px, 760px); }
  .hero { min-height: auto; grid-template-columns: 1fr; padding-block: 100px; }
  .hero-sigil { position: absolute; right: -15vw; z-index: -1; width: 55vw; opacity: .28; }
  .section-heading, .featured-panel, .roster-header { grid-template-columns: 1fr; }
  .section-heading { gap: 22px; }
  .pixel-party { min-height: 330px; border-top: 1px solid var(--line); border-left: 0; }
  .roster-header { gap: 44px; padding-top: 72px; }
  .roster-tools { max-width: 520px; }
  .site-footer { grid-template-columns: 1fr 1fr; }
  .site-footer p { display: none; }
}

@media (max-width: 620px) {
  :root { --shell: calc(100% - 28px); }
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: calc(100% + 8px);
    right: 14px;
    left: 14px;
    display: grid;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 18px 50px rgba(0,0,0,.35);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity .2s ease, transform .2s ease;
  }
  .nav-links.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); }
  .nav-links a { padding: 12px; }
  .hero { padding-block: 80px; }
  .hero h1 { font-size: clamp(3.1rem, 16vw, 5rem); }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 20px; }
  .world-section, .featured-section { padding-block: 78px; }
  .signal-card { grid-template-columns: 42px 1fr; gap: 12px; }
  .featured-panel { min-height: 0; }
  .featured-copy { padding: 34px 26px 42px; }
  .pixel-party { min-height: 260px; }
  .mini-chibi-one { left: 8%; }
  .mini-chibi-two { left: 39%; }
  .mini-chibi-three { left: 72%; }
  .site-footer { min-height: 100px; }
  .roster-header { padding-block: 62px 38px; }
  .roster-title h1 { font-size: clamp(3.6rem, 19vw, 5.7rem); }
  .roster-title > p:last-child { margin-top: 25px; }
  .character-grid { columns: 1; }
  .character-card { grid-template-columns: minmax(128px, 38%) 1fr; }
  .character-art, .card-featured .character-art, .card-compact .character-art { min-height: 245px; }
  .character-info { padding: 20px 17px; }
  .character-heading { display: block; }
  .character-heading .profile-badge { display: inline-block; margin-top: 10px; }
  .character-traits { display: none; }
  .roster-meta { align-items: flex-start; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Discord desktop-app-inspired workspace shell */
body::before {
  display: none;
}

.site-header {
  border-bottom-color: rgba(0, 0, 0, .35);
  background: #1e1f22;
  backdrop-filter: none;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .2);
}

.navbar {
  width: calc(100% - 24px);
  min-height: 52px;
}

.brand {
  font-size: .9rem;
}

.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 4px;
}

.nav-links a {
  padding: 6px 10px;
  font-size: .82rem;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  background: #35373c;
}

.app-main {
  height: calc(100vh - 53px);
  min-height: 620px;
  overflow: hidden;
}

.home-workspace,
.characters-workspace,
.gallery-workspace,
.docs-workspace {
  display: grid;
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

.home-workspace {
  grid-template-columns: minmax(0, 1fr) 280px;
}

.characters-workspace {
  grid-template-columns: minmax(0, 1fr) 280px;
}

.gallery-workspace {
  grid-template-columns: minmax(0, 1fr) 280px;
}

.docs-workspace {
  grid-template-columns: minmax(0, 1fr) 280px;
}

.channel-sidebar,
.archive-sidebar,
.context-sidebar {
  position: relative;
  min-width: 0;
  background: #2b2d31;
}

.notes-sidebar {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow-y: auto;
  border-left: 1px solid rgba(0, 0, 0, .2);
  background: #2b2d31;
}

.notes-header {
  display: flex;
  height: 48px;
  flex: 0 0 48px;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid rgba(0, 0, 0, .32);
  color: var(--text);
  font-size: .76rem;
}

.notes-header > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notes-header > div > span {
  color: var(--subtle);
  font-size: .92rem;
}

.notes-header > span {
  padding: 2px 6px;
  border-radius: 4px;
  background: #1e1f22;
  color: var(--subtle);
  font-size: .58rem;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px;
}

.page-note {
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, .22);
  border-radius: 7px;
  background: #313338;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .1);
}

.page-note > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.note-state {
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(88, 101, 242, .14);
  color: #aeb4ff;
  font-size: .55rem;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.note-waiting {
  background: rgba(240, 178, 50, .12);
  color: #e7c46c;
}

.note-number {
  color: #6d6f78;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .58rem;
}

.page-note h2 {
  margin: 10px 0 5px;
  font-size: .82rem;
  line-height: 1.3;
}

.page-note p,
.notes-empty p,
.notes-footnote {
  color: var(--subtle);
  font-size: .68rem;
  line-height: 1.5;
}

.page-note p {
  margin: 0;
}

.notes-empty {
  padding: 32px 15px;
  border: 1px dashed #404249;
  border-radius: 7px;
  color: var(--muted);
  text-align: center;
}

.notes-empty > span {
  display: grid;
  width: 30px;
  height: 30px;
  margin: 0 auto 10px;
  place-items: center;
  border-radius: 50%;
  background: rgba(35, 165, 89, .12);
  color: #66c58a;
  font-weight: 800;
}

.notes-empty strong {
  display: block;
  font-size: .76rem;
}

.notes-empty p {
  margin: 4px 0 0;
}

.notes-footnote {
  margin: auto 12px 12px;
  padding-top: 12px;
  border-top: 1px solid #3f4147;
  font-size: .61rem;
}

.channel-sidebar,
.archive-sidebar {
  display: flex;
  flex-direction: column;
}

.workspace-title,
.feed-header {
  display: flex;
  height: 48px;
  flex: 0 0 48px;
  align-items: center;
  justify-content: space-between;
  padding-inline: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, .32);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .015);
}

.workspace-title {
  color: var(--text);
  font-size: .84rem;
}

.workspace-title > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.workspace-icon {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: .66rem;
  font-weight: 800;
}

.channel-group {
  padding: 18px 8px 0;
}

.channel-group > p,
.archive-filter-group > p,
.context-section > p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 8px 5px;
  color: var(--subtle);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .025em;
  text-transform: uppercase;
}

.channel-link {
  display: flex;
  height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border-radius: 4px;
  color: var(--subtle);
  font-size: .88rem;
  font-weight: 500;
  transition: color .15s ease, background .15s ease;
}

.channel-link > span {
  width: 16px;
  color: #80848e;
  font-size: 1.05rem;
  text-align: center;
}

.channel-link:hover {
  background: #35373c;
  color: #dbdee1;
}

.channel-link.is-active {
  background: #404249;
  color: #fff;
}

.operator-panel {
  display: grid;
  min-height: 52px;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 7px 9px;
  background: #232428;
  color: var(--subtle);
  font-size: .7rem;
}

.operator-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: #3f4147;
  color: #fff;
  font-family: ui-monospace, monospace;
  font-size: .57rem;
  font-weight: 800;
}

.operator-panel div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.operator-panel strong {
  overflow: hidden;
  color: var(--text);
  font-size: .7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operator-panel i,
.feed-header i {
  display: inline-block;
  width: 1px;
  height: 20px;
  margin-inline: 10px;
  background: #4e5058;
  vertical-align: middle;
}

.operator-panel div span i {
  width: 6px;
  height: 6px;
  margin: 0 4px 0 0;
  border-radius: 50%;
  background: var(--success);
}

.home-feed,
.character-main-pane,
.gallery-main-pane,
.docs-main-pane {
  min-width: 0;
  background: #313338;
}

.home-feed {
  display: flex;
  min-height: 0;
  flex-direction: column;
}

.feed-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #313338;
}

.feed-header > div {
  display: flex;
  min-width: 0;
  align-items: center;
}

.feed-header > div > span {
  margin-right: 9px;
  color: #80848e;
  font-size: 1.35rem;
  font-weight: 500;
}

.feed-header strong {
  font-size: .87rem;
}

.feed-header p {
  overflow: hidden;
  margin: 0;
  color: var(--subtle);
  font-size: .73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-status {
  flex: 0 0 auto;
  color: var(--subtle);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.feed-scroll {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.welcome-card {
  position: relative;
  max-width: 800px;
  padding: 64px 34px 30px;
}

.welcome-glyph {
  display: grid;
  width: 62px;
  height: 62px;
  margin-bottom: 26px;
  place-items: center;
  border-radius: 50%;
  background: #1e1f22;
}

.welcome-glyph span {
  width: 22px;
  height: 22px;
  border: 2px solid var(--accent-bright);
  transform: rotate(45deg);
}

.welcome-card .eyebrow {
  margin-bottom: 9px;
  color: var(--subtle);
  font-size: .66rem;
}

.welcome-card h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: -.045em;
}

.welcome-card h1 span {
  color: var(--muted);
}

.welcome-card > p:not(.eyebrow) {
  max-width: 650px;
  margin: 17px 0 22px;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.65;
}

.button {
  min-height: 38px;
  padding-inline: 14px;
  border-radius: 4px;
  font-size: .78rem;
}

.date-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 16px 20px;
  border-top: 1px solid #3f4147;
}

.date-divider span {
  position: absolute;
  padding: 0 5px;
  background: #313338;
  color: var(--subtle);
  font-size: .63rem;
  font-weight: 700;
}

.dispatch {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  padding: 4px 34px 18px 18px;
  scroll-margin-top: 64px;
}

.dispatch:hover {
  background: rgba(0, 0, 0, .045);
}

.dispatch-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  background: #404249;
  color: #fff;
  font-size: .76rem;
  font-weight: 800;
}

.avatar-violet { background: #5865f2; }
.avatar-red { background: #da373c; }
.avatar-amber { background: #9b6b32; }
.avatar-green { background: #24845a; }

.dispatch-author {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.dispatch-author strong {
  font-size: .89rem;
}

.dispatch-author span {
  color: var(--subtle);
  font-size: .64rem;
}

.dispatch-body > p {
  max-width: 780px;
  margin: 3px 0 9px;
  color: #dbdee1;
  font-size: .88rem;
  line-height: 1.45;
}

.dispatch-embed {
  display: grid;
  max-width: 540px;
  grid-template-columns: 4px 1fr;
  overflow: hidden;
  border-radius: 4px;
  background: #2b2d31;
}

.dispatch-embed > span {
  background: var(--accent);
}

.dispatch-embed.danger-embed > span {
  background: #da373c;
}

.dispatch-embed > div {
  padding: 12px 14px;
}

.dispatch-embed strong {
  font-size: .78rem;
}

.dispatch-embed p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.45;
}

.reaction-row {
  display: flex;
  gap: 4px;
}

.reaction-row span {
  padding: 3px 7px;
  border: 1px solid #4e5058;
  border-radius: 7px;
  background: #2b2d31;
  color: var(--muted);
  font-size: .7rem;
}

.system-message {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border-radius: 4px;
  background: rgba(35, 165, 89, .09);
  color: #a5d6b8;
  font-size: .7rem;
}

.context-sidebar {
  overflow-y: auto;
  border-left: 1px solid rgba(0, 0, 0, .16);
  padding: 24px 8px;
}

.context-section + .context-section {
  margin-top: 25px;
}

.status-member {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 4px;
  color: var(--muted);
}

a.status-member:hover {
  background: #35373c;
}

.member-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 50%;
  background: #404249;
  color: #dbdee1;
  font-size: .55rem;
  font-weight: 800;
}

.member-blue { background: #435582; }
.member-amber { background: #6b5144; }

.status-member div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.status-member strong {
  overflow: hidden;
  font-size: .76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-member small {
  overflow: hidden;
  color: var(--subtle);
  font-size: .63rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Character archive app view */
.archive-search-wrap {
  padding: 12px 10px 8px;
}

.archive-search-wrap .search-field {
  height: 32px;
  border-color: transparent;
  background: #1e1f22;
}

.archive-search-wrap .search-field svg {
  width: 14px;
}

.archive-search-wrap .search-field input {
  font-size: .73rem;
}

.archive-filter-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
}

.archive-filter-group > p {
  width: auto;
  margin-top: 6px;
  margin-bottom: 4px;
}

.archive-filter-group .filter-chip {
  display: flex;
  width: 100%;
  height: 34px;
  align-items: center;
  gap: 9px;
  padding: 0 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--subtle);
  font-size: .82rem;
  font-weight: 550;
  text-align: left;
}

.archive-filter-group .filter-chip span {
  width: 16px;
  color: #80848e;
  text-align: center;
}

.archive-filter-group .filter-chip:hover {
  background: #35373c;
  color: #dbdee1;
}

.archive-filter-group .filter-chip.is-active {
  background: #404249;
  color: #fff;
}

.character-main-pane {
  height: 100%;
  overflow-y: auto;
}

.gallery-main-pane {
  height: 100%;
  overflow-y: auto;
}

.gallery-main-pane .feed-header {
  top: 0;
}

.gallery-heading {
  padding: 28px 30px 18px;
}

.gallery-heading .eyebrow {
  margin-bottom: 8px;
  font-size: .62rem;
}

.gallery-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1;
  letter-spacing: -.045em;
}

.gallery-heading > div > p:last-child {
  max-width: 650px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: .86rem;
}

.gallery-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 0 30px;
  padding: 14px;
  border: 1px solid rgba(0, 0, 0, .22);
  border-radius: 7px;
  background: #2b2d31;
}

.gallery-select {
  display: flex;
  width: min(230px, 28%);
  flex-direction: column;
  gap: 5px;
}

.gallery-select > span {
  color: var(--subtle);
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.gallery-select select {
  width: 100%;
  height: 36px;
  padding: 0 34px 0 10px;
  border: 1px solid #1e1f22;
  border-radius: 4px;
  outline: 0;
  background: #1e1f22;
  color: var(--text);
  font-size: .75rem;
  cursor: pointer;
}

.gallery-select select:focus-visible {
  border-color: var(--accent-bright);
}

.chibi-toggle {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  cursor: pointer;
}

.chibi-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-track {
  position: relative;
  width: 34px;
  height: 20px;
  flex: 0 0 34px;
  border-radius: 99px;
  background: #1e1f22;
  transition: background .2s ease;
}

.toggle-track span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--subtle);
  transition: transform .2s var(--ease), background .2s ease;
}

.chibi-toggle input:checked + .toggle-track {
  background: var(--accent);
}

.chibi-toggle input:checked + .toggle-track span {
  background: #fff;
  transform: translateX(14px);
}

.chibi-toggle input:focus-visible + .toggle-track {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
}

.chibi-toggle > span:last-child {
  display: flex;
  flex-direction: column;
}

.chibi-toggle strong {
  font-size: .72rem;
}

.chibi-toggle small {
  color: var(--subtle);
  font-size: .58rem;
}

.gallery-content {
  padding: 0 30px 50px;
}

.gallery-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 13px;
  padding-top: 13px;
  border-top: 1px solid #3f4147;
  color: var(--subtle);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .61rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.gallery-meta p {
  margin: 0;
}

.gallery-grid {
  columns: 3 250px;
  column-gap: 12px;
}

.gallery-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 12px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .24);
  border-radius: 7px;
  background: #2b2d31;
  break-inside: avoid;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .13);
  transition: transform .25s var(--ease), box-shadow .25s ease, border-color .2s ease;
}

.gallery-card:hover {
  border-color: #4e5058;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .24);
  transform: translateY(-2px);
}

.gallery-card[hidden] {
  display: none;
}

.gallery-card > a {
  position: relative;
  display: block;
  overflow: hidden;
  background: #1e1f22;
}

.gallery-card > a::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, .04);
  content: "";
  pointer-events: none;
}

.gallery-card img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform .45s var(--ease), filter .3s ease;
}

.gallery-card:hover img {
  filter: brightness(1.05);
  transform: scale(1.015);
}

.gallery-card figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
}

.gallery-card figcaption > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.gallery-card figcaption strong {
  overflow: hidden;
  font-size: .74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-card figcaption div span {
  color: var(--subtle);
  font-size: .61rem;
}

.media-code {
  flex: 0 0 auto;
  color: #6d6f78;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .56rem;
}

.gallery-empty {
  margin-top: 12px;
}

/* Markdown document library */
.docs-main-pane {
  height: 100%;
  overflow-y: auto;
}

.docs-main-pane .feed-header {
  top: 0;
}

.docs-heading {
  padding: 28px 30px 18px;
}

.docs-heading .eyebrow {
  margin-bottom: 8px;
  font-size: .62rem;
}

.docs-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1;
  letter-spacing: -.045em;
}

.docs-heading > div > p:last-child {
  max-width: 650px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: .86rem;
}

.docs-toolbar {
  display: grid;
  grid-template-columns: minmax(230px, 320px) minmax(220px, 1fr) auto;
  align-items: end;
  gap: 16px;
  margin: 0 30px 18px;
  padding: 14px;
  border: 1px solid rgba(0, 0, 0, .22);
  border-radius: 7px;
  background: #2b2d31;
}

.docs-select {
  width: 100%;
}

.document-summary {
  min-width: 0;
}

.doc-topic {
  display: inline-block;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(88, 101, 242, .14);
  color: #aeb4ff;
  font-size: .55rem;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.document-summary p {
  overflow: hidden;
  margin: 5px 0 0;
  color: var(--subtle);
  font-size: .67rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-link {
  display: inline-flex;
  height: 36px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 11px;
  border-radius: 4px;
  background: #35373c;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  transition: background .2s ease, color .2s ease;
}

.source-link:hover {
  background: #404249;
  color: var(--text);
}

.document-shell {
  width: min(900px, calc(100% - 60px));
  margin: 0 auto 50px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, .24);
  border-radius: 8px;
  background: #2b2d31;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .15);
}

.document-meta {
  padding: 11px 18px;
  border-bottom: 1px solid rgba(0, 0, 0, .24);
  color: var(--subtle);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .59rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.markdown-body {
  padding: clamp(28px, 6vw, 64px);
  color: #dbdee1;
}

.markdown-body h1 {
  max-width: 700px;
  margin: 0 0 38px;
  color: var(--text);
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -.045em;
}

.markdown-body h2,
.markdown-body h3 {
  margin: 32px 0 12px;
  color: var(--text);
  line-height: 1.2;
}

.markdown-body p {
  margin: 0 0 16px;
  font-size: .92rem;
  line-height: 1.75;
}

.markdown-body .dialogue-line {
  position: relative;
  min-height: 52px;
  margin: 0 0 7px;
  padding: 13px 18px 13px 122px;
  border-left: 3px solid #4e5058;
  border-radius: 0 5px 5px 0;
  background: #313338;
  font-size: .88rem;
  line-height: 1.58;
}

.markdown-body .dialogue-line strong:first-child {
  position: absolute;
  top: 14px;
  left: 16px;
  color: var(--muted);
  font-size: .69rem;
  letter-spacing: .02em;
}

.markdown-body .speaker-fionn {
  border-left-color: var(--accent);
  background: rgba(88, 101, 242, .07);
}

.markdown-body .speaker-fionn strong:first-child {
  color: #aeb4ff;
}

.markdown-body .speaker-journalist {
  border-left-color: #5c6069;
}

.markdown-body blockquote {
  margin: 24px 0;
  padding: 12px 18px;
  border-left: 3px solid var(--accent);
  background: #313338;
  color: var(--muted);
}

.markdown-body ul {
  padding-left: 24px;
  color: var(--muted);
}

.markdown-body code {
  padding: 2px 5px;
  border-radius: 3px;
  background: #1e1f22;
  color: #e5e7eb;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .84em;
}

.markdown-body a {
  color: #aeb4ff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.markdown-body hr {
  margin: 36px 0;
  border: 0;
  border-top: 1px solid #3f4147;
}

.document-error {
  padding: 80px 20px;
  color: var(--muted);
  text-align: center;
}

.document-error h2 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 1rem;
}

.document-error p {
  margin: 0;
  font-size: .76rem;
}

.character-main-pane .feed-header {
  top: 0;
}

.archive-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 30px 0;
}

.archive-toolbar .search-field {
  width: min(320px, 36%);
  height: 36px;
  flex: 0 0 auto;
  border-color: transparent;
  background: #1e1f22;
}

.archive-toolbar .search-field svg {
  width: 15px;
}

.archive-toolbar .search-field input {
  font-size: .76rem;
}

.archive-toolbar .filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.archive-toolbar .filter-chip {
  height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: 4px;
  background: #2b2d31;
  color: var(--subtle);
  font-size: .72rem;
}

.archive-toolbar .filter-chip:hover {
  background: #35373c;
  color: #dbdee1;
}

.archive-toolbar .filter-chip.is-active {
  background: #404249;
  color: #fff;
}

.roster-header {
  display: block;
  padding: 28px 30px 18px;
}

.roster-title h1 {
  font-size: clamp(2rem, 4vw, 3.15rem);
  line-height: 1;
  letter-spacing: -.045em;
}

.roster-title > p:last-child {
  max-width: 650px;
  margin-top: 12px;
  font-size: .86rem;
}

.roster-title .eyebrow {
  margin-bottom: 8px;
  font-size: .62rem;
}

.roster-section {
  padding: 0 30px 50px;
}

.roster-meta {
  margin-bottom: 13px;
  padding-top: 13px;
  font-size: .61rem;
}

.character-grid {
  columns: 2 410px;
  column-gap: 12px;
}

.character-card {
  margin-bottom: 12px;
  border-color: rgba(0, 0, 0, .22);
  border-radius: 7px;
  background: #2b2d31;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}

.character-card:hover {
  border-color: rgba(0, 0, 0, .3);
  background: #2e3035;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .18);
  transform: translateY(-2px);
}

.character-info {
  padding: 20px;
}

.character-heading h2 {
  font-size: 1.25rem;
}

.character-info > p {
  font-size: .8rem;
  line-height: 1.55;
}

.character-art {
  border-right-color: rgba(0, 0, 0, .22);
}

@media (max-width: 1050px) {
  .home-workspace {
    grid-template-columns: minmax(0, 1fr) 240px;
  }

  .context-sidebar {
    display: none;
  }

  .characters-workspace {
    grid-template-columns: minmax(0, 1fr) 240px;
  }

  .gallery-workspace {
    grid-template-columns: minmax(0, 1fr) 240px;
  }

  .docs-workspace {
    grid-template-columns: minmax(0, 1fr) 240px;
  }

  .docs-toolbar {
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  }

  .source-link {
    display: none;
  }

  .character-grid {
    columns: 1;
  }
}

@media (max-width: 820px) {
  .app-main {
    height: auto;
    overflow: visible;
  }

  .home-workspace,
  .characters-workspace,
  .gallery-workspace,
  .docs-workspace {
    display: block;
    height: auto;
    overflow: visible;
  }

  .home-feed,
  .character-main-pane,
  .gallery-main-pane,
  .docs-main-pane {
    height: auto;
    min-height: calc(100vh - 53px);
    overflow: visible;
  }

  .feed-scroll {
    overflow: visible;
  }

  .notes-sidebar {
    min-height: 260px;
    overflow: visible;
    border-top: 1px solid rgba(0, 0, 0, .32);
    border-left: 0;
  }

  .notes-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .gallery-main-pane .feed-header {
    display: none;
  }

  .docs-main-pane .feed-header {
    display: none;
  }

  .docs-heading {
    padding: 28px 14px 15px;
  }

  .docs-toolbar {
    display: block;
    margin: 0 14px 14px;
  }

  .document-summary {
    margin-top: 10px;
  }

  .document-summary p {
    white-space: normal;
  }

  .document-shell {
    width: calc(100% - 28px);
    margin-bottom: 24px;
  }

  .markdown-body {
    padding: 26px 18px;
  }

  .markdown-body .dialogue-line {
    padding: 36px 13px 12px;
  }

  .markdown-body .dialogue-line strong:first-child {
    top: 10px;
    left: 12px;
  }

  .gallery-heading {
    padding: 28px 14px 15px;
  }

  .gallery-toolbar {
    position: sticky;
    top: 52px;
    z-index: 12;
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 0;
    padding: 10px 14px;
    border-width: 1px 0;
    border-radius: 0;
  }

  .gallery-select {
    width: 100%;
  }

  .chibi-toggle {
    grid-column: 1 / -1;
    margin-left: 0;
  }

  .gallery-content {
    padding: 0 14px 40px;
  }

  .gallery-grid {
    columns: 2 150px;
    column-gap: 9px;
  }

  .gallery-card {
    margin-bottom: 9px;
  }

  .gallery-card figcaption {
    padding: 9px;
  }

  .media-code {
    display: none;
  }
}

@media (max-width: 720px) {
  .app-main {
    height: auto;
    min-height: calc(100vh - 53px);
    overflow: visible;
  }

  .home-workspace,
  .characters-workspace {
    display: block;
    height: auto;
    overflow: visible;
  }

  .channel-sidebar,
  .context-sidebar {
    display: none;
  }

  .home-feed,
  .character-main-pane {
    height: auto;
    min-height: calc(100vh - 53px);
    overflow: visible;
  }

  .feed-scroll {
    overflow: visible;
  }

  .feed-header {
    top: 52px;
  }

  .feed-header p,
  .feed-status {
    display: none;
  }

  .welcome-card {
    padding: 48px 18px 28px;
  }

  .welcome-card h1 {
    font-size: 2.4rem;
  }

  .dispatch {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    padding-inline: 12px 16px;
  }

  .dispatch-avatar {
    width: 34px;
    height: 34px;
  }

  .archive-sidebar {
    position: sticky;
    top: 52px;
    z-index: 12;
    display: block;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, .32);
  }

  .archive-sidebar .workspace-title,
  .archive-sidebar .operator-panel,
  .archive-filter-group > p {
    display: none;
  }

  .archive-search-wrap {
    padding: 0 0 7px;
  }

  .archive-filter-group {
    display: flex;
    flex-direction: row;
    gap: 5px;
    padding: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .archive-filter-group .filter-chip {
    width: auto;
    flex: 0 0 auto;
    padding-inline: 10px;
  }

  .character-main-pane .feed-header {
    display: none;
  }

  .archive-toolbar {
    position: sticky;
    top: 52px;
    z-index: 12;
    display: block;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(0, 0, 0, .32);
    background: #2b2d31;
  }

  .archive-toolbar .search-field {
    width: 100%;
    margin-bottom: 7px;
  }

  .archive-toolbar .filter-group {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .archive-toolbar .filter-chip {
    flex: 0 0 auto;
  }

  .roster-header {
    padding: 28px 14px 15px;
  }

  .roster-section {
    padding: 0 14px 40px;
  }

  .character-card {
    grid-template-columns: minmax(122px, 38%) 1fr;
  }

  .character-info {
    padding: 17px 15px;
  }
}
